Search Results

Search found 4845 results on 194 pages for 'hand'.

Page 42/194 | < Previous Page | 38 39 40 41 42 43 44 45 46 47 48 49  | Next Page >

  • Avoiding coupling

    - by Seralize
    It is also true that a system may become so coupled, where each class is dependent on other classes that depend on other classes, that it is no longer possible to make a change in one place without having a ripple effect and having to make subsequent changes in many places.[1] This is why using an interface or an abstract class can be valuable in any object-oriented software project. Quote from Wikipedia Starting from scratch I'm starting from scratch with a project that I recently finished because I found the code to be too tightly coupled and hard to refactor, even when using MVC. I will be using MVC on my new project aswell but want to try and avoid the pitfalls this time, hopefully with your help. Project summary My issue is that I really wish to keep the Controller as clean as possible, but it seems like I can't do this. The basic idea of the program is that the user picks wordlists which is sent to the game engine. It will pick random words from the lists until there are none left. Problem at hand My main problem is that the game will have 'modes', and need to check the input in different ways through a method called checkWord(), but exactly where to put this and how to abstract it properly is a challenge to me. I'm new to design patterns, so not sure whether there exist any might fit my problem. My own attempt at abstraction Here is what I've gotten so far after hours of 'refactoring' the design plans, and I know it's long, but it's the best I could do to try and give you an overview (Note: As this is the sketch, anything is subject to change, all help and advice is very welcome. Also note the marked coupling points): Wordlist class Wordlist { // Basic CRUD etc. here! // Other sample methods: public function wordlistCount($user_id) {} // Returns count of how many wordlists a user has public function getAll($user_id) {} // Returns all wordlists of a user } Word class Word { // Basic CRUD etc. here! // Other sample methods: public function wordCount($wordlist_id) {} // Returns count of words in a wordlist public function getAll($wordlist_id) {} // Returns all words from a wordlist public function getWordInfo($word_id) {} // Returns information about a word } Wordpicker class Wordpicker { // The class needs to know which words and wordlists to exclude protected $_used_words = array(); protected $_used_wordlists = array(); // Wordlists to pick words from protected $_wordlists = array(); /* Public Methods */ public function setWordlists($wordlists = array()) {} public function setUsedWords($used_words = array()) {} public function setUsedWordlists($used_wordlists = array()) {} public function getRandomWord() {} // COUPLING POINT! Will most likely need to communicate with both the Wordlist and Word classes /* Protected Methods */ protected function _checkAvailableWordlists() {} // COUPLING POINT! Might need to check if wordlists are deleted etc. protected function _checkAvailableWords() {} // COUPLING POINT! Method needs to get all words in a wordlist from the Word class } Game class Game { protected $_session_id; // The ID of a game session which gets stored in the database along with game details protected $_game_info = array(); // Game instantiation public function __construct($user_id) { if (! $this->_session_id = $this->_gameExists($user_id)) { // New game } else { // Resume game } } // This is the method I tried to make flexible by using abstract classes etc. // Does it even belong in this class at all? public function checkWord($answer, $native_word, $translation) {} // This method checks the answer against the native word / translation word, depending on game mode public function getGameInfo() {} // Returns information about a game session, or creates it if it does not exist public function deleteSession($session_id) {} // Deletes a game session from the database // Methods dealing with game session information protected function _gameExists($user_id) {} protected function _getProgress($session_id) {} protected function _updateProgress($game_info = array()) {} } The Game /* CONTROLLER */ /* "Guess the word" page */ // User input $game_type = $_POST['game_type']; // Chosen with radio buttons etc. $wordlists = $_POST['wordlists']; // Chosen with checkboxes etc. // Starts a new game or resumes one from the database $game = new Game($_SESSION['user_id']); $game_info = $game->getGameInfo(); // Instantiates a new Wordpicker $wordpicker = new Wordpicker(); $wordpicker->setWordlists((isset($game_info['wordlists'])) ? $game_info['wordlists'] : $wordlists); $wordpicker->setUsedWordlists((isset($game_info['used_wordlists'])) ? $game_info['used_wordlists'] : NULL); $wordpicker->setUsedWords((isset($game_info['used_words'])) ? $game_info['used_words'] : NULL); // Fetches an available word if (! $word_id = $wordpicker->getRandomWord()) { // No more words left - game over! $game->deleteSession($game_info['id']); redirect(); } else { // Presents word details to the user $word = new Word(); $word_info = $word->getWordInfo($word_id); } The Bit to Finish /* CONTROLLER */ /* "Check the answer" page */ // ?????????????????? ( http://pastebin.com/cc6MtLTR ) Make sure you toggle the 'Layout Width' to the right for a better view. Thanks in advance. Questions To which extent should objects be loosely coupled? If object A needs info from object B, how is it supposed to get this without losing too much cohesion? As suggested in the comments, models should hold all business logic. However, as objects should be independent, where to glue them together? Should the model contain some sort of "index" or "client" area which connects the dots? Edit: So basically what I should do for a start is to make a new model which I can more easily call with oneliners such as $model->doAction(); // Lots of code in here which uses classes! How about the method for checking words? Should it be it's own object? I'm not sure where I should put it as it's pretty much part of the 'game'. But on another hand, I could just leave out the 'abstraction and OOPness' and make it a method of the 'client model' which will be encapsulated from the controller anyway. Very unsure about this.

    Read the article

  • Are the famous websites handmade? [closed]

    - by Mithun Chuckraverthy
    I'm a newbie in web designing. I always wanted to build a professional quality website by myself. So, I started learning HTML/XHTML and CSS for presentation; and, JavaScript and PHP/MySQL for scripting. I wonder, would the developers of famous websites design them by hand? Or, have they found out any better idea of using softwares? If so, can you tell me what are they? (By the word famous, I mean any websites that are liked by millions of people all over the world. Like: Google, Facebook etc.) Thanks in advance!

    Read the article

  • Compiz runs almost at 100% and the system is slow, what can I do?

    - by Heiner Valverde
    My system became very slow out of the sudden, yesterday Compiz was running extremely smooth, today it started working very slow and slowing the computer. What I've done so far was to resize my swap partition to 6 gigabytes (my computer has 3 gigabytes of RAM), before it was on 5.1 gigabytes, so I though that was the reason of this but still not. Also I tested running only metacity by running metacity --replace and also with Mutter. With metacity works really great no problem but, in the other hand, with mutter the computer works slower than running compiz instead. I am using the Nvidia driver version 173.14.28 and my X Server version as reports the NVidia X Server Settings is the 11.0. My Linux kernel running on this computer is 2.6.35-25-generic and my ubuntu version is 10.10. Any help will be appreciated.

    Read the article

  • Positive reinforcements @ work [closed]

    - by nurne
    I found out that what fuels me to do well at work are positive reinforcements From bosses, colleagues, and customers My current job at a startup is very demanding My boss doesn't have time to give positive reinforcements, and also i'm always behind schedule so maybe i don't deserve positive reinforcements On the other hand i don't get any negative reinforcements, so i guess that as long as this doesn't happen - what i'm doing is ok How is your relationship with bosses colleagues and customers @ work? Do you need positive reinforcements? Do you get them? How do you make them happen? Is there some kind of standard for developers? For hi-tech? Thanks

    Read the article

  • Are python's cryptographic modules good enough?

    - by Aerovistae
    I mean, say you were writing professional grade software that would involve sensitive client information. (Take this in the context of me being an amateur programmer.) Would you use hlib and hmac? Are they good enough to secure data? Or would you write something fancier by hand? Edit: In context of those libraries containing more or less the best hashing algorithms in the world, I guess it's silly to ask if you'd "write something fancier." What I'm really asking here is whether it's enough on its own.

    Read the article

  • How to add a shortcut for Humble Bundle games in Unity?

    - by waspinator
    I downloaded some games from the humblebundle, but most of them don't have deb files. They run fine after extracting them and double clicking on the executable, but unity doesn't automatically find them so I can't search for them, or add them to the side bar. I tried to drag the executable onto the side bar, but it just dimmed and didn't do anything once I dropped it. I also tried to right-click on the executable in and clicked on "Make Link", but I couldn't drop that onto the side bar either. I would prefer a solution that does not require using the terminal or editing configuration files by hand if possible.

    Read the article

  • SEO for images: can I use a different (cookieless) domain?

    - by Oliver
    Hello, We want to increase the value of some of our important images by means of SEO, and we want to start serving them from a different, i.e. cookieless, domain. We want to go from http://www.example.com/images/1234.jpg to http://www.example.com/germany/bavaria/landscape.jpg which can easily be done via URL rewriting. Then on the other hand, we would like to serve the image from a completely different domain, let's say http://www.examplestatic.com/germany/bavaria/landscape.jpg, to save the overhead of sending the cookie from www.example.com. Somehow I feel that this is not a good idea because I move the image away from the content by putting it on a different domain. Can anyone shed some light on this problem? Naturally, I would just use a different subdomain, e.g. img.example.com, but we already use subdomains for languages and our cookies are valid for all subdomains of example.com, so this won't help. I'd really appreciate any hints. Cheers,

    Read the article

  • Listing technologies on a resume for a software position when your background is game programming?

    - by Ford
    So I'm thinking about applying for a entry level position in the software industry but my limited experience working and all my notable experience in college is with game technologies. Sure, the languages transfer over well but most of the technologies I have experience with are all related to graphics programming, engines of various types, and such, and do not transfer over at all. I feel like it would be inappropriate to just take my game programming resume and basically replace the word game with software for the reasons mentioned but on the other hand if I take them out I will only have languages and some technologies that I have some small passing experience with- which will obviously not reflect well on me. Should I leave them out or put them in, and if so how can I spin them to be appropriate?

    Read the article

  • Server 2012R2 – PowerShell Web Access

    - by Waclaw Chrabaszcz
    Originally posted on: http://geekswithblogs.net/Wchrabaszcz/archive/2014/05/17/server-2012r2--powershell-web-access.aspxHaha … Sometimes I'm joking that there is nothing worse than Linux fanboi imprisoned in Windows engineer's body. Maybe someday I will start blogging about my noob's experiences. However let's stick to the point. Sometimes the easiest solutions are the best. After couple of tries how to reach left pocket using right hand I'm going to follow easy path. Today's plan is very easy, I'm going to take advantage of Server 2012 and install Web gateway to PowerShell console. After that I would be able execute PoSH from any device including Linux. Install-WindowsFeature –Name WindowsPowerShellWebAccess –IncludeManagementToolsInstall-PswaWebApplication –UseTestCertificateAdd-PswaAuthorizationRule –UserName * -ComputerName * -ConfigurationName *  Let's test it …

    Read the article

  • Ubuntu 12.04 boot freezes

    - by Lajos Soukup
    I installed win7 on one of my machines. It works without any problem. Now I can not install Ubuntu 12.04 (11.10, 11.04) because the installation process stops in a very early stage: I can see that ISOLinux was loaded, then I can see some very simple icons, then I can see text messages of the kernel. The last message I can see: [6.177983] sr 5:0:0:0: attached scsi general ss1 type 5 At that point the system stops. I tried different versions (11.04) , I disabled, and then disconnected the hdd, but the same problem occured independently from my actions. I can boot a gparted live cd, but that system can not see my hdd. On the other hand, I can boot the installation cd of the latest stable Debian distribution without any problem, but I would prefer to use Ubuntu, because I use that distribution on all of our machines.s Configuration: Asus P8H61-MLE motheboard, Gigabyte GTS 450, Intel i5, 4gb ram, wd 1T sata hdd Any idea? Best regards, Lajos

    Read the article

  • Authenticating users for a website

    - by MCB
    I'm working on a website and I want to validate that an individual is an employee at one of a large number of companies (probably using their company's email address, which I don't know before hand). The idea being some users are the general public and others are from these companies. And I need some way to authenticate that the users claiming to be employees are being honest while still having a friendly enough UI. I did an informal survey of people I know and the domains and emails will match in a majority of cases but they might not always match exactly so you might have a company with a website foo.com and an email [email protected] (although foobar.com did redirect back to foo.com). And while I can easily check that I'm not sure what other variations might be out there (maybe fooLA.com and email [email protected], etc.)

    Read the article

  • System freeze after opening Wi-Fi menu can boot into the machine and use Internet in recovery mode

    - by Michael
    So right now sitting in front of my Alienware area 51 desktop. It has a Broadcom Netlink BCM 5784M gigabit ethernet PCI E card. Most of the time able to get through the login screen and to the main screen if I click on the wireless settings on the top right-hand corner the system immediately freezes the cursor does not move at all keyboards are unresponsive. I was doing some quick Google searching and I found a suggestion to boot into recovery mode I did this and did a apt-get Distribution update which ran successfully installed then I rebooted into the regular system same thing I'm pretty sure it's the network card because even if I don't click the settings if a network related dialog opens such as disconnection or connection the system again immediately freezes. I'm running Ubuntu 13.04 ** update 1 ** Just was able to use my system for a little bit however when I went into Firefox and hit the web it again froze so obviously a driver problem but I'm not sure how to get drivers for Broadcom which apparently according to the description on stack-overflow is terrible Any ideas? Sorry for lack of punctuation on an ipad.

    Read the article

  • QuadTree: store only points, or regions?

    - by alekop
    I am developing a quadtree to keep track of moving objects for collision detection. Each object has a bounding shape, let's say they are all circles. (It's a 2D top-down game) I am unsure whether to store only the position of each object, or the whole bounding shape. If working with points, insertion and subdivision is easy, because objects will never span multiple nodes. On the other hand, a proximity query for an object may miss collisions, because it won't take the objects' dimensions into account. How to calculate the query region when you only have points? If working with regions, how to handle an object that spans multiple nodes? Should it be inserted in the nearest parent node that completely contains it, even if this exceeds the node's capacity? Thanks.

    Read the article

  • Largest successful JavaScript project? [closed]

    - by 80x24 console
    A common theme in the GWT community is "I wouldn't want to build a project of THAT size using a pure JavaScript library!" What is the largest project that you have successfully delivered with frontend functionality written in JavaScript? (not Java or GWT) Please provide at least a hand-wavy SLOC estimate of the unique JS code (not including libraries, frameworks, toolkits, test code, generated code, server-side processing such as PHP, etc.) that was in the finished product. Note to GWT advocates: Please read the question carefully before answering. I've heard plenty of stories about JS failures and GWT successes, but I'd like to hear some quantified JS successes. Note to mods: This is primarily a business-of-software question, not a tools question. It factors into a real-world business decision.

    Read the article

  • Can I toggle word-wrapping on/off quickly in Gedit?

    - by Ivan
    Depending on nature of the text, some times line wrapping is convenient, some times it is just confusing. And every time I need to switch this (pretty frequently) I have to do to View - Preferences - Enable text wrapping - Close - 4 clicks, not mentioning all the hand, eye and thought motion. Can this be done a quicker way? Most of text editors have this 2 clicks away (in a menu) at maximum, some have it on a toolbar or a hot key, but I couldn;t find any quick way in Gedit :-( Maybe there is a hot key I don't know?

    Read the article

  • Programming curricula

    - by davidk01
    There are a lot of schools that teach Java and C++ but whenever I see the syllabus for one of these classes it's almost always some cut and dry OO stuff with possibly some boring end of class project. With all the little gadgets and emulators for those gadgets why aren't more schools re-purposing those classes so that the students work their way up to building android or meego applications? That way students get to experience first hand what it takes to engineer/build a piece of software instead of doing finger exercises with syntax. Practically every self-taught programmer that I know started programming because they wanted to make their gadgets do things for them. They didn't learn a programming language with an abstract conception of using it on some far distant project so I don't understand why schools don't emulate this style of teaching.

    Read the article

  • dhcpd fails to start

    - by TECHPREACHER
    I recently installed Ubuntu 11.10 I then used apt-get to grab isc-dhcp3. I removed Network-Manager and manually configured my network interface eth0. In addition, I hand edited a dhcpd.conf file and designated eth0 as the listen port in /etc/default/isc-dhcp-server. However, each time I attempt to start dhcpd it fails. When I view the syslog file, the last line is as follows: "Not configured to listen on any interfaces!" My eth0 interface works fine. I can ping addresses inside and outside the network and perform DNS queries. Any help would be greatly appreciated. AJ

    Read the article

  • Should I tell a departed coworker about their "sev 1" defect?

    - by noahz
    I had a co-worker leave our company recently. Before leaving, he coded a component that had a severe memory leak that caused a production outage (OutOfMemoryError in Java). The problem was essentially a HashMap that grew and never removed entries, and the solution was to replace the HashMap with a cache implementation. From a professional standpoint, I feel that I should let him know about the defect so he can learn from the error. On the other hand, once people leave a company, they often don't want to hear about legacy projects that they have left behind for bigger and better things. What is the general protocol for this sort of situation?

    Read the article

  • New Information Center - Optimize Performance of FMW 11g

    - by Daniel Mortimer
    Following on the heels of the recently published - "Reviewing Security for FMW 11g" Information Center, we are pleased to announce the publication of Information Center: Optimizing Performance of Oracle Fusion Middleware 11g [ID 1469617.2] Screenshot of ID 1469617.2 We are in the process of making further tweaks and changes to improve the other ** "Oracle Fusion Middleware 11g" Information Centers. So watch this space! ** You can navigate to these other Information Centers via the menu found on the left hand side of the "Optimize Performance" Information Center.

    Read the article

  • Shader inputs in a general purpouse engine

    - by dreta
    I'm not familiar with SDKs like Unity or UDK that much, so i can't check this off hand. Do general purpouse engines allow users to create custom uniform variables? The way i see it, and the way i have implemented it in an engine i'm writing to learn 3D, is that there is a "set" of uniforms provided by the engine and if you want to write a custom shader then you utilize uniforms you need to create a wanted effect. Now, the thing is, first of all i'm not an artist, second of all, i didn't have a chance to create complex scenes yet. So my question is, is it common practice to define variables that the engine provides and only allow the user to work with what they're given? Allowing users to add custom programs and use them where they want is not hard, but i have issues imagining how you'd go about doing the same for uniforms.

    Read the article

  • What should I worry about when changing OpenGL origin to upper left of screen?

    - by derivative
    For self education, I'm writing a 2D platformer engine in C++ using SDL / OpenGL. I initially began with pure SDL using the tutorials on sdltutorials.com and lazyfoo.net, but I'm now rendering in an OpenGL context (specifically immediate mode but I'm learning about VAOs/VBOs) and using SDL for interface, audio, etc. SDL uses a coordinate system with the origin in the upper left of the screen and the positive y-axis pointing down. It's easy to set up my orthographic projection in OpenGL to mirror this. I know that texture coordinates are a right-hand system with values from 0 to 1 -- flipping the texture vertically before rendering (well, flip the file before loading) yields textures that render correctly... which is fine if I'm drawing the entire texture, but ultimately I'll be using tilesets and can imagine problems. What should I be concerned about in terms of rendering when I do this? If anybody has any advice or they've done this themselves and can point out future pitfalls, that would be great, but really any thoughts would be appreciated.

    Read the article

  • OTN, T-Shirts, and Tunes at Mezzanine - Tuesday Oct 2.

    - by Bob Rhubart
    By now you've probably heard about the Oracle OpenWorld Music Festival, which will bring an incredible array of bands, spanning the spectrum of genres, to several venues throughout San Francisco. The festival runs Sunday through Thursday, with a break on Wednesday for the Oracle Appreciation Event on Treasure Island featuring Pearl Jam, Kings of Leon, and X. ***CORRECTION*** What you probably don't know is that OTN is sponsoring the Tuesday night Festival show at Mezzanine (444 Jessie Street at Mint), featuring:  GOLDEN STATEDEATH VALLEY HIGH LOW FLYING OWLS The OTN crew will be on hand, passing out t-shirts and resisting the temptation to misbehave. Mostly. 

    Read the article

  • Gnome 3 - Old fashioned buttons and menus

    - by vigs1990
    I've upgraded to Gnome 3 and the problem I'm facing is that when I restart, sometimes the menus and buttons look old-fashioned like this: whereas sometimes, it looks modern and neat like this: Notice the differences between the two: here are a few differences: The menu bar (notice the difference in fonts, dark grey color of Snapshot1 vs the light grey color in Snapshot2 in the background) The file navigation bar bellow the menu bar (notice the 'Home' button there and also the left arrow button) The left-hand side navigation bar (font, background color and color of selected folder) The old style look effects the GTK aspects of the interface, such as the menu, buttons, mouse pointer etc. Another observation is that changing the GTK themes does using gnome-tweak-tool when the old style look is loaded does NOT work. However, this works when the regular look is loaded. How can I ensure that the old-fashioned look does not load on boot?

    Read the article

  • Bunny Inc. Season 2: Find Specialist Partner Resources for Success

    - by kellsey.ruppel
    You may need an additional hand to improve your IT infrastructure, or advice to evolve existing enterprise applications. Or perhaps you’re seeking revolutionary ideas to refresh online presence. Whatever the case, spotting the right partners’ ecosystem will be a central step to grow your business. Don't be a Hare Inc. company by wasting valuable time sourcing relevant expertise, competencies and proven successes on Oracle's product portfolio on your own. Follow Bunny Inc. in the fourth episode of the saga and discover what our worldwide partner community can do for you thanks to the new Oracle Partner Network Specialized program. 

    Read the article

  • C++ AMP recording and slides

    - by Daniel Moth
    Yesterday we announced C++ Accelerated Massive Parallelism. Many of you want to know more about the API instead of just meta information. I will trickle more code over the coming months leading up to the date when we will share actual bits. Until you have bits in your hand, it is only your curiosity that is blocked, so I ask you to be patient with that and allow me to release this on our own schedule ;-) You can now watch my 45-minute session introducing C++ AMP on channel9. You will also want to download the slides (pdf), because they are not readable in the recording. Comments about this post welcome at the original blog.

    Read the article

< Previous Page | 38 39 40 41 42 43 44 45 46 47 48 49  | Next Page >