Search Results

Search found 392 results on 16 pages for 'mad cow'.

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

  • Farmyard

    - by Richard Jones
    Moooooooo     For a while now we’ve been using Apple’s enterprise device app distribution mechanism.   This allows you to have a user, click on a URL on their iOS device and it pulls down a new version of an enterprise app. of of our servers. Its really nice,  have a look at - http://developer.apple.com/library/ios/#featuredarticles/FA_Wireless_Enterprise_App_Distribution/Introduction/Introduction.html   I’ve embedded this, into a check on application launch, that a web-service is called to detect a newer version of the software is available.  It then calls the URL to the App and a new version is deployed. You can alert users that a new App update is available by sending them a push notification.  See screenshot at the top. We send our push notifications out to users,  using a simple C# service.    The fun part is this.   You can instruct the push notification to play a sound (embedded in the app already). So our push notification’s play a random farmyard noise, i.e from a selection of - cow.wav dogbrk.wav duck.wav goose.wav horse.wav lamb.wav monkey.wav – left field I know rooster.wav Imagine my amusement being able to periodically send out an update and watch our office (of about 60 people) turn into farm for a few seconds. I’ve messed up a few times, with people being interrupted on customer conference calls,  but people seem good humoured about it. (so far) Simple(ish) pleasures…

    Read the article

  • 13.10 doesn't boot on Vaio Pro 13

    - by vaioonbuntu
    I just installed Ubuntu 13.10 on my new Vaio Pro 13, disabled safe mode, but used UEFI and not legacy mode. I did an encrypted LVM installation and erased the complete SSD. It booted just fine from USB, but after installation it doesn't boot. The Vaio failed boot screen appears. I then tried this advice here: 13.10 on vaio pro with UEFI sadly it fails for me with "/usr/sbin/grub-probe: error: failed to get canonical path of /cow." I then tried mounted the encrypted partition with Nautilus and tried this: Cannot update grub with paramters on live USB With /dev/sda2 and then to install GRUB to /dev/sda. Didn't succeed and warned me that the "GPT partition label contains no BIOS Boot Partition; embedding won't be possible" What do i have to do, go fix GRUB and be able to boot my finished install? Here's my Boot Repair Log: http://paste.ubuntu.com/6386598/ I would really appreciate any help, I'm so happy to finally be able to ditch my big fat Macbook Pro and use Ubuntu on my new, light Vaio Pro, if only I could fix GRUB. best, x

    Read the article

  • Cannot access the filesystems using LiveCD (LVM2,EXT2)

    - by ftkg
    I have to restore the /etc/passwd file I accidentally renamed in my Ubuntu Server, so I booted the machine using a LiveCD. Problem is, the system filesystem does not appear in Nautilus, under 'Devices'. Am I missing anything? ubuntu@ubuntu:~$ sudo fdisk -l Disk /dev/sda: 320.1 GB, 320072933376 bytes 255 heads, 63 sectors/track, 38913 cylinders, total 625142448 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x000956dc Device Boot Start End Blocks Id System /dev/sda1 * 2048 499711 248832 83 Linux /dev/sda2 501758 625141759 312320001 5 Extended /dev/sda5 501760 625141759 312320000 8e Linux LVM ubuntu@ubuntu:~$ mount /cow on / type overlayfs (rw) proc on /proc type proc (rw,noexec,nosuid,nodev) sysfs on /sys type sysfs (rw,noexec,nosuid,nodev) udev on /dev type devtmpfs (rw,mode=0755) devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620) tmpfs on /run type tmpfs (rw,noexec,nosuid,size=10%,mode=0755) /dev/sr0 on /cdrom type iso9660 (ro,noatime) /dev/loop0 on /rofs type squashfs (ro,noatime) none on /sys/fs/fuse/connections type fusectl (rw) none on /sys/kernel/debug type debugfs (rw) none on /sys/kernel/security type securityfs (rw) tmpfs on /tmp type tmpfs (rw,nosuid,nodev) none on /run/lock type tmpfs (rw,noexec,nosuid,nodev,size=5242880) none on /run/shm type tmpfs (rw,nosuid,nodev) gvfs-fuse-daemon on /home/ubuntu/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev,user=ubuntu) ubuntu@ubuntu:~$ sudo blkid /dev/loop0: TYPE="squashfs" /dev/sda1: UUID="aad69790-198d-45bc-9ccd-e4cba7456914" TYPE="ext2" /dev/sda5: UUID="wbIDX7-RILL-VtFT-gX15-N1GJ-Yyfg-V8Oe5m" TYPE="LVM2_member" /dev/sr0: LABEL="Ubuntu 12.04 LTS i386" TYPE="iso9660" ubuntu@ubuntu:~$ cat /etc/fstab overlayfs / overlayfs rw 0 0 tmpfs /tmp tmpfs nosuid,nodev 0 0

    Read the article

  • Getting file system free space

    - by Fred Riley
    This isn't a problem as such, more a request for information based on ignorance of the Linux filesystem. The very short question is: How do I find out how much free and used space there is on the volume from which Ubuntu is running? More detail: I'm running Ubuntu 12.04 from a 64Gb USB3 stick, created from booting up a year-old Ubuntu 12.04 DVD and running Startup Disk Creator. The reason for this is that the Master Boot Record on my hard disk, holding Windoze 7, has gone belly-up, and whilst awaiting a recovery disk I'm running Ubunto off USB or DVD as a 'trial'. (And will continue to run Ubuntu after restoring Windoze, as I've rediscovered my love of the penguin :o)) After installing Ubuntu on the stick I ran the software update app, which downloaded some 450Mb of updates and took a couple of hours to install to the stick. A couple of times I got a message saying that disk space was short. So I looked in the file manager (or whatever it's called these days) and couldn't see the stick listed, just: SYSTEM hard disk (listed as 479Gb Filesystem) two other partitions that had been created by Windoze "4.3GB Filesystem" which when I try to open gives the error "Could not find /cow", and when I try to unmount it tells me I can't because it's not mounted - D'OH!! Edit: screenshot of file manager Edit: screenshot of low disk space warning What I can't see is the USB stick from which I'm running Ubuntu. Where's it gone, anybody know? This is tangentially related to a previous question of mine about system tools, in that I'm trying to get control and knowledge of the system in the newest incarnation of Ubuntu.

    Read the article

  • prevent screen rotation android

    - by Sephy
    hi everybody, I have one of my activities which I would like to prevent from rotating because i'm starting an AsynTask, and screen rotation makes it restart... so is there any way to tell this activity "DO NOT ROTATE the screen even if the user is shaking his phone like mad"? Thx for the constant help guys.

    Read the article

  • Any way to access Gearman administration?

    - by webdestroya
    I want to be able to query a gearman server to determine how many instances of a worker I have running (basically I want to make sure that RunTaskA is available and RunTaskB is available if there are no workers handling those tasks, I want to be able to send an alert out. Is there any way to do this? Also: Mad props if you know of a PHP way to query the gearman server.

    Read the article

  • Are there any technical problems using an animated GIF for a web site’s favicon instead of an actual

    - by Paul D. Waite
    When putting a favicon on your site, you can apparently use an animated gif, just by changing the gif file’s extension to .ico. http://www.k-director.com/blog/how-to-add-an-animated-faviconico/ Have you encountered any problems doing this? (Aside from users being driven mad by some stupid little blinking favicon.) Have you seen a browser get confused by a gif file with a .ico extension?

    Read the article

  • struts 2 - where should I set global application variables?

    - by Nicola Montecchio
    Hi I'm using struts 2 and I'd like to read some custom-defined parameters (global variables), preferably from web.xml or some custom ".properties" file (i.e. not hardcoded in the Java sources). This problem has been driving me mad for the past half hour as I can't google any reasonable solution. What is the best way to do this? I find it strange that it is so difficult ... all the best Nicola Montecchio

    Read the article

  • Is There Something Wrong With My Computer Or The Website Server?

    - by thewarspk
    Recently I've been playing one new game which is called THE WARS, it's so fucking interesting that has become the routine work of my life. Yesterday i carelessly downloaded some files with virus, now my computer can't work properly, i just found i couldn't open the game page! Im so mad now, im wondering is there something wrong with my computer or website server, if it's mine, i will find someone to fix my PC, please check out for me...thank you very much, here is the address http://wars.swagblack.com/webgamethewars.aspx

    Read the article

  • SVN: Branches for Every Little Change?

    - by yar
    Hi. We have a client (who has a client, who has a client) who is driving us mad with change requests to a code base (in PHP). Our first response was to just work in a main trunk in SVN, but the client often comes back and requests that a certain change needs to get pushed to the live servers ASAP. On the other hand, other changes get reduced in priority suddenly, which originally came grouped with other changes (seemingly). We are thinking of using a branch for every change request. Is this mad? What other solutions might work? Thanks! Edit: This is a really hard question to choose the correct answer for. Thanks to everybody for your great answers. Edit: I know that the best answer I chose was not particularly popular. I too wanted to find a technical solution to this problem. But now I think that if the client wants software with features that can be deployed in a modular fashion... this problem should not be solved in our use of the version control system. It would have to be designed into the software. Edit: Now it's almost a month later and my coworker/client has convinced me that multiple branches is the way to go. This is not just due to the client's insanity, but also based on our need to be able to determine if a feature is "ready to go" or "needs more work" or whatever. I don't have the SVN with me, but we merge using the advice from the SVN Cookbook: you merge the branch from the revision it was branched to the head revision. Also, using this system, we merge all branches at some point and that becomes the new QA and then live build. Then we branch from that. Last Edit (Perhaps): Months later, this system is still working out for us. We create branches for every ticket and rarely have problems. On the other hand, we do try to keep things separate as far as what people are working on... Two Years Later: We use GIT now, and now this system is actually quite reasonable.

    Read the article

  • Why do techs recommend YUM installs yet repositories and providers are ages behind?

    - by JM4
    I have been reading page after page after page about the benefits of using YUM package installer and how NOBODY should built installs from source files (which again makes no sense to me) yet the repositories and source builders always package files in Tarball format, leaving a TON of work (which usually ends up going wrong) to the individual instead of formatting SRPMs for the end user. Has the world gone mad? I feel like I am taking crazy pills!

    Read the article

  • Facebook Like not Pulling Title

    - by matthewb
    I am having some issues with the new facebook like button. It shows up fine, however for some reason it's not pulling the title of the page. I have the and I am using og:title, all are filled in, when I view the source of the iframe created on the load of he button, the in there is blank. I am also trying to put the tweetmeme and that's seeing that title and not the meta, or the normal page title. What am I doing wrong? <html xmlns="http://www.w3.org/1999/xhtml" xmlns:og="http://opengraphprotocol.org/schema/" xmlns:fb="http://developers.facebook.com/schema/"> <fb:like href="<?=$url?>" layout="button_count" show_faces="false" width="100" font="arial"></fb:like> UPDATE: Complete Head <head> <title>Ladder 15 Gets A New Menu!</title> <meta content="Growing up can be hard to do, especially in the Mad River family. But Ladder 15 has come into its own over the winter.&nbsp; With some new cocktails, wine selection, a hefty new beer list and veteran Chef David Ansill in the kitchen, you can check your fist pump at" name="Description"> <meta content="" name="Keywords"> <meta content="cities2night inc." name="author"> <meta content="Cities2Night 2010" name="copyright"> <meta content="en-us" name="language"> <meta content="General" name="rating"> <meta content="index,follow" name="robots"> <meta content="text/html; charset=UTF-8" http-equiv="Content-Type"> <meta content="Ladder 15 gets a new menu!" name="tweetmeme-title"> <meta content="Ladder 15 gets a new menu!" property="og:title"> <meta content="article" property="og:type"> <meta content="http://philly.cities2night.com/articles/show/listing/11/ladder-15-gets-a-new-menu" property="og:url"> <meta content="http://philly.cities2night.com/public/article_images/11.jpg" property="og:image"> <meta content="c0176da0ec38aaf107c0ef6c8cdeee38" property="fb:app_id"> <meta content="Philly2night.com" property="og:site_name"> <meta content="Growing up can be hard to do, especially in the Mad River family. But Ladder" property="og:description"></head>

    Read the article

  • Help - Getting wrong orientation

    - by barbgal
    Hi all, I am having one issue in my application which drives me mad... In my application, i rotate the simulator to the landscape mode but in my below function i get portrait orientation... what is the problem here. Pls help me out -(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { if ( interfaceOrientation == UIInterfaceOrientationPortrait || interfaceOrientation == UIInterfaceOrientationPortraitUpsideDown ) { NSLog(@" portrait orientation"); } else { NSLog(@"Landscape"); } }

    Read the article

  • Is it necessary to look, website same in all browser?

    - by metal-gear-solid
    Is it necessary to look, website same in all browser? are some client mad? isn't it need of pixel perfection ( to inch to inch match with Design) a madness? isn't it asking IE6 Pixel perfection, as of now, is a madness? Is it sin to to use JavaScript for visual enhancement, like to enable border radius in IE using Javascript and from CSS in other browsers?

    Read the article

  • Adding an existing site column to a custom list

    - by Graeme
    I think I'm going mad - this seemed like an easy thing to do but I can't find any info on it at all. I have created a Custom List and added 4 columns to it. Created By and Modified By are already in the list but hidden from the view. I want to add a Date Modified column (which is a built in field) to this Custom List. How do I do this programmatically?

    Read the article

  • sql generate unique table/view name

    - by Claudiu
    I want to create some mad robust code. I want to take a query as a string, create a temporary view / table to store the results, use it, then drop the table. I want to use a name that is guaranteed to not already exist in the database. Is there an SQL command to generate a unique table name? I'm using postgresql if this is implementation-specific.

    Read the article

  • website page losing title

    - by user128015
    i am going mad with this problem now - if u goto http://talll.com and start clicking around on the menu items like news, economics etc., u will find that the page title says "undefined" - i just want to set the page title to some value thats all - HELPPPPPP!!!

    Read the article

  • CodePlex Daily Summary for Tuesday, May 18, 2010

    CodePlex Daily Summary for Tuesday, May 18, 2010New ProjectsCafeControl: Supports Remote LOGIN,Remote logout ,Account Creation ,Account LOGOUT ,Temporary Login ,SMS Reported and many other features Requires .net 4.0 Cloud & Contacts: Cloud Contacts makes it easier for share your contacts.Cow connect: Ziel des Projektes Cow connect, ist es ein Tool zu schrieben das Verschiedene Datenbanken, unterschiedlicher Herdenmanagement Tool z.b: Helm Multik...DNN Simple Blog: A simplified blog module that adheres to the DNN API and is designed for a single blog author per module instance. The module also makes use of Web...dotSpatial: dotSpatial is an open source project focused on developing a core set of GIS and mapping libraries that live together harmoniously in the System.Sp...Dynamic Survey Forms - SharePoint Web Part: Create manage dynamic survey forms as SharePoint web part. Record survey score for logged user or for someone else. This project has been designed ...EDXL Sharp: EDXLSharp is a C# / .NET 3.5 implementation of the OASIS Emergency Data Exchange Language (EDXL) family of standards. This set of libraries can be...EPiServer CMS 6 Visual Studio Project Template for VB w/ Public Templates: This is a Visual Studio 2008 Project Template with will allow the creation of a EPiServer CMS 6 project set up as and with all code in Visual Basic...Functional Command Toolbar for Windows: A floating window with a text box for typing functional command and executing it. The tool supports .NET addin, functional scripting and other feat...GameFX: Silverlight Game Development LibraryLightweight Fluent Workflow: ObjectFlow is a lightweight workflow engine for creating & executing workflows. The fluent interface makes it easy to define and understand workf...LinqSpecs: A toolset for use the specification pattern in linq queries.Money Watch: Personal Finances management system written in C#, NHibernate and SQL express.Multi-screen Viewer: This viewer allows to open and view pdf file (presentation) on multiple screens. There is no need to see the file in fullscreen on each screen (mon...neo-tsql: set of stored procedures and functions for sql serverNHTrace: NHTrace is a tool for tracing sql commands executed by NHibernate with syntax highlighting.NQueue: NQueue provides an enterprise level work scheduling and execution framework and toolset that contains no single point of failure. Using a farm of s...Online Cash Manager: Online Cash Manager based on ASP .NET MVC2 VS 2010 RTM MVC 2POCO Bridge: Bridging Silverlight and full .NET apps.REngine - game engine in Silverlight: REngine makes it easier for game developers to develop games in Microsoft Silverlight. RunAs Launcher: RunAs Launcher is a C# utility that provides a GUI for running applications under different credentials. It works in situations where the built-in ...secs4net: SECS-II/GEM/HSMS implementation on .NET. This library provide easy way to communicate with SEMI standard compatible device.SharePoint Admin Dashboard: SharePoint Dashboard for admins. Allows lightening fast multiple server management. RDP doesn't scale. Manage 10 servers easier than 1 with i...Silver spring: saltSocial Map: Social map is a social network based on geograpghical informationTweetZone: TweetZone is new type of twitter client application include DATABASE in it, and it shows you STATS. This Application's cache makes it faster to acc...Yet Another Database Viewer: Yet Another Database Viewer is developed for a basic database view and editing so you don't have to install anything. It's developed in c#.New Releases3FD - Framework For Fast Development: Alpha 1: The first test release. There is still some bugs, but it is functional. The garbage collector is showing memory leaking that must be corrected in t...Ajax Toolkit for ASP.NET MVC: MvcAjaxToolkit gridext with ContextMenu and Tmpl: MvcAjaxToolkit gridext with ContextMenu and Tmpl gridext is a extension for flexigridASP.NET MVC Extensions: SP1 Preview: SP1 Preview ========= 1. Autofac support added. 2. Changed Windsor Adapter. IWindsorInstaller is used instead of IModule.Book Cataloger: BookCataloger1.0.7a: New Features: Author editor form prototype Improvements: .NET Framework 4.0 required Input checking improved Comment edit loads and saves text...Braintree Client Library: Braintree-2.2.0: Prevent race condition when pulling back collection results -- search results represent the state of the data at the time the query was run Renam...CassiniDev - Cassini 3.5/4.0 Developers Edition: CassiniDev 3.5.1 and 4.0.1 beta 2: Documentation New in CassiniDev v3.5.1.0/v4.0.1.0 Added .Net 4 / VS10 build. Simplified test fixtures. Un-Refactored the not-so-simple MVP pa...dotNetTips: dotNetTips.Utility 3.5 R3: This is a new release (version 3.5.0.4) compatible with .NET 3.5. Requires SP1 if using the Entity Framework extensions. This is a minor update fro...Dynamic Survey Forms - SharePoint Web Part: Dynamic Survey forms for SharePoint. Alpha 1.0.1: Alpha release. Before running installer create database from script attached in zip file. In your web.config make sure your first connection strin...Event Scavenger: Viewer version 3.2.1: Added quick filters on event source and event id dialog boxes. Collector and Admin tool unaffected.Expression Blend Samples: Blend 4 Sketch Mockups Library: This library provides a set of commonly needed controls, icons and cursors to use in SketchFlow applications. After running the installer, create ...Fluent Ribbon Control Suite: Fluent Ribbon Control Suite 1.3: Fluent Ribbon Control Suite 1.3(supports .NET 3.5 and .NET 4 RTM) Includes: Fluent.dll (with .pdb and .xml) Showcase Application Samples Found...Home Access Plus+: v4.2.2: Version 4.2.2 Change Log: Changes to how mycomputer handles NTFS permissions File Changes: ~/Bin/HAP.Web.dll ~/Bin/HAP.Web.pdbIdeaNMR: IdeaNMR Web App PreAlpha 0.1: This is the first release.IP Informer: Beta Release: V0.8.0.0 Beta.LinkedIn® for Windows Mobile: LinkedIn for Windows Mobile v0.9: Main updates for this release Fixed Status update. (updates where not correctly passed on to LinkedIn) Added landscape/GSensor support. (Currentl...LINQ to Twitter: LINQ to Twitter Beta v2.0.11: New items added since v1.1 include: Support for OAuth (via DotNetOpenAuth), secure communication via https, VB language support, serialization of ...LinqSpecs: Version 1.0 alpha: This is the alpha version of LinqSpecs.miniTodo: mini Todo version 0.2: ・デザインを透明主体に変更  -件数を表示している部分のドラッグでウィンドウ移動  -上記の部分右クリックで、「最前面に表示」、「全アイテム管理」 ・グラフを日/週/月単位の3種類に増やした ・新規作成、完了時にアニメーション追加。完了時にはサウンドも追加 ・テキスト未入力時は追加ボタンも非表示My Notepad: My Notepad (Beta): This is the Beta version of My Notepad. The software is stable enough for you to use. Enjoy the flexibility of docking and also the all new Syntax ...NHTrace: NHTrace-45713: NHTrace-45713Nito.KitchenSink: Version 8: New features (since Version 5) Fixed null reference bug in ExceptionExtensions. Added DynamicStaticTypeMembers and RefOutArg for dynamically (lat...Nito.LINQ: Beta (v0.5): Rx version The "with Rx" versions of Nito.LINQ are built against Rx 1.0.2521.102, released 2010-05-14. Breaking changes Corrected internal read-on...Object/Relational Mapper & Code Generator in Net 2.0 for Relational & XML Schema: 2.9: Work on UI templates for associative tables (2-column PK), using users/roles pages as an example. Added templates for Not-In-Group sql and cache-ba...patterns & practices - GAX Extensions Library: GEL for gax2010: This is the GEL for GAX 2010, support Visual Stuido 2010patterns & practices - Smart Client Guidance: Smart Client Software Factory 2010 Documentation: If the right-side pane of the chm file is not displayed correctly, do the following: 1) Download SCSF2010Guide.chm file. 2) Start the windows explo...patterns & practices - Windows Azure Guidance: WAAG - Part 1 - Release Candidate: "Release Candidate" for Part 1 of the Windows Azure Guide Highlights of this release are: Code samples complete. Fixed few bugs on "Dependency Ch...Rawr: Rawr 2.3.17: >Rawr3 Public Beta has been released! Click here for details.< - Lots of improvements to the default data files. There is a known issue with the s...RunAs Launcher: RunAs Launcher 1.2: This is the first version being released to CodePlex. Simply extract the file and run the executable. For those that wish to download the source c...Rx Contrib: V1.5: Bug fixsecs4net: Release 1.0: Notes: Runtime requirement: .Net framework 2.0 SP2 with System.Core(.NET 3.5), System.Threading(Rx for 3.5 SP1)SharePoint Admin Dashboard: SPDashboard v1.0: SPDashboard v1.0ShortURL Creator: ShortURL Creator 1.3.0.0: Added new provider u.nu and minimum UI changesStyleCop+: StyleCop+ 0.7: StyleCop+ is now fully compatible with StyleCop 4.4. The following entities were supported in Advanced Naming Rules: - Delegate - Event - Property...Value Injecter: an aspect oriented mapper: Value Injecter 1.2: ValueInjecter library, Sample solution that contains: web-forms sample project win-forms sample project unit tests samplesVCC: Latest build, v2.1.30517.0: Automatic drop of latest buildVCC: Latest build, v2.1.30517.1: Automatic drop of latest buildVidCoder: 0.4.1: Changes: Marks system as "working" to prevent computer from sleeping during an encode. CPU priority changed to BelowNormal during encodes. Enco...WSP Listener: WSP Listener version 2.0.0.0: This new version includes: All assemblies and required assets in one WSP Seperated code in library assembly Activate the WSP Listener with one...Yet Another Database Viewer: Beta: first release of the programYet another developer blog - Examples: Asynchronous TreeView in ASP.NET WebForms: This sample application shows how to use jQuery TreeView plugin for creating an asynchronous TreeView in ASP.NET WebForms. This application is acco...Most Popular ProjectsRawrWBFS ManagerAJAX Control ToolkitMicrosoft SQL Server Product Samples: DatabaseSilverlight ToolkitWindows Presentation Foundation (WPF)patterns & practices – Enterprise LibraryMicrosoft SQL Server Community & SamplesPHPExcelASP.NETMost Active Projectspatterns & practices – Enterprise LibraryPHPExcelRawrBlogEngine.NETMicrosoft Biology FoundationCustomer Portal Accelerator for Microsoft Dynamics CRMWindows Azure Command-line Tools for PHP DevelopersGMap.NET - Great Maps for Windows Forms & PresentationCassiniDev - Cassini 3.5/4.0 Developers EditionDotNetZip Library

    Read the article

  • When I shutdown the computer, it restarts

    - by Prabu
    I am unable to shutdown. Whenever I try to shutdown, it reboots. I am running Ubuntu 12.10. I have run the boot-repair and this is the result: Boot Info Script 0.61.full + Boot-Repair extra info [Boot-Info November 20th 2012] ============================= Boot Info Summary: =============================== => Grub2 (v2.00) is installed in the MBR of /dev/sda and looks at sector 1 of the same hard drive for core.img. core.img is at this location and looks in partition 1 for (,msdos1)/boot/grub. sda1: __________________________________________________________________________ File system: ext4 Boot sector type: - Boot sector info: Operating System: Ubuntu 12.10 Boot files: /boot/grub/grub.cfg /etc/fstab /boot/grub/i386-pc/core.img sda2: __________________________________________________________________________ File system: Extended Partition Boot sector type: - Boot sector info: sda5: __________________________________________________________________________ File system: swap Boot sector type: - Boot sector info: ============================ Drive/Partition Info: ============================= Drive: sda _____________________________________________________________________ Disk /dev/sda: 1000.2 GB, 1000204886016 bytes 255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 4096 bytes Partition Boot Start Sector End Sector # of Sectors Id System /dev/sda1 * 2,048 1,936,809,983 1,936,807,936 83 Linux /dev/sda2 1,936,812,030 1,953,523,711 16,711,682 5 Extended /dev/sda5 1,936,812,032 1,953,523,711 16,711,680 82 Linux swap / Solaris "blkid" output: ________________________________________________________________ Device UUID TYPE LABEL /dev/loop0 squashfs /dev/sda1 229a5484-7659-4ce1-98ce-2f05f61a1ffa ext4 /dev/sda5 6c6dca25-ab67-4de4-8602-26fdb6154781 swap /dev/sr0 iso9660 Ubuntu 12.10 amd64 ================================ Mount points: ================================= Device Mount_Point Type Options /dev/loop0 /rofs squashfs (ro,noatime) /dev/sr0 /cdrom iso9660 (ro,noatime) =========================== sda1/boot/grub/grub.cfg: =========================== -------------------------------------------------------------------------------- # # DO NOT EDIT THIS FILE # # It is automatically generated by grub-mkconfig using templates # from /etc/grub.d and settings from /etc/default/grub # ### BEGIN /etc/grub.d/00_header ### if [ -s $prefix/grubenv ]; then set have_grubenv=true load_env fi set default="0" if [ x"${feature_menuentry_id}" = xy ]; then menuentry_id_option="--id" else menuentry_id_option="" fi export menuentry_id_option if [ "${prev_saved_entry}" ]; then set saved_entry="${prev_saved_entry}" save_env saved_entry set prev_saved_entry= save_env prev_saved_entry set boot_once=true fi function savedefault { if [ -z "${boot_once}" ]; then saved_entry="${chosen}" save_env saved_entry fi } function recordfail { set recordfail=1 if [ -n "${have_grubenv}" ]; then if [ -z "${boot_once}" ]; then save_env recordfail; fi; fi } function load_video { if [ x$feature_all_video_module = xy ]; then insmod all_video else insmod efi_gop insmod efi_uga insmod ieee1275_fb insmod vbe insmod vga insmod video_bochs insmod video_cirrus fi } if [ x$feature_default_font_path = xy ] ; then font=unicode else insmod part_msdos insmod ext2 set root='hd0,msdos1' if [ x$feature_platform_search_hint = xy ]; then search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 229a5484-7659-4ce1-98ce-2f05f61a1ffa else search --no-floppy --fs-uuid --set=root 229a5484-7659-4ce1-98ce-2f05f61a1ffa fi font="/usr/share/grub/unicode.pf2" fi if loadfont $font ; then set gfxmode=auto load_video insmod gfxterm set locale_dir=$prefix/locale set lang=en_US insmod gettext fi terminal_output gfxterm if [ "${recordfail}" = 1 ]; then set timeout=10 else set timeout=10 fi ### END /etc/grub.d/00_header ### ### BEGIN /etc/grub.d/05_debian_theme ### set menu_color_normal=white/black set menu_color_highlight=black/light-gray if background_color 44,0,30; then clear fi ### END /etc/grub.d/05_debian_theme ### ### BEGIN /etc/grub.d/10_linux ### function gfxmode { set gfxpayload="${1}" if [ "${1}" = "keep" ]; then set vt_handoff=vt.handoff=7 else set vt_handoff= fi } if [ "${recordfail}" != 1 ]; then if [ -e ${prefix}/gfxblacklist.txt ]; then if hwmatch ${prefix}/gfxblacklist.txt 3; then if [ ${match} = 0 ]; then set linux_gfx_mode=keep else set linux_gfx_mode=text fi else set linux_gfx_mode=text fi else set linux_gfx_mode=keep fi else set linux_gfx_mode=text fi export linux_gfx_mode if [ "${linux_gfx_mode}" != "text" ]; then load_video; fi menuentry 'Ubuntu' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-229a5484-7659-4ce1-98ce-2f05f61a1ffa' { recordfail gfxmode $linux_gfx_mode insmod gzio insmod part_msdos insmod ext2 set root='hd0,msdos1' if [ x$feature_platform_search_hint = xy ]; then search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 229a5484-7659-4ce1-98ce-2f05f61a1ffa else search --no-floppy --fs-uuid --set=root 229a5484-7659-4ce1-98ce-2f05f61a1ffa fi linux /boot/vmlinuz-3.5.0-19-generic root=UUID=229a5484-7659-4ce1-98ce-2f05f61a1ffa ro quiet splash acpi=force $vt_handoff initrd /boot/initrd.img-3.5.0-19-generic } submenu 'Advanced options for Ubuntu' $menuentry_id_option 'gnulinux-advanced-229a5484-7659-4ce1-98ce-2f05f61a1ffa' { menuentry 'Ubuntu, with Linux 3.5.0-19-generic' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.5.0-19-generic-advanced-229a5484-7659-4ce1-98ce-2f05f61a1ffa' { recordfail gfxmode $linux_gfx_mode insmod gzio insmod part_msdos insmod ext2 set root='hd0,msdos1' if [ x$feature_platform_search_hint = xy ]; then search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 229a5484-7659-4ce1-98ce-2f05f61a1ffa else search --no-floppy --fs-uuid --set=root 229a5484-7659-4ce1-98ce-2f05f61a1ffa fi echo 'Loading Linux 3.5.0-19-generic ...' linux /boot/vmlinuz-3.5.0-19-generic root=UUID=229a5484-7659-4ce1-98ce-2f05f61a1ffa ro quiet splash acpi=force $vt_handoff echo 'Loading initial ramdisk ...' initrd /boot/initrd.img-3.5.0-19-generic } menuentry 'Ubuntu, with Linux 3.5.0-19-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.5.0-19-generic-recovery-229a5484-7659-4ce1-98ce-2f05f61a1ffa' { recordfail insmod gzio insmod part_msdos insmod ext2 set root='hd0,msdos1' if [ x$feature_platform_search_hint = xy ]; then search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 229a5484-7659-4ce1-98ce-2f05f61a1ffa else search --no-floppy --fs-uuid --set=root 229a5484-7659-4ce1-98ce-2f05f61a1ffa fi echo 'Loading Linux 3.5.0-19-generic ...' linux /boot/vmlinuz-3.5.0-19-generic root=UUID=229a5484-7659-4ce1-98ce-2f05f61a1ffa ro recovery nomodeset echo 'Loading initial ramdisk ...' initrd /boot/initrd.img-3.5.0-19-generic } menuentry 'Ubuntu, with Linux 3.5.0-17-generic' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.5.0-17-generic-advanced-229a5484-7659-4ce1-98ce-2f05f61a1ffa' { recordfail gfxmode $linux_gfx_mode insmod gzio insmod part_msdos insmod ext2 set root='hd0,msdos1' if [ x$feature_platform_search_hint = xy ]; then search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 229a5484-7659-4ce1-98ce-2f05f61a1ffa else search --no-floppy --fs-uuid --set=root 229a5484-7659-4ce1-98ce-2f05f61a1ffa fi echo 'Loading Linux 3.5.0-17-generic ...' linux /boot/vmlinuz-3.5.0-17-generic root=UUID=229a5484-7659-4ce1-98ce-2f05f61a1ffa ro quiet splash acpi=force $vt_handoff echo 'Loading initial ramdisk ...' initrd /boot/initrd.img-3.5.0-17-generic } menuentry 'Ubuntu, with Linux 3.5.0-17-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-3.5.0-17-generic-recovery-229a5484-7659-4ce1-98ce-2f05f61a1ffa' { recordfail insmod gzio insmod part_msdos insmod ext2 set root='hd0,msdos1' if [ x$feature_platform_search_hint = xy ]; then search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 229a5484-7659-4ce1-98ce-2f05f61a1ffa else search --no-floppy --fs-uuid --set=root 229a5484-7659-4ce1-98ce-2f05f61a1ffa fi echo 'Loading Linux 3.5.0-17-generic ...' linux /boot/vmlinuz-3.5.0-17-generic root=UUID=229a5484-7659-4ce1-98ce-2f05f61a1ffa ro recovery nomodeset echo 'Loading initial ramdisk ...' initrd /boot/initrd.img-3.5.0-17-generic } } ### END /etc/grub.d/10_linux ### ### BEGIN /etc/grub.d/20_linux_xen ### ### END /etc/grub.d/20_linux_xen ### ### BEGIN /etc/grub.d/20_memtest86+ ### menuentry "Memory test (memtest86+)" { insmod part_msdos insmod ext2 set root='hd0,msdos1' if [ x$feature_platform_search_hint = xy ]; then search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 229a5484-7659-4ce1-98ce-2f05f61a1ffa else search --no-floppy --fs-uuid --set=root 229a5484-7659-4ce1-98ce-2f05f61a1ffa fi linux16 /boot/memtest86+.bin } menuentry "Memory test (memtest86+, serial console 115200)" { insmod part_msdos insmod ext2 set root='hd0,msdos1' if [ x$feature_platform_search_hint = xy ]; then search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 229a5484-7659-4ce1-98ce-2f05f61a1ffa else search --no-floppy --fs-uuid --set=root 229a5484-7659-4ce1-98ce-2f05f61a1ffa fi linux16 /boot/memtest86+.bin console=ttyS0,115200n8 } ### END /etc/grub.d/20_memtest86+ ### ### BEGIN /etc/grub.d/30_os-prober ### ### END /etc/grub.d/30_os-prober ### ### BEGIN /etc/grub.d/30_uefi-firmware ### ### END /etc/grub.d/30_uefi-firmware ### ### BEGIN /etc/grub.d/40_custom ### # This file provides an easy way to add custom menu entries. Simply type the # menu entries you want to add after this comment. Be careful not to change # the 'exec tail' line above. ### END /etc/grub.d/40_custom ### ### BEGIN /etc/grub.d/41_custom ### if [ -f ${config_directory}/custom.cfg ]; then source ${config_directory}/custom.cfg elif [ -z "${config_directory}" -a -f $prefix/custom.cfg ]; then source $prefix/custom.cfg; fi ### END /etc/grub.d/41_custom ### -------------------------------------------------------------------------------- =============================== sda1/etc/fstab: ================================ -------------------------------------------------------------------------------- # /etc/fstab: static file system information. # # Use 'blkid' to print the universally unique identifier for a # device; this may be used with UUID= as a more robust way to name devices # that works even if disks are added and removed. See fstab(5). # # <file system> <mount point> <type> <options> <dump> <pass> # / was on /dev/sda1 during installation UUID=229a5484-7659-4ce1-98ce-2f05f61a1ffa / ext4 errors=remount-ro 0 1 # swap was on /dev/sda5 during installation UUID=6c6dca25-ab67-4de4-8602-26fdb6154781 none swap sw 0 0 -------------------------------------------------------------------------------- =================== sda1: Location of files loaded by Grub: ==================== GiB - GB File Fragment(s) 200.155235291 = 214.915047424 boot/grub/grub.cfg 1 40.280788422 = 43.251167232 boot/initrd.img-3.5.0-17-generic 1 2.468288422 = 2.650304512 boot/initrd.img-3.5.0-19-generic 1 200.149234772 = 214.908604416 boot/vmlinuz-3.5.0-17-generic 1 1.990135193 = 2.136891392 boot/vmlinuz-3.5.0-19-generic 1 2.468288422 = 2.650304512 initrd.img 1 1.990135193 = 2.136891392 vmlinuz 1 1.990135193 = 2.136891392 vmlinuz.old 1 =============================== StdErr Messages: =============================== cat: write error: Broken pipe File descriptor 8 (/proc/6297/mounts) leaked on lvscan invocation. Parent PID 13390: bash No volume groups found ADDITIONAL INFORMATION : =================== log of boot-repair 2012-12-17__01h53 =================== boot-repair version : 3.197~ppa1~quantal boot-sav version : 3.197~ppa1~quantal glade2script version : 3.2.2~ppa45~quantal boot-sav-extra version : 3.197~ppa1~quantal boot-repair is executed in live-session (Ubuntu 12.10, quantal, Ubuntu, x86_64) CPU op-mode(s): 32-bit, 64-bit file=/cdrom/preseed/ubuntu.seed boot=casper initrd=/casper/initrd.lz quiet splash -- maybe-ubiquity =================== os-prober: /dev/sda1:Ubuntu 12.10 (12.10):Ubuntu:linux =================== blkid: /dev/loop0: TYPE="squashfs" /dev/sr0: LABEL="Ubuntu 12.10 amd64" TYPE="iso9660" /dev/sda1: UUID="229a5484-7659-4ce1-98ce-2f05f61a1ffa" TYPE="ext4" /dev/sda5: UUID="6c6dca25-ab67-4de4-8602-26fdb6154781" TYPE="swap" 1 disks with OS, 1 OS : 1 Linux, 0 MacOS, 0 Windows, 0 unknown type OS. Warning: extended partition does not start at a cylinder boundary. DOS and Linux will interpret the contents differently. =================== sda1/etc/default/grub : # If you change this file, run 'update-grub' afterwards to update # /boot/grub/grub.cfg. # For full documentation of the options in this file, see: # info -f grub -n 'Simple configuration' GRUB_DEFAULT=0 GRUB_HIDDEN_TIMEOUT=0 GRUB_HIDDEN_TIMEOUT_QUIET=true GRUB_TIMEOUT=10 GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian` GRUB_CMDLINE_LINUX_DEFAULT="quiet splash acpi=force" GRUB_CMDLINE_LINUX="" # Uncomment to enable BadRAM filtering, modify to suit your needs # This works with Linux (no patch required) and with any kernel that obtains # the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...) #GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef" # Uncomment to disable graphical terminal (grub-pc only) #GRUB_TERMINAL=console # The resolution used on graphical terminal # note that you can use only modes which your graphic card supports via VBE # you can see them in real GRUB with the command `vbeinfo' #GRUB_GFXMODE=640x480 # Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux #GRUB_DISABLE_LINUX_UUID=true # Uncomment to disable generation of recovery mode menu entries #GRUB_DISABLE_RECOVERY="true" # Uncomment to get a beep at grub start #GRUB_INIT_TUNE="480 440 1" =================== sda1/etc/grub.d/ : drwxr-xr-x 2 root root 4096 Oct 17 14:59 grub.d total 72 -rwxr-xr-x 1 root root 7541 Oct 14 17:36 00_header -rwxr-xr-x 1 root root 5488 Oct 4 09:30 05_debian_theme -rwxr-xr-x 1 root root 10891 Oct 14 17:36 10_linux -rwxr-xr-x 1 root root 10258 Oct 14 17:36 20_linux_xen -rwxr-xr-x 1 root root 1688 Oct 11 14:10 20_memtest86+ -rwxr-xr-x 1 root root 10976 Oct 14 17:36 30_os-prober -rwxr-xr-x 1 root root 1426 Oct 14 17:36 30_uefi-firmware -rwxr-xr-x 1 root root 214 Oct 14 17:36 40_custom -rwxr-xr-x 1 root root 216 Oct 14 17:36 41_custom -rw-r--r-- 1 root root 483 Oct 14 17:36 README =================== UEFI/Legacy mode: This live-session is not in EFI-mode. SecureBoot maybe enabled. =================== PARTITIONS & DISKS: sda1 : sda, not-sepboot, grubenv-ok grub2, grub-pc , update-grub, 64, with-boot, is-os, not--efi--part, fstab-without-boot, fstab-without-efi, no-nt, no-winload, no-recov-nor-hid, no-bmgr, notwinboot, apt-get, grub-install, with--usr, fstab-without-usr, not-sep-usr, standard, farbios, /mnt/boot-sav/sda1. sda : not-GPT, BIOSboot-not-needed, has-no-EFIpart, not-usb, has-os, 2048 sectors * 512 bytes =================== parted -l: Model: ATA ST1000DM003-1CH1 (scsi) Disk /dev/sda: 1000GB Sector size (logical/physical): 512B/4096B Partition Table: msdos Number Start End Size Type File system Flags 1 1049kB 992GB 992GB primary ext4 boot 2 992GB 1000GB 8556MB extended 5 992GB 1000GB 8556MB logical linux-swap(v1) Warning: Unable to open /dev/sr0 read-write (Read-only file system). /dev/sr0 has been opened read-only. Error: Can't have a partition outside the disk! =================== parted -lm: BYT; /dev/sda:1000GB:scsi:512:4096:msdos:ATA ST1000DM003-1CH1; 1:1049kB:992GB:992GB:ext4::boot; 2:992GB:1000GB:8556MB:::; 5:992GB:1000GB:8556MB:linux-swap(v1)::; Warning: Unable to open /dev/sr0 read-write (Read-only file system). /dev/sr0 has been opened read-only. Error: Can't have a partition outside the disk! =================== mount: /cow on / type overlayfs (rw) proc on /proc type proc (rw,noexec,nosuid,nodev) sysfs on /sys type sysfs (rw,noexec,nosuid,nodev) udev on /dev type devtmpfs (rw,mode=0755) devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620) tmpfs on /run type tmpfs (rw,noexec,nosuid,size=10%,mode=0755) /dev/sr0 on /cdrom type iso9660 (ro,noatime) /dev/loop0 on /rofs type squashfs (ro,noatime) none on /sys/fs/fuse/connections type fusectl (rw) none on /sys/kernel/debug type debugfs (rw) none on /sys/kernel/security type securityfs (rw) tmpfs on /tmp type tmpfs (rw,nosuid,nodev) none on /run/lock type tmpfs (rw,noexec,nosuid,nodev,size=5242880) none on /run/shm type tmpfs (rw,nosuid,nodev) none on /run/user type tmpfs (rw,noexec,nosuid,nodev,size=104857600,mode=0755) gvfsd-fuse on /run/user/ubuntu/gvfs type fuse.gvfsd-fuse (rw,nosuid,nodev,user=ubuntu) /dev/sda1 on /mnt/boot-sav/sda1 type ext4 (rw) =================== ls: /sys/block/sda (filtered): alignment_offset bdi capability dev device discard_alignment events events_async events_poll_msecs ext_range holders inflight power queue range removable ro sda1 sda2 sda5 size slaves stat subsystem trace uevent /sys/block/sr0 (filtered): alignment_offset bdi capability dev device discard_alignment events events_async events_poll_msecs ext_range holders inflight power queue range removable ro size slaves stat subsystem trace uevent /dev (filtered): alarm ashmem autofs binder block bsg btrfs-control bus cdrom cdrw char console core cpu cpu_dma_latency disk dri dvd dvdrw ecryptfs fb0 fd full fuse fw0 hidraw0 hidraw1 hpet input kmsg kvm log mapper mcelog mei mem net network_latency network_throughput null oldmem port ppp psaux ptmx pts random rfkill rtc rtc0 sda sda1 sda2 sda5 sg0 sg1 shm snapshot snd sr0 stderr stdin stdout uinput urandom usb vga_arbiter vhost-net zero ls /dev/mapper: control =================== df -Th: Filesystem Type Size Used Avail Use% Mounted on /cow overlayfs 3.9G 100M 3.8G 3% / udev devtmpfs 3.9G 12K 3.9G 1% /dev tmpfs tmpfs 1.6G 864K 1.6G 1% /run /dev/sr0 iso9660 763M 763M 0 100% /cdrom /dev/loop0 squashfs 717M 717M 0 100% /rofs tmpfs tmpfs 3.9G 32K 3.9G 1% /tmp none tmpfs 5.0M 4.0K 5.0M 1% /run/lock none tmpfs 3.9G 176K 3.9G 1% /run/shm none tmpfs 100M 52K 100M 1% /run/user /dev/sda1 ext4 910G 26G 838G 3% /mnt/boot-sav/sda1 =================== fdisk -l: Disk /dev/sda: 1000.2 GB, 1000204886016 bytes 255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 4096 bytes I/O size (minimum/optimal): 4096 bytes / 4096 bytes Disk identifier: 0x000da1e9 Device Boot Start End Blocks Id System /dev/sda1 * 2048 1936809983 968403968 83 Linux /dev/sda2 1936812030 1953523711 8355841 5 Extended Partition 2 does not start on physical sector boundary. /dev/sda5 1936812032 1953523711 8355840 82 Linux swap / Solaris Partition outside the disk detected. =================== Recommended repair Recommended-Repair This setting will reinstall the grub2 of sda1 into the MBR of sda. Additional repair will be performed: unhide-bootmenu-10s Unhide GRUB boot menu in sda1/etc/default/grub grub-install (GRUB) 2.00-7ubuntu11,grub-install (GRUB) 2. Reinstall the GRUB of sda1 into the MBR of sda Installation finished. No error reported. grub-install /dev/sda: exit code of grub-install /dev/sda:0 chroot /mnt/boot-sav/sda1 update-grub Generating grub.cfg ... Found linux image: /boot/vmlinuz-3.5.0-19-generic Found initrd image: /boot/initrd.img-3.5.0-19-generic Found linux image: /boot/vmlinuz-3.5.0-17-generic Found initrd image: /boot/initrd.img-3.5.0-17-generic Found memtest86+ image: /boot/memtest86+.bin Unhide GRUB boot menu in sda1/boot/grub/grub.cfg Boot successfully repaired. You can now reboot your computer.

    Read the article

  • python: variable not getting defined after several conditionals

    - by Protean
    For some reason this program is saying that 'switch' is not defined. What is going on? #PYTHON 3.1.1 class mysrt: def __init__(self): self.DATA = open('ORDER.txt', 'r') self.collect = 0 cache1 = str(self.DATA.readlines()) cache2 = [] for i in range(len(cache1)): if cache1[i] == '*': if self.collect == 0: self.collect = 1 elif self.collect == 1: self.collect = 0 elif self.collect == 1: cache2.append(cache1[i]) self.ORDER = cache2 self.ARRAY = [] self.GLOBALi = 0 self.GLOBALmax = range(len(self.ORDER)) self.GLOBALc = [] self.GLOBALl = [] def sorter(self, array): CACHE_LIST_1 = [] CACHE_LIST_2 = [] i = 0 for ORDERi in range(len(self.ORDER)): for ARRAYi in range(len(array)): CACHE = array[ARRAYi] if CACHE[self.GLOBALi] == self.ORDER[ORDERi]: CACHE_LIST_1.append(CACHE) else: CACHE_LIST_2.append(CACHE) for i in range(len(CACHE_LIST_1)): if CACHE_LIST_1[0] == CACHE_LIST_1[i] or range(len(CACHE_LIST_1)) == 1: switch = 1 print ('1') else: switch = 0 print ('0') break if switch == 1: self.GLOBALl += CACHE_LIST_1 + self.GLOBALc self.GLOBALi = 0 self.GLOBALc = [] else: self.GLOBALi += 1 self.GLOBALc += CACHE_LIST_2 mysrt.sorter(CACHE) return (self.GLOBALl) #GLOBALi =0 # if range(len(self.GLOBALc)) =! range(len(self.ARRAY)) array = ['ape', 'cow','dog','bat'] ORDER_FILE = [] mysort = mysrt() print (mysort.sorter(array))

    Read the article

  • Python 3.1.1 Problem With Tuples

    - by Protean
    This piece of code is supposed to go through a list and preform some formatting to the items, such as removing quotations, and then saving it to another list. class process: def rchr(string_i, asciivalue): string_o = () for i in range(len(string_i)): if ord(string_i[i]) != asciivalue: string_o += string_i[i] return string_o def flist(self, list_i): cache = () cache_list = [] for line in list_i: cache = line.split('\t') cacbe[0] = process.rchr(str(cache[0]), 34) cache_list.append(cache[0]) cache_list[index] = cache index += 1 cache_list.sort() return cache_list p = process() list1a = ['cow', 'dog', '"sheep"'] list1 = p.flist(list1a) print (country_list) However; it chokes at 'string_o += string_i[i]' and gives the following error: Traceback (most recent call last): File "/Projects/Python/safafa.py", line 23, in <module> list1 = p.flist(list1a) File "/Projects/Python/safafa.py", line 14, in flist cacbe[0] = process.rchr(str(cache[0]), 34) File "/Projects/Python/safafa.py", line 7, in rchr string_o += string_i[i] TypeError: can only concatenate tuple (not "str") to tuple

    Read the article

  • Python's equivalence?

    - by user304014
    Is there anyway to transform the following code in Java to Python's equivalence? public class Animal{ public enum AnimalBreed{ Dog, Cat, Cow, Chicken, Elephant } private static final int Animals = AnimalBreed.Dog.ordinal(); private static final String[] myAnimal = new String[Animals]; private static Animal[] animal = new Animal[Animals]; public static final Animal DogAnimal = new Animal(AnimalBreed.Dog, "woff"); public static final Animal CatAnimal = new Animal(AnimalBreed.Cat, "meow"); private AnimalBreed breed; public static Animal myDog (String name) { return new Animal(AnimalBreed.Dog, name); } }

    Read the article

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