Search Results

Search found 1666 results on 67 pages for 'andrew'.

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

  • How to refactor and improve this XNA mouse input code?

    - by Andrew Price
    Currently I have something like this: public bool IsLeftMouseButtonDown() { return currentMouseState.LeftButton == ButtonState.Pressed && previousMouseSate.LeftButton == ButtonState.Pressed; } public bool IsLeftMouseButtonPressed() { return currentMouseState.LeftButton == ButtonState.Pressed && previousMouseSate.LeftButton == ButtonState.Released; } public bool IsLeftMouseButtonUp() { return currentMouseState.LeftButton == ButtonState.Released && previousMouseSate.LeftButton == ButtonState.Released; } public bool IsLeftMouseButtonReleased() { return currentMouseState.LeftButton == ButtonState.Released && previousMouseSate.LeftButton == ButtonState.Pressed; } This is fine. In fact, I kind of like it. However, I'd hate to have to repeat this same code five times (for right, middle, X1, X2). Is there any way to pass in the button I want to the function so I could have something like this? public bool IsMouseButtonDown(MouseButton button) { return currentMouseState.IsPressed(button) && previousMouseState.IsPressed(button); } public bool IsMouseButtonPressed(MouseButton button) { return currentMouseState.IsPressed(button) && !previousMouseState.IsPressed(button); } public bool IsMouseButtonUp(MouseButton button) { return !currentMouseState.IsPressed(button) && previousMouseState.IsPressed(button); } public bool IsMouseButtonReleased(MouseButton button) { return !currentMouseState.IsPressed(button) && previousMouseState.IsPressed(button); } I suppose I could create some custom enumeration and switch through it in each function, but I'd like to first see if there is a built-in solution or a better way.. Thanks!

    Read the article

  • How do I account for changed or forgotten tasks in an estimate?

    - by Andrew
    To handle task-level estimates and time reporting, I have been using (roughly) the technique that Steve McConnell describes in Chapter 10 of Software Estimation. Specifically, when the time comes for me to create task-level estimates (right before coding begins on a project), I determine the tasks at a fairly granular level so that, whenever possible, I have no tasks with a single-point, 50%-confidence estimate greater than four hours. That way, the task estimation process helps with constructing the software while helping me not to forget tasks during estimation. I come up with a range of hours possible for each task also, and using the statistical calculations that McConnell describes along with my historical accuracy data, I can generate estimates at other confidence levels when desired. I feel like this method has been working fairly well for me. We are required to put tasks and their estimates into TFS for tracking, so I use the estimates at the percentage of confidence I am told to use. I am unsure, however, what to do when I do forget a task, or I end up needing to do work that does not neatly fall within one of the tasks I estimated. Of course, trying to avoid this situation is best, but how do I account for forgotten/changed tasks? I want to have the best historical data I can to help me with future estimates, but right now, I basically am just calculating whether I made the 50%-confidence estimate and whether I made it inside the ranged estimate. I'll be happy to clarify what I'm asking if needed -- let me know what is unclear.

    Read the article

  • Installing gdm on headless Server Edition

    - by Andrew Koester
    I have Ubuntu Server running on a headless box, which is right now, almost entirely doing only software RAID and feels a little underused. I'd like to get into using Ubuntu as a desktop a little more. What do I need to do (install/etc.) to get Gnome while keeping the box itself headless? I'm not sure which packages to install or which steps to take. I figure I'll just use X over the network (Xming or the like) but something like NX might work.

    Read the article

  • Make the sound louder in Lubuntu

    - by Andrew
    I have a Toshiba r835 running Lubuntu 11.10. Turning the volume slider up all the way doesn't give very loud sound. I've tried typing alsamixer in a terminal and turning up all the levels there to maximum, but the speakers are still fairly quiet. Is there a simple way to increase maximum volume in software? I understand that there are physical limits to the sound the laptop's speakers can produce, but I suspect my maximum volume is limited by software. EDIT: This is exactly the type of solution I'm looking for. However, it doesn't work for me. What I did: sudo pico /etc/asound.conf This file does not exist, so I create a new one, containing: pcm.!default { type plug slave.pcm "softvol" } pcm.softvol { type softvol slave { pcm "dmix" } control { name "Pre-Amp" card 0 } min_dB -5.0 max_dB 20.0 resolution 6 } I reboot the machine, and type alsamixer. I use my left/right arrow keys to inspect the various volume options. I expect to see a new option, called Pre-Amp, but I don't see one. This fix seems to work for other people. Why doesn't this fix work for me?

    Read the article

  • An alternative to a video codec for storing motion changes [on hold]

    - by Andrew Simpson
    I have a 3 dimensional byte array. The 3-d array represents a jpeg image. Each channel/array represents part of the RGB spectrum. I am not interested in retaining black pixels. A black pixel is represented by this atypical arrangement: myarray[0,0,0] =0; myarray[0,0,1] =0; myarray[0,0,2] =0; So, I have flattened this 3d array out to a 1d array by doing this byte[] AFlatArray = new byte[width x height x 3] and then assigning values respective to the coordinate. But like I said I do not want black pixels. So this array has to only contain color pixels with the x,y coordinate. The result I want is to re-represent the image from the i dimension byte array that only contains non-black pixels. How do I do that? It looks like I have to store black pixels as well because of the xy coordinate system. I have tried writing to a binary file but the size of that file is greater than the jpeg file as the jpeg file is compressed. I am using c#.

    Read the article

  • Trying not to get ahead of myself but it is hard!

    - by Andrew
    Well I made a 5 year plan for myself (11years-16years) I am pretty good at Java, HTML, and PHP. I have already done some end projects: Small Java Platform Game A Small Polynomial Solver A Small Image Sharing Site A Chess Website: chesslounge.net I am currently doing some Android Development and so far I have made a program that Vibrates, Blinks the Light, or Creates a custom status message based on the user input. And a program that rotates a pyramid with a texture. My question is: Should I stick to what I am doing or Learn something a little new? I am itching to do C++, but what is your advice?

    Read the article

  • Design pattern for logging changes in parent/child objects saved to database

    - by andrew
    I’ve got a 2 database tables in parent/child relationship as one-many. I’ve got three classes representing the data in these two tables: Parent Class { Public int ID {get; set;} .. other properties } Child Class { Public int ID {get;set;} Public int ParentID {get; set;} .. other properties } TogetherClass { Public Parent Parent; Public List<Child> ChildList; } Lastly I’ve got a client and server application – I’m in control of both ends so can make changes to both programs as I need to. Client makes a request for ParentID and receives a Together Class for the matching parent, and all of the child records. The client app may make changes to the children – add new children, remove or modify existing ones. Client app then sends the Together Class back to the server app. Server app needs to update the parent and child records in the database. In addition I would like to be able to log the changes – I’m doing this by having 2 separate tables one for Parent, one for child; each containing the same columns as the original plus date time modified, by whom and a list of the changes. I’m unsure as to the best approach to detect the changes in records – new records, records to be deleted, records with no fields changed, records with some fields changed. I figure I need to read the parent & children records and compare those to the ones in the Together Class. Strategy A: If Together class’s child record has an ID of say 0, that indicates a new record; insert. Any deleted child records are no longer in the Together Class; see if any of the comparison child records are not found in the Together class and delete if not found (Compare using ID). Check each child record for changes and if changed log. Strategy B: Make a new Updated TogetherClass UpdatedClass { Public Parent Parent {get; set} Public List<Child> ListNewChild {get;set;} Public List<Child> DeletedChild {get;set;} Public List<Child> ExistingChild {get;set;} // used for no changes and modified rows } And then process as per the list. The reason why I’m asking for ideas is that both of these solutions don’t seem optimal to me and I suspect this problem has been solved already – some kind of design pattern ? I am aware of one potential problem in this general approach – that where Client App A requests a record; App B requests same record; A then saves changes; B then saves changes which may overwrite changes A made. This is a separate locking issue which I’ll raise a separate question for if I’ve got trouble implementing. The actual implementation is c#, SQL Server and WCF between client and server - sharing a library containing the class implementations. Apologies if this is a duplicate post – I tried searching various terms without finding a match though.

    Read the article

  • Dealing with state problems in functional programming

    - by Andrew Martin
    I've learned how to program primarily from an OOP standpoint (like most of us, I'm sure), but I've spent a lot of time trying to learn how to solve problems the functional way. I have a good grasp on how to solve calculational problems with FP, but when it comes to more complicated problems I always find myself reverting to needing mutable objects. For example, if I'm writing a particle simulator, I will want particle "objects" with a mutable position to update. How are inherently "stateful" problems typically solved using functional programming techniques?

    Read the article

  • Problems after installing Ubuntu 11.10

    - by Andrew Orr
    I'm having trouble with Ubuntu 11.10. It has to do with nomodeset. After I boot into Ubuntu, it goes to a purple screen for about 10 seconds and then goes blank. After that nothing happens. I've read other people's questions about this and I know it has to do with enabling nomodeset. This worked for me when I was using the LiveCD mode, but now Ubuntu is permanently installed as a dual-boot system. Going into recovery mode doesn't work, pressing "e" in the boot loader and writing nomodeset after quiet splash doesn't work either. Holding shift any time it's booting doesn't work. I don't know what to do anymore. I have an HP Pavilion dv6 laptop with an AMD A6-3400M CPU, and my GPU is an AMD Radeon HD 6520G. I've never worked with Linux before so taking me through this step-by-step would be great. Thanks!

    Read the article

  • How to get MAC address from c# [migrated]

    - by Andrew Simpson
    I have a C# application. In a routine I have code to get the MAC address from using SendARP. It works on Windows 7 but does not work on Windows XP. I just get a null string returned. This is my code. Thanks... System.Runtime.InteropServices.DllImport("iphlpapi.dll", ExactSpelling = true)] static extern int SendARP(int DestIP, int SrcIP, byte[] pMacAddr, ref int PhyAddrLen); public static PhysicalAddress GetMacAddress(IPAddress ipAddress) { const int MacAddressLength = 6; //i know it is has a length of 6 int length = MacAddressLength; var macBytes = new byte[MacAddressLength]; SendARP(BitConverter.ToInt32(ipAddress.GetAddressBytes(), 0), 0, macBytes, ref length); return new PhysicalAddress(macBytes); }

    Read the article

  • How to manage product backlog/user stories

    - by Andrew Stephens
    We're about to start a new project using Agile (using TFS), and I have a couple of "good practice" questions regarding the product backlog:- When we first start adding users stories, is it a good idea to put them in (say) a "Backlog" iteration, or just leave their iteration blank? Obviously when the time comes to start work on a US it would be moved into the appropriate iteration backlog. When breaking an epic down into smaller USs, would I simply close the original epic, as it's no longer required? Or should I create the new USs as children of the epic? (it's then someone's responsibility to close the epic once all child USs have been completed). Lastly, should the product backlog list all USs regardless of status, or only those that have not been started (i.e in my proposed "Backlog" iteration)? I realise these questions aren't life-or-death, but it would be nice to know how other people manage their product backlogs so we can organise things properly from the start.

    Read the article

  • Fedora login gone after Ubuntu updates on a dual boot

    - by andrew
    After a software update for Ubuntu, my dual boot with Fedora will not show Fedora in the start menu. It just boots into Ubuntu and when I hold Shift and boot, it only has Ubuntu in the list. I have tried the post about installing grub-customizer but when I run that, I get Reading package lists... Done Building dependency tree Reading state information... Done E: Unable to locate package grub-customizer I cannot find any other way to fix this problem. I am a complete newbie to Linux.

    Read the article

  • Text reverses on remote gnome session

    - by Andrew Stern
    I have two computers running 10.4 . The first machine is a wired desktop with sshd. The second is a wifi connected laptop with the ssh client. When I use my laptop to bring up a remote gnome session to my desktop all the text gets reversed. Steps: 1) login as a user on the laptop to activate the wifi with a stored key. 2) goto a console Ctrl-Alt F1 3) do a xterm -- :1 to bring up a blank graphic session 4) ssh -Y user@desktopmachine gnome-session This shows reversed text and messes up the keyboard so I can't type

    Read the article

  • Can non-IT people handle a wiki?

    - by Andrew Heath
    (I'm hoping that some of you will have encountered this issue before and can offer some insights...) My company is looking to improve their market research data management. Current data management style: "Hey Jimbo, where's that picture of our WhatZit 2.0? "yeah I remember that email about that company from that guy, gimme a few minutes to search my Outlook" "who has the newest copy of the Important Competitor's product catalogue? Mine is from '09." ... "Colleen does, and she's on maternity leave. You'll have to call her to get her workstation password..." Desired data management style: data organized neatly by topic (legal, economic, industrial, competitor) for each topic, multiple media types stored together (company product images, press releases, contact info) but still neatly sorted by type data editing histories communal access (no data silos) I was thinking about setting up a department wiki for all users to access. It seems to satisfy the four criteria above, but I'm a little concerned about how user-friendly (read: decipherable to non-technical people) it is for the more advanced features like image galleries, article formatting, and the like. Has anyone here setup a wiki for non-IT people and had it not catch on fire//become a ghost town//look like Geocities? Bonus question: can you see any obvious drawbacks to my choice of MediaWiki (or any other wiki) for solving this problem? Thank you.

    Read the article

  • Problem with Free sapce

    - by Andrew Neely
    I was zeroing out the free space on my Ubuntu 12.04 using sfill, when the command stopped responding and I had to reboot the machine. Now, the system says that it has no space left, and that it is running in low graphics mode. Before this happened, I had nearly 500 gig free. df says there are 0 bytes free. df -i reports only 2% of INODES used. I've run fsck and it didn't resolve the issue. What can I do to resolve the issue?

    Read the article

  • Rebuild package from upstream source?

    - by Andrew
    I'm trying to rebuild a package (specifically grub2) to overcome some bugs that have been fixed upstream but not fixed in Ubuntu, and have the package integrate into Ubuntu properly. The package is hosted in bzr both on Launchpad and GNU Savannah. How can convert a "raw" upstream source package into an "Ubuntu" version and recompile/repackage it? I've worked out that I can get the latest Ubuntu version of the package source with apt-get source, but there are significant differences to the upstream version. What is the best course of action here?

    Read the article

  • What use is a Business Logic Layer (BLL)?

    - by Andrew S. Arnold
    In reading up on good practice for database applications I've frequently come across advocates of so-called "business logic layers" and I'm trying to decide if it's best for my project to use one (it's a small personal project). My issue lies in the fact that I can't think of anything for the BLL to do that the DAL can't already handle (executing queries and mapping results to objects), so my BLL just calls the DAL without doing anything itself. Maybe I'm wrong about exactly what the DAL should be doing too. But regardless, what sorts of functionality should be expected of a BLL in a database management application?

    Read the article

  • Can I host a website on a different address from the webmail?

    - by Andrew
    I have what is to me an unusual situation. I have a client for whom I have built a website which I will be hosting, they have been using their domain name for their email addresses for a long period before I came along so moving their email account to my host would be problematic and building the website with their current host would also be problematic because their host is very restrictive. So to fix this I altered the A record in their existing control panel to point the domain name to my server. As a result I can see the pages that I have created at their domain and they can still access their existing webmail. However, it appears that they are now experiencing problems receiving email so I can only assume my solution was incorrect. What is the correct way to point their domain at my website but keep their webmail with the existing host? EDIT: 25/5/2012 - My client has finally responded to me after changing the MX record on their existing C-Panel. Email to their email address were being bounced back with the error 'no such recipient', so I set up the same email address in the new C-Panel and changed the MX record there to 'Remote mail exchanger' which has stopped the emails bouncing but has apparently lost them in cyperspace! Unfortunately I can't add a new record because this would require a fully qualified domain name and their domain name is of course pointed at our server!

    Read the article

  • Sitemaps showing twice in Webmaster Tools

    - by Andrew Lott
    Within my Webmaster Tools account I'm able to able to view details about Sitemaps that are uploaded for websites I manage. For some reason each sitemap is listed twice with the exact same details under both "By me" and "All". Even sites that don't have a sitemap yet tell me I have 0 sitemaps, twice... I originally thought this might apply to sites that have multiple "Users & Site Owners" in Webmaster Tools, but it even happens for sites that only I manage. I've checked other user accounts to compare and this doesn't happen; they just get one set of tabs for By Me/All, not two. What could be causing this?

    Read the article

  • Registration free hosting for ASP.NET web service

    - by Andrew
    I've built a simple ASP.NET web service, tested it locally and would like to test it when externally hosted. Are there free hosting services available where I can just upload the assembly and service description file and test it straight away. Without registering the account, etc. My service does not do anything malicious and I am ok to run it in a restricted (security sandbox, bandwith, calls per second, etc) environment? I have heard about appharbor.com but it looks like an overkill to test a simple web service.

    Read the article

  • Default values - are they good or evil?

    - by Andrew
    The question about default values in general - default return function values, default parameter values, default logic for when something is missing, default logic for handling exceptions, default logic for handling the edge conditions etc. For a long time I considered default values to be a "pure evil" thing, something that "cloaks the catastrophe" and results in a very hard do find bugs. But recently I started to think about default values as some sort of a technical debt ... which is not a straight bad thing but something that could provide some "short term financing" get us to survive the project (how many of us could afford to buy a house without taking out the mortgage?). When I say a "short term" - I don't mean - "do something quickly first and do refactor it out later before it hits the production". No - I am talking about relying on a hardcoded default values in a production software. Granted - it could cause some issues, but what if it only going to cause a single trouble in a whole year. Again - I am talking about the "average" mainstream software here (not a software for a nuclear power station) - the average web site or a UI application for the accounting software, meaning that people lives are not at stake, nor millions of dollars. Again, from my experience, business users would rather live with the software which "works somehow", rather then wait for a perfect one. And the use of default values helps a lot if you develop a software in a RAD style. But again - the longest debug sessions I have spent were because of the bugs introduced by a default value which either stopped being "a default" along the way or because a small subsystem has recently been upgraded and as a result of this upgrade it does not handle the default correctly (e.g. empty list vs null, or null string vs empty string). So my question is - are the default values good or evil. And if they are a technical debt - how do measure up how much you can borrow so you can afford the repayments? Would really appreciate any input. Cheers. EDIT: If I am using the default values as a way to cut the corners during the development - and if the corners cutting results in a bugs and issues - what is the methodology to recover from these issues?

    Read the article

  • How do I set up hosting a domain name at home with Apache?

    - by Andrew McIntyre
    I am relatively new to Ubuntu Linux and I am struggling to figure out the basic set-up of hosting a domain name at home with Apache2. I understand that you have to change your IP from dynamic to a static IP Address but I am not sure how you achieve that step. I am looking for some assistance on this on how to enable self signing certificates, make the domain name resolve on the Internet from hosting the website on the web server, enabling protected directories and the basic commands of accessing the directory where the website files can be uploaded and available on the World Wide Web.

    Read the article

  • How do I consistently activate USB speakers

    - by Andrew.Healy
    I have a pair of Ricco USB speakers. As these are external, I sought to use them with 11.10. They are recognised by 'aplay -l' and Pulseaudio- I have selected them, but, have to reset the volume, every time I log on. I can also only recieve feedback and sound from apps and programs- like Kaffeine- on this boosted volume- I cannot get System Sounds, like logon or logoff. I have tried the alsamixer install that used to work, to no effect. Is their an app that I should be trying or is this feat impossible ? I have tried to delete all the files in .pulse and rebooting or just deletion of the entire .purge directory, as Michael K suggested- neither work as the directory is automatically rewritten on reboot. Ideas?

    Read the article

  • Converting 3 dimension byte array to a single byte array [on hold]

    - by Andrew Simpson
    I have a 3 dimensional byte array. The 3-d array represents a jpeg image. Each channel/array represents part of the RGB spectrum. I am not interested in retaining black pixels. A black pixel is represented by this atypical arrangement: myarray[0,0,0] =0; myarray[0,0,1] =0; myarray[0,0,2] =0; So, I have flattened this 3d array out to a 1d array by doing this byte[] AFlatArray = new byte[width x height x 3] and then assigning values respective to the coordinate. But like I said I do not want black pixels. So this array has to only contain color pixels with the x,y coordinate. The result I want is to re-represent the image from the i dimension byte array that only contains non-black pixels. How do I do that? It looks like I have to store black pixels as well because of the xy coordinate system. I have tried writing to a binary file but the size of that file is greater than the jpeg file as the jpeg file is compressed. I am using c#.

    Read the article

  • Custom ecommerce solution (similar to newegg.com) price [closed]

    - by Andrew
    I am wondering, how much would it cost me to hire a team of developers who could make improved clone of newegg.com ecommerce solution together with the back end? Please give comments based on your experience and realistic measures. Comments like "hire team of freelancers from India -they will do it for $1,000" are not welcome. I am talking about using realistic, quality and proven developers. Maybe good advise on how to approach ecommerce development? Thank you

    Read the article

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