Search Results

Search found 8247 results on 330 pages for 'smart phone'.

Page 51/330 | < Previous Page | 47 48 49 50 51 52 53 54 55 56 57 58  | Next Page >

  • How backward compatible are the HSDPA mobile networks

    - by Chris Kimpton
    Hi, I have got this Huawei wifi device, which has been unlocked for other networks. Works fine in UK on Vodafone (as well as 3). We are trying to get it to work with the Claro network in Jamaica. It connects and stays connected, but fails to get a 3g connection, just the slow EDGE one. Claro support say its because Claro currently does not support the 2100MHz frequency for 3G, which is what the device uses Does that sound correct? They say I need one that: Ensure however that these devices can use the 850MHz frequency. My understanding was that the device supports up to 2100, including their 850mhz... I am thinking that maybe the APN is incorrect, but I have set it to the only value I can find on the net, namely: internet.ideasclaro.com.jm Thanks in advance, Chris

    Read the article

  • Is my hard drive about to die?

    - by Hristo Deshev
    I have two hard drives set up as a RAID 1 array on my server (Linux, software RAID using mdadm) and one of them just got me this "present" in syslog: Nov 23 02:05:29 h2 kernel: [7305215.338153] ata1.00: exception Emask 0x0 SAct 0x1 SErr 0x0 action 0x0 Nov 23 02:05:29 h2 kernel: [7305215.338178] ata1.00: irq_stat 0x40000008 Nov 23 02:05:29 h2 kernel: [7305215.338197] ata1.00: failed command: READ FPDMA QUEUED Nov 23 02:05:29 h2 kernel: [7305215.338220] ata1.00: cmd 60/08:00:d8:df:da/00:00:3a:00:00/40 tag 0 ncq 4096 in Nov 23 02:05:29 h2 kernel: [7305215.338221] res 41/40:08:d8:df:da/00:00:3a:00:00/00 Emask 0x409 (media error) <F> Nov 23 02:05:29 h2 kernel: [7305215.338287] ata1.00: status: { DRDY ERR } Nov 23 02:05:29 h2 kernel: [7305215.338305] ata1.00: error: { UNC } Nov 23 02:05:29 h2 kernel: [7305215.358901] ata1.00: configured for UDMA/133 Nov 23 02:05:32 h2 kernel: [7305218.269054] ata1.00: exception Emask 0x0 SAct 0x1 SErr 0x0 action 0x0 Nov 23 02:05:32 h2 kernel: [7305218.269081] ata1.00: irq_stat 0x40000008 Nov 23 02:05:32 h2 kernel: [7305218.269101] ata1.00: failed command: READ FPDMA QUEUED Nov 23 02:05:32 h2 kernel: [7305218.269125] ata1.00: cmd 60/08:00:d8:df:da/00:00:3a:00:00/40 tag 0 ncq 4096 in Nov 23 02:05:32 h2 kernel: [7305218.269126] res 41/40:08:d8:df:da/00:00:3a:00:00/00 Emask 0x409 (media error) <F> Nov 23 02:05:32 h2 kernel: [7305218.269196] ata1.00: status: { DRDY ERR } Nov 23 02:05:32 h2 kernel: [7305218.269215] ata1.00: error: { UNC } Nov 23 02:05:32 h2 kernel: [7305218.341565] ata1.00: configured for UDMA/133 Nov 23 02:05:35 h2 kernel: [7305221.193342] ata1.00: exception Emask 0x0 SAct 0x1 SErr 0x0 action 0x0 Nov 23 02:05:35 h2 kernel: [7305221.193368] ata1.00: irq_stat 0x40000008 Nov 23 02:05:35 h2 kernel: [7305221.193386] ata1.00: failed command: READ FPDMA QUEUED Nov 23 02:05:35 h2 kernel: [7305221.193408] ata1.00: cmd 60/08:00:d8:df:da/00:00:3a:00:00/40 tag 0 ncq 4096 in Nov 23 02:05:35 h2 kernel: [7305221.193409] res 41/40:08:d8:df:da/00:00:3a:00:00/00 Emask 0x409 (media error) <F> Nov 23 02:05:35 h2 kernel: [7305221.193474] ata1.00: status: { DRDY ERR } Nov 23 02:05:35 h2 kernel: [7305221.193491] ata1.00: error: { UNC } Nov 23 02:05:35 h2 kernel: [7305221.388404] ata1.00: configured for UDMA/133 Nov 23 02:05:38 h2 kernel: [7305224.426316] ata1.00: exception Emask 0x0 SAct 0x1 SErr 0x0 action 0x0 Nov 23 02:05:38 h2 kernel: [7305224.426343] ata1.00: irq_stat 0x40000008 Nov 23 02:05:38 h2 kernel: [7305224.426363] ata1.00: failed command: READ FPDMA QUEUED Nov 23 02:05:38 h2 kernel: [7305224.426387] ata1.00: cmd 60/08:00:d8:df:da/00:00:3a:00:00/40 tag 0 ncq 4096 in Nov 23 02:05:38 h2 kernel: [7305224.426388] res 41/40:08:d8:df:da/00:00:3a:00:00/00 Emask 0x409 (media error) <F> Nov 23 02:05:38 h2 kernel: [7305224.426459] ata1.00: status: { DRDY ERR } Nov 23 02:05:38 h2 kernel: [7305224.426478] ata1.00: error: { UNC } Nov 23 02:05:38 h2 kernel: [7305224.498133] ata1.00: configured for UDMA/133 Nov 23 02:05:41 h2 kernel: [7305227.400583] ata1.00: exception Emask 0x0 SAct 0x1 SErr 0x0 action 0x0 Nov 23 02:05:41 h2 kernel: [7305227.400608] ata1.00: irq_stat 0x40000008 Nov 23 02:05:41 h2 kernel: [7305227.400627] ata1.00: failed command: READ FPDMA QUEUED Nov 23 02:05:41 h2 kernel: [7305227.400649] ata1.00: cmd 60/08:00:d8:df:da/00:00:3a:00:00/40 tag 0 ncq 4096 in Nov 23 02:05:41 h2 kernel: [7305227.400650] res 41/40:08:d8:df:da/00:00:3a:00:00/00 Emask 0x409 (media error) <F> Nov 23 02:05:41 h2 kernel: [7305227.400716] ata1.00: status: { DRDY ERR } Nov 23 02:05:41 h2 kernel: [7305227.400734] ata1.00: error: { UNC } Nov 23 02:05:41 h2 kernel: [7305227.472432] ata1.00: configured for UDMA/133 From what I read so far, I am not sure if read errors mean that a hard drive is dying on me (no write errors so far). I've had hard drive errors in the past and those always had errors about failing to write to specific sectors in the logs. Not this time. Should I be replacing the drive? Could something else be causing the problem? I've scheduled a smartctl -t long test that will finish in a couple of hours. I hope this will give me some more info.

    Read the article

  • What are the default/best bluetooth packages for Ubuntu 9.10?

    - by Igoru
    I've had some problems with Bluetooth in my Ubuntu 9.10, and ended up by uninstalling everything related. I would like to know what are the default packages for BTH in Ubuntu, and what are your recommendations (like blueman or thing like this). I have a high-end cellphone and would like to use everything that's possible, talking about bluetooth, with it (a samsung scrapy touch, or GT-B3410).

    Read the article

  • Is there such a thing as an IP femtocell, and what does it do?

    - by The Journeyman geek
    My dad mentioned a co-worker suggested using a device, that might use CDMA to route calls through IP to save costs on a certain overseas project we're on- since our home base is quite far from there. I've never heard of such a device, so if it does exist, I'm wondering, if it's specific to particular ISPs, or if you can just pick one off the shelf, plug it into an arbitrary Internet connection, and make calls using it and a cellphone of some sort? As you can tell, details are sketchy, so... if such a device doesn't exist, saying so might be a right answer ;)

    Read the article

  • Why doesn't my Droid phone charge when connected to a powered USB hub that is not connected to my computer?

    - by pkaeding
    I notice that my new Motorola Droid phone charges perfectly fine when I connect it to my computer via the USB cable, or if I connect it to a car cigarette lighter-USB adapter, or a wall power-USB adapter. It also works fine when I connect it to a powered USB hub that is connected to my computer. However, if that same powered USB hub is not connected to my computer when I connect the phone, it does not charge. If I connect the computer to the hub, and then connect the phone to the hub, it will charge. If I then disconnect the computer from the hub, the phone will continue to charge. Does anyone know why this is happening, or what I can do to be able to charge my phone from a powered hub, without my computer being present?

    Read the article

  • Using a PC + headset as a telephone without VOIP

    - by user76782
    I'm trying to find a way to realize a decentralized callcenter, so that the callcenter agents can talk from their home office with just a PC + headset. The big challange is that some of the agents have very low bandwith and the quality with VOIP is too bad. So my question is: What other solutions are possible when VOIP is not a option? What exactly do I need to do if I try to achieve this with for example Landline/PBX or GSM? (e.g. Which software do I need to install? Which device do I need?)

    Read the article

  • How can one associate a 3ware controller with the corresponding /dev/tw?? device?

    - by barbaz
    I have a few 3ware RAID controllers installed in a system. Is there any way to figure out the mapping between the following identifiers, each describing in a way the very same RAID controller? The tw_cli reported controller id (e.g. c0,c1,c2,...) The corresponding device nodes that allow smartctl access via the 3ware driver (e.g. /dev/twa0, /dev/twa1, /dev/twl0) The block device presented to the system representing a RAID unit (/dev/sda, /dev/sdb,...)

    Read the article

  • is there such a thing as a ip femtocell, and what does it do?

    - by The Journeyman geek
    My dad mentioned a co-worker suggested using a device, that might use cdma to route calls through IP to save costs on a certain overseas project we're on- since our home base is quite far from there. I've never heard of such a device, so if it does, i'm wondering, if its specific to particular ISPs, or if you can just pick one off the shelf, plug it into an arbitraty internet connection, and make calls using it and a cellphone of some sort? As you can tell, details are sketchy, so... if such a device dosen't exist, saying so might be a right answer ;)

    Read the article

  • FreeNAS: Can't access shares on a windows 7

    - by rzlines
    I have just setup a FreeNAS server. I have formatted and added a second hard drive. And mounted the data partition of the first hard drive. I have enabled CIFS and added both the hard drives to the shares. My workgroup is default WORKGROUP, I can see other computers on my network. I can access freenas through my browser that's how I configured it. Got one more question do I need to mount my second drive, if I do what partition number do I put, as it keeps giving me the error of using the wrong partition. Also my second drive doesn't show up on the home page as available as I can only see my first drive's space there.

    Read the article

  • iPhone: how to test that a 3Gs is what it says it is?

    - by Mike
    I'm about to buy a second hand iPhone. It's supposedly a 3Gs; hardly used and de-blocked. Is there any way of checking this through the handset before I give over my money? I recently sold my Nokia W72 and the guy I sold it too put in a code and it showed him my usage details? Any advice given is greatly appreciated. Thanks Mike.

    Read the article

  • How can I share data from a Samsung Wave Mobile phone with the Mac OS?

    - by M. Bedi
    This is driving me up the wall just a bit. I have a new Samsung Wave mobile phone. It is running the Bada OS. The mobile phone does not come with anyone software for the Mac. The Kies desktop interface is only available for Windows. I did try installing the Kies software in a VM with Parallels 5 but it did not detect the phone connected via USB. I tried using Bluetooth file exchange on the Mac; it lets me browse the file system on the Wave phone but not actually see any of the media files; I just get empty directory views. But I am able to access files using media sharing with the Wave phone and my PS3. So what would be a Mac desks top app that can be used a media sharing browser?

    Read the article

  • Is it possible to get a google voice number without already having a phone number?

    - by boost
    I'm sorry if this is the wrong place to post this, but I couldn't find a more suitable website in the stackexchange network. I currently have no phone number; I can make outgoing calls via the widget in gmail, but I cannot receive calls (as far as I know). I know that you can set up a google voice number to forward to google chat, and this is exactly what I want. The problem is, I can't get a google voice number in the first place, because it first requires that I have an existing phone number, even if I wouldn't use it. So, it is possible to skip providing an existing phone number, and just get a google voice number that forwards to google chat? Alternatively, is there any free phone service that can be used without a phone and lets you receive calls from any number? I realize I'm kind of asking for free candy, but, if it's out there, I'd be a fool

    Read the article

  • Cannot download or send MMS

    - by CGFoX
    I have a Huawei Honor with Android 4.0.3. I got a plan at AT&T that includes 200 messages (both SMS and MMS) per month. Unfortunately I can neither receive nor send MMS. When I receive one, there's a download-button. But when I hit download it doesn't do anything, even when I got internet connection via wifi. When I try to send a MMS it only says "sending...", but nothing happens. My guess is that I didn't configure the settings correctly, but I couldn't find anything useful online. Also I don't have a single APN. Maybe I need to create one? Thanks for your help!

    Read the article

  • Unreadable sectors reported by smartd, is it serious?

    - by stribika
    I have a RAID 5 array of 4 disks. In the last 2 days I began to see these messages in the log: Jun 13 23:01:05 localhost smartd[4537]: Device: /dev/sda [SAT], 1 Currently unreadable (pending) sectors Jun 13 23:01:05 localhost smartd[4537]: Device: /dev/sdb [SAT], 2 Currently unreadable (pending) sectors If I have 2 faulty disks then the array should not show all disks OK: md0 : active raid1 sdd1[3] sdb1[1] sdc1[2] sda1[0] 64128 blocks [4/4] [UUUU] Strangely there are no other problems just the log messages. I am worried because sda is new and I previously had problems with sdb. (Completely died but the guy who sold it to me fixed it somehow.) Am I in danger of losing data? What should I do now?

    Read the article

  • Receiving and processing SMS messages through a script?

    - by ShankarG
    I am attempting to setup a system to receive and process SMS messages automatically. The system is intended for use in a context (an unfunded migrant workers' union in India) where both finances and sysadmin skills are extremely constrained (I would be the only person, in the near future, who would be administering the system). The intention is to make some functions - registration of members, generation of ID cards, communication of alerts and other information - easier. However, for receiving and sending SMS, I have not been able to find any email to SMS or other kind of gateway that functions in India. Perhaps there is one (edit: apparently Clickatell does have an India service, but the prices appear astronomical). If not, can one rely on a USB mobile modem (such as those provided by many mobile providers in India)? It seems like, with utilities such as gammu or bitpim, SMS operations on such a modem could be scripted. Is this actually feasible, though? Thanks in advance for your thoughts and suggestions. edit: Original first question removed since the two questions had little to do with each other. The original first question has been asked separately here

    Read the article

  • Running Hyper-V and VMWare together

    - by Shiki
    I have two virtualization software on one of my laptops which is dedicated to Windows 8 development. A VMWare for generic virtualization and the Windows 8 like Hyper-V for the WP8 SDK. Unfortunately these softwares don't like each other. Is there a way to get them play along? The exact problem is that if I install the SDK, VMWare won't even update or run. There is only one way to make them work. Switch Hyper-V on and off. Which is one restart all the time.

    Read the article

  • Tool to test HDD for health?

    - by Ognjen
    I've had my HDD replaced, and now my computer is freezing every 1 to 5 minutes for 5 to 10 seconds. Actually, only active applications freeze (but it can be ANY application), usually when I click something, but sometimes by themselves. How can I check if this is HDD issue or software issue? I don't want to send my laptop for second HDD replacement right away, since the last service took 40 days, so I am looking for a tool that could confirm that this is a HDD issue.

    Read the article

  • Quick method to determine SSD drive health?

    - by ewwhite
    I have an Intel X-25M drive that was marked "failed" twice in a ZFS storage array, as noted here. However, after removing the drive, it seems to to mount, read and write in other computers (Mac, PC, USB enclosure, etc.) Is there a good way to determine the drive's present health? I feel that the previous failure in the ZFS solution was the convergence of bugs, bad error reporting and hardware. It seems like this drive may have some life in it, though.

    Read the article

  • jQuery Templates and Data Linking (and Microsoft contributing to jQuery)

    - by ScottGu
    The jQuery library has a passionate community of developers, and it is now the most widely used JavaScript library on the web today. Two years ago I announced that Microsoft would begin offering product support for jQuery, and that we’d be including it in new versions of Visual Studio going forward. By default, when you create new ASP.NET Web Forms and ASP.NET MVC projects with VS 2010 you’ll find jQuery automatically added to your project. A few weeks ago during my second keynote at the MIX 2010 conference I announced that Microsoft would also begin contributing to the jQuery project.  During the talk, John Resig -- the creator of the jQuery library and leader of the jQuery developer team – talked a little about our participation and discussed an early prototype of a new client templating API for jQuery. In this blog post, I’m going to talk a little about how my team is starting to contribute to the jQuery project, and discuss some of the specific features that we are working on such as client-side templating and data linking (data-binding). Contributing to jQuery jQuery has a fantastic developer community, and a very open way to propose suggestions and make contributions.  Microsoft is following the same process to contribute to jQuery as any other member of the community. As an example, when working with the jQuery community to improve support for templating to jQuery my team followed the following steps: We created a proposal for templating and posted the proposal to the jQuery developer forum (http://forum.jquery.com/topic/jquery-templates-proposal and http://forum.jquery.com/topic/templating-syntax ). After receiving feedback on the forums, the jQuery team created a prototype for templating and posted the prototype at the Github code repository (http://github.com/jquery/jquery-tmpl ). We iterated on the prototype, creating a new fork on Github of the templating prototype, to suggest design improvements. Several other members of the community also provided design feedback by forking the templating code. There has been an amazing amount of participation by the jQuery community in response to the original templating proposal (over 100 posts in the jQuery forum), and the design of the templating proposal has evolved significantly based on community feedback. The jQuery team is the ultimate determiner on what happens with the templating proposal – they might include it in jQuery core, or make it an official plugin, or reject it entirely.  My team is excited to be able to participate in the open source process, and make suggestions and contributions the same way as any other member of the community. jQuery Template Support Client-side templates enable jQuery developers to easily generate and render HTML UI on the client.  Templates support a simple syntax that enables either developers or designers to declaratively specify the HTML they want to generate.  Developers can then programmatically invoke the templates on the client, and pass JavaScript objects to them to make the content rendered completely data driven.  These JavaScript objects can optionally be based on data retrieved from a server. Because the jQuery templating proposal is still evolving in response to community feedback, the final version might look very different than the version below. This blog post gives you a sense of how you can try out and use templating as it exists today (you can download the prototype by the jQuery core team at http://github.com/jquery/jquery-tmpl or the latest submission from my team at http://github.com/nje/jquery-tmpl).  jQuery Client Templates You create client-side jQuery templates by embedding content within a <script type="text/html"> tag.  For example, the HTML below contains a <div> template container, as well as a client-side jQuery “contactTemplate” template (within the <script type="text/html"> element) that can be used to dynamically display a list of contacts: The {{= name }} and {{= phone }} expressions are used within the contact template above to display the names and phone numbers of “contact” objects passed to the template. We can use the template to display either an array of JavaScript objects or a single object. The JavaScript code below demonstrates how you can render a JavaScript array of “contact” object using the above template. The render() method renders the data into a string and appends the string to the “contactContainer” DIV element: When the page is loaded, the list of contacts is rendered by the template.  All of this template rendering is happening on the client-side within the browser:   Templating Commands and Conditional Display Logic The current templating proposal supports a small set of template commands - including if, else, and each statements. The number of template commands was deliberately kept small to encourage people to place more complicated logic outside of their templates. Even this small set of template commands is very useful though. Imagine, for example, that each contact can have zero or more phone numbers. The contacts could be represented by the JavaScript array below: The template below demonstrates how you can use the if and each template commands to conditionally display and loop the phone numbers for each contact: If a contact has one or more phone numbers then each of the phone numbers is displayed by iterating through the phone numbers with the each template command: The jQuery team designed the template commands so that they are extensible. If you have a need for a new template command then you can easily add new template commands to the default set of commands. Support for Client Data-Linking The ASP.NET team recently submitted another proposal and prototype to the jQuery forums (http://forum.jquery.com/topic/proposal-for-adding-data-linking-to-jquery). This proposal describes a new feature named data linking. Data Linking enables you to link a property of one object to a property of another object - so that when one property changes the other property changes.  Data linking enables you to easily keep your UI and data objects synchronized within a page. If you are familiar with the concept of data-binding then you will be familiar with data linking (in the proposal, we call the feature data linking because jQuery already includes a bind() method that has nothing to do with data-binding). Imagine, for example, that you have a page with the following HTML <input> elements: The following JavaScript code links the two INPUT elements above to the properties of a JavaScript “contact” object that has a “name” and “phone” property: When you execute this code, the value of the first INPUT element (#name) is set to the value of the contact name property, and the value of the second INPUT element (#phone) is set to the value of the contact phone property. The properties of the contact object and the properties of the INPUT elements are also linked – so that changes to one are also reflected in the other. Because the contact object is linked to the INPUT element, when you request the page, the values of the contact properties are displayed: More interesting, the values of the linked INPUT elements will change automatically whenever you update the properties of the contact object they are linked to. For example, we could programmatically modify the properties of the “contact” object using the jQuery attr() method like below: Because our two INPUT elements are linked to the “contact” object, the INPUT element values will be updated automatically (without us having to write any code to modify the UI elements): Note that we updated the contact object above using the jQuery attr() method. In order for data linking to work, you must use jQuery methods to modify the property values. Two Way Linking The linkBoth() method enables two-way data linking. The contact object and INPUT elements are linked in both directions. When you modify the value of the INPUT element, the contact object is also updated automatically. For example, the following code adds a client-side JavaScript click handler to an HTML button element. When you click the button, the property values of the contact object are displayed using an alert() dialog: The following demonstrates what happens when you change the value of the Name INPUT element and click the Save button. Notice that the name property of the “contact” object that the INPUT element was linked to was updated automatically: The above example is obviously trivially simple.  Instead of displaying the new values of the contact object with a JavaScript alert, you can imagine instead calling a web-service to save the object to a database. The benefit of data linking is that it enables you to focus on your data and frees you from the mechanics of keeping your UI and data in sync. Converters The current data linking proposal also supports a feature called converters. A converter enables you to easily convert the value of a property during data linking. For example, imagine that you want to represent phone numbers in a standard way with the “contact” object phone property. In particular, you don’t want to include special characters such as ()- in the phone number - instead you only want digits and nothing else. In that case, you can wire-up a converter to convert the value of an INPUT element into this format using the code below: Notice above how a converter function is being passed to the linkFrom() method used to link the phone property of the “contact” object with the value of the phone INPUT element. This convertor function strips any non-numeric characters from the INPUT element before updating the phone property.  Now, if you enter the phone number (206) 555-9999 into the phone input field then the value 2065559999 is assigned to the phone property of the contact object: You can also use a converter in the opposite direction also. For example, you can apply a standard phone format string when displaying a phone number from a phone property. Combining Templating and Data Linking Our goal in submitting these two proposals for templating and data linking is to make it easier to work with data when building websites and applications with jQuery. Templating makes it easier to display a list of database records retrieved from a database through an Ajax call. Data linking makes it easier to keep the data and user interface in sync for update scenarios. Currently, we are working on an extension of the data linking proposal to support declarative data linking. We want to make it easy to take advantage of data linking when using a template to display data. For example, imagine that you are using the following template to display an array of product objects: Notice the {{link name}} and {{link price}} expressions. These expressions enable declarative data linking between the SPAN elements and properties of the product objects. The current jQuery templating prototype supports extending its syntax with custom template commands. In this case, we are extending the default templating syntax with a custom template command named “link”. The benefit of using data linking with the above template is that the SPAN elements will be automatically updated whenever the underlying “product” data is updated.  Declarative data linking also makes it easier to create edit and insert forms. For example, you could create a form for editing a product by using declarative data linking like this: Whenever you change the value of the INPUT elements in a template that uses declarative data linking, the underlying JavaScript data object is automatically updated. Instead of needing to write code to scrape the HTML form to get updated values, you can instead work with the underlying data directly – making your client-side code much cleaner and simpler. Downloading Working Code Examples of the Above Scenarios You can download this .zip file to get with working code examples of the above scenarios.  The .zip file includes 4 static HTML page: Listing1_Templating.htm – Illustrates basic templating. Listing2_TemplatingConditionals.htm – Illustrates templating with the use of the if and each template commands. Listing3_DataLinking.htm – Illustrates data linking. Listing4_Converters.htm – Illustrates using a converter with data linking. You can un-zip the file to the file-system and then run each page to see the concepts in action. Summary We are excited to be able to begin participating within the open-source jQuery project.  We’ve received lots of encouraging feedback in response to our first two proposals, and we will continue to actively contribute going forward.  These features will hopefully make it easier for all developers (including ASP.NET developers) to build great Ajax applications. Hope this helps, Scott P.S. [In addition to blogging, I am also now using Twitter for quick updates and to share links. Follow me at: twitter.com/scottgu]

    Read the article

  • Phone-book Database Help - Python

    - by IDOntWantThat
    I'm new to programming and have an assignment I've been working at for awhile. I understand defining functions and a lot of the basics but I'm kind of running into a brick wall at this point. I'm trying to figure this one out and don't really understand how the 'class' feature works yet. I'd appreciate any help with this one; also any help with some python resources that have can dummy down how/why classes are used. You've been going to work on a database project at work for sometime now. Your boss encourages you to program the database in Python. You disagree, arguing that Python is not a database language but your boss persists by providing the source code below for a sample telephone database. He asks you to do two things: Evaluate the existing source code and extend it to make it useful for managers in the firm. (You do not need a GUI interface, just work on the database aspects: data entry and retrieval - of course you must get the program to run or properly work He wants you to critically evaluate Python as a database tool. Import the sample code below into the Python IDLE and enhance it, run it and debug it. Add features to make this a more realistic database tool by providing for easy data entry and retrieval. import shelve import string UNKNOWN = 0 HOME = 1 WORK = 2 FAX = 3 CELL = 4 class phoneentry: def __init__(self, name = 'Unknown', number = 'Unknown', type = UNKNOWN): self.name = name self.number = number self.type = type # create string representation def __repr__(self): return('%s:%d' % ( self.name, self.type )) # fuzzy compare or two items def __cmp__(self, that): this = string.lower(str(self)) that = string.lower(that) if string.find(this, that) >= 0: return(0) return(cmp(this, that)) def showtype(self): if self.type == UNKNOWN: return('Unknown') if self.type == HOME: return('Home') if self.type == WORK: return('Work') if self.type == FAX: return('Fax') if self.type == CELL: return('Cellular') class phonedb: def __init__(self, dbname = 'phonedata'): self.dbname = dbname; self.shelve = shelve.open(self.dbname); def __del__(self): self.shelve.close() self.shelve = None def add(self, name, number, type = HOME): e = phoneentry(name, number, type) self.shelve[str(e)] = e def lookup(self, string): list = [] for key in self.shelve.keys(): e = self.shelve[key] if cmp(e, string) == 0: list.append(e) return(list) # if not being loaded as a module, run a small test if __name__ == '__main__': foo = phonedb() foo.add('Sean Reifschneider', '970-555-1111', HOME) foo.add('Sean Reifschneider', '970-555-2222', CELL) foo.add('Evelyn Mitchell', '970-555-1111', HOME) print 'First lookup:' for entry in foo.lookup('reifsch'): print '%-40s %s (%s)' % ( entry.name, entry.number, entry.showtype() ) print print 'Second lookup:' for entry in foo.lookup('e'): print '%-40s %s (%s)' % ( entry.name, entry.number, entry.showtype() ) I'm not sure if I'm on the right track but here is what I have so far: def openPB(): foo = phonedb() print 'Please select an option:' print '1 - Lookup' print '2 - Add' print '3 - Delete' print '4 - Quit' entry=int(raw_input('>> ')) if entry==1: namelookup=raw_input('Please enter a name: ') for entry in foo.lookup(namelookup): print '%-40s %s (%s)' % (entry.name, entry.number, entry.showtype() ) elif entry==2: name=raw_input('Name: ') number=raw_input('Number: ') showtype=input('Type (UNKNOWN, HOME, WORK, FAX, CELL): \n>> ') for entry in foo.add(name, number, showtype): #Trying to figure out this part print '%-40s %s (%s)'% (entry.name, entry.number, entry.showtype() ) elif entry==3: delname=raw_input('Please enter a name to delete: ') # #Trying to figure out this part print "Contact '%s' has been deleted" (delname) elif entry==4: print "Phone book is now closed" quit else: print "Your entry was not recognized." openPB() openPB()

    Read the article

< Previous Page | 47 48 49 50 51 52 53 54 55 56 57 58  | Next Page >