Search Results

Search found 931 results on 38 pages for 'jonathan shepherd'.

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

  • What is the best practice for website design and markup now that mobile browsers are common?

    - by Jonathan Drain
    Back in 2008, smartphones were a small market and it was commonplace for sites to be designed for a fixed width - say, 900px or 960px - with the page centered if the browser window was larger. Many designers said fluid width was better, but since user screens typically varied between 1024x768 and 1920x1080, fluid width allowed longer line length than is optimal for ease of reading, and so many sites (including Stack Exchange) use fixed width. Now that mobile devices are common, what is the the best approach to support both desktop and mobile browsers? Establish a separate mobile site (e.g: mobile.example.com) Serve a different CSS to mobile devices; if so how? Server-side browser sniffing, or a @media rule? Use Javascript or something to adapt the website dynamically to the client? Should all websites be expected to be responsive? Some kind of fluid layout Something else?

    Read the article

  • Capital D key not working / producing output

    - by Jonathan
    For some inexplicable reason the capital d key on my Ubuntu system is no longer producing output. Hitting caps lock and then d produces a D. I've tried multiple keyboards and the issue is the same. There's nothing bound to Shift+d under System Preferences Keyboard Shortcuts. xev produces the following: shift + a KeyPress event, serial 36, synthetic NO, window 0x4c00001, root 0x27a, subw 0x0, time 31268952, (130,-16), root:(1000,525), state 0x10, keycode 62 (keysym 0xffe2, Shift_R), same_screen YES, XLookupString gives 0 bytes: XmbLookupString gives 0 bytes: XFilterEvent returns: False KeyPress event, serial 36, synthetic NO, window 0x4c00001, root 0x27a, subw 0x0, time 31269376, (130,-16), root:(1000,525), state 0x11, keycode 38 (keysym 0x41, A), same_screen YES, XLookupString gives 1 bytes: (41) "A" XmbLookupString gives 1 bytes: (41) "A" XFilterEvent returns: False KeyRelease event, serial 36, synthetic NO, window 0x4c00001, root 0x27a, subw 0x0, time 31269584, (130,-16), root:(1000,525), state 0x11, keycode 38 (keysym 0x41, A), same_screen YES, XLookupString gives 1 bytes: (41) "A" XFilterEvent returns: False KeyRelease event, serial 36, synthetic NO, window 0x4c00001, root 0x27a, subw 0x0, time 31269608, (130,-16), root:(1000,525), state 0x11, keycode 62 (keysym 0xffe2, Shift_R), same_screen YES, XLookupString gives 0 bytes: XFilterEvent returns: False shift + d KeyPress event, serial 36, synthetic NO, window 0x4c00001, root 0x27a, subw 0x0, time 31102792, (115,-13), root:(985,528), state 0x10, keycode 62 (keysym 0xffe2, Shift_R), same_screen YES, XLookupString gives 0 bytes: XmbLookupString gives 0 bytes: XFilterEvent returns: False FocusOut event, serial 36, synthetic NO, window 0x4c00001, mode NotifyGrab, detail NotifyAncestor FocusIn event, serial 36, synthetic NO, window 0x4c00001, mode NotifyUngrab, detail NotifyAncestor KeymapNotify event, serial 36, synthetic NO, window 0x0, keys: 2 0 0 0 0 0 0 64 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 KeyRelease event, serial 36, synthetic NO, window 0x4c00001, root 0x27a, subw 0x0, time 31103104, (115,-13), root:(985,528), state 0x11, keycode 62 (keysym 0xffe2, Shift_R), same_screen YES, XLookupString gives 0 bytes: XFilterEvent returns: False

    Read the article

  • Accessing second hard drive

    - by Jonathan
    So I recently installed Ubuntu 10.10 64-bit on my computer. I installed it on my 60gb SSD hard drive, and in the installation it never acknowledged the existence of my second hard drive. The hard drive that I keep all my files on, and which I want to make my home folder if I can, is a Western Digital Caviar Black 1TB SATA 6Gb/s 64MB cache (WD1002FAEX). I've read the following: https://help.ubuntu.com/community/Mount but honestly cannot work out how to access the hard drive from my Ubuntu installation. I did have Windows 7 64-bit prior to installing Ubuntu. I have backed up all the files on the hard drive, but if I could just access them straight off that would be super cool. Does anyone know how I can use the second hard drive? Thank you for your help EDIT: The following directories are currently in my /dev/ folder: ati/, block/, bsg/, bus/, char/, cpu/, isk/, input/, mapper/, net/, pktcdvd/, pts/, shm/, snd/, and usb/ EDIT: Result from sudo fdisk -l Disk /dev/sda: 60.0 GB, 60022480896 bytes 255 heads, 63 sectors/track, 7297 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x000d2dfd Device Boot Start End Blocks Id System /dev/sda1 * 1 6994 56174592 83 Linux /dev/sda2 6994 7298 2438145 5 Extended /dev/sda5 6994 7298 2438144 82 Linux swap / Solaris @djeykib So very close to fixing it.. unfortunately on the last command you gave it says this: $ sudo apt-get install linux-lts-backport-natty Reading package lists... Done Building dependency tree Reading state information... Done E: Unable to locate package linux-lts-backport-natty Checking on http://www.ubuntuupdates.org/ppas reveals that it is only available for 10.04. Looks like I'll have to unplug and re-plug hardware if I want it working still :(

    Read the article

  • Hardware Virtualization no longer required for Windows 7 XP Mode

    - by Jonathan Kehayias
    One of my frustrations in upgrading to Windows 7 last year was that Virtual PC no longer worked since I didn’t have Hardware Virtualization on my CPU.  This really drove my transition entirely to VMware Workstation on my personal laptop.  I recently reinstalled my work laptop (with permission) on Windows 7 Enterprise and figured I’d give XP Mode a look since this machine has Hardware Virtualization enabled.  I was surprised to find that Hardware Virtualization was no longer required,...(read more)

    Read the article

  • How do I communicate with an IronPython component in a C#/XNA game?

    - by Jonathan Hobbs
    My XNA game is component-oriented, and has various components for position, physics representation, rendering, etc, all of which extend a base Component class. The player and enemies also have controllers which are currently defined in C#. I'd like to turn them into Python scripts, but I'm not sure how to interact with those scripts. The examples in Embedding IronPython in a C# Application suggest I'd have to create a wrapper class (e.g. a Script component) which compiles a Python script, and call the Update methods of the component in the script Is this the most effective way of working with a Python object? I feel that I'm missing something in my research - there must be a way to load up a script, instantiate a Python object and then work directly with it from within C#. Or is the wrapper required?

    Read the article

  • Ubuntu stops letting wired or wireless mice click through after a short while

    - by Jonathan Chan
    Hi! I have a very confusing problem that renders Ubuntu near unusable. Whenever I try to use any wired or wireless mouse with my Ubuntu 10.10 install, clicks stop going through - often times, this blockage of clicks happens in less than a minute. Sometimes no clicks are accepted, other times, clicks are accepted in certain windows and denied in others. The end result is the same, and I am forced to resort to using the keyboard to navigate. If anyone could help me resolve this problem, I would be very appreciative, as it would finally allow me to try Ubuntu. Thanks!

    Read the article

  • cannot boot Ubuntu after fresh install

    - by Jonathan
    I just installed Ubuntu on a Lenovo v570, and cannot boot into the system. All I get is a loop, where some (bios) info is displayed, and then the computer asks me where I would like to boot from. I tried reinstalling, reinstalling with a custom partition scheme, and boot -repair after the install. None of these work. I can see the files on my harddisk have been copied. I have installed many Ubuntus in the past, as well other distros where custom partitioning is required. I don't know where to find any useful information since I don't even get too the grub menu. One odd thing I noticed. The bios now had options to boot USB, OpenSuse,Fedora, or the HD. I am not dual booting. I also realized that the boot info is for a network boot, which means the computer is not recognizing what to boot. It is boot an HD problem, because I can install other OSs just fine. I am completely stumped. I would like to settle this, and end up with a tutorial, that explains to me what happened.

    Read the article

  • How to fix "error: unknown file system" on all available partitions

    - by Jonathan
    I've had a running problem with removing Linux from my Windows 7 laptop. Initially, it was installed as a dual-boot, and worked well. To remove, I deleted the partitions on my laptop. This removed grub, and I was left with needing to enter: set root=... set prefix=... insmod normal normal each restart. I didn't restore the Windows boot-loader and have since re-partitioned my drive. Now, upon reaching the command prompt screen, an ls query showshd0, with three partitions, but none of them have a recognizable boot-loader as each returns with error: unknown file system. Booting from a Windows 7 rescue disk doesn't seem to work, as it sends me to the same command prompt terminal. All I'm looking to do is restore the boot-loader, either grub or Windows 7. Any help would be appreciated. Thanks in advance.

    Read the article

  • Using PInvoke vs .NET provided functions

    - by Jonathan Shepherd
    From version to version of .NET the more function that's equal to P/Invoke is added to .NET Now there are 2 questions in my mine. 1) Which one is prefer other the other in term of speed, normally I use .Net function but in tight loop I don't really know which one is going to be faster. 2) Is there any website that provide the list of counter-parts?

    Read the article

  • Extracting a specific value from command-line output using powershell

    - by Andrew Shepherd
    I've just started learning PowerShell this morning, and I'm grappling with the basics. Here's the problem: I want to query subversion for the revision number of a repository, and then create a new directory with this revision number. The command svn_info outputs a number of label\value pairs, delimited by colons. For example Path: c# URL: file:///%5Copdy-doo/Archive%20(H)/Development/CodeRepositories/datmedia/Development/c%23 Repository UUID: b1d03fca-1949-a747-a1a0-046c2429f46a Revision: 58 Last Changed Rev: 58 Last Changed Date: 2011-01-12 11:36:12 +1000 (Wed, 12 Jan 2011) Here is my current code which solves the problem. Is there a way to do this with less code? I'm thinking that with the use of piping you could do this with one or two lines. I certainly shouldn't have to use a temporary file. $RepositoryRoot = "file:///%5Cdat-ftp/Archive%20(H)/Development/CodeRepositories/datmedia" $BuildBase="/Development/c%23" $RepositoryPath=$RepositoryRoot + $BuildBase # Outputing the info into a file svn info $RepositoryPath | Out-File -FilePath svn_info.txt $regex = [regex] '^Revision: (\d{1,4})' foreach($info_line in get-content "svn_info.txt") { $match = $regex.Match($info_line); if($match.Success) { $revisionNumber = $match.Groups[1]; break; } } "Revision number = " + $revisionNumber;

    Read the article

  • Android TelephonyManager.getNetworkType() returned constant values in bearer speed order?

    - by Rob Shepherd
    TelephonyManager.getNetworkType() returns one of the constant values. It appears that the constant values have an integer order, by possible bearer link speed. I know using constant values used in the following manner is generally bad, however could one use this to determine a basic cutoff for application functionality and have it work between API levels? (in API-v1 there was nothing above 0x03) if( telephonyManager.getNetworkType() > TelephonyManager.NETWORK_TYPE_EDGE ) { return "3G! party on!"; } else if( telephonyManager.getNetworkType() > TelephonyManager.NETWORK_TYPE_UNKNOWN ) { return "2G, OK. just don't go nuts!"; } else { return "No data sorry" }

    Read the article

  • Invoking ADO.NET from MATLAB

    - by Andrew Shepherd
    It's possible to call .NET from MATLAB, so I thought I would try to use ADO.NET to connect to a database. I seem to have hit a blocking problem - anytime you try and create a Command object, it throws an error. You can try this yourself: >> NET.addAssembly('System.Data'); >> sqlconn = System.Data.SqlClient.SqlConnection(); >> sqlconn.State ans = Closed >> % So far, so good >> sqlcmd = System.Data.SqlClient.SqlCommand(); ??? Error using ==> System.Data.SqlClient.SqlCommand 'Connection' is already defined as a property. >> Does anyone have some insight into this? It seems like a pure and simple bug on MATLAB's part - maybe it happens with every .NET class that happens to have a property called "Connection". Should I just throw in the towel and give up on using MATLAB to talk to a database using .NET?

    Read the article

  • Finding specific pixel colors of a BitmapImage

    - by Andrew Shepherd
    I have a WPF BitmapImage which I loaded from a .JPG file, as follows: this.m_image1.Source = new BitmapImage(new Uri(path)); I want to query as to what the colour is at specific points. For example, what is the RGB value at pixel (65,32)? How do I go about this? I was taking this approach: ImageSource ims = m_image1.Source; BitmapImage bitmapImage = (BitmapImage)ims; int height = bitmapImage.PixelHeight; int width = bitmapImage.PixelWidth; int nStride = (bitmapImage.PixelWidth * bitmapImage.Format.BitsPerPixel + 7) / 8; byte[] pixelByteArray = new byte[bitmapImage.PixelHeight * nStride]; bitmapImage.CopyPixels(pixelByteArray, nStride, 0); Though I will confess there's a bit of monkey-see, monkey do going on with this code. Anyway, is there a straightforward way to process this array of bytes to convert to RGB values?

    Read the article

  • FancyURLOpener failing since moving to python 3.1.2

    - by Andrew Shepherd
    I had an application that was downloading a .CSV file from a password-protected website then processing it futher. I was using FancyURLOpener, and simply hardcoding the username and password. (Obviously, security is not a high priority in this particular instance). Since downloading Python 3.1.2, this code has stopped working. Does anyone know of the changes that have happened to the implementation? Here is a cut down version of the code: import urllib.request; class TracOpener (urllib.request.FancyURLopener) : def prompt_user_passwd(self, host, realm) : return ('andrew_ee', '_my_unenctryped_password') csvUrl='http://mysite/report/19?format=csv@USER=fred_nukre' opener = TracOpener(); f = opener.open(csvUrl); s = f.read(); f.close(); s; For the sake of completeness, here's the entire call stack: Traceback (most recent call last): File "C:\reporting\download_csv_file.py", line 12, in <module> f = opener.open(csvUrl); File "C:\Program Files\Python31\lib\urllib\request.py", line 1454, in open return getattr(self, name)(url) File "C:\Program Files\Python31\lib\urllib\request.py", line 1628, in open_http return self._open_generic_http(http.client.HTTPConnection, url, data) File "C:\Program Files\Python31\lib\urllib\request.py", line 1624, in _open_generic_http response.status, response.reason, response.msg, data) File "C:\Program Files\Python31\lib\urllib\request.py", line 1640, in http_error result = method(url, fp, errcode, errmsg, headers) File "C:\Program Files\Python31\lib\urllib\request.py", line 1878, in http_error_401 return getattr(self,name)(url, realm) File "C:\Program Files\Python31\lib\urllib\request.py", line 1950, in retry_http_basic_auth return self.open(newurl) File "C:\Program Files\Python31\lib\urllib\request.py", line 1454, in open return getattr(self, name)(url) File "C:\Program Files\Python31\lib\urllib\request.py", line 1628, in open_http return self._open_generic_http(http.client.HTTPConnection, url, data) File "C:\Program Files\Python31\lib\urllib\request.py", line 1590, in _open_generic_http auth = base64.b64encode(user_passwd).strip() File "C:\Program Files\Python31\lib\base64.py", line 56, in b64encode raise TypeError("expected bytes, not %s" % s.__class__.__name__) TypeError: expected bytes, not str

    Read the article

  • Draw a column graph with no space between columns

    - by Andrew Shepherd
    I am using the WPF toolkit, and am trying to render a graph that looks like a histogram. In particular, I want each column to be right up against each other column. There should be no gaps between columns. There are a number of components that you apply when creating a column graph. (See example XAML below). Does anybody know if there is a property you can set on one of the elements which refers to the width of the white space between columns? <charting:Chart Height="600" Width="Auto" HorizontalAlignment="Stretch" Name="MyChart" Title="Column Graph" LegendTitle="Legend"> <charting:ColumnSeries Name="theColumnSeries" Title="Series A" IndependentValueBinding="{Binding Path=Name}" DependentValueBinding="{Binding Path=Population}" Margin="0" > </charting:ColumnSeries> <charting:Chart.Axes> <charting:LinearAxis Orientation="Y" Minimum="200000" Maximum="2500000" ShowGridLines="True" /> <charting:CategoryAxis Name="chartCategoryAxis" /> </charting:Chart.Axes> </charting:Chart>

    Read the article

  • Excel Automation From .NET - creating a new worksheet

    - by Andrew Shepherd
    I am attempting what seems like a simple task: using C# to create a new Excel document containing new worksheets. For some reason, I am getting a strange COM error (0x800A03EC) Has anyone managed to get this to work? Does anyone have suggestions as to how to troubleshoot this? I've isolated this into the minimum amount of code: using Microsoft.Office.Interop.Excel; using System.Diagnostics; namespace ExcelAutomation { public static class ExcelTests { public static void CreateWorksheet() { try { var app = new Microsoft.Office.Interop.Excel.Application(); app.Visible = true; var workBooks = app.Workbooks; var newWorkbook = app.Workbooks.Add(XlWBATemplate.xlWBATWorksheet); Worksheet existingWorksheet = (Worksheet)newWorkbook.Sheets[1]; Worksheet workSheet = (Worksheet)newWorkbook.Sheets.Add ( null, // before existingWorksheet, null, // 1, null //XlSheetType.xlWorksheet ); } catch (System.Runtime.InteropServices.COMException ex) { Trace.WriteLine(string.Format("Caught COMException. Message: \"{0}\"", ex.Message)); } } } } The output window now says: Caught COMException. Message: "Exception from HRESULT: 0x800A03EC"

    Read the article

  • WPF Standard Commands - Where's Exit?

    - by Andrew Shepherd
    I'm creating a standard menu in my WPF application. I know that I can create custom commands, but I know there are also a bunch of standard commands to bind to. For example, to open a file I should bind to ApplicationCommands.Open, to close a file I should bind to ApplicationCommands.Close. There's also a large number of EditCommands, ComponentCommands or NavigationCommands. There doesn't seem to be an "Exit" command. I would have expected there to be ApplicationCommands.Exit. What should I bind to the "Exit" menu item? To create a custom command for something this generic just seems wrong.

    Read the article

  • Excel Automation - creating a new worksheet

    - by Andrew Shepherd
    I am attempting what seems like a simple task: using C# to create a new Excel document containing new worksheets. For some reason, I am getting a strange COM error (0x800A03EC) Has anyone managed to get this to work? Does anyone have suggestions as to how to troubleshoot this? I've isolated this into the minimum amount of code: using Microsoft.Office.Interop.Excel; using System.Diagnostics; namespace ExcelAutomation { public static class ExcelTests { public static void CreateWorksheet() { try { var app = new Microsoft.Office.Interop.Excel.Application(); app.Visible = true; var workBooks = app.Workbooks; var newWorkbook = app.Workbooks.Add(XlWBATemplate.xlWBATWorksheet); Worksheet existingWorksheet = (Worksheet)newWorkbook.Sheets[1]; Worksheet workSheet = (Worksheet)newWorkbook.Sheets.Add ( null, // before existingWorksheet, null, // 1, null //XlSheetType.xlWorksheet ); } catch (System.Runtime.InteropServices.COMException ex) { Trace.WriteLine(string.Format("Caught COMException. Message: \"{0}\"", ex.Message)); } } } } The output window now says: Caught COMException. Message: "Exception from HRESULT: 0x800A03EC"

    Read the article

  • Database Modelling - Conceptually different entities but with near identical fields

    - by Andrew Shepherd
    Suppose you have two sets of conceptual entities: MarketPriceDataSet which has multiple ForwardPriceEntries PoolPriceForecastDataSet which has multiple PoolPriceForecastEntry Both different child objects have near identical fields: ForwardPriceEntry has MarketPriceDataSetId (foreign key to parent table) StartDate EndDate SimulationItemId ForwardPrice PoolPriceForecastEntry has PoolPriceForecastDataSetId (foreign key to parent table) StartDate EndDate SimulationItemId ForecastPoolPrice If I modelled them as separate tables, the only difference would be the foreign key, and the name of the price field. There has been a debate as to whether the two near identical tables should be merged into one. Options I've thought of to model this is: Just keep them as two independent, separate tables Have both sets in the one table with an additional "type" field, and a parent_id equalling a foreign key to either parent table. This would sacrifice referential integrity checks. Have both sets in the one table with an additional "type" field, and create a complicated sequence of joining tables to maintain referential integrity. What do you think I should do, and why?

    Read the article

  • ASP.NET ListView, custom DataSources, and editing items

    - by Andrew Shepherd
    The MSDN walkthroughs provide a number of examples where you can drag a DataSource from the toolbox, run through some simple configuration steps, then drag a ListView onto the screen, point it at the DataSource, and hey - you've got full table editing. Now I'm trying to write my own DataSource class (a class that implements System.Web.UI.IDataSource) and my own DataSourceView class. I now assign an instance of this custom DataSource class to the ListView.DataSource propery. The display of all the items is working well. However, updating, inserting and deleting just is not working. I'm overriding every function I can in my DataSourceView class, and they just aren't being called. This is such a huge topic, I'll focus this question on one simple example: When you press the "Edit" button (the button inside the ItemTemplate with a CommandName of "Edit", you expect the ItemTemplate to be replaced by an EditItemTemplate. This did not happen. The only way I could get it to happen was to handle the onitemediting event. protected void _listViewPublicHolidays_ItemEditing(object sender, ListViewEditEventArgs e) { _listViewPublicHolidays.EditIndex = e.NewEditIndex; _listViewPublicHolidays.DataBind(); } This is hardly a problem, but how come I had to do it at all? In the MSDN walkthroughs where I attach a ListView to a LinqDataSource, this code doesn't have to be written. Can someone who's been here before hazard a guess as to what would be different or missing in my custom datasource?

    Read the article

  • Database Modelling - Conceptually different entities with near identical fields

    - by Andrew Shepherd
    Suppose you have two sets of conceptual entities: MarketPriceDataSet which has multiple ForwardPriceEntries PoolPriceForecastDataSet which has multiple PoolPriceForecastEntry Both different child objects have near identical fields: ForwardPriceEntry has StartDate EndDate SimulationItemId ForwardPrice MarketPriceDataSetId (foreign key to parent table) PoolPriceForecastEntry has StartDate EndDate SimulationItemId ForecastPoolPrice PoolPriceForecastDataSetId (foreign key to parent table) If I modelled them as separate tables, the only difference would be the foreign key, and the name of the price field. There has been a debate as to whether the two near identical tables should be merged into one. Options I've thought of to model this is: Just keep them as two independent, separate tables Have both sets in the one table with an additional "type" field, and a parent_id equalling a foreign key to either parent table. This would sacrifice referential integrity checks. Have both sets in the one table with an additional "type" field, and create a complicated sequence of joining tables to maintain referential integrity. What do you think I should do, and why?

    Read the article

  • Working With Extended Events

    - by Fatherjack
    SQL Server 2012 has made working with Extended Events (XE) pretty simple when it comes to what sessions you have on your servers and what options you have selected and so forth but if you are like me then you still have some SQL Server instances that are 2008 or 2008 R2. For those servers there is no built-in way to view the Extended Event sessions in SSMS. I keep coming up against the same situations – Where are the xel log files? What events, actions or predicates are set for the events on the server? What sessions are there on the server already? I got tired of this being a perpetual question and wrote some TSQL to save as a snippet in SQL Prompt so that these details are permanently only a couple of clicks away. First, some history. If you just came here for the code skip down a few paragraphs and it’s all there. If you want a little time to reminisce about SQL Server then stick with me through the next paragraph or two. We are in a bit of a cross-over period currently, there are many versions of SQL Server but I would guess that SQL Server 2008, 2008 R2 and 2012 comprise the majority of installations. With each of these comes a set of management tools, of which SQL Server Management Studio (SSMS) is one. In 2008 and 2008 R2 Extended Events made their first appearance and there was no way to work with them in the SSMS interface. At some point the Extended Events guru Jonathan Kehayias (http://www.sqlskills.com/blogs/jonathan/) created the SQL Server 2008 Extended Events SSMS Addin which is really an excellent tool to ease XE session administration. This addin will install in SSMS 2008 or 2008R2 but not SSMS 2012. If you use a compatible version of SSMS then I wholly recommend downloading and using it to make your work with XE much easier. If you have SSMS 2012 installed, and there is no reason not to as it will let you work with all versions of SQL Server, then you cannot install this addin. If you are working with SQL Server 2012 then SSMS 2012 has built in functionality to manage XE sessions – this functionality does not apply for 2008 or 2008 R2 instances though. This means you are somewhat restricted and have to use TSQL to manage XE sessions on older versions of SQL Server. OK, those of you that skipped ahead for the code, you need to start from here: So, you are working with SSMS 2012 but have a SQL Server that is an earlier version that needs an XE session created or you think there is a session created but you aren’t sure, or you know it’s there but can’t remember if it is running and where the output is going. How do you find out? Well, none of the information is hidden as such but it is a bit of a wrangle to locate it and it isn’t a lot of code that is unlikely to remain in your memory. I have created two pieces of code. The first examines the SYS.Server_Event_… management views in combination with the SYS.DM_XE_… management views to give the name of all sessions that exist on the server, regardless of whether they are running or not and two pieces of TSQL code. One piece will alter the state of the session: if the session is running then the code will stop the session if executed and vice versa. The other piece of code will drop the selected session. If the session is running then the code will stop it first. Do not execute the DROP code unless you are sure you have the Create code to hand. It will be dropped from the server without a second chance to change your mind. /**************************************************************/ /***   To locate and describe event sessions on a server    ***/ /***                                                        ***/ /***   Generates TSQL to start/stop/drop sessions           ***/ /***                                                        ***/ /***        Jonathan Allen - @fatherjack                    ***/ /***                 June 2013                                ***/ /***                                                        ***/ /**************************************************************/ SELECT  [EES].[name] AS [Session Name - all sessions] ,         CASE WHEN [MXS].[name] IS NULL THEN ISNULL([MXS].[name], 'Stopped')              ELSE 'Running'         END AS SessionState ,         CASE WHEN [MXS].[name] IS NULL              THEN ISNULL([MXS].[name],                          'ALTER EVENT SESSION [' + [EES].[name]                          + '] ON SERVER STATE = START;')              ELSE 'ALTER EVENT SESSION [' + [EES].[name]                   + '] ON SERVER STATE = STOP;'         END AS ALTER_SessionState ,         CASE WHEN [MXS].[name] IS NULL              THEN ISNULL([MXS].[name],                          'DROP EVENT SESSION [' + [EES].[name]                          + '] ON SERVER; -- This WILL drop the session. It will no longer exist. Don't do it unless you are certain you can recreate it if you need it.')              ELSE 'ALTER EVENT SESSION [' + [EES].[name]                   + '] ON SERVER STATE = STOP; ' + CHAR(10)                   + '-- DROP EVENT SESSION [' + [EES].[name]                   + '] ON SERVER; -- This WILL stop and drop the session. It will no longer exist. Don't do it unless you are certain you can recreate it if you need it.'         END AS DROP_Session FROM    [sys].[server_event_sessions] AS EES         LEFT JOIN [sys].[dm_xe_sessions] AS MXS ON [EES].[name] = [MXS].[name] WHERE   [EES].[name] NOT IN ( 'system_health', 'AlwaysOn_health' ) ORDER BY SessionState GO I have excluded the system_health and AlwaysOn sessions as I don’t want to accidentally execute the drop script for these sessions that are created as part of the SQL Server installation. It is possible to recreate the sessions but that is a whole lot of aggravation I’d rather avoid. The second piece of code gathers details of running XE sessions only and provides information on the Events being collected, any predicates that are set on those events, the actions that are set to be collected, where the collected information is being logged and if that logging is to a file target, where that file is located. /**********************************************/ /***    Running Session summary                ***/ /***                                        ***/ /***    Details key values of XE sessions     ***/ /***    that are in a running state            ***/ /***                                        ***/ /***        Jonathan Allen - @fatherjack    ***/ /***        June 2013                        ***/ /***                                        ***/ /**********************************************/ SELECT  [EES].[name] AS [Session Name - running sessions] ,         [EESE].[name] AS [Event Name] ,         COALESCE([EESE].[predicate], 'unfiltered') AS [Event Predicate Filter(s)] ,         [EESA].[Action] AS [Event Action(s)] ,         [EEST].[Target] AS [Session Target(s)] ,         ISNULL([EESF].[value], 'No file target in use') AS [File_Target_UNC] -- select * FROM    [sys].[server_event_sessions] AS EES         INNER JOIN [sys].[dm_xe_sessions] AS MXS ON [EES].[name] = [MXS].[name]         INNER JOIN [sys].[server_event_session_events] AS [EESE] ON [EES].[event_session_id] = [EESE].[event_session_id]         LEFT JOIN [sys].[server_event_session_fields] AS EESF ON ( [EES].[event_session_id] = [EESF].[event_session_id]                                                               AND [EESF].[name] = 'filename'                                                               )         CROSS APPLY ( SELECT    STUFF(( SELECT  ', ' + sest.name                                         FROM    [sys].[server_event_session_targets]                                                 AS SEST                                         WHERE   [EES].[event_session_id] = [SEST].[event_session_id]                                       FOR                                         XML PATH('')                                       ), 1, 2, '') AS [Target]                     ) AS EEST         CROSS APPLY ( SELECT    STUFF(( SELECT  ', ' + [sesa].NAME                                         FROM    [sys].[server_event_session_actions]                                                 AS sesa                                         WHERE   [sesa].[event_session_id] = [EES].[event_session_id]                                       FOR                                         XML PATH('')                                       ), 1, 2, '') AS [Action]                     ) AS EESA WHERE   [EES].[name] NOT IN ( 'system_health', 'AlwaysOn_health' ) /*Optional to exclude 'out-of-the-box' traces*/ I hope that these scripts are useful to you and I would be obliged if you would keep my name in the script comments. I have no problem with you using it in production or personal circumstances, however it has no warranty or guarantee. Don’t use it unless you understand it and are happy with what it is going to do. I am not ever responsible for the consequences of executing this script on your servers.

    Read the article

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