Daily Archives

Articles indexed Sunday February 27 2011

Page 8/9 | < Previous Page | 4 5 6 7 8 9  | Next Page >

  • "more than 3 levels of indentation, you're screwed" How should I understand this quote ?

    - by jokoon
    The answer to that is that if you need more than 3 levels of indentation, you're screwed anyway, and should fix your program. What can I deduct from this quote ? On top of the fact that too long methods are hard to maintain, are they hard or impossible to optimize for the compiler ? I don't really understand if this quote encourages better coding practice or is really a mathematical/algorithmic sort of truth... I also read in some C++ optimizing guide that dividing up a program into more function improves its design is a common thing taught at school, but it should be not done too much, since it can turn into a lot of JMP calls (even if the compiler can inline some methods by itself).

    Read the article

  • Technologie Roadmap: Portlet JSR286 vs Widget/Gadget

    - by Aerosteak
    Hello IBM got me confused (again). For many years IBM have been pushing for Portlet Containers with the JSR 168 and later the JSR 286 Specification. 2008-2009, IBM the Lotus division introduced the iWidget Specification. Based on my reading, it is a more dynamic and lightweight version of the Portlets, close to Google Gadget. It uses a different paradigm than Porlet while providing the same features. A major differentiator with this kind of client side technologies is that you don’t need a big and costly Portal infrastructure. To not fall in the ‘It depends on needs’ discussions, let consider the following: * New company, no legacy portlet, no portal in place. What are your thoughts on this?

    Read the article

  • Can it be useful to build an application starting with the GUI?

    - by Grant Palin
    The trend in application design and development seems to be starting with the "guts": the domain, then data access, then infrastructure, etc. The GUI seems to usually come later in the process. I wonder if it could ever be useful to build the GUI first... My rationale is that by building at least a prototype GUI, you gain a better idea of what needs to happen behind the scenes, and so are in a better position to start work on the domain and supporting code. I can see an issue with this practice in that if the supporting code is not yet written, there won't be much for the GUI layer to actually do. Perhaps building mock objects or throwaway classes (somewhat like is done in unit testing) would provide just enough of a foundation to build the GUI on initially. Might this be a feasible idea for a real project? Maybe we could add GDD (GUI Driven Development) to the acronym stable...

    Read the article

  • What's the better user experience: Waiting once at startup for a long time or waiting frequently for a short time?

    - by Roflcoptr
    I'm currently design an application that involves a lot of calculation. Now I have generally two possibilities which I have both tested: 1) During startup of the application I calculated only the most important values and these values that consume a lot of time. So the user has to wait approximately 15 seconds during startup. But on the other hand a lot of user interactions require recalculation so that the user often has to wait 2-3 seconds after clicking somewhere until the application has calculated and loaded all values 2) I load everything during startup. This takes from 90 to 120 seconds... This is quite a long time, but the big advantage is that all the user interactions are executed immediately. So what would you generally consider the better approach? Loading all time-consuming operations during startup or when needed?

    Read the article

  • Do Loops kind of Reset every time you go through it?... [closed]

    - by JacKeown
    #include <iostream> using namespace std; int main (void) { cout << " 1\t2\t3\t4\t5\t6\t7\t8\t9" << endl << "" << endl; for (int c = 1; c < 10; c++) { cout << c << "| "; for (int i = 1; i < 10; i++) { cout << i * c << '\t'; } cout << endl; } return 0; } Hey so this code produces a times table...I found it on Google Code's C++ class online...I'm confused about why "i" in the second for loop resets to 1 every time you go through that loop...or is it being declared again in the first parameter? Thanks in advance!

    Read the article

  • MVC and individual elements of the model under a common base class

    - by Stewart
    Admittedly my experience of using the MVC pattern is limited. It might be argued that I don't really separate the V from the C, though I keep the M separate from the VC to the extent I can manage. I'm considering the scenario in which the application's model includes a number of elements that have a common base class. For example, enemy characters in a video game, or shape types in a vector graphics app. The view wants to render these elements. Of course, the different subclasses call for different rendering. The problem is that the elements are part of the model. Rendering them is conceptually part of the view. But how they are to be rendered depends on parameters of both: Attributes and state of the element are parameters of the model User settings are parameters of the view - and to support multiple platforms and/or view modes, different views may be used What's your preferred way of dealing with this? Put the rendering code in the model classes, passing in any view parameters? Put the rendering code in the view, using a switch or similar to select the right rendering for the model element type? Have some intermediate classes as a model-view interface, of which the model will create objects on demand and the view will then render them? Something else?

    Read the article

  • What percentage of revenue would be fair for app stores to take? [closed]

    - by Tyler Collier
    Apple takes 30% of revenue from app sales on the iPhone app store. Now Apple does the same with the Mac app store. Google also takes a 30% cut in the Android Market. These seem pretty steep. What percentage do you think would be fair and good for both you as a developer/vendor and Apple/Google? What's a happier middle ground? 20%? If the answer you give is less than 30% but you are selling apps in the app store or android market, please explain why you are willing to, and what benefits Apple and Google would see from reducing their cuts.

    Read the article

  • Versioning millions of files with distributed SCM

    - by C. Lawrence Wenham
    I'm looking into the feasibility of using off-the-shelf distributed SCMs such as Git or Mercurial to manage millions of XML files. Each file would be a commercial transaction, such as a purchase order, that would be updated perhaps 10 times during the lifecycle of the transaction until it is "done" and changes no more. And by "manage", I mean that the SCM would be used to not just version the files, but also to replicate them to other machines for redundancy and transfer of IP. Lets suppose, for the sake of example, that a goal is to provide good performance if it was handling the volume of orders that Amazon.com claimed to have at its peak in December 2010: about 150,000 orders per minute. We're expecting the system to be distributed over many servers in order to get reasonable performance. We're also planning to use solid-state drives exclusively. There is a reason why we don't want to use an RDBMS for primary storage, but it's a bit beyond the scope of this question. Does anyone have first-hand experience with the performance of distributed SCMs under such a load, and what strategies were used? Open-source preferred, since the final product is to be FOSS, too.

    Read the article

  • Install HP driver in ubuntu

    - by dotNET
    Hey, I need to install the wifi driver to ubuntu. so I downloaded the driver from hp website but the extension is .rpm, so I need to convert him to .deb so I can install it on ubuntu. The problem is I don't have internet connection on ubuntu to do this : sudo apt-get install alien how can convert the driver on windows for example, or how can I do download alien and place it under my usb to install it after booting on ubuntu. Thanks

    Read the article

  • How do I get the source code of packages installed through apt-get?

    - by dustyprogrammer
    I am assuming that all application installed through apt-get are open source; but for those that are available in that manner, where can I get the source code for these applications as well as update them? I have a couple applications I use regularly that aren't being actively developed any longer and I would like to add features. Where would I go to get the rights to update these applications? mainly: hellanzb in my case Please and thank you.

    Read the article

  • Add static ARP entries when network is brought up

    - by jozzas
    I have some pretty dumb IP devices on a subnet with my Ubuntu server, and the server receives streaming data from each device. I have run into a problem in that when an ARP request is issued to the device while it is streaming data to the server, the request is ignored, the cache entry times out and the server stops receiving the stream. So, to prevent the server from sending ARP requests to these devices altogether, I would like to add a static ARP entry for each, something like arp -i eth2 -s ip.of.the.device mac:of:the:device But these "static" ARP entries are lost if networking is disabled / enabled or if the server is rebooted. Where is the best place to automatically add these entries, preferably somewhere that will re-add them every time the interface eth2 is brought up? I really don't want to have to write a script that monitors the output of arp and re-adds the cache entries if they're missing. Edit to add what my final script was: Created the file /etc/network/if-up.d/add-my-static-arp With the contents: #!/bin/sh arp -i eth0 -s 192.168.0.4 00:50:cc:44:55:55 arp -i eth0 -s 192.168.0.5 00:50:cc:44:55:56 arp -i eth0 -s 192.168.0.6 00:50:cc:44:55:57 And then obviously add the permission to allow it to be executed: chmod +x /etc/network/if-up.d/add-my-static-arp And these arp entries will be manually added or re-added every time any network interface is brought up.

    Read the article

  • Is libunity planning on including functions for Unity Places?

    - by SaidKLE
    I am unclear on this, because I have heard mention of a proposed API for Unity Places, and such an API would be extremely useful for projects involving home automation. I am interested in developing in that direction, but I haven't been able to find the API for Unity Places. It would make the most sense of libunity was to include Unity Places because it would put all the functionality of the Unity launcher into one place. If libunity is not the API for UPs, does such an API exist, and how would I find it?

    Read the article

  • BAD ARCHIVE MIRROR using PXE BOOT method

    - by omkar
    i m trying to automatically install UBUNTU on a client PC by using the method of PXE BOOT method....my Objectives are below:- i m following the steps given in this link installation using PXE BOOT 1:-the server will have a KICKSTART config file which contains the parameters for the OS installation and the files which are required for the OS installations. 2:-the client will have to detect this configuration along with the setup files and complete the installation without any input from the user. In my server i have installed DHCP3-server,Apache2 and TFTP for helping me with the installation. i have nearly achieved my first objective,i m able to boot my client using the files stored in the server,but during the installation stage it is asking me to "CHOOSE A MIRROR of UBUNTU ARCHIVE".i gave the server's IP address and the path in the server where the files are located but then too its giving me error "BAD ARCHIVE MIRROR". so is it possible that instead of downloading all the files from the internet and storing them on my disk , can i use the files which comes with the UBUNTU-CD, and how to store this files in what format (should i zip them ) on the disk. secondly i am also generating the ks.cfg which i wanted to give to the client for automatic installation of the OS ,so how should the configuration file be given to the installation process.

    Read the article

  • How to maintain document compatibility between LibreOffice and other office suites?

    - by CYREX
    When I save a document in LibreOffice and try to open it in Office 2007 for example, most or all of the paragraphs moved somehow. For what I found out is that the document has Widows and Orphans. How do I fix this so the document can be seen 100% accurate in Office 2007, 2003, OpenOffice and LibreOffice? What tips do askubuntu suggest about creating a compatible document between them (even though U know the non standard approach of Office 2007 in this)?

    Read the article

  • Binfmt config not persisting after booting

    - by Ishpeck
    I have the binfmt kernel module set up so I can run .NET apps as if they were native binaries. I have the /etc/rc.local file configured identically to this. If I power down my computer or boot into Windows, when I come back to Ubuntu, I can't run .NET apps without calling Mono. However, if I simply touch /etc/rc.local and restart, the binfmt configuration appears to kick in and I can run my .NET EXE's as I expect to. How do I get my configuration to stick?

    Read the article

  • "bad mirror archive" : What should I put as the "mirror of ubuntu archive" on installation of ubuntu?

    - by rockit
    I'm trying to set up ubuntu from my old macintosh laptop, but when it asks me to put in the "mirror of ubuntu archive" I run into problems. For the mirror, I put in mirror.anl.gov for the ubuntu archive mirror directory, i put in pub/ubuntu/ Then I leave the http proxy blank and hit "continue" It then tries to "download release files", which starts at 0%, and eventually jumps straight to 100% and then it presents me with an error of "bad mirror archive". Any advice? I never set up ubuntu before, and I'm really struggling with this step.

    Read the article

  • rewrite on urls to add “/”

    - by Jean
    Hello, I know how to rewrite urls to redirect to a page. When the "/" is not at the end of www.DomainName.com/user/myUserName the redirect works: RewriteRule /$ /user/index.php When I write RewriteBase / the above rule does not work, but a 404 error. How to add a "/" at the end of www.DomainName.com/user/myUserName/ and still redirect to /user/index.php. This can be written into the .htaccess or httpd.conf Thanks Jean

    Read the article

  • Using YouTube as a CDN

    - by Syed
    Why isn't YouTube used as a CDN for video and audio files? Through YouTube's api and developer tools, it would be possible to post all media files to YouTube from a CMS and then make a call to them when needed. This seems like it's within YouTube's TOS, it's a cost-effective way to store, retrieve, and distribute media files, and it could also make for easy monetization. I ask because I'm working on a new project for a public radio station. I can't figure out the real downside to this sort of an implementation.

    Read the article

  • Multiplayer / Networking options for a 2D game with physics

    - by lahmas
    Summary: My 50% finished 2D sidescroller with Box2D as physics engine should have multiplayer support in the final version. However, the current code is just a singleplayer game. What should I do now? And more important, how should I implement multiplayer and combine it with singleplayer? Is it a bad idea to code the singleplayer mode separated from multiplayer mode (like Notch did it with Minecraft)? The performance in singleplayer should be as good as possible (Simulating physics with using a loopback server to implement singleplayer mode would be a problem there) Full background / questions: I'm working on a relatively large 2D game project in C++, with physics as a core element of it. (I use Box2D for that) The finished game should have full multiplayer support, however I made the mistake that I didn't plan the networking part properly and basically worked on a singleplayer game until now. I thought that multiplayer support could be added to the almost finished singleplayer game in a relatively easy and clear way, but apparently, from what I have read this is wrong. I even read that a multiplayer game should be programmed as one from the beginning, with the singleplayer mode actually just consisting of hosting an invisible local server and connecting to it via loopback. (I found out that most FPS game engines do it that way, an example would be Source) So here I am, with my half finished 2D sidescroller game, and I don't really know how to go on. Simply continueing to work on the singleplayer / client seems useless to me now, as I'd have to recode and refactor even more later. First, a general question to anybody who possibly found himself in a situation like this: How should I proceed? Then, the more specific one - I have been trying to find out how I can approach the networking part for my game: (Possible solutions:) Invisible / loopback server for singleplayer This would have the advantage that there basically is no difference between singleplayer and multiplayer mode. Not much additional code would be needed. A big disadvantage: Performance and other limitations in singleplayer. There would be two physics simulations running. One for the client and one for the loopback server. Even if you work around by providing a direct path for the data from the loopback server, through direct communcation by the threads for example, the singleplayer would be limited. This is a problem because people should be allowed to play around with masses of objects at once. Separated singleplayer / Multiplayer mode There would be no server involved in singleplayer mode. I'm not really sure how this would work. But at least I think that there would be a lot of additional work, because all of the singleplayer features would have to be re-implemented or glued to multiplayer mode. Multiplayer mode as a module for singleplayer This is merely a quick thought I had. Multiplayer could consist of a singleplayer game, with an additional networking module loaded and connected to a server, which sends and receives data and updates the singleplayer world. In the retrospective, I regret not having planned the multiplayer mode earlier. I'm really stuck at this point and I hope that somebody here is able to help me!

    Read the article

  • When dealing with a static game board, what are some methods to make it more interesting?

    - by Ólafur Waage
    Let's say you have a game board that you look at. It does not move but there is some action going on. For example Chess, Checkers, Solitaire. The game I'm working on is not one of this but it's a good reference. What are some methods you can apply to the game or the design that increases the appeal of the user to the game. Of course you can make it prettier but what are some other methods you can use? For example: Visual cues, game design changes, user interface arrangement, etc.

    Read the article

< Previous Page | 4 5 6 7 8 9  | Next Page >