Search Results

Search found 10841 results on 434 pages for 'air native extension'.

Page 91/434 | < Previous Page | 87 88 89 90 91 92 93 94 95 96 97 98  | Next Page >

  • Is it possible to have file filters for multiple extension types?

    - by Jon Cage
    I'm using a standard Windows FileDialog to allow the user to select some files. I'd like to filter out only the file types I'm interested in though (lets call them *.a and *.b). Is there any way to do this without using *.*? I've tried the following but it fails to match any files at all: this->openFileDialog1->DefaultExt = L"*.a,*.b"; this->openFileDialog1->FileName = L"openFileDialog1"; this->openFileDialog1->Filter = L"My Data Files (*.a,*.b)|*.a,*.b";

    Read the article

  • ASP.NET MVC Paging/Sorting/Filtering a list using ModelMetadata

    - by rajbk
    This post looks at how to control paging, sorting and filtering when displaying a list of data by specifying attributes in your Model using the ASP.NET MVC framework and the excellent MVCContrib library. It also shows how to hide/show columns and control the formatting of data using attributes.  This uses the Northwind database. A sample project is attached at the end of this post. Let’s start by looking at a class called ProductViewModel. The properties in the class are decorated with attributes. The OrderBy attribute tells the system that the Model can be sorted using that property. The SearchFilter attribute tells the system that filtering is allowed on that property. Filtering type is set by the  FilterType enum which currently supports Equals and Contains. The ScaffoldColumn property specifies if a column is hidden or not The DisplayFormat specifies how the data is formatted. public class ProductViewModel { [OrderBy(IsDefault = true)] [ScaffoldColumn(false)] public int? ProductID { get; set; }   [SearchFilter(FilterType.Contains)] [OrderBy] [DisplayName("Product Name")] public string ProductName { get; set; }   [OrderBy] [DisplayName("Unit Price")] [DisplayFormat(DataFormatString = "{0:c}")] public System.Nullable<decimal> UnitPrice { get; set; }   [DisplayName("Category Name")] public string CategoryName { get; set; }   [SearchFilter] [ScaffoldColumn(false)] public int? CategoryID { get; set; }   [SearchFilter] [ScaffoldColumn(false)] public int? SupplierID { get; set; }   [OrderBy] public bool Discontinued { get; set; } } Before we explore the code further, lets look at the UI.  The UI has a section for filtering the data. The column headers with links are sortable. Paging is also supported with the help of a pager row. The pager is rendered using the MVCContrib Pager component. The data is displayed using a customized version of the MVCContrib Grid component. The customization was done in order for the Grid to be aware of the attributes mentioned above. Now, let’s look at what happens when we perform actions on this page. The diagram below shows the process: The form on the page has its method set to “GET” therefore we see all the parameters in the query string. The query string is shown in blue above. This query gets routed to an action called Index with parameters of type ProductViewModel and PageSortOptions. The parameters in the query string get mapped to the input parameters using model binding. The ProductView object created has the information needed to filter data while the PageAndSorting object is used for paging and sorting the data. The last block in the figure above shows how the filtered and paged list is created. We receive a product list from our product repository (which is of type IQueryable) and first filter it by calliing the AsFiltered extension method passing in the productFilters object and then call the AsPagination extension method passing in the pageSort object. The AsFiltered extension method looks at the type of the filter instance passed in. It skips properties in the instance that do not have the SearchFilter attribute. For properties that have the SearchFilter attribute, it adds filter expression trees to filter against the IQueryable data. The AsPagination extension method looks at the type of the IQueryable and ensures that the column being sorted on has the OrderBy attribute. If it does not find one, it looks for the default sort field [OrderBy(IsDefault = true)]. It is required that at least one attribute in your model has the [OrderBy(IsDefault = true)]. This because a person could be performing paging without specifying an order by column. As you may recall the LINQ Skip method now requires that you call an OrderBy method before it. Therefore we need a default order by column to perform paging. The extension method adds a order expressoin tree to the IQueryable and calls the MVCContrib AsPagination extension method to page the data. Implementation Notes Auto Postback The search filter region auto performs a get request anytime the dropdown selection is changed. This is implemented using the following jQuery snippet $(document).ready(function () { $("#productSearch").change(function () { this.submit(); }); }); Strongly Typed View The code used in the Action method is shown below: public ActionResult Index(ProductViewModel productFilters, PageSortOptions pageSortOptions) { var productPagedList = productRepository.GetProductsProjected().AsFiltered(productFilters).AsPagination(pageSortOptions);   var productViewFilterContainer = new ProductViewFilterContainer(); productViewFilterContainer.Fill(productFilters.CategoryID, productFilters.SupplierID, productFilters.ProductName);   var gridSortOptions = new GridSortOptions { Column = pageSortOptions.Column, Direction = pageSortOptions.Direction };   var productListContainer = new ProductListContainerModel { ProductPagedList = productPagedList, ProductViewFilterContainer = productViewFilterContainer, GridSortOptions = gridSortOptions };   return View(productListContainer); } As you see above, the object that is returned to the view is of type ProductListContainerModel. This contains all the information need for the view to render the Search filter section (including dropdowns),  the Html.Pager (MVCContrib) and the Html.Grid (from MVCContrib). It also stores the state of the search filters so that they can recreate themselves when the page reloads (Viewstate, I miss you! :0)  The class diagram for the container class is shown below.   Custom MVCContrib Grid The MVCContrib grid default behavior was overridden so that it would auto generate the columns and format the columns based on the metadata and also make it aware of our custom attributes (see MetaDataGridModel in the sample code). The Grid ensures that the ShowForDisplay on the column is set to true This can also be set by the ScaffoldColumn attribute ref: http://bradwilson.typepad.com/blog/2009/10/aspnet-mvc-2-templates-part-2-modelmetadata.html) Column headers are set using the DisplayName attribute Column sorting is set using the OrderBy attribute. The data is formatted using the DisplayFormat attribute. Generic Extension methods for Sorting and Filtering The extension method AsFiltered takes in an IQueryable<T> and uses expression trees to query against the IQueryable data. The query is constructed using the Model metadata and the properties of the T filter (productFilters in our case). Properties in the Model that do not have the SearchFilter attribute are skipped when creating the filter expression tree.  It returns an IQueryable<T>. The extension method AsPagination takes in an IQuerable<T> and first ensures that the column being sorted on has the OrderBy attribute. If not, we look for the default OrderBy column ([OrderBy(IsDefault = true)]). We then build an expression tree to sort on this column. We finally hand off the call to the MVCContrib AsPagination which returns an IPagination<T>. This type as you can see in the class diagram above is passed to the view and used by the MVCContrib Grid and Pager components. Custom Provider To get the system to recognize our custom attributes, we create our MetadataProvider as mentioned in this article (http://bradwilson.typepad.com/blog/2010/01/why-you-dont-need-modelmetadataattributes.html) protected override ModelMetadata CreateMetadata(IEnumerable<Attribute> attributes, Type containerType, Func<object> modelAccessor, Type modelType, string propertyName) { ModelMetadata metadata = base.CreateMetadata(attributes, containerType, modelAccessor, modelType, propertyName);   SearchFilterAttribute searchFilterAttribute = attributes.OfType<SearchFilterAttribute>().FirstOrDefault(); if (searchFilterAttribute != null) { metadata.AdditionalValues.Add(Globals.SearchFilterAttributeKey, searchFilterAttribute); }   OrderByAttribute orderByAttribute = attributes.OfType<OrderByAttribute>().FirstOrDefault(); if (orderByAttribute != null) { metadata.AdditionalValues.Add(Globals.OrderByAttributeKey, orderByAttribute); }   return metadata; } We register our MetadataProvider in Global.asax.cs. protected void Application_Start() { AreaRegistration.RegisterAllAreas();   RegisterRoutes(RouteTable.Routes);   ModelMetadataProviders.Current = new MvcFlan.QueryModelMetaDataProvider(); } Bugs, Comments and Suggestions are welcome! You can download the sample code below. This code is purely experimental. Use at your own risk. Download Sample Code (VS 2010 RTM) MVCNorthwindSales.zip

    Read the article

  • CodePlex Daily Summary for Thursday, May 13, 2010

    CodePlex Daily Summary for Thursday, May 13, 2010New ProjectsC# 4.0: VS 2010Collaborative Rich Text Edit Prototype Silverlight on Windows Azure: Working like Google Doc but based on Silverlight/Windows Azure. Multiple users can edit one rich text document simultaneously. This is a POC and my...Consulting Assigment: Proyecto de consultoría para el curso Gestión de proyectos de la UCRCS 105 MP Splitter: Simple program to help with splitting up MPs for grading.DipEngine - graphic engine written on Xen for XNA: DIPEngine makes it easier for developers to use it in your game. It's developed in C# and using Xen for XNADotNetAgent: Agent FrameworkExtending C# editor - Outlining, classification: Extensions to VS C# editor current feautereset. Outlining for switch, for(each), if etc. statements. Classification types for method parameters and...Floe IRC Client: Floe is an IRC client written entirely in C#, using the .NET 4.0 framework with WPF technology. It is inspired largely by both XChat and mIRC, and ...Gestalt.Net: Gestalt.Net is a simple to use library for application configuration. It allows for more flexibility, easier to use, and more powerful than the app...GIM.OnlineChess: An implementation of online long-term chessGoogleTrail: Create and Export using the google map to develop the Trek Trails and Export Those Trails as Garmin Custom Map Compatible MapsGrassidi: What could Grassidi be?HodsAudio: Personal web based music library.Hospital Manage System: Free Hospital Manage SystemHtml Reader: Html Reader makes it easier for WPF WebBrowser users to access the Document property, and retrieve information from HTML pages. You'll no longer ha...Intellitouch.BackOffice: This project is a control for a menu.Jank: JankKooBoo Image Galery: It's a Module for kooboo that implements an image galery admin and view Developed for kooboo 2.1.1.0MoonyDesk (windows desktop widgets): Windows desktop plugin based widgets system written on WPFMSNSharp Application with Video Conferencing Feature: In MSN World, users don’t communicate directly each other.I examined P2P open source video/audio conference systems . After researching, I found Vi...mysample: study sample siteNoteFlyBot: An Intelligent Note Program is: - a 'Post-it' note that accept sNatural Language command to Upload content to EMC Repositories - Start Workflow...OpenGraphNET: A OpenGraphNET is a simple parser for the Open Graph protocol created by Facebook. More information on this can be found at opengraphprotocol.org.POCO - ADO.NET Entity Framework 4.0: The sample shows how to retrieve the data using POCO using EDM 4.0. Database used: Northwind (http://www.microsoft.com/downloads/details.aspx?Fa...sqlmx: sqlmxUpgrade Log Parser for SharePoint 2010: This is a simple Upgrade Log Parser for SharePoint 2010. It will add a node in the upgrade section of the central administration and deploy a pag...New ReleasesAMP (Adamo Media Player): AMP (Adamo Media Player): First Release version 0.1.0 Installation Instructions Unzip the package Run Setup.exe Follow Setup instructions File includes .NET Framework ...BeanProxy: BeanProxy 2.8: BeanProxy is a C# (.NET 3.5) library housing classes that facilitates unit testing. Any non-static, public interface/class/or abstract class can be...Begtostudy-Test: Test V1: Download to testCBM-Command: 2010-05-13: Release Notes - 2010-05-13New Features Configuration Manager is complete Changes Had to put CBM-Command on a big-time diet. Ran out of room on the...CS 105 MP Splitter: CS 105 MP Splitter: Uses SharpZipLib for unzipping (http://www.icsharpcode.net/OpenSource/SharpZipLib/) Uses ILMerge to merge it all into a single executable (http://w...DipEngine - graphic engine written on Xen for XNA: DipGUI: Provides simple controls for use itEvent Scavenger: Collector service update - version 3.2.3: Added additional functionality to check if host/machine is available on the network before trying to open Event log. Also added code to try to use ...ExcelExportLib: ExcelExportLib 1.4.0.0: Solution converted to Visual Studio 2010 - Added support for formulas in cells - Added support for cell naming - Added support for cell's comments...F# Project Extender: V0.9.1.0 (VS2008,VS2010): F# project extender for Visual Studio 2008 and Visual Studio 2010. What's new : Now supports both Visual Studio 2010 and Visual Studio 2008 Fixed...Floe IRC Client: Floe IRC Client 2010-05: Initial release. Note: The .NET Framework v4.0 is required to run this app. It can be downloaded here: http://www.microsoft.com/downloads/details....Fluent Assertions: Release 1.2.1: This is small release with two improvements: You can now use the Enumeration() extension method on a Func<IEnumerable> before calling ShouldThrow<T...Gestalt.Net: Gestalt.Net 1.0: Initial release of Gestalt.Net, a simple to use library for application configuration. It allows for more flexibility, easier to use, and more powe...GPdotNET - Tree Based Genetic Programming Tool: GPdotNETv0.9: This is the same version as previous, but compiled with Visual Studio 2010 and .NET 4.0. You no longer need CTP of ParallelFX.HKGolden Express: HKGoldenExpress (Build 201005122025): New features: (None) Bug fix: (None) Improvements: HKGolden Express now parse JSON data rather than XML document from HKGolden API. This shoul...Jobping Url Shortener: Deploy Code 0.3: Contains only the files for running 0.3 version of the code.Jobping Url Shortener: Source Code 0.3: Feature added: Restriction placed on the domains that the shortener will shorten. Our installation will only shorten www.jobping.com urls. Bug Fix...KooBoo Image Galery: Beta 1: This is the first release and it is divided in some parts Module Install - Is the admin module and an default view Plugin - returns the galery as...LinkedIn® for Windows Mobile: LinkedIn for Windows Mobile v0.8.5: Changes in release 0.8.5 Allow for multiple updatetypes. Add search by Company. Show profiles of all people in an update .MDownloader: MDownloader-0.15.13.58780: Fixed Uploading.com dead links detection; Fixed links detection at pages and in FilesTube results; Fixed RSS channel checking; Enabled by def...Microsoft - Domain Oriented N-Layered .NET 4.0 App Sample (Microsoft Spain): V0.8 - N-Layer DDD Sample App (VS.2010 RTM compat): Required Software (Microsoft Base Software needed for Development environment) Visual Studio 2010 RTM & .NET 4.0 RTM (Final Versions) Unity Applic...MoonyDesk (windows desktop widgets): MoonyDesk: MoonyDesk alpha releaseMSNSharp Application with Video Conferencing Feature: MSNVideoChat: Msn Video Chat Application's exe and screenshot is attached.NazTek.Extension.Clr35: NazTek.Extension.Clr35 Binary: FxCop compliant codebaseNazTek.Extension.Clr35: NazTek.Extension.Clr35 Signed Binary: Signed binaryNazTek.Extension.Clr35: NazTek.Extension.Clr35 Signed Source: Signed sourceNazTek.Extension.Clr35: NazTek.Extension.Clr35 Source: FxCop compliant codebasepatterns & practices Web Client Developer Guidance: Web Client Software Factory 2010 Guide: If the right-side pane of the chm file is not displayed correctly, do the following: 1) Download WCSF2010Guide.chm file. 2) Start the windows explo...Powershell Scripts for Admins: BizTalk PowerShell Module: BizTalk PowerShell Module Available commands : Get-Applications Start-Application Stop-Application Get-HostInstances Start-HostInstance Stop-Hos...Reusable Library: V1.0.8: A collection of reusable abstractions for enterprise application developerReusable Library Demo: V1.0.6: A demonstration of reusable abstractions for enterprise application developerRobot Shootans: Robot Shootans 0.9: This is the second public release of the game. All instructions for play are in the game itself. Known issues: Bullet collision is still a little...Rx Contrib: V1.2: - Bug fix - API changes public static ReactiveQueue<T> CreateConcurrentQueue( ConcurrentPublicationBehavior concurrentPublicationBeha...SqlDiffFramework-A Visual Differencing Engine for Dissimilar Data Sources: SqlDiffFramework 1.0.1.0: Maintenance Release An embedded user control inadvertently assumed US regional and language settings; with non-US settings the application crashed ...Transcriber: Transcriber V0.5.0: Pre-releaseUpgrade Log Parser for SharePoint 2010: Upgrade Log Parser for SharePoint 2010: Introduction I did an upgrade from MOSS 2007 to SharePoint 2010 and SP2010 generated such a large log file and I really didn't feel like scrolling ...VCC: Latest build, v2.1.30512.0: Automatic drop of latest buildVisual Leak Detector for Visual C++ 2008/2010: v2.0a: Renamed vld dll files. Problem with MSVC 2010 Unicode library fixed.VsTortoise - a TortoiseSVN add-in for Microsoft Visual Studio: VsTortoise Build 24 Beta: Build 24 (beta) New: Added "Open Modified File..." to Solution Explorer context menus. VsTortoise.SolutionExplorerSelectedItemsOpenModifiedFile com...WatchersNET.TagCloud: WatchersNET.TagCloud 01.05.00: Whats New Custom Tags: Tag Name and Tag Url can be localized New Option to set Start Date to grab Search Referrals from New Option to Choose th...Wavelet analysis: Wavelet analysis: Первая публичная версия проекта.XNA Shooter Engine: ModelViewer Alpha 1 Preview: ModelViewer is a utility for previewing HLSL shaders and XNA BasicEffects using the XSE rendering engine. It can also be used with the Microsoft XN...Yet another developer blog - Examples: XML and XSLT transformation in ASP.NET MVC example: This sample application shows how to perform XSL transformation of XML file in ASP.NET MVC (using dedicated HtmlHelper extensions or ActionResult)....Most Popular ProjectsWBFS ManagerRawrAJAX Control ToolkitMicrosoft SQL Server Product Samples: DatabaseSilverlight ToolkitWindows Presentation Foundation (WPF)patterns & practices – Enterprise LibraryMicrosoft SQL Server Community & SamplesPHPExcelASP.NETMost Active Projectspatterns & practices – Enterprise LibraryMirror Testing SystemRawrBlogEngine.NETPHPExcelwhitejQuery Library for SharePoint Web ServicesMicrosoft Biology FoundationFarseer Physics EngineShake - C# Make

    Read the article

  • C#/.NET Little Wonders: Use Cast() and TypeOf() to Change Sequence Type

    - by James Michael Hare
    Once again, in this series of posts I look at the parts of the .NET Framework that may seem trivial, but can help improve your code by making it easier to write and maintain. The index of all my past little wonders posts can be found here. We’ve seen how the Select() extension method lets you project a sequence from one type to a new type which is handy for getting just parts of items, or building new items.  But what happens when the items in the sequence are already the type you want, but the sequence itself is typed to an interface or super-type instead of the sub-type you need? For example, you may have a sequence of Rectangle stored in an IEnumerable<Shape> and want to consider it an IEnumerable<Rectangle> sequence instead.  Today we’ll look at two handy extension methods, Cast<TResult>() and OfType<TResult>() which help you with this task. Cast<TResult>() – Attempt to cast all items to type TResult So, the first thing we can do would be to attempt to create a sequence of TResult from every item in the source sequence.  Typically we’d do this if we had an IEnumerable<T> where we knew that every item was actually a TResult where TResult inherits/implements T. For example, assume the typical Shape example classes: 1: // abstract base class 2: public abstract class Shape { } 3:  4: // a basic rectangle 5: public class Rectangle : Shape 6: { 7: public int Widtgh { get; set; } 8: public int Height { get; set; } 9: } And let’s assume we have a sequence of Shape where every Shape is a Rectangle… 1: var shapes = new List<Shape> 2: { 3: new Rectangle { Width = 3, Height = 5 }, 4: new Rectangle { Width = 10, Height = 13 }, 5: // ... 6: }; To get the sequence of Shape as a sequence of Rectangle, of course, we could use a Select() clause, such as: 1: // select each Shape, cast it to Rectangle 2: var rectangles = shapes 3: .Select(s => (Rectangle)s) 4: .ToList(); But that’s a bit verbose, and fortunately there is already a facility built in and ready to use in the form of the Cast<TResult>() extension method: 1: // cast each item to Rectangle and store in a List<Rectangle> 2: var rectangles = shapes 3: .Cast<Rectangle>() 4: .ToList(); However, we should note that if anything in the list cannot be cast to a Rectangle, you will get an InvalidCastException thrown at runtime.  Thus, if our Shape sequence had a Circle in it, the call to Cast<Rectangle>() would have failed.  As such, you should only do this when you are reasonably sure of what the sequence actually contains (or are willing to handle an exception if you’re wrong). Another handy use of Cast<TResult>() is using it to convert an IEnumerable to an IEnumerable<T>.  If you look at the signature, you’ll see that the Cast<TResult>() extension method actually extends the older, object-based IEnumerable interface instead of the newer, generic IEnumerable<T>.  This is your gateway method for being able to use LINQ on older, non-generic sequences.  For example, consider the following: 1: // the older, non-generic collections are sequence of object 2: var shapes = new ArrayList 3: { 4: new Rectangle { Width = 3, Height = 13 }, 5: new Rectangle { Width = 10, Height = 20 }, 6: // ... 7: }; Since this is an older, object based collection, we cannot use the LINQ extension methods on it directly.  For example, if I wanted to query the Shape sequence for only those Rectangles whose Width is > 5, I can’t do this: 1: // compiler error, Where() operates on IEnumerable<T>, not IEnumerable 2: var bigRectangles = shapes.Where(r => r.Width > 5); However, I can use Cast<Rectangle>() to treat my ArrayList as an IEnumerable<Rectangle> and then do the query! 1: // ah, that’s better! 2: var bigRectangles = shapes.Cast<Rectangle>().Where(r => r.Width > 5); Or, if you prefer, in LINQ query expression syntax: 1: var bigRectangles = from s in shapes.Cast<Rectangle>() 2: where s.Width > 5 3: select s; One quick warning: Cast<TResult>() only attempts to cast, it won’t perform a cast conversion.  That is, consider this: 1: var intList = new List<int> { 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89 }; 2:  3: // casting ints to longs, this should work, right? 4: var asLong = intList.Cast<long>().ToList(); Will the code above work?  No, you’ll get a InvalidCastException. Remember that Cast<TResult>() is an extension of IEnumerable, thus it is a sequence of object, which means that it will box every int as an object as it enumerates over it, and there is no cast conversion from object to long, and thus the cast fails.  In other words, a cast from int to long will succeed because there is a conversion from int to long.  But a cast from int to object to long will not, because you can only unbox an item by casting it to its exact type. For more information on why cast-converting boxed values doesn’t work, see this post on The Dangers of Casting Boxed Values (here). OfType<TResult>() – Filter sequence to only items of type TResult So, we’ve seen how we can use Cast<TResult>() to change the type of our sequence, when we expect all the items of the sequence to be of a specific type.  But what do we do when a sequence contains many different types, and we are only concerned with a subset of a given type? For example, what if a sequence of Shape contains Rectangle and Circle instances, and we just want to select all of the Rectangle instances?  Well, let’s say we had this sequence of Shape: 1: var shapes = new List<Shape> 2: { 3: new Rectangle { Width = 3, Height = 5 }, 4: new Rectangle { Width = 10, Height = 13 }, 5: new Circle { Radius = 10 }, 6: new Square { Side = 13 }, 7: // ... 8: }; Well, we could get the rectangles using Select(), like: 1: var onlyRectangles = shapes.Where(s => s is Rectangle).ToList(); But fortunately, an easier way has already been written for us in the form of the OfType<T>() extension method: 1: // returns only a sequence of the shapes that are Rectangles 2: var onlyRectangles = shapes.OfType<Rectangle>().ToList(); Now we have a sequence of only the Rectangles in the original sequence, we can also use this to chain other queries that depend on Rectangles, such as: 1: // select only Rectangles, then filter to only those more than 2: // 5 units wide... 3: var onlyBigRectangles = shapes.OfType<Rectangle>() 4: .Where(r => r.Width > 5) 5: .ToList(); The OfType<Rectangle>() will filter the sequence to only the items that are of type Rectangle (or a subclass of it), and that results in an IEnumerable<Rectangle>, we can then apply the other LINQ extension methods to query that list further. Just as Cast<TResult>() is an extension method on IEnumerable (and not IEnumerable<T>), the same is true for OfType<T>().  This means that you can use OfType<TResult>() on object-based collections as well. For example, given an ArrayList containing Shapes, as below: 1: // object-based collections are a sequence of object 2: var shapes = new ArrayList 3: { 4: new Rectangle { Width = 3, Height = 5 }, 5: new Rectangle { Width = 10, Height = 13 }, 6: new Circle { Radius = 10 }, 7: new Square { Side = 13 }, 8: // ... 9: }; We can use OfType<Rectangle> to filter the sequence to only Rectangle items (and subclasses), and then chain other LINQ expressions, since we will then be of type IEnumerable<Rectangle>: 1: // OfType() converts the sequence of object to a new sequence 2: // containing only Rectangle or sub-types of Rectangle. 3: var onlyBigRectangles = shapes.OfType<Rectangle>() 4: .Where(r => r.Width > 5) 5: .ToList(); Summary So now we’ve seen two different ways to get a sequence of a superclass or interface down to a more specific sequence of a subclass or implementation.  The Cast<TResult>() method casts every item in the source sequence to type TResult, and the OfType<TResult>() method selects only those items in the source sequence that are of type TResult. You can use these to downcast sequences, or adapt older types and sequences that only implement IEnumerable (such as DataTable, ArrayList, etc.). Technorati Tags: C#,CSharp,.NET,LINQ,Little Wonders,TypeOf,Cast,IEnumerable<T>

    Read the article

  • change height in Android 2.2 LinearLayout in code

    - by Niro
    Im trying to change height of Layouts through the code without success. I've tried all of the examples i saw here and other site and my app just keep shutting down. xml code: <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/main_lay" android:orientation="vertical" tools:context=".MainActivity" > <LinearLayout android:id="@+id/layout_add" > </LinearLayout> <LinearLayout android:layout_width="fill_parent" android:layout_height="50dp" android:background="@color/green"> <ImageView android:layout_width="fill_parent" android:contentDescription="@string/desc" android:layout_height="45dp" android:layout_gravity="center_vertical|left" android:scaleType="fitStart" android:background="@color/orange" android:src="@drawable/logo" > </ImageView> </LinearLayout> </LinearLayout> Java code: main_layout=(LinearLayout)findViewById(R.id.main_lay); main_layout.setLayoutParams(new FrameLayout.LayoutParams(LayoutParams.MATCH_PARENT,LayoutParams.MATCH_PARENT)); main_layout.setBackgroundResource(R.color.white); layout_add = (LinearLayout) findViewById(R.id.layout_add); layout_add.setLayoutParams(new FrameLayout.LayoutParams(LayoutParams.FILL_PARENT,50 )); layout_add.setBackgroundResource(R.color.dark_grey); I cant understand what im doing wrong. I've tried different ways to fix it. The Backround setting is working fine. Thank you guys Niro This is the Logcat 12-09 16:12:39.007: E/AnalyticsSDKTest.cpp(6338): Time w/ UTC Offset: 2012-12-09 12-09 16:16:14.517: E/ActivityManager(121): fail to set top app changed! 12-09 16:16:14.547: E/InputDispatcher(121): channel '4056b9c8 com.nirosadvice.converter/com.nirosadvice.converter.MainActivity (server)' ~ Consumer closed input channel or an error occurred. events=0x8 12-09 16:16:14.547: E/InputDispatcher(121): channel '4056b9c8 com.nirosadvice.converter/com.nirosadvice.converter.MainActivity (server)' ~ Channel is unrecoverably broken and will be disposed! 12-09 16:16:18.071: E/PVWmdrmProxy(5716): binder died for component: ComponentInfo{com.pv.wmdrmservice/com.pv.wmdrmservice.PVWmdrmService} 12-09 16:16:18.161: E/AndroidRuntime(18911): FATAL EXCEPTION: main 12-09 16:16:18.161: E/AndroidRuntime(18911): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.nirosadvice.converter/com.nirosadvice.converter.MainActivity}: java.lang.RuntimeException: Binary XML file line #1: You must supply a layout_width attribute. 12-09 16:16:18.161: E/AndroidRuntime(18911): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1821) 12-09 16:16:18.161: E/AndroidRuntime(18911): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1842) 12-09 16:16:18.161: E/AndroidRuntime(18911): at android.app.ActivityThread.access$1500(ActivityThread.java:132) 12-09 16:16:18.161: E/AndroidRuntime(18911): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1038) 12-09 16:16:18.161: E/AndroidRuntime(18911): at android.os.Handler.dispatchMessage(Handler.java:99) 12-09 16:16:18.161: E/AndroidRuntime(18911): at android.os.Looper.loop(Looper.java:150) 12-09 16:16:18.161: E/AndroidRuntime(18911): at android.app.ActivityThread.main(ActivityThread.java:4263) 12-09 16:16:18.161: E/AndroidRuntime(18911): at java.lang.reflect.Method.invokeNative(Native Method) 12-09 16:16:18.161: E/AndroidRuntime(18911): at java.lang.reflect.Method.invoke(Method.java:507) 12-09 16:16:18.161: E/AndroidRuntime(18911): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839) 12-09 16:16:18.161: E/AndroidRuntime(18911): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597) 12-09 16:16:18.161: E/AndroidRuntime(18911): at dalvik.system.NativeStart.main(Native Method) 12-09 16:16:18.161: E/AndroidRuntime(18911): Caused by: java.lang.RuntimeException: Binary XML file line #1: You must supply a layout_width attribute. 12-09 16:16:18.161: E/AndroidRuntime(18911): at android.content.res.TypedArray.getLayoutDimension(TypedArray.java:491) 12-09 16:16:18.161: E/AndroidRuntime(18911): at android.view.ViewGroup$LayoutParams.setBaseAttributes(ViewGroup.java:3684) 12-09 16:16:18.161: E/AndroidRuntime(18911): at android.view.ViewGroup$MarginLayoutParams.<init>(ViewGroup.java:3764) 12-09 16:16:18.161: E/AndroidRuntime(18911): at android.widget.FrameLayout$LayoutParams.<init>(FrameLayout.java:457) 12-09 16:16:18.161: E/AndroidRuntime(18911): at android.widget.FrameLayout.generateLayoutParams(FrameLayout.java:423) 12-09 16:16:18.161: E/AndroidRuntime(18911): at android.widget.FrameLayout.generateLayoutParams(FrameLayout.java:47) 12-09 16:16:18.161: E/AndroidRuntime(18911): at android.view.LayoutInflater.inflate(LayoutInflater.java:396) 12-09 16:16:18.161: E/AndroidRuntime(18911): at android.view.LayoutInflater.inflate(LayoutInflater.java:320) 12-09 16:16:18.161: E/AndroidRuntime(18911): at android.view.LayoutInflater.inflate(LayoutInflater.java:276) 12-09 16:16:18.161: E/AndroidRuntime(18911): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:231) 12-09 16:16:18.161: E/AndroidRuntime(18911): at android.app.Activity.setContentView(Activity.java:1715) 12-09 16:16:18.161: E/AndroidRuntime(18911): at com.nirosadvice.converter.MainActivity.onCreate(MainActivity.java:87) 12-09 16:16:18.161: E/AndroidRuntime(18911): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1072) 12-09 16:16:18.161: E/AndroidRuntime(18911): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1785) 12-09 16:16:18.161: E/AndroidRuntime(18911): ... 11 more Thanks After Iv'e added the attributes to the XML - this is what i'm getting : CatLog: 12-09 16:42:33.168: E/AndroidRuntime(19065): FATAL EXCEPTION: main 12-09 16:42:33.168: E/AndroidRuntime(19065): java.lang.ClassCastException: android.view.ViewGroup$LayoutParams 12-09 16:42:33.168: E/AndroidRuntime(19065): at android.widget.LinearLayout.measureVertical(LinearLayout.java:360) 12-09 16:42:33.168: E/AndroidRuntime(19065): at android.widget.LinearLayout.onMeasure(LinearLayout.java:309) 12-09 16:42:33.168: E/AndroidRuntime(19065): at android.view.View.measure(View.java:8526) 12-09 16:42:33.168: E/AndroidRuntime(19065): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3224) 12-09 16:42:33.168: E/AndroidRuntime(19065): at android.widget.FrameLayout.onMeasure(FrameLayout.java:250) 12-09 16:42:33.168: E/AndroidRuntime(19065): at android.view.View.measure(View.java:8526) 12-09 16:42:33.168: E/AndroidRuntime(19065): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3224) 12-09 16:42:33.168: E/AndroidRuntime(19065): at android.widget.FrameLayout.onMeasure(FrameLayout.java:250) 12-09 16:42:33.168: E/AndroidRuntime(19065): at android.view.View.measure(View.java:8526) 12-09 16:42:33.168: E/AndroidRuntime(19065): at android.view.ViewRoot.performTraversals(ViewRoot.java:902) 12-09 16:42:33.168: E/AndroidRuntime(19065): at android.view.ViewRoot.handleMessage(ViewRoot.java:1957) 12-09 16:42:33.168: E/AndroidRuntime(19065): at android.os.Handler.dispatchMessage(Handler.java:99) 12-09 16:42:33.168: E/AndroidRuntime(19065): at android.os.Looper.loop(Looper.java:150) 12-09 16:42:33.168: E/AndroidRuntime(19065): at android.app.ActivityThread.main(ActivityThread.java:4263) 12-09 16:42:33.168: E/AndroidRuntime(19065): at java.lang.reflect.Method.invokeNative(Native Method) 12-09 16:42:33.168: E/AndroidRuntime(19065): at java.lang.reflect.Method.invoke(Method.java:507) 12-09 16:42:33.168: E/AndroidRuntime(19065): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839) 12-09 16:42:33.168: E/AndroidRuntime(19065): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597) 12-09 16:42:33.168: E/AndroidRuntime(19065): at dalvik.system.NativeStart.main(Native Method) 12-09 16:42:39.023: E/AnalyticsSDKTest.cpp(6338): Time w/ UTC Offset: 2012-12-09 21:42:39-05:00 12-09 16:42:49.013: E/AndroidRuntime(19095): FATAL EXCEPTION: main 12-09 16:42:49.013: E/AndroidRuntime(19095): java.lang.ClassCastException: android.view.ViewGroup$LayoutParams 12-09 16:42:49.013: E/AndroidRuntime(19095): at android.widget.LinearLayout.measureVertical(LinearLayout.java:360) 12-09 16:42:49.013: E/AndroidRuntime(19095): at android.widget.LinearLayout.onMeasure(LinearLayout.java:309) 12-09 16:42:49.013: E/AndroidRuntime(19095): at android.view.View.measure(View.java:8526) 12-09 16:42:49.013: E/AndroidRuntime(19095): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3224) 12-09 16:42:49.013: E/AndroidRuntime(19095): at android.widget.FrameLayout.onMeasure(FrameLayout.java:250) 12-09 16:42:49.013: E/AndroidRuntime(19095): at android.view.View.measure(View.java:8526) 12-09 16:42:49.013: E/AndroidRuntime(19095): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3224) 12-09 16:42:49.013: E/AndroidRuntime(19095): at android.widget.FrameLayout.onMeasure(FrameLayout.java:250) 12-09 16:42:49.013: E/AndroidRuntime(19095): at android.view.View.measure(View.java:8526) 12-09 16:42:49.013: E/AndroidRuntime(19095): at android.view.ViewRoot.performTraversals(ViewRoot.java:902) 12-09 16:42:49.013: E/AndroidRuntime(19095): at android.view.ViewRoot.handleMessage(ViewRoot.java:1957) 12-09 16:42:49.013: E/AndroidRuntime(19095): at android.os.Handler.dispatchMessage(Handler.java:99) 12-09 16:42:49.013: E/AndroidRuntime(19095): at android.os.Looper.loop(Looper.java:150) 12-09 16:42:49.013: E/AndroidRuntime(19095): at android.app.ActivityThread.main(ActivityThread.java:4263) 12-09 16:42:49.013: E/AndroidRuntime(19095): at java.lang.reflect.Method.invokeNative(Native Method) 12-09 16:42:49.013: E/AndroidRuntime(19095): at java.lang.reflect.Method.invoke(Method.java:507) 12-09 16:42:49.013: E/AndroidRuntime(19095): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839) 12-09 16:42:49.013: E/AndroidRuntime(19095): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597) 12-09 16:42:49.013: E/AndroidRuntime(19095): at dalvik.system.NativeStart.main(Native Method) 12-09 16:44:00.913: E/AndroidRuntime(19148): FATAL EXCEPTION: main 12-09 16:44:00.913: E/AndroidRuntime(19148): java.lang.ClassCastException: android.view.ViewGroup$LayoutParams 12-09 16:44:00.913: E/AndroidRuntime(19148): at android.widget.LinearLayout.measureVertical(LinearLayout.java:360) 12-09 16:44:00.913: E/AndroidRuntime(19148): at android.widget.LinearLayout.onMeasure(LinearLayout.java:309) 12-09 16:44:00.913: E/AndroidRuntime(19148): at android.view.View.measure(View.java:8526) 12-09 16:44:00.913: E/AndroidRuntime(19148): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3224) 12-09 16:44:00.913: E/AndroidRuntime(19148): at android.widget.FrameLayout.onMeasure(FrameLayout.java:250) 12-09 16:44:00.913: E/AndroidRuntime(19148): at android.view.View.measure(View.java:8526) 12-09 16:44:00.913: E/AndroidRuntime(19148): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3224) 12-09 16:44:00.913: E/AndroidRuntime(19148): at android.widget.FrameLayout.onMeasure(FrameLayout.java:250) 12-09 16:44:00.913: E/AndroidRuntime(19148): at android.view.View.measure(View.java:8526) 12-09 16:44:00.913: E/AndroidRuntime(19148): at android.view.ViewRoot.performTraversals(ViewRoot.java:902) 12-09 16:44:00.913: E/AndroidRuntime(19148): at android.view.ViewRoot.handleMessage(ViewRoot.java:1957) 12-09 16:44:00.913: E/AndroidRuntime(19148): at android.os.Handler.dispatchMessage(Handler.java:99) 12-09 16:44:00.913: E/AndroidRuntime(19148): at android.os.Looper.loop(Looper.java:150) 12-09 16:44:00.913: E/AndroidRuntime(19148): at android.app.ActivityThread.main(ActivityThread.java:4263) 12-09 16:44:00.913: E/AndroidRuntime(19148): at java.lang.reflect.Method.invokeNative(Native Method) 12-09 16:44:00.913: E/AndroidRuntime(19148): at java.lang.reflect.Method.invoke(Method.java:507) 12-09 16:44:00.913: E/AndroidRuntime(19148): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839) 12-09 16:44:00.913: E/AndroidRuntime(19148): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597) 12-09 16:44:00.913: E/AndroidRuntime(19148): at dalvik.system.NativeStart.main(Native Method) 12-09 16:44:02.935: E/InputDispatcher(121): channel '4056b9c8 com.nirosadvice.converter/com.nirosadvice.converter.MainActivity (server)' ~ Consumer closed input channel or an error occurred. events=0x8 12-09 16:44:02.935: E/InputDispatcher(121): channel '4056b9c8 com.nirosadvice.converter/com.nirosadvice.converter.MainActivity (server)' ~ Channel is unrecoverably broken and will be disposed! 12-09 16:45:25.075: E/AndroidRuntime(19210): FATAL EXCEPTION: main 12-09 16:45:25.075: E/AndroidRuntime(19210): java.lang.ClassCastException: android.view.ViewGroup$LayoutParams 12-09 16:45:25.075: E/AndroidRuntime(19210): at android.widget.LinearLayout.measureVertical(LinearLayout.java:360) 12-09 16:45:25.075: E/AndroidRuntime(19210): at android.widget.LinearLayout.onMeasure(LinearLayout.java:309) 12-09 16:45:25.075: E/AndroidRuntime(19210): at android.view.View.measure(View.java:8526) 12-09 16:45:25.075: E/AndroidRuntime(19210): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3224) 12-09 16:45:25.075: E/AndroidRuntime(19210): at android.widget.FrameLayout.onMeasure(FrameLayout.java:250) 12-09 16:45:25.075: E/AndroidRuntime(19210): at android.view.View.measure(View.java:8526) 12-09 16:45:25.075: E/AndroidRuntime(19210): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3224) 12-09 16:45:25.075: E/AndroidRuntime(19210): at android.widget.FrameLayout.onMeasure(FrameLayout.java:250) 12-09 16:45:25.075: E/AndroidRuntime(19210): at android.view.View.measure(View.java:8526) 12-09 16:45:25.075: E/AndroidRuntime(19210): at android.view.ViewRoot.performTraversals(ViewRoot.java:902) 12-09 16:45:25.075: E/AndroidRuntime(19210): at android.view.ViewRoot.handleMessage(ViewRoot.java:1957) 12-09 16:45:25.075: E/AndroidRuntime(19210): at android.os.Handler.dispatchMessage(Handler.java:99) 12-09 16:45:25.075: E/AndroidRuntime(19210): at android.os.Looper.loop(Looper.java:150) 12-09 16:45:25.075: E/AndroidRuntime(19210): at android.app.ActivityThread.main(ActivityThread.java:4263) 12-09 16:45:25.075: E/AndroidRuntime(19210): at java.lang.reflect.Method.invokeNative(Native Method) 12-09 16:45:25.075: E/AndroidRuntime(19210): at java.lang.reflect.Method.invoke(Method.java:507) 12-09 16:45:25.075: E/AndroidRuntime(19210): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839) 12-09 16:45:25.075: E/AndroidRuntime(19210): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597) 12-09 16:45:25.075: E/AndroidRuntime(19210): at dalvik.system.NativeStart.main(Native Method) 12-09 16:50:34.507: E/AndroidRuntime(19358): FATAL EXCEPTION: main 12-09 16:50:34.507: E/AndroidRuntime(19358): java.lang.ClassCastException: android.view.ViewGroup$LayoutParams 12-09 16:50:34.507: E/AndroidRuntime(19358): at android.widget.LinearLayout.measureVertical(LinearLayout.java:360) 12-09 16:50:34.507: E/AndroidRuntime(19358): at android.widget.LinearLayout.onMeasure(LinearLayout.java:309) 12-09 16:50:34.507: E/AndroidRuntime(19358): at android.view.View.measure(View.java:8526) 12-09 16:50:34.507: E/AndroidRuntime(19358): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3224) 12-09 16:50:34.507: E/AndroidRuntime(19358): at android.widget.FrameLayout.onMeasure(FrameLayout.java:250) 12-09 16:50:34.507: E/AndroidRuntime(19358): at android.view.View.measure(View.java:8526) 12-09 16:50:34.507: E/AndroidRuntime(19358): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3224) 12-09 16:50:34.507: E/AndroidRuntime(19358): at android.widget.FrameLayout.onMeasure(FrameLayout.java:250) 12-09 16:50:34.507: E/AndroidRuntime(19358): at android.view.View.measure(View.java:8526) 12-09 16:50:34.507: E/AndroidRuntime(19358): at android.view.ViewRoot.performTraversals(ViewRoot.java:902) 12-09 16:50:34.507: E/AndroidRuntime(19358): at android.view.ViewRoot.handleMessage(ViewRoot.java:1957) 12-09 16:50:34.507: E/AndroidRuntime(19358): at android.os.Handler.dispatchMessage(Handler.java:99) 12-09 16:50:34.507: E/AndroidRuntime(19358): at android.os.Looper.loop(Looper.java:150) 12-09 16:50:34.507: E/AndroidRuntime(19358): at android.app.ActivityThread.main(ActivityThread.java:4263) 12-09 16:50:34.507: E/AndroidRuntime(19358): at java.lang.reflect.Method.invokeNative(Native Method) 12-09 16:50:34.507: E/AndroidRuntime(19358): at java.lang.reflect.Method.invoke(Method.java:507) 12-09 16:50:34.507: E/AndroidRuntime(19358): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839) 12-09 16:50:34.507: E/AndroidRuntime(19358): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597) 12-09 16:50:34.507: E/AndroidRuntime(19358): at dalvik.system.NativeStart.main(Native Method) Third try - after changing the Frame to Linear : 12-09 17:42:39.076: E/AnalyticsSDKTest.cpp(6338): Time w/ UTC Offset: 2012-12-09 22:42:39-05:00 12-09 17:55:44.141: E/ActivityManager(121): Fix ANR:broadcast when App died 12-09 17:55:44.722: E/AndroidRuntime(19469): FATAL EXCEPTION: main 12-09 17:55:44.722: E/AndroidRuntime(19469): java.lang.ClassCastException: android.view.ViewGroup$LayoutParams 12-09 17:55:44.722: E/AndroidRuntime(19469): at android.widget.LinearLayout.measureVertical(LinearLayout.java:360) 12-09 17:55:44.722: E/AndroidRuntime(19469): at android.widget.LinearLayout.onMeasure(LinearLayout.java:309) 12-09 17:55:44.722: E/AndroidRuntime(19469): at android.view.View.measure(View.java:8526) 12-09 17:55:44.722: E/AndroidRuntime(19469): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3224) 12-09 17:55:44.722: E/AndroidRuntime(19469): at android.widget.FrameLayout.onMeasure(FrameLayout.java:250) 12-09 17:55:44.722: E/AndroidRuntime(19469): at android.view.View.measure(View.java:8526) 12-09 17:55:44.722: E/AndroidRuntime(19469): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3224) 12-09 17:55:44.722: E/AndroidRuntime(19469): at android.widget.FrameLayout.onMeasure(FrameLayout.java:250) 12-09 17:55:44.722: E/AndroidRuntime(19469): at android.view.View.measure(View.java:8526) 12-09 17:55:44.722: E/AndroidRuntime(19469): at android.view.ViewRoot.performTraversals(ViewRoot.java:902) 12-09 17:55:44.722: E/AndroidRuntime(19469): at android.view.ViewRoot.handleMessage(ViewRoot.java:1957) 12-09 17:55:44.722: E/AndroidRuntime(19469): at android.os.Handler.dispatchMessage(Handler.java:99) 12-09 17:55:44.722: E/AndroidRuntime(19469): at android.os.Looper.loop(Looper.java:150) 12-09 17:55:44.722: E/AndroidRuntime(19469): at android.app.ActivityThread.main(ActivityThread.java:4263) 12-09 17:55:44.722: E/AndroidRuntime(19469): at java.lang.reflect.Method.invokeNative(Native Method) 12-09 17:55:44.722: E/AndroidRuntime(19469): at java.lang.reflect.Method.invoke(Method.java:507) 12-09 17:55:44.722: E/AndroidRuntime(19469): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839) 12-09 17:55:44.722: E/AndroidRuntime(19469): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597) 12-09 17:55:44.722: E/AndroidRuntime(19469): at dalvik.system.NativeStart.main(Native Method)

    Read the article

  • Hard Disk DRDY error: is it a crash

    - by pranjal
    I am using IBM Thinkpad, 1.7GHz, 512 RAM with Linux Mint 9 installed. I have two partitions in addition to root. One of the partitions became read-only yesterday, after which I rebooted my system. It is extremely slow along with DRDY Error : Is my Hard disk crashed ? Error Log while booting. Differences between boot sector and its backup. failed command : READ DMA BMDMA : stat 0X25 ata 1.00 : status : { DRDY ERR } ata 1.00 : status :{ UNC } Buffer I/O error on logical device, logical block 65467 smartctl output for the partition: mint mint # smartctl -a /dev/sda1 smartctl version 5.38 [i686-pc-linux-gnu] Copyright (C) 2002-8 Bruce Allen Home page is http://smartmontools.sourceforge.net/ === START OF INFORMATION SECTION === Device Model: TOSHIBA MK4026GAX RoHS Serial Number: X5LY1623T Firmware Version: PA107E User Capacity: 40,007,761,920 bytes Device is: Not in smartctl database [for details use: -P showall] ATA Version is: 6 ATA Standard is: Exact ATA specification draft version not indicated Local Time is: Thu Feb 17 06:48:25 2011 UTC SMART support is: Available - device has SMART capability. SMART support is: Enabled === START OF READ SMART DATA SECTION === SMART overall-health self-assessment test result: PASSED General SMART Values: Offline data collection status: (0x84) Offline data collection activity was suspended by an interrupting command from host. Auto Offline Data Collection: Enabled. Self-test execution status: ( 0) The previous self-test routine completed without error or no self-test has ever been run. Total time to complete Offline data collection: ( 153) seconds. Offline data collection capabilities: (0x1b) SMART execute Offline immediate. Auto Offline data collection on/off support. Suspend Offline collection upon new command. Offline surface scan supported. Self-test supported. No Conveyance Self-test supported. No Selective Self-test supported. SMART capabilities: (0x0003) Saves SMART data before entering power-saving mode. Supports SMART auto save timer. Error logging capability: (0x01) Error logging supported. No General Purpose Logging support. Short self-test routine recommended polling time: ( 2) minutes. Extended self-test routine recommended polling time: ( 30) minutes. SMART Attributes Data Structure revision number: 16 Vendor Specific SMART Attributes with Thresholds: ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE 1 Raw_Read_Error_Rate 0x000b 100 100 050 Pre-fail Always - 0 2 Throughput_Performance 0x0005 100 100 050 Pre-fail Offline - 0 3 Spin_Up_Time 0x0027 100 100 001 Pre-fail Always - 310 4 Start_Stop_Count 0x0032 100 100 000 Old_age Always - 3968 5 Reallocated_Sector_Ct 0x0033 100 100 050 Pre-fail Always - 40 7 Seek_Error_Rate 0x000b 100 100 050 Pre-fail Always - 0 8 Seek_Time_Performance 0x0005 100 100 050 Pre-fail Offline - 0 9 Power_On_Hours 0x0032 082 082 000 Old_age Always - 7257 10 Spin_Retry_Count 0x0033 179 100 030 Pre-fail Always - 0 12 Power_Cycle_Count 0x0032 100 100 000 Old_age Always - 3484 192 Power-Off_Retract_Count 0x0032 100 100 000 Old_age Always - 489 193 Load_Cycle_Count 0x0032 064 064 000 Old_age Always - 367150 194 Temperature_Celsius 0x0022 100 100 000 Old_age Always - 36 (Lifetime Min/Max 14/57) 196 Reallocated_Event_Count 0x0032 100 100 000 Old_age Always - 33 197 Current_Pending_Sector 0x0032 100 100 000 Old_age Always - 82 198 Offline_Uncorrectable 0x0030 100 100 000 Old_age Offline - 1 199 UDMA_CRC_Error_Count 0x0032 200 253 000 Old_age Always - 0 220 Disk_Shift 0x0002 100 100 000 Old_age Always - 101 222 Loaded_Hours 0x0032 085 085 000 Old_age Always - 6146 223 Load_Retry_Count 0x0032 100 100 000 Old_age Always - 0 224 Load_Friction 0x0022 100 100 000 Old_age Always - 0 226 Load-in_Time 0x0026 100 100 000 Old_age Always - 227 240 Head_Flying_Hours 0x0001 100 100 001 Pre-fail Offline - 0 SMART Error Log Version: 1 ATA Error Count: 2371 (device log contains only the most recent five errors) CR = Command Register [HEX] FR = Features Register [HEX] SC = Sector Count Register [HEX] SN = Sector Number Register [HEX] CL = Cylinder Low Register [HEX] CH = Cylinder High Register [HEX] DH = Device/Head Register [HEX] DC = Device Command Register [HEX] ER = Error register [HEX] ST = Status register [HEX] Powered_Up_Time is measured from power on, and printed as DDd+hh:mm:SS.sss where DD=days, hh=hours, mm=minutes, SS=sec, and sss=millisec. It "wraps" after 49.710 days. Error 2371 occurred at disk power-on lifetime: 7256 hours (302 days + 8 hours) When the command that caused the error occurred, the device was active or idle. After command completion occurred, registers were: ER ST SC SN CL CH DH -- -- -- -- -- -- -- 40 51 05 1a 1b 00 e0 Error: UNC 5 sectors at LBA = 0x00001b1a = 6938 Commands leading to the command that caused the error were: CR FR SC SN CL CH DH DC Powered_Up_Time Command/Feature_Name -- -- -- -- -- -- -- -- ---------------- -------------------- c8 00 05 1a 1b 00 e0 00 00:03:10.061 READ DMA f8 00 00 00 00 00 e0 00 00:03:10.061 READ NATIVE MAX ADDRESS ec 00 00 00 00 00 a0 02 00:03:10.053 IDENTIFY DEVICE ef 03 45 00 00 00 a0 02 00:03:10.053 SET FEATURES [Set transfer mode] f8 00 00 00 00 00 e0 00 00:03:10.053 READ NATIVE MAX ADDRESS Error 2370 occurred at disk power-on lifetime: 7256 hours (302 days + 8 hours) When the command that caused the error occurred, the device was active or idle. After command completion occurred, registers were: ER ST SC SN CL CH DH -- -- -- -- -- -- -- 40 51 05 1a 1b 00 e0 Error: UNC 5 sectors at LBA = 0x00001b1a = 6938 Commands leading to the command that caused the error were: CR FR SC SN CL CH DH DC Powered_Up_Time Command/Feature_Name -- -- -- -- -- -- -- -- ---------------- -------------------- c8 00 05 1a 1b 00 e0 00 00:03:03.328 READ DMA f8 00 00 00 00 00 e0 00 00:03:03.327 READ NATIVE MAX ADDRESS ec 00 00 00 00 00 a0 02 00:03:03.320 IDENTIFY DEVICE ef 03 45 00 00 00 a0 02 00:03:03.319 SET FEATURES [Set transfer mode] f8 00 00 00 00 00 e0 00 00:03:03.319 READ NATIVE MAX ADDRESS Error 2369 occurred at disk power-on lifetime: 7256 hours (302 days + 8 hours) When the command that caused the error occurred, the device was active or idle. After command completion occurred, registers were: ER ST SC SN CL CH DH -- -- -- -- -- -- -- 40 51 05 1a 1b 00 e0 Error: UNC 5 sectors at LBA = 0x00001b1a = 6938 Commands leading to the command that caused the error were: CR FR SC SN CL CH DH DC Powered_Up_Time Command/Feature_Name -- -- -- -- -- -- -- -- ---------------- -------------------- c8 00 05 1a 1b 00 e0 00 00:02:56.582 READ DMA f8 00 00 00 00 00 e0 00 00:02:56.582 READ NATIVE MAX ADDRESS ec 00 00 00 00 00 a0 02 00:02:56.574 IDENTIFY DEVICE ef 03 45 00 00 00 a0 02 00:02:56.574 SET FEATURES [Set transfer mode] f8 00 00 00 00 00 e0 00 00:02:56.574 READ NATIVE MAX ADDRESS Error 2368 occurred at disk power-on lifetime: 7256 hours (302 days + 8 hours) When the command that caused the error occurred, the device was active or idle. After command completion occurred, registers were: ER ST SC SN CL CH DH -- -- -- -- -- -- -- 40 51 05 1a 1b 00 e0 Error: UNC 5 sectors at LBA = 0x00001b1a = 6938 Commands leading to the command that caused the error were: CR FR SC SN CL CH DH DC Powered_Up_Time Command/Feature_Name -- -- -- -- -- -- -- -- ---------------- -------------------- c8 00 05 1a 1b 00 e0 00 00:02:49.809 READ DMA f8 00 00 00 00 00 e0 00 00:02:49.809 READ NATIVE MAX ADDRESS ec 00 00 00 00 00 a0 02 00:02:49.801 IDENTIFY DEVICE ef 03 45 00 00 00 a0 02 00:02:49.801 SET FEATURES [Set transfer mode] f8 00 00 00 00 00 e0 00 00:02:49.801 READ NATIVE MAX ADDRESS Error 2367 occurred at disk power-on lifetime: 7256 hours (302 days + 8 hours) When the command that caused the error occurred, the device was active or idle. After command completion occurred, registers were: ER ST SC SN CL CH DH -- -- -- -- -- -- -- 40 51 05 1a 1b 00 e0 Error: UNC 5 sectors at LBA = 0x00001b1a = 6938 Commands leading to the command that caused the error were: CR FR SC SN CL CH DH DC Powered_Up_Time Command/Feature_Name -- -- -- -- -- -- -- -- ---------------- -------------------- c8 00 05 1a 1b 00 e0 00 00:02:43.056 READ DMA f8 00 00 00 00 00 e0 00 00:02:43.056 READ NATIVE MAX ADDRESS ec 00 00 00 00 00 a0 02 00:02:43.048 IDENTIFY DEVICE ef 03 45 00 00 00 a0 02 00:02:43.048 SET FEATURES [Set transfer mode] f8 00 00 00 00 00 e0 00 00:02:43.047 READ NATIVE MAX ADDRESS SMART Self-test log structure revision number 1 No self-tests have been logged. [To run self-tests, use: smartctl -t] Device does not support Selective Self Tests/Logging Do I need to get a new Hard Disk my PC ?

    Read the article

  • How to create Python module distribution to gracefully fall-back to pure Python code

    - by Craig McQueen
    I have written a Python module, and I have two versions: a pure Python implementation and a C extension. I've written the __init__.py file so that it tries to import the C extension, and if that fails, it imports the pure Python code (is that reasonable?). Now, I'd like to know what is the best way to distribute this module (e.g. write setup.py) so it can be easily used by people with or without the facility to build, or use, the C extension, just by running: python setup.py install My experience is limited, but I see two possible cases: User does not have MS Visual Studio, or the GCC compiler suite, installed on their machine, to build the C extension User is running IronPython, Jython, or anything other than CPython. I only have used CPython. So I'm not sure how I could distribute this module so that it would work smoothly and be easy to install on those platforms, if they're unable to use the C extension.

    Read the article

  • How to create Python module distribution to gracefully fall-back to pure Python code

    - by Craig McQueen
    I have written a Python module, and I have two versions: a pure Python implementation and a C extension. I've written the __init__.py file so that it tries to import the C extension, and if that fails, it imports the pure Python code (is that reasonable?). Now, I'd like to know what is the best way to distribute this module (e.g. write setup.py) so it can be easily used by people with or without the facility to build, or use, the C extension. My experience is limited but I see two possible cases: User does not have MS Visual Studio, or the GCC compiler suite, installed on their machine, to build the C extension User is running IronPython, Jython, or anything other than CPython. I only have used CPython. So I'm not sure how I could distribute this module so that it would work smoothly and be easy to install on those platforms, if they're unable to use the C extension.

    Read the article

  • Can I stop ASP.NET from returning 'The resource cannot be found.'?

    - by mackenir
    I have installed an HttpModule into my web app that will handle all requests with a given file extension. I want ASP.NET to handle all requests with the extension, regardless of whether there is an underlying file on disk. So, when I added the extension to the 'Application Extension Mappings', I unchecked the 'Verify that file exists' checkbox. However, this just transfers the file check to ASP.NET rather IIS, so I just get a different error page when requesting URLs with the file extension. Is there a way to preempt this ASP.NET file checking and intercept the requests?

    Read the article

  • Setting up Android application for Analytics and tracking

    - by Samuh
    Tracking events and setting up Analytics for Websites seems easy. You create an account with one of the Analytics service providers like Google. They give you javascript code that you embed in your pages (whichever event you wish to track) and voila..you're done. I have written a native application for Android phones, which is actually an adaptation of the actual web site. Now, I am required to setup Analytics and tracking for this native application. Question: How to do setup a native application for Analytics? We have Java Script code(not Google Analytics but for some other engine) that works for the original web site. Is there a way to incorporate that in the native application? I know Android supports Java Script via WebViews(Webkit);my application does not have webviews, it is native! I have not worked on JavaScript since school so excuse me if I sound naive. Thanks.

    Read the article

  • How to make form validation in Django dynamic?

    - by Oli
    I'm trying to make a form that handles the checking of a domain: the form should fail based on a variable that was set earlier in another form. Basically, when a user wants to create a new domain, this form should fail if the entered domain exists. When a user wants to move a domain, this form should fail if the entered domain doesn't exist. I've tried making it dynamic overload the initbut couldn't see a way to get my passed variabele to the clean function. I've read that this dynamic validation can be accomplished using a factory method, but maybe someone can help me on my way with this? Here's a simplified version of the form so far: #OrderFormStep1 presents the user with a choice: create or move domain class OrderFormStep2(forms.Form): domain = forms.CharField() extension = forms.CharField() def clean(self): cleaned_data = self.cleaned_data domain = cleaned_data.get("domain") extension = cleaned_data.get("extension") if domain and extension: code = whoislookup(domain+extension); #Raise error based on result from OrderFormStep1 #raise forms.ValidationError('error, domain already exists') #raise forms.ValidationError('error, domain does not exist') return cleaned_data

    Read the article

  • How do you extend a Ruby module with macro-like metaprogramming methods?

    - by Ian Terrell
    Consider the following extension (the pattern popularized by several Rails plugins over the years): module Extension def self.included(recipient) recipient.extend ClassMethods recipient.class_eval { include InstanceMethods } end module ClassMethods def macro_method puts "Called macro_method within #{self.name}" end end module InstanceMethods def instance_method puts "Called instance_method within #{self.object_id}" end end end If you wished to expose this to every class, you can do the following: Object.send :include, Extension Now you can define any class and use the macro method: class FooClass macro_method end #=> Called macro_method within FooClass And instances can use the instance methods: FooClass.new.instance_method #=> Called instance_method within 2148182320 But even though Module.is_a?(Object), you cannot use the macro method in a module: module FooModule macro_method end #=> undefined local variable or method `macro_method' for FooModule:Module (NameError) This is true even if you explicitly include the original Extension into Module with Module.send(:include, Extension). How do you add macro like methods to Ruby modules?

    Read the article

  • Fake ISAPI Handler to serve static files with extention that are rewritted by url rewriter

    - by developerit
    Introduction I often map html extention to the asp.net dll in order to use url rewritter with .html extentions. Recently, in the new version of www.nouvelair.ca, we renamed all urls to end with .html. This works great, but failed when we used FCK Editor. Static html files would not get serve because we mapped the html extension to the .NET Framework. We can we do to to use .html extension with our rewritter but still want to use IIS behavior with static html files. Analysis I thought that this could be resolve with a simple HTTP handler. We would map urls of static files in our rewriter to this handler that would read the static file and serve it, just as IIS would do. Implementation This is how I coded the class. Note that this may not be bullet proof. I only tested it once and I am sure that the logic behind IIS is more complicated that this. If you find errors or think of possible improvements, let me know. Imports System.Web Imports System.Web.Services ' Author: Nicolas Brassard ' For: Solutions Nitriques inc. http://www.nitriques.com ' Date Created: April 18, 2009 ' Last Modified: April 18, 2009 ' License: CPOL (http://www.codeproject.com/info/cpol10.aspx) ' Files: ISAPIDotNetHandler.ashx ' ISAPIDotNetHandler.ashx.vb ' Class: ISAPIDotNetHandler ' Description: Fake ISAPI handler to serve static files. ' Usefull when you want to serve static file that has a rewrited extention. ' Example: It often map html extention to the asp.net dll in order to use url rewritter with .html. ' If you want to still serve static html file, add a rewritter rule to redirect html files to this handler Public Class ISAPIDotNetHandler Implements System.Web.IHttpHandler Sub ProcessRequest(ByVal context As HttpContext) Implements IHttpHandler.ProcessRequest ' Since we are doing the job IIS normally does with html files, ' we set the content type to match html. ' You may want to customize this with your own logic, if you want to serve ' txt or xml or any other text file context.Response.ContentType = "text/html" ' We begin a try here. Any error that occurs will result in a 404 Page Not Found error. ' We replicate the behavior of IIS when it doesn't find the correspoding file. Try ' Declare a local variable containing the value of the query string Dim uri As String = context.Request("fileUri") ' If the value in the query string is null, ' throw an error to generate a 404 If String.IsNullOrEmpty(uri) Then Throw New ApplicationException("No fileUri") End If ' If the value in the query string doesn't end with .html, then block the acces ' This is a HUGE security hole since it could permit full read access to .aspx, .config, etc. If Not uri.ToLower.EndsWith(".html") Then ' throw an error to generate a 404 Throw New ApplicationException("Extention not allowed") End If ' Map the file on the server. ' If the file doesn't exists on the server, it will throw an exception and generate a 404. Dim fullPath As String = context.Server.MapPath(uri) ' Read the actual file Dim stream As IO.StreamReader = FileIO.FileSystem.OpenTextFileReader(fullPath) ' Write the file into the response context.Response.Output.Write(stream.ReadToEnd) ' Close and Dipose the stream stream.Close() stream.Dispose() stream = Nothing Catch ex As Exception ' Set the Status Code of the response context.Response.StatusCode = 404 'Page not found ' For testing and bebugging only ! This may cause a security leak ' context.Response.Output.Write(ex.Message) Finally ' In all cases, flush and end the response context.Response.Flush() context.Response.End() End Try End Sub ' Automaticly generated by Visual Studio ReadOnly Property IsReusable() As Boolean Implements IHttpHandler.IsReusable Get Return False End Get End Property End Class Conclusion As you see, with our static files map to this handler using query string (ex.: /ISAPIDotNetHandler.ashx?fileUri=index.html) you will have the same behavior as if you ask for the uri /index.html. Finally, test this only in IIS with the html extension map to aspnet_isapi.dll. Url rewritting will work in Casini (Internal Web Server shipped with Visual Studio) but it’s not the same as with IIS since EVERY request is handle by .NET. Versions First release

    Read the article

  • Add a Hovering Image Toolbar to Firefox

    - by Asian Angel
    When you work with webpage images in Firefox you normally have to use the Context Menu to do anything with them. The Image Toolbar extension provides an extra toolbar to use when you hover your mouse over webpage images. Note: This extension will not function if you have the NoScript extension installed/enabled unless JavaScript has permission to be active on that page. Before You can see the available “Context Menu” options for working with images here. Not bad but it would be nice if some other convenient options were available as well. Image Toolbar in Action Once you have installed the extension you will be able to view the toolbar whenever you hover your mouse over an image. All of the commands are active by default but you can choose what is available in the options. The toolbar will also appear in the upper left region of the image but can be set to appear relative to the cursor. Note: The default minimum image size for the toolbar to appear over is “260 x 260 pixels” so you will probably want to change it to a much smaller size (see options below). Here is what is available in the Image Toolbar: Save – Choose between being prompted when saving or automatically saving to a specified location Copy – Copies image and image URL so that you can paste the image or URL depending on the app pasted into Print – Provides print preview and printing capabilities Info – Opens a window with “properties information” about the image Folder – Opens browser’s download folder in Windows Explorer The “Save, Copy, Print, & Folder Commands” are all pretty clear in what you can expect from them but what about the “Info Command”? This is what you will see if you use the “Info Command” and expand the window out all the way. Very nice… Options There are quite a few options available for what appears to be such a small toolbar. The first “Tab Area” lets you set up the “Save Scheme” that best suits your personal needs. You can choose which commands are available in the toolbar, decide if you would like text labels visible, and enable small icons if desired. As mentioned above the default image size for the toolbar to appear is “260 x 260 pixels”…we set ours for “10 x 10 pixels”. If you would like the toolbar to appear relative to your mouse cursor as opposed to the upper left corner of the image then you can select for that here. Conclusion If you have been wanting more options for working with webpage images in Firefox then this will make a very useful and convenient addition to your browser. Links Download the Image Toolbar extension (Mozilla Add-ons) Similar Articles Productive Geek Tips Conserve Space in Firefox by Combining ToolbarsShow Alexa Ranking in FirefoxLightweight Extension to Show PageRank in FirefoxSwitch Windows by Hovering the Mouse Over a Window in Windows 7 or VistaQuick Tip: Show PageRank in Firefox while Google Toolbar is Hidden TouchFreeze Alternative in AutoHotkey The Icy Undertow Desktop Windows Home Server – Backup to LAN The Clear & Clean Desktop Use This Bookmarklet to Easily Get Albums Use AutoHotkey to Assign a Hotkey to a Specific Window Latest Software Reviews Tinyhacker Random Tips DVDFab 6 Revo Uninstaller Pro Registry Mechanic 9 for Windows PC Tools Internet Security Suite 2010 Roadkill’s Scan Port scans for open ports Out of 100 Tweeters Out of band Security Update for Internet Explorer 7 Cool Looking Screensavers for Windows SyncToy syncs Files and Folders across Computers on a Network (or partitions on the same drive) If it were only this easy

    Read the article

  • Where’s my MD.050?

    - by Dave Burke
    A question that I’m sometimes asked is “where’s my MD.050 in OUM?” For those not familiar with an MD.050, it serves the purpose of being a Functional Design Document (FDD) in one of Oracle’s legacy Methods. Functional Design Documents have existed for many years with their primary purpose being to describe the functional aspects of one or more components of an IT system, typically, a Custom Extension of some sort. So why don’t we have a direct replacement for the MD.050/FDD in OUM? In simple terms, the disadvantage of the MD.050/FDD approach is that it tends to lead practitioners into “Design mode” too early in the process. Whereas OUM encourages more emphasis on gathering, and describing the functional requirements of a system ahead of the formal Analysis and Design process. So that just means more work up front for the Business Analyst or Functional Consultants right? Well no…..the design of a solution, particularly when it involves a complex custom extension, does not necessarily take longer just because you put more thought into the functional requirements. In fact, one could argue the complete opposite, in that by putting more emphasis on clearly understanding the nuances of functionality requirements early in the process, then the overall time and cost incurred during the Analysis to Design process should be less. In short, as your understanding of requirements matures over time, it is far easier (and more cost effective) to update a document or a diagram, than to change lines of code. So how does that translate into Tasks and Work Products in OUM? Let us assume you have reached a point on a project where a Custom Extension is needed. One of the first things you should consider doing is creating a Use Case, and remember, a Use Case could be as simple as a few lines of text reflecting a “User Story”, or it could be what Cockburn1 describes a “fully dressed Use Case”. It is worth mentioned at this point the highly scalable nature of OUM in the sense that “documents” should not be produced just because that is the way we have always done things. Some projects may well be predicated upon a base of electronic documents, whilst other projects may take a much more Agile approach to describing functional requirements; through “User Stories” perhaps. In any event, it is quite common for a Custom Extension to involve the creation of several “components”, i.e. some new screens, an interface, a report etc. Therefore several Use Cases might be required, which in turn can then be assembled into a Use Case Package. Once you have the Use Cases attributed to an appropriate (fit-for-purpose) level of detail, and assembled into a Package, you can now create an Analysis Model for the Package. An Analysis Model is conceptual in nature, and depending on the solution being developing, would involve the creation of one or more diagrams (i.e. Sequence Diagrams, Collaboration Diagrams etc.) which collectively describe the Data, Behavior and Use Interface requirements of the solution. If required, the various elements of the Analysis Model may be indexed via an Analysis Specification. For Custom Extension projects that follow a pure Object Orientated approach, then the Analysis Model will naturally support the development of the Design Model without any further artifacts. However, for projects that are transitioning to this approach, then the various elements of the Analysis Model may be represented within the Analysis Specification. If we now return to the original question of “Where’s my MD.050”. The full answer would be: Capture the functional requirements within a Use Case Group related Use Cases into a Package Create an Analysis Model for each Package Consider creating an Analysis Specification (AN.100) as a index to each Analysis Model artifact An alternative answer for a relatively simple Custom Extension would be: Capture the functional requirements within a Use Case Optionally, group related Use Cases into a Package Create an Analysis Specification (AN.100) for each package 1 Cockburn, A, 2000, Writing Effective Use Case, Addison-Wesley Professional; Edition 1

    Read the article

  • Stay on Schedule in Chrome with DayHiker

    - by Matthew Guay
    Do you keep your schedule and tasks in Google Calendar?  Here’s a handy extension for Google Chrome that can keep you on top of your appointments without having to open Google Calendar in another tab. Integrate Google Calendar with Chrome DayHiker is a handy extension for Google Chrome that can help you stay on schedule in your browser.  Desktop applications typically can keep you notified easier with popups or alerts, but webapps require you to visit them to view your information.  DayHiker takes the best of both, and can make your Google Calendar work more like a desktop application. To get started, open the DayHiker page from the Chrome Extensions Gallery (link below), and click Install.  Confirm you wish to install it at the prompt. Now you’ll have a new extension button in your Chrome toolbar.  Click the calendar icon to view your Google Calendar.  You’ll need to be signed into your Google account for your calendar to display; click the key icon to select your account if it doesn’t show your appointments automatically. If you’re signed into multiple Google accounts, such as your public Gmail and a Google Apps account, you can select the calendar you wish and click Continue. Now you can quickly see your upcoming appointments.  Simply hover over the icon to see your upcoming events.  Or, just glance at it to see if there are any appointments coming up, as the indicator icon will change colors to show how long you have until your next appointment. Click the icon to see more information about your appointments. Or, click the Add link to add a new appointment.  If you need to edit the appointment details, click Edit Details and the appointment will open in Google Calendar for you to edit. You can also view and manage your tasks in Google Calendar.  Click the checkmark icon, and then add or check-off tasks directly from the extension pane. You can also set an alarm clock in DayHiker.  Click the green circle icon, and then enter the time for the alarm to go off.  Strangely it will only chime if the extension pane is left open, so if you click anywhere else in the browser or even switch to another program it will not chime.   If you’d like to customize DayHiker’s settings, right-click on it and select Options, or select Options in the Chrome Extensions page.  Here you can customize your badges and the DayHiker icon, or enter a custom domain for your Google Apps Pro calendar.   Conclusion If you rely on Google Calendar to stay on top of your schedule, DayHiker can help you stay scheduled and know what’s coming up.  We wish DayHiker supported multiple calendars so we could combine our Google Apps calendars with our personal Google Calendar, but even still, it is a very useful tool.  Whether you’re a tightly scheduled person or just like to jot down to-dos and keep track of them, this extension will help you do this efficiently with familiar Google tools. Link Download DayHiker from the Chrome Extensions Gallery Similar Articles Productive Geek Tips Configure Disk Defragmenter Schedule in Windows 7 or VistaSchedule Updates for Windows Media CenterOpen Multiple Sites Without Reopening the Menus in FirefoxFind a Website’s Actual Location with Chrome FlagsSubscribe to RSS Feeds in Chrome with a Single Click TouchFreeze Alternative in AutoHotkey The Icy Undertow Desktop Windows Home Server – Backup to LAN The Clear & Clean Desktop Use This Bookmarklet to Easily Get Albums Use AutoHotkey to Assign a Hotkey to a Specific Window Latest Software Reviews Tinyhacker Random Tips HippoRemote Pro 2.2 Xobni Plus for Outlook All My Movies 5.9 CloudBerry Online Backup 1.5 for Windows Home Server Dual Boot Ubuntu and Windows 7 What is HTML5? Default Programs Editor – One great tool for Setting Defaults Convert BMP, TIFF, PCX to Vector files with RasterVect Free Identify Fonts using WhatFontis.com Windows 7’s WordPad is Actually Good

    Read the article

  • Hidden exceptions

    - by user12617285
    Occasionally you may find yourself in a Java application environment where exceptions in your code are being caught by the application framework and either silently swallowed or converted into a generic exception. Either way, the potentially useful details of your original exception are inaccessible. Wouldn't it be nice if there was a VM option that showed the stack trace for every exception thrown, whether or not it's caught? In fact, HotSpot includes such an option: -XX:+TraceExceptions. However, this option is only available in a debug build of HotSpot (search globals.hpp for TraceExceptions). And based on a quick skim of the HotSpot source code, this option only prints the exception class and message. A more useful capability would be to have the complete stack trace printed as well as the code location catching the exception. This is what the various TraceException* options in in Maxine do (and more). That said, there is a way to achieve a limited version of the same thing with a stock standard JVM. It involves the use of the -Xbootclasspath/p non-standard option. The trick is to modify the source of java.lang.Exception by inserting the following: private static final boolean logging = System.getProperty("TraceExceptions") != null; private void log() { if (logging && sun.misc.VM.isBooted()) { printStackTrace(); } } Then every constructor simply needs to be modified to call log() just before returning: public Exception(String message) { super(message); log(); } public Exception(String message, Throwable cause) { super(message, cause); log(); } // etc... You now need to compile the modified Exception.java source and prepend the resulting class to the boot class path as well as add -DTraceExceptions to your java command line. Here's a console session showing these steps: % mkdir boot % javac -d boot Exception.java % java -DTraceExceptions -Xbootclasspath/p:boot -cp com.oracle.max.vm/bin test.output.HelloWorld java.util.zip.ZipException: error in opening zip file at java.util.zip.ZipFile.open(Native Method) at java.util.zip.ZipFile.(ZipFile.java:127) at java.util.jar.JarFile.(JarFile.java:135) at java.util.jar.JarFile.(JarFile.java:72) at sun.misc.URLClassPath$JarLoader.getJarFile(URLClassPath.java:646) at sun.misc.URLClassPath$JarLoader.access$600(URLClassPath.java:540) at sun.misc.URLClassPath$JarLoader$1.run(URLClassPath.java:607) at java.security.AccessController.doPrivileged(Native Method) at sun.misc.URLClassPath$JarLoader.ensureOpen(URLClassPath.java:599) at sun.misc.URLClassPath$JarLoader.(URLClassPath.java:583) at sun.misc.URLClassPath$3.run(URLClassPath.java:333) at java.security.AccessController.doPrivileged(Native Method) at sun.misc.URLClassPath.getLoader(URLClassPath.java:322) at sun.misc.URLClassPath.getLoader(URLClassPath.java:299) at sun.misc.URLClassPath.getResource(URLClassPath.java:168) at java.net.URLClassLoader$1.run(URLClassLoader.java:194) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:190) at sun.misc.Launcher$ExtClassLoader.findClass(Launcher.java:229) at java.lang.ClassLoader.loadClass(ClassLoader.java:306) at java.lang.ClassLoader.loadClass(ClassLoader.java:295) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) at java.lang.ClassLoader.loadClass(ClassLoader.java:247) java.security.PrivilegedActionException at java.security.AccessController.doPrivileged(Native Method) at sun.misc.URLClassPath$JarLoader.ensureOpen(URLClassPath.java:599) at sun.misc.URLClassPath$JarLoader.(URLClassPath.java:583) at sun.misc.URLClassPath$3.run(URLClassPath.java:333) at java.security.AccessController.doPrivileged(Native Method) at sun.misc.URLClassPath.getLoader(URLClassPath.java:322) ... It's worth pointing out that this is not as useful as direct VM support for tracing exceptions. It has (at least) the following limitations: The trace is shown for every exception, whether it is thrown or not. It only applies to subclasses of java.lang.Exception as there appears to be bootstrap issues when the modification is applied to Throwable.java. It does not show you where the exception was caught. It involves overriding a class in rt.jar, something should never be done in a non-development environment.

    Read the article

  • Integrate Google Wave With Your Windows Workflow

    - by Matthew Guay
    Have you given Google Wave a try, only to find it difficult to keep up with?  Here’s how you can integrate Google Wave with your desktop and workflow with some free and simple apps. Google Wave is an online web app, and unlike many Google services, it’s not easily integrated with standard desktop applications.  Instead, you’ll have to keep it open in a browser tab, and since it is one of the most intensive HTML5 webapps available today, you may notice slowdowns in many popular browsers.  Plus, it can be hard to stay on top of your Wave conversations and collaborations by just switching back and forth between the website and whatever else you’re working on.  Here we’ll look at some tools that can help you integrate Google Wave with your workflow, and make it feel more native in Windows. Use Google Wave Directly in Windows What’s one of the best ways to make a web app feel like a native application?  By making it into a native application, of course!  Waver is a free Air powered app that can make the mobile version of Google Wave feel at home on your Windows, Mac, or Linux desktop.  We found it to be a quick and easy way to keep on top of our waves and collaborate with our friends. To get started with Waver, open their homepage on the Adobe Air Marketplace (link below) and click Download From Publisher. Waver is powered by Adobe Air, so if you don’t have Adobe Air installed, you’ll need to first download and install it. After clicking the link above, Adobe Air will open a prompt asking what you wish to do with the file.  Click Open, and then install as normal. Once the installation is finished, enter your Google Account info in the window.   After a few moments, you’ll see your Wave account in miniature, running directly in Waver.  Click a Wave to view it, or click New wave to start a new Wave message.  Unfortunately, in our tests the search box didn’t seem to work, but everything else worked fine. Google Wave works great in Waver, though all of the Wave features are not available since it is running the mobile version of Wave. You can still view content from plugins, including YouTube videos, directly in Waver.   Get Wave Notifications From Your Windows Taskbar Most popular email and Twitter clients give you notifications from your system tray when new messages come in.  And with Google Wave Notifier, you can now get the same alerts when you receive a new Wave message. Head over to the Google Wave Notifier site (link below), and click the download link to get started.  Make sure to download the latest Binary zip, as this one will contain the Windows program rather than the source code. Unzip the folder, and then run GoogleWaveNotifier.exe. On first run, you can enter your Google Account information.  Notice that this is not a standard account login window; you’ll need to enter your email address in the Username field, and then your password below it. You can also change other settings from this dialog, including update frequency and whether or not to run at startup.  Click the value, and then select the setting you want from the dropdown menu. Now, you’ll have a new Wave icon in your system tray.  When it detects new Waves or unread updates, it will display a popup notification with details about the unread Waves.  Additionally, the icon will change to show the number of unread Waves.  Click the popup to open Wave in your browser.  Or, if you have Waver installed, simply open the Waver window to view your latest Waves. If you ever need to change settings again in the future, right-click the icon and select Settings, and then edit as above. Get Wave Notifications in Your Email  Most of us have Outlook or Gmail open all day, and seldom leave the house without a Smartphone with push email.  And thanks to a new Wave feature, you can still keep up with your Waves without having to change your workflow. To activate email notifications from Google Wave, login to your Wave account, click the arrow beside your Inbox, and select Notifications. Select how quickly you want to receive notifications, and choose which email address you wish to receive the notifications.  Click Save when you’re finished. Now you’ll receive an email with information about new and updated Waves in your account.  If there were only small changes, you may get enough info directly in the email; otherwise, you can click the link and open that Wave in your browser. Conclusion Google Wave has great potential as a collaboration and communications platform, but by default it can be hard to keep up with what’s going on in your Waves.  These apps for Windows help you integrate Wave with your workflow, and can keep you from constantly logging in and checking for new Waves.  And since Google Wave registration is now open for everyone, it’s a great time to give it a try and see how it works for yourself. Links Signup for Google Wave (Google Account required) Download Waver from the Adobe Air Marketplace Download Google Wave Notifier Similar Articles Productive Geek Tips We Have 20 Google Wave Invites. Want One?Tired of Waiting for Google Wave? Try ShareFlow NowIntegrate Google Docs with Outlook the Easy WayAwesome Desktop Wallpapers: The Windows 7 EditionWeek in Geek: The Stupid Geek Tricks to Hide Extra Windows Edition TouchFreeze Alternative in AutoHotkey The Icy Undertow Desktop Windows Home Server – Backup to LAN The Clear & Clean Desktop Use This Bookmarklet to Easily Get Albums Use AutoHotkey to Assign a Hotkey to a Specific Window Latest Software Reviews Tinyhacker Random Tips HippoRemote Pro 2.2 Xobni Plus for Outlook All My Movies 5.9 CloudBerry Online Backup 1.5 for Windows Home Server Default Programs Editor – One great tool for Setting Defaults Convert BMP, TIFF, PCX to Vector files with RasterVect Free Identify Fonts using WhatFontis.com Windows 7’s WordPad is Actually Good Greate Image Viewing and Management with Zoner Photo Studio Free Windows Media Player Plus! – Cool WMP Enhancer

    Read the article

  • Combine the Address & Search Bars in Firefox

    - by Asian Angel
    The Search Bar in Firefox is very useful for finding additional information or images while browsing but the UI space it takes up can be frustrating at times. Now you can reclaim that UI space and still have access to all that searching goodness with the Foobar extension. Note: This is about the Foobar Firefox extension and not to be confused with Foobar2000 the open source music player. Before If you have the “Search Bar” displayed there is no doubt that it is taking up valuable space in your browser’s UI. What you need is the ability to reclaim that UI space and still have the same access to your search capability as before…no more sacrificing one for a gain with the other. After As soon as you have installed the extension you can see that the top part of your browser will look much sleeker without the “Search Bar” to clutter it up. The “Search Engine Icon” will now be visible inside of your “Address Bar” as seen here. You will be able to access the same “Search Engine Menu” as before by clicking on the “Search Engine Icon”. There are two display modes for search results (setting available in the “Options”). The first one shown here is “Simple Mode” where all results are in a condensed format. Notice that not only are there search suggestions but also “Bookmarks & History” listings as well. You can literally get the best of both when conducting a search. Note: The number of entries for search suggestions and bookmark/history listings can be adjusted higher or lower in the “Options”. The second one is “Rich Mode” where the results are shown with more details. Choose the “mode” that best suits your personal style. For our first example you can see the results when we conducted a quick search on “Windows 7” (using the first of the three offerings shown from Bing). Our second example was a search for “Flowers” using our Photobucket search engine. Once again nice results opened in a new tab for us. Options The options are easy to go through. It is really nice to be able to choose the number of results that you want displayed and the format that you want them shown in. Note: Changing the “Suggestion popup style” will require a browser restart to take effect. Conclusion If you love using the “Search Bar” in Firefox but want to reclaim the UI space then you will definitely want to add this extension to your browser. The ability to customize the number of results and choose the formatting make this extension even better. Links Download the Foobar extension (Mozilla Add-ons) Similar Articles Productive Geek Tips Combine the Address Bar and Progress Bar Together in FirefoxHide Some or All of the GUI Bars in FirefoxEnable Partial Match AutoComplete in the Firefox Address BarQuick Firefox UI TweaksAdd Search Forms to the Firefox Search Bar TouchFreeze Alternative in AutoHotkey The Icy Undertow Desktop Windows Home Server – Backup to LAN The Clear & Clean Desktop Use This Bookmarklet to Easily Get Albums Use AutoHotkey to Assign a Hotkey to a Specific Window Latest Software Reviews Tinyhacker Random Tips Revo Uninstaller Pro Registry Mechanic 9 for Windows PC Tools Internet Security Suite 2010 PCmover Professional Scan your PC for nasties with Panda ActiveScan CleanMem – Memory Cleaner AceStock – The Personal Stock Monitor Add Multiple Tabs to Office Programs The Wearing of the Green – St. Patrick’s Day Theme (Firefox) Perform a Background Check on Yourself

    Read the article

  • "ERROR:Could not find java.nio.file.Paths" when using Oracle JDK 1.7

    - by Ankit
    I want to try out some features rolled out in Oracle's new JDK 1.7. I followed the post:- Oracle JDK 1.7 but the post doesn't seem to help. I was trying to fetch out the structure for java.nio.file.Paths class file but got the following error:- buffer@ankit:~$ javap java.nio.file.Paths ERROR:Could not find java.nio.file.Paths However i can easily get the information about class structures till JAVA SE 1.6, here is an example:- buffer@ankit:~$ javap java.lang.Object Compiled from "Object.java" public class java.lang.Object{ public java.lang.Object(); public final native java.lang.Class getClass(); public native int hashCode(); public boolean equals(java.lang.Object); protected native java.lang.Object clone() throws java.lang.CloneNotSupportedException; public java.lang.String toString(); public final native void notify(); public final native void notifyAll(); public final native void wait(long) throws java.lang.InterruptedException; public final void wait(long, int) throws java.lang.InterruptedException; public final void wait() throws java.lang.InterruptedException; protected void finalize() throws java.lang.Throwable; static {}; } Running java -version gives the following result:- buffer@ankit:~$ java -version java version "1.7.0_09" Java(TM) SE Runtime Environment (build 1.7.0_09-b05) Java HotSpot(TM) 64-Bit Server VM (build 23.5-b02, mixed mode) SYSTEM INFORMATION buffer@ankit:~$ sudo update-alternatives --config java [sudo] password for buffer: There are 4 choices for the alternative java (providing /usr/bin/java). Selection Path Priority Status ------------------------------------------------------------ 0 /usr/lib/jvm/java-6-openjdk-amd64/jre/bin/java 1061 auto mode 1 /usr/lib/jvm/java-6-openjdk-amd64/jre/bin/java 1061 manual mode 2 /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java 1051 manual mode 3 /usr/lib/jvm/jdk1.7.0_09/ 1 manual mode * 4 /usr/lib/jvm/jdk1.7.0_09/bin/java 1 manual mode buffer@ankit:~$ sudo update-alternatives --config javac There are 2 choices for the alternative javac (providing /usr/bin/javac). Selection Path Priority Status ------------------------------------------------------------ 0 /usr/lib/jvm/java-6-openjdk-amd64/bin/javac 1061 auto mode 1 /usr/lib/jvm/java-6-openjdk-amd64/bin/javac 1061 manual mode * 2 /usr/lib/jvm/jdk1.7.0_09/bin/javac 1 manual mode buffer@ankit:~$ sudo update-alternatives --config javaws There are 3 choices for the alternative javaws (providing /usr/bin/javaws). Selection Path Priority Status ------------------------------------------------------------ 0 /usr/lib/jvm/java-6-openjdk-amd64/jre/bin/javaws 1061 auto mode 1 /usr/lib/jvm/java-6-openjdk-amd64/jre/bin/javaws 1061 manual mode 2 /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/javaws 1060 manual mode * 3 /usr/lib/jvm/jdk1.7.0_09/bin/javaws 1 manual mode The directory structure of /usr/lib/jvm/ is as follows:- buffer@ankit:~$ ls -l /usr/lib/jvm/ total 24 lrwxrwxrwx 1 root root 24 Dec 2 2011 default-java -> java-1.6.0-openjdk-amd64 drwxr-xr-x 4 root root 4096 Nov 8 16:24 java-1.5.0-gcj-4.6 lrwxrwxrwx 1 root root 24 Dec 2 2011 java-1.6.0-openjdk -> java-1.6.0-openjdk-amd64 lrwxrwxrwx 1 root root 20 Oct 25 00:01 java-1.6.0-openjdk-amd64 -> java-6-openjdk-amd64 lrwxrwxrwx 1 root root 20 Oct 25 06:59 java-1.7.0-openjdk-amd64 -> java-7-openjdk-amd64 lrwxrwxrwx 1 root root 24 Dec 2 2011 java-6-openjdk -> java-1.6.0-openjdk-amd64 drwxr-xr-x 7 root root 4096 Nov 8 16:24 java-6-openjdk-amd64 drwxr-xr-x 3 root root 4096 Nov 8 16:24 java-6-openjdk-common drwxr-xr-x 5 root root 4096 Nov 8 05:48 java-7-openjdk-amd64 drwxr-xr-x 3 root root 4096 Nov 8 05:48 java-7-openjdk-common drwxr-xr-x 8 buffer buffer 4096 Sep 25 09:08 jdk1.7.0_09 Any help would be highly appreciated.

    Read the article

  • Remote desktop from ubuntu to windows

    - by Deepak Rajput
    I want to take remote desktop from ubuntu to windows xp and 7,I am looking for a solution i can install software over the air. Vnc,Avoid installation of Vnc server in windows (policy problem) Looking software like Dameware in software is installed over the air and removed backed after the job is done. Should allow to control the current active desktop and interact with the user session. Please help me.

    Read the article

  • Looking for an ultra portable laptop for Ubuntu

    - by prule
    Hi, I'm in the market for a new laptop, and portability is important since I really only use it when I'm travelling to and from work - primarily for programming. I've been searching high and low for something like this: less than 2kg hopefully Intel i5 (but negotiable) NO dvd drive - just don't need it 4G ram either 7200rpm disk or SSD (ssd preferable) 13 inch screen not too pricey (MacBook Air is about $1700 AUD) available in Australia The Dell Inspiron 13z and Lenovo Edge 13 look close, but I've not found anything that says I'm not going to have a fight with compatibility. The MacBook Air 13 looks like the PERFECT hardware, but I'm afraid it will just be easier to run MacOS than Ubuntu. I want to stay with Ubuntu, but the MacBook Air is only $1700 so I'm in danger of becoming another apple fanboi if I can't find anything competitive. Going through all the sites looking for stuff has been a huge waste of time System 76 doesn't deliver to Australia http://www.linux-laptop.net/ and http://www.linlap.com/ are hard work and not confidence inspiring http://www.vgcomputing.com.au/nsintro.html is hard work again, searching for every laptop they say has excellent compatibility on the web to find out what spec it is http://zareason.com/shop/Strata-Pro-13.html (at $1345 USD) looks interesting, but I've got no idea how much I'll get stung by customs importing Dell Inspiron 13z with i5, 4G, 320 7200rpm disk, ATI Mobility Radeon HD5430 - 1GB, Dell Wireless 1501 802.11b/g/n @ $1200 AUD seems like the only competitor but is it compatible? (Dell support offer no opinion - as far as they are concerned they only have 2 models that are certified for ubuntu) Am I worrying too much about the compatibility? Should I just go with Dell? Or switch to MacOS? (It would be good to have a searchable database that had the full machine specs, and compatibility - I'm thinking about building something... but I don't have much time right now...) Thanks. UPDATE I went with a MacBook Air. The price/weight/power was just right. Everything else was either too pricy (i5) or too heavy, or underpowered (SU7300 1.3GHz). Its a pity, because I didn't really want to leave Ubuntu. I'll still run it on my media center and spare (heavy) laptop.

    Read the article

  • Eclipse throwing error when copying and pasting

    - by hoffmandirt
    I am using Eclipse 3.5 SR2 for Java EE developers. Each time I press control+C or control+V for the first time after I open a file I get an error. After I close the error, I can successfully copy and paste. The error message made me believe that it was related to the Mylyn plugin, but I uninstalled it and still no difference. Has anyone else experience this problem? I also have the subclipse, adobe flex builder, and maven plugins installed. The 'org.eclipse.mylyn.tasks.ui.hyperlinks.detectors.url' extension from plug-in 'org.eclipse.mylyn.tasks.ui' to the 'org.eclipse.ui.workbench.texteditor.hyperlinkDetectors' extension point failed to load the hyperlink detector. Plug-in org.eclipse.mylyn.tasks.ui was unable to load class org.eclipse.mylyn.internal.tasks.ui.editors.TaskUrlHyperlinkDetector. An error occurred while automatically activating bundle org.eclipse.mylyn.tasks.ui (520). The 'org.eclipse.mylyn.java.hyperlink.detector.stack' extension from plug-in 'org.eclipse.mylyn.java.tasks' to the 'org.eclipse.ui.workbench.texteditor.hyperlinkDetectors' extension point failed to load the hyperlink detector. Plug-in org.eclipse.mylyn.java.tasks was unable to load class org.eclipse.mylyn.internal.java.tasks.JavaStackTraceHyperlinkDetector. org/eclipse/mylyn/tasks/ui/AbstractTaskHyperlinkDetector The 'org.eclipse.mylyn.tasks.ui.hyperlinks.detectors.task' extension from plug-in 'org.eclipse.mylyn.tasks.ui' to the 'org.eclipse.ui.workbench.texteditor.hyperlinkDetectors' extension point failed to load the hyperlink detector. Plug-in org.eclipse.mylyn.tasks.ui was unable to load class org.eclipse.mylyn.internal.tasks.ui.editors.TaskHyperlinkDetector. An error occurred while automatically activating bundle org.eclipse.mylyn.tasks.ui (520).

    Read the article

< Previous Page | 87 88 89 90 91 92 93 94 95 96 97 98  | Next Page >