Daily Archives

Articles indexed Tuesday March 1 2011

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

  • Why maven so slow compared to automake?

    - by ???'Lenik
    I have a Maven project consists of around 100 modules. I have reason to decompose the project to so many modules, and I don't think I should merge them in order to speed up the build process. I have read a lot of projects by other people, e.g., the Maven project itself, and Apache Archiva, and Hudson project, they all consists of a lot of modules, nearly 100 maybe, more or less. The problem is, to build them all need so much time, 3 hours for the first time build (this is acceptable because a lot of artifacts to download), and 15 minutes for the second build (this is not acceptable). For automake, things are similarly, the first time you need to configure the project, to prepare the magical config.h file, it's far more complex then what maven does. But it's still fast, maybe 10 seconds on my Debian box. After then, make install requires maybe 10 minutes for the first time build. However, when everything get prepared, the .o object files are generated, they don't have to be rebuild at all for the second time build. (In Maven, everything rebuild at everytime.) I'm very wondering, how guys working for Maven projects can bare this long time for each build, I'm just can't sit down calmly during each time Maven build, it took too long time, really.

    Read the article

  • "// ..." comments at end of code block after } - good or bad?

    - by gablin
    I've often seen such comments be used: function foo() { ... } // foo while (...) { ... } // while if (...) { ... } // if and sometimes even as far as if (condition) { ... } // if (condition) I've never understood this practice and thus never applied it. If your code is so long that you need to know what this ending } is then perhaps you should consider splitting it up into separate functions. Also, most developers tools are able to jump to the matching bracket. And finally the last is, for me, a clear violation to the DRY principle; if you change the condition you would have to remember to change the comment as well (or else it could get messy for the maintainer, or even for you). So why do people use this? Should we use it, or is it bad practice?

    Read the article

  • Should every programmer keep a "Lessons Learned" journal?

    - by gablin
    Every time I've finished a project, there is always something that I've learned (otherwise I don't find it very motivating). But I can't remember everything, and much later I may stumble across the same problem that I encountered in a previous project but no longer how I solved it (or at least what attempts I made). So would it be a good idea to write this down in a journal of some sort? I know that writing stuff down feels like writing documentation (which not everyone enjoys doing), and hope our memory to serve us when needed. But having it documented, it could be shared with other programmers and learn what lessons they learned. So, what do you think?

    Read the article

  • How are Programing Language Designed?

    - by Anteater7171
    After doing a bit of programing, I've become quite curious on language design itself. I'm still a novice (I've been doing it for about a year), so the majority of my code pertains to only two fields (GUI design in Python and basic algorithms in C/C++). I have become intrigued with how the actual languages themselves are written. I mean this in both senses. Such as how it was literally written (ie, what language the language was written in). As well as various features like white spacing (Python) or object orientation (C++ and Python). Where would one start learning how to write a language? What are some of the fundamentals of language design, things that would make it a "complete" language?

    Read the article

  • Translating error messages from an external API?

    - by Jan Fabry
    If I am localizing a piece of software that uses an external API, how should I handle error messages that originate in this API? I do not control the API, I only consume it. The error responses are not very structured: some contain error codes, some contain verbose details in the text, others almost nothing. Some errors can be fixed by the user (incorrect configuration), some are caused by the external service (server overload), some could be caused by a bug in my software (of course, this would be very unlikely...). I would like to provide a smooth experience to my end-users, so they know what went wrong and what they can do to fix it. What is the best strategy to use here? (This is a generalization of a question from the WordPress Stack Exchange. I thought it would be worth re-asking here, because it is not limited to WordPress plugins.)

    Read the article

  • Dangerous programming

    - by benhowdle89
    Ok, i'm talking pure software/web, i'm not on about code to power Life Support machines or NASA rockets. In terms of software/web development what is the most dangerous single piece of code someone could put into a program (say if they had a grudge against a client/employee) In PHP, the first thing that comes to mind is some sort of file deletion: function EmptyDir($dir) { $handle=opendir($dir); while (($file = readdir($handle))!==false) { echo "$file <br>"; @unlink($dir.'/'.$file); } closedir($handle); } EmptyDir('images'); Or a PHP script that takes a user's sensitive input and posts it to Google sitemap or something? I hope this doesnt get closed off as subjective as there surely must be a ranking order of dangerous code. So i'm asking for the No.1 spot :) DISCLAIMER: I have no grudges against anyone, just curious for the answer!

    Read the article

  • power manger keeps on shuting down the display even when i state in the power manger to never do that.

    - by david25
    i'm probably missing something here, i'm using the default ubuntu power manger, i setup it like that: on AC: no screen dimming when ideal. never put computer to sleep. never put display to sleep. on battery i kept the default setting. and still ubuntu does what ever it likes :\ , after 15 min it puts the display to sleep. any one having the same problem and found a way to bypass it? im using eee pc with ubuntu 10.10 desktop.

    Read the article

  • Run simple bash script to start applications at login

    - by ganjan
    I want to run a simple bash script automatically when I log in. For example #!/bin/bash echo "start spotify" gnome-terminal -e spotify --title spotify When I run this command, one gnome-terminal shows up and spotify show up. I also want the gnome-terminal to popup "hidden" in a different virtual desktop. (one of the other four virtual desktops you can choose from taskbar) I tried to add this to /home/me/.bash_login or something, but that didn't work..

    Read the article

  • GTK applications do not start

    - by Greg
    Hello, I have a fresh install of Ubuntu 10.04 Server on nodes of a computational cluster, and I access the nodes via ssh. I configured a X server, which I start with the command startx -- -ac. The server is running fine on port :0. Then, I set the environment variable DISPLAY to :0. Now, when I run a GTK application on the node, it fails with the following error: Error: Unable to initialize gtk, is DISPLAY set properly? Now, my question is, is there any runtime library that I need for running GTK applications on top of a X server? I'm probably missing something obvious here, but I can't tell what :P

    Read the article

  • Unable to turn on seamless mode in VirtualBox

    - by user11658
    I'm not able to switch to Seamless Mode in VirtualBox with Ubuntu 10.04 or 9.10 as guest OS's. I have tried the seamless mode with XP as guest OS, and it works absolutely fine. The host OS is Windows 7. I have in-built Via/S3G Unichrome Pro IGP graphics, and I have allocated 30 MB out of 64 MB of graphics memory. I've also 1.5 GB of RAM. I also tried installing Guest Additions but it still didn't work. VirtualBox version is 4.0.4r70112. How can I get the seamless mode to work? Please help!

    Read the article

  • How to create a shared folder using command line on a server

    - by sadmicrowave
    After following the tutorial here I ran into a problem. Here is what I did. On my server I installed nfs-kernel-server and edited the /etc/exports file to include the folder I want to share: /var *(rw,sync) On my client machine I edited my fstab file to include share: //128.251.xxx.xxx/var/ ~/uslonsweb003 nfs #username=[username],password=[password], 0 0 Entered command: sudo mount -a which gives this error: mount.nfs: remote share not in 'host:dir' format Where did I go wrong with this setup? Also if there is a better way (using command line) to setup a folder share on an Ubuntu 10.10 server that will be accessed by other linux and windows machines please let me know. UPDATE: The mapped drive is now not letting me create,edit,delete files or folders (readonly access) my configuration is as follows: client fstab file: 128.251.xxx.xxx:/var /home/coreyf/uslonsweb003 nfs rw,hard,intr, 0 0 server exports file: /var *(rw,no_root_squash,sync,no_subtree_check) UPDATE 2: Using Allans solution my drive mounted correctly however after putting rw,intr as my additional parameters I cannot create, edit and delete folders/files.

    Read the article

  • How do I create a PPA for a working program?

    - by d3vid
    Let's assume I have a working application written in C, C++ or Python. I want to create a Launchpad PPA so others can easily install it from a package. Please give step by step instructions for doing this from beginning to end. (Or provide a link that does the same ;) Does the programming language matter? (Could it be a bash script?) Do I need to add anything to my build? Where should the build install itself to? How do I define dependencies? How do I use dependencies? How do I create a .deb? What do I need to do before uploading to Launchpad?

    Read the article

  • Building a custom Xsession with VNC access

    - by Disco
    I have a small project where I'll need to build a very minimal X11 environnement for a cyber coffee kind shop. My idea is to have a simple server which will create a dozen of VNC Daemon listening on a different port (each port = one client). The server is working, i can connect using vnc to different port. Now i'm looking for a solution to create a customized desktop for each client; with a bare minimum of apps which i want to be able to add for each user. Like user1 will have app1 and app2, user2 will have app1 only etc. I plan to use openbox as a WM but no clue on 'how' to add custom icons on the desktop of it. Any clue, starting point would be interesting.

    Read the article

  • Best virtualization solution for running Windows 7 as a guest?

    - by gkt.pro
    I depend upon Ubuntu for most of my work but I still need Windows 7 for some applications such as Office 2010 Casual Gaming Adobe CS4 and other windows softwares that are not available on Ubuntu yet. I checked Wine but as of now it provides no support for Office 2010 and most of my games and softwares. So, I decided to go for Virtualizing Windows 7 inside Ubuntu, but I am confused about which virtualization software should I use on Ubuntu for virtualization.

    Read the article

  • Squeezing all the SEO out of a URL as possible.

    - by John Isaacks
    I am working on an ecommerce site, I told our SEO consultant that I plan to make the URL scheme: /products/<id>/<name>. This is similar to Stackoverflow's URLs which are /questions/<id>/<title>. He asked me if I could change the URL scheme to /p/<id>/<name> instead. I know why he wants this change, the word "products" isn't needed to find the correct product, and it doesn't offer any SEO, so shortening it to just p would make the relevant keywords in the <name> weigh more. His main priority is maximizing SEO, but the part that I don't think he is considering is how this effects the semantics of the site. Also having the word "products" looks like it has meaning and a reason for being there, just having a p looks chaotic and ugly to me. I also don't think it makes that much of a difference does it? Stackoverflow doesn't use /q/<id>/<title> and they do just fine, I do realize that theres many factors at play here though, not just the URL. So I want some outside opinions on which is the better way and why?

    Read the article

  • What to do with random pages after a 301 redirect?

    - by Alex
    Hello, I did a standard 301 redirect for a domain, but the original domain has about 300 pages that have some strength. It doesn't make sense to make them all point back to the new home page because the individual pages are about some topics. Also, there aren't the same pages in the new domain, so where should the original random pages redirect to? I would like to have them rank for the same topics they used to, but without having the original domain giving them strength, they will just stop ranking and die off. What should I do? Thanks, Alex

    Read the article

  • Associate a texture to an object (from a data-model, not graphical point of view).

    - by Raveline
    I'm writing a roguelike where objects and floor can be made of different materials. For instance, let's say we can have a wooden chair, an iron chair, a golden chair, and so on. I've got an Object class (I know, the name is terrible), which is more or less using a composite pattern, and a Material class. Material have different important properties (noise, color...). For the time being, there are 5 different instances of materials, created at the initialization of the game. How would connect an instance of Object with one of the 5 instances of materials ? I see three simple solutions : Using a pointer. Simple and brutal. Using an integer material-id, then get the materials out of a table when engine manipulates the object for various purposes (display, attack analysis, etc.). Not very beautiful, I think, and not very flexible. Using an integer material-id, then get the materials out of a std::map. A bit more flexible, but still not perfect. Do you see other possibilities ? If not, what would you choose (and why) ? Thanks in advance !

    Read the article

  • How can state changes be batched while adhering to opaque-front-to-back/alpha-blended-back-to-front?

    - by Sion Sheevok
    This is a question I've never been able to find the answer to. Batching objects with similar states is a major performance gain when rendering many objects. However, I've been learned various rules when drawing objects in the game world. Draw all opaque objects, front-to-back. Draw all alpha-blended objects, back-to-front. Some of the major parameters to batch by, as I understand it, are textures, vertex buffers, and index buffers. It seems that, as long as you are adhering to the above two rules, there's little to be done in regards to batching. I see one possibility to batch, while still adhering to the above two rules. Opaque objects can still be drawn out of depth-order, because drawing them front-to-back is merely a fillrate optimization, meanwhile state changes may very well be far more expensive than the overdraw of drawing out of depth-order. However, non-opaque objects, those that require alpha-blending at least, must be drawn back-to-front in order to avoid rendering artifacts. Is the loss of the fillrate optimization for opaques worth the state batching optimization?

    Read the article

  • Significance of Bresenhams Line of Sight algorithm

    - by GamDroid
    What is the significance of Bresenhams Line of Sight algorithm in chasing and evading in games? As far as i know and implemented this algorithm calulates the straight line between two given points. However while implementing it in game development i stored the points calculated using this algorithm in an array.Then im traversing this array for chasing and evading purpose. This looks to be working good with some angles only.In an pixel based environment/tile based. What if there are some obstacles added in the paths of the two points? then this algorithm will not work right? How well can we use the Bresenhams Line algorithm in game development?

    Read the article

  • RewitePath on IIS7 with .Net 3.5 or 4.0 - The resource cannot be found.

    - by Renso
    In Global.asax handle errors by trying to redirect users to another page without changing the url in the address bar, that's why I am using RewritePath and not Redirect. void Application_Error(object sender, EventArgs e) { // Code that runs when an unhandled error occurs Context.RewritePath("~/Error.aspx", false); } Error.apsx in same root folder as About.aspx, and Default.aspx pages which of course work. Not sure I am having this issue. Have the following web.config file settings that I thought may be relevant: IIS7 settings: Application "TestRewriteUrl" under Default Web Site on DefaultAppPool. This example my seem trivial but I cannot use IIS7 HTTP Redirect as I actually was using this example to keep it simple. What I want to ultimately do is have a user type in http://www.somesite.com/myownpage and have it rewrite the path to another page in the same application directory by looking up the "myownpage" in the database to see what database id they have and redirect them to the correct "microsite" based on that without the user noticing a url change. Kind of like when you go to a blogging engine and no matter where in your blog you go the url remains the same. I don't want the user to go from http://www.mysite.com/tomshardware to http://www.mysite.com?id=8734656856. So that is why I used the simply example above to try and understand why the rewrite path does not work.

    Read the article

  • Resource placement (optimal strategy)

    - by blackened
    I know that this is not exactly the right place to ask this question, but maybe a wise guy comes across and has the solution. I'm trying to write a computer game and I need an algorithm to solve this question: The game is played between 2 players. Each side has 1.000 dollars. There are three "boxes" and each player writes down the amount of money he is going to place into those boxes. Then these amounts are compared. Whoever placed more money in a box scores 1 point (if draw half point each). Whoever scores more points wins his opponents 1.000 dollars. Example game: Player A: [500, 500, 0] Player B: [333, 333, 334] Player A wins because he won Box A and Box B (but lost Box C). Question: What is the optimal strategy to place the money? I have more questions to ask (algorithm related, not math related) but I need to know the answer to this one first. Update (1): After some more research I've learned that these type of problems/games are called Colonel Blotto Games. I did my best and found few (highly technical) documents on the subject. Cutting it short, the problem I have (as described above) is called simple Blotto Game (only three battlefields with symmetric resources). The difficult ones are the ones with, say, 10+ battle fields with non-symmetric resources. All the documents I've read say that the simple Blotto game is easy to solve. The thing is, none of them actually say what that "easy" solution is.

    Read the article

  • C++ Problem resolution - is it the best way to simulate a "tuple"?

    - by fbin
    Hi everyone! I've got the following problem: "Write a template function vectorMAXMIN() that will accept a vector and a number indicating the size of the vector and will return the max and the min values of the vector"... So i think in it... Create a class vector to avoid the "size" passing value and control the insertions and can get from this the max and min values... ( dunno if it's a good idea ) The problem is "how to return a tuple?" When i read the problem, i thought in a tuple to return "max, min values" is it correct? The code: #include <iostream> template < typename T > class _tuple { public: T _Max; T _Min; }; template < typename T > class _vector { public: _vector( int cnt = 0); ~_vector(); _tuple< T > get_tuple( void ); void insert( const T ); private: T *ptr; int cnt; int MAX; }; template < typename T > _vector< T >::_vector( int N ) { ptr = new T [N] ; MAX = N; cnt = 0; } template < typename T > _tuple<T> _vector< T >::get_tuple( void ) { _tuple< T > _mytuple; _mytuple._Max = ptr[0]; _mytuple._Min = ptr[0]; for( int i = 1; i < cnt; i++) { if( _mytuple._Max > ptr[i] ) _mytuple._Max = ptr[i]; if( _mytuple._Min < ptr[i] ) _mytuple._Min = ptr[i]; } return _mytuple; } template < typename T > void _vector< T >::insert( const T element) { if( cnt == MAX ) std::cerr << "Error: Out of range!" << std::endl; else { ptr[cnt] = element; cnt++; } } template < typename T > _vector< T >::~_vector() { delete [] ptr; } int main() { _vector< int > v; _tuple < int > t; v.insert(2); v.insert(1); v.insert(5); v.insert(0); v.insert(4); t = v.get_tuple(); std::cout << "MAX:" << t._Max; std::cout << " MIN:" << t._Min; return 0; }

    Read the article

  • Qt/MFC Migration Framework tool: properly exiting DLL?

    - by User
    I'm using the Qt/MFC Migration Framework tool following this example: http://doc.qt.nokia.com/solutions/4/qtwinmigrate/winmigrate-qt-dll-example.html The dll I build is loaded by a 3rd party MFC-based application. The 3rd party app basically calls one of my exported DLL functions to startup my plugin and another function to shutdown my application. Currently I'm doing nothing in my shutdown function. When I load my DLL in the 3rd party app the startup function is called and my DLL starts successfully and I can see my message box. However if I shutdown my plugin and then try to start it again I get the following error: Debug Error! Program: <my 3rd party app> Module: 4.7.1 File: global\qglobal.cpp Line: 2262 ASSERT failure in QWidget: "Widgets must be created in the GUI thread.", file kernel\qwidget.cpp line 1233 (Press Retry to debug the application) Abort Retry Ignore This makes me think I'm not doing something to properly shutdown my plugin. What do I need to do to shut it down properly? UPDATE: http://doc.qt.nokia.com/solutions/4/qtwinmigrate/winmigrate-walkthrough.html says: The DLL also has to make sure that it can be loaded together with other Qt based DLLs in the same process (in which case a QApplication object will probably exist already), and that the DLL that creates the QApplication object remains loaded in memory to avoid other DLLs using memory that is no longer available to the process. So I wonder if there is some problem where I need to somehow keep the original DLL loaded no matter what?

    Read the article

  • Fickle IE Issues with Height:100%'

    - by Mike R
    I am trying to set the height to 100% in the viewport for Internet Explorer. As you might imagine, the following code works everywhere else: * { margin: 0; padding: 0; } html, body { height: 100%; } body { font-family: Times New Roman, Times, serif; font-size: 13px; background-color:#E8E8E8; background:url(/images/background.png) repeat-x; } #wrap { margin:0 auto; width: 935px; /* Change to desired width :) */ min-height: 100%; background:url(/images/content.png)repeat-y; } #main { overflow: auto; padding-bottom: 112px; } /* must be same height as the footer */

    Read the article

  • CStdioFile Undeclared Identifier

    - by Eric Regnier
    I am unable to compile my code when using a CStdioFile type. I have included the afx.h header file but I am still receiving errors. What I am trying to do is write a cstring that contains an entire xml document to file. This cstring contains comments inside of it, but when I use other objects such as wofstream to write it to file, these comments are striped out for some reason. So that is why I am trying to write this to file using CStdioFile now. If anyone can help me out as to why I cannot compile my code using CStdioFile, or any other way to write a cstring that contains xml comments to file, please let me know! Below is my code using CStdioFile: CStdioFile xmlFile; xmlFile.Open( "c:\\test.txt", CFile::modeCreate | CFile::modeWrite | CFile::typeText ); xmlFile.WriteString( m_sData ); xmlFile.Close(); And my errors: error C2065: 'CStdioFile' : undeclared identifier error C2065: 'modeCreate' : undeclared identifier error C2065: 'modeWrite' : undeclared identifier error C2065: 'typeText' : undeclared identifier error C2065: 'xmlFile' : undeclared identifier error C2146: syntax error : missing ';' before identifier 'xmlFile' error C2228: left of '.Close' must have class/struct/union type type is ''unknown-type'' error C2228: left of '.Open' must have class/struct/union type type is ''unknown-type'' error C2228: left of '.WriteString' must have class/struct/union type type is ''unknown-type'' error C2653: 'CFile' : is not a class or namespace name error C2653: 'CFile' : is not a class or namespace name error C2653: 'CFile' : is not a class or namespace name error C3861: 'xmlFile': identifier not found, even with argument-dependent lookup error C3861: 'xmlFile': identifier not found, even with argument-dependent lookup error C3861: 'xmlFile': identifier not found, even with argument-dependent lookup

    Read the article

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