Daily Archives

Articles indexed Wednesday February 16 2011

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

  • What is the best unit test framework for .NET and why?

    - by rmx
    It seems to me that everyone uses NUnit without even considering the other options. I think this is because: Everyone is familiar with it already so they won't have to learn a new API. It is already set up with their continuous integration server to work with NUnit. Am I wrong about this? I decided to use xUnit on one of my own projects recently and I love it! It makes so much more sense to me and conceptually it seems like a definite step forward from NUnit. I'd like to hear opinions on which framework is actually the best - not taking into consideration having to learn it or reconfigure your automated testing.

    Read the article

  • Method chaining vs encapsulation

    - by Oak
    There is the classic OOP problem of method chaining vs "single-access-point" methods: main.getA().getB().getC().transmogrify(x, y) vs main.getA().transmogrifyMyC(x, y) The first seems to have the advantage that each class is only responsible for a smaller set of operations, and makes everything a lot more modular - adding a method to C doesn't require any effort in A, B or C to expose it. The downside, of course, is weaker encapsulation, which the second code solves. Now A has control of every method that passes through it, and can delegate it to its fields if it wants to. I realize there's no single solution and it of course depends on context, but I would really like to hear some input about other important differences between the two styles, and under what circumstances should I prefer either of them - because right now, when I try to design some code, I feel like I'm just not using the arguments to decide one way or the other.

    Read the article

  • How to get SRGP working?

    - by Bo Tian
    I'm running 64-bit Ubuntu 10.10, and I'm trying to make SRGP work. SRGP is an old graphics package that accompanies the book "Computer Graphics" by Foley, van Dam, et al. I have installed libx11-dev, but I still can't get through make. I get the error "cannot find -lsrgp" when I typed make PROG=show_pattern. Full compilation messages are here http://pastebin.com/CWuw4xte What do I have to do to get it working?

    Read the article

  • Fullscreen windowed mode in id games

    - by Oli
    I run a TwinView, dual monitor system. I like to play games fullscreen on one of the monitors, not spanning both. With wine, this works by just setting it to desktop mode and setting the resolution to that of one screen. For OpenTTD, I used Compiz's Window Rules plugin. But I have a few native games that this doesn't work for. Today's experiment involved Prey (Doom 3 engine) but I've had similar issues with other ID engines. So in short: has anybody found a way of having Prey/OpenAreana/Doom3/etc run in windowed mode but with fullscreen decorations (that is to say, no borders and above the panel)?

    Read the article

  • Installer doesn't display partition I want to install to

    - by Aditya
    While performing a Ubuntu 10.10 installation on my laptop, it doesn't show partitions pertaining to the PC. My PC configuration is as follows : HP Pavilion dv6 - 2020AX AMD Turion II Dual Core Mobile Processor M500 4 GB RAM OS Installed : Windows 7 500 GB Hard drive partitioned as follows : C : 227 GB (Free : 142 GB) D : 11.9 GB (Free : 1.98 GB) - Recovery F : 174 GB (Free : 18 GB) G : 50.5 GB (Free : 50.4 GB) So, I want to perform a Dual-boot installation on my PC, so that Ubuntu resides in the free disk space G:. Therefore, I started the Ubuntu 10.10 installation and select the manual partitioning feature in the installation. However, in the 'Allocate Drive Space' section of the installation, following partitions information is displayed: Partition Type Size Used /dev/sda /dev/sda1      1 MB    unknown /dev/sda2    ntfs    208 MB   unknown /dev/sda3   ntfs    244813 MB    168540 MB /dev/sda4    ntfs    255083 MB   3221 MB where /dev/sda - 500 GB So, what exactly is the problem? What is it should I do to install Ubuntu 10.10 in the G: disk space? Why are the partitions not being shown as the way they should be? Any Suggestions. Thank you for the help.

    Read the article

  • Cannot play windows WMA lossless files on Rhythmbox

    - by sr71
    I have installed Ubuntu 10.10 with all its updates (without Windows) on it’s own drive and everything is working fine. I want to play WMA audio files, also mp3 files. The mp3 files play fine. The WMA files do not play. Used "Rhythmbox Music Player" with and without "Ubuntu-restricted" -extras. Still does not play the lossless windows audio files. I am frustrated with searching to play a WMA file ("download this converter"), but one cannot use this until one "deletes this". I have done everything but it still does not play my windows lossless files that I made from all my CD’s. I am looking for a music player that I can use to play mp3’s and WMA lossless music files and automatically put the album cover on and update the info if one exists. Installation should be as simple as possible. Right now I am back to the original virgin Ubuntu 10.10 with all the recent updates. This computer will do nothing but play music (mp3 and WMA) through a stereo system. I also use Internet to update album info for the music. I do not care what bells and whistles the music player program has, as long as it is an easy install and just plays my mp3 and wma lossless music files. Any help would be appreciated.

    Read the article

  • Randomly Freezes - How Can I Diagnose the Problem?

    - by j0rd4n
    At random times, Ubuntu 10.04 freezes, and I have to do a hard shutdown. It was upgraded from 9.10 which didn't freeze. First, is this is common problem with a quick answer, and if not, what can I do to diagnose it? I've tried checking application/kernel logs, but nothing gives me a clue as to what caused the problem. My guess, is that since the OS froze, no logs could be updated. Ideas? SOLUTION: Solved it. My particular problem was my graphics card (integrated Radeon 9000 series). netconsole revealed I was getting the error: "reserve failed for wait". After trial-and-error, I manually configured my video card and disabled hardware acceleration. Completely fixed the issue. Here is what I did: Manually Created xorg.conf Ubuntu automatically configures xorg.conf and doesn't use a file. To edit this file, you have to tell Ubuntu to explicitly create one and then edit it. Here are the steps: Restart system Hold Shift as GRUB boots Select root terminal in GRUB login menu Execute: X -config xorg.conf.new Copy: cp xorg.conf.new /etc/X11/xorg.conf Disable Hardware Acceleration The following is specific to my Radeon card, but I'm sure other cards have a similar setup. Edit xorg.conf Find "Device" section for graphics card Uncomment "NoAccel" option and set to "True" Save + reboot Hope that helps.

    Read the article

  • How to mark dependencies as solved?

    - by joo
    On my Ubuntu I needed to install a newer version of erlang. Then I installed rabbitmq-server with dpkg --force-depends -i rabbitmq-server_2.1.1-1_all.deb And everything worked fine, till... Now I have the following problem when doing an apt-get install or upgrade: rabbitmq-server: Depends: erlang-base (>= 1:12.b.3) but it is not installable or erlang-base-hipe (>= 1:12.b.3) but it is not installable Depends: erlang-ssl which is a virtual package. or erlang-nox (< 1:13.b-dfsg1-1) but it is not installable Depends: erlang-os-mon which is a virtual package. or erlang-nox (< 1:13.b-dfsg1-1) but it is not installable Depends: erlang-mnesia which is a virtual package. or erlang-nox (< 1:13.b-dfsg1-1) but it is not installable Depends: erlang-inets which is a virtual package. or erlang-nox (< 1:13.b-dfsg1-1) but it is not installable Remove the following packages: rabbitmq-server Score is 121 Accept this solution? [Y/n/q/?] What command tells apt to resolve dependencies without removing the package? Thanks a lot in advance...

    Read the article

  • New computer hangs on shutdown/reboot, how to troubleshoot?

    - by torbengb
    Summary: My machine hangs on shutdown/restart: all windows and the menu bar disappear but the desktop wallpaper remains, and it stays like that without disk activity forever (hours). It doesn't even show the shutdown screen (the one with the animated dots) where I could hit ESC and watch the shutdown text. How can I troubleshoot this? Details: I've just received a new nettop computer (Acer Aspire Revo 3700: CPU:Atom D525, GPU:Nvidia ION2). I've just made a clean install of Ubuntu 10.10 using the standard USB pendrive method. The machine boots okay and works OK including WLAN and audio, but the graphics are not OK. Ubuntu offered to install&activate the current recommended Nvidia driver, but the machine hangs on shutdown/restart which prevents the installation of the proper Nvidia driver. I have to cycle the power to reboot. I ran the Update Manager in the hope that the updates would fix the hang-up. At the end of the update-installation it asked to reboot - and got stuck just like before. I see no obvious cause of the freeze and I don't know if it's caused by graphics problems or anything else. The only USB attachment is a mouse/keyboard; I don't have any external storage attached; and I don't have any programs running (the machine freezes even when doing restart right after login). How can I determine what is causing the freeze? How can I fix this? I'm frankly rather disappointed because I bought this new machine in the hopes of getting the graphics to work, which failed miserably on my old machine, even though Ubuntu is supposed to be good with Nvidia. Being a fresh convert from Windows, I was hoping for a happier experience this time, so I'm very much looking forward to your suggestions! ... After posting this question, I see related questions in the right sidebar: this, this, and this. Don't know why these didn't show up while I composed by question. Those questions suggest some ACPI settings but I am not experienced enough to find/change those settings. I'll try the sudo shutdown -h now command when I get home and see if that works, then update this question. I did check the system BIOS but didn't see anything out of the ordinary.

    Read the article

  • Javascript is not loading

    - by Oden
    Hey, I've got a problem with JavaScript under Ubuntu, that drives me crazy. I'm using Gedit for my web sites since I'm an Ubuntu user. When I start a new website I create (usually with the gnome terminal) folder structure, and I copy the files I need into them. The next step is creating an index.html where I build the design and basic JavaScript functionality. JavaScript is stored in a sub-folder of the project and when i try to load one using the tag in the header, my whole page body disappears. If the source contains a script tag with its own body, and its not the first its code wont run. I've tried to solve the problem by setting chmod to 777 with sudo chmod -R 777 . but nothing changed. CSS is loading correctly, but JS isn't. I'm using the newest version of apache, no mod_rewrite stuff, but i get the same problem when I run the html from file (file:///...) Do anyone know how to solve this problem?

    Read the article

  • How can I force X to start in a computer without a monitor?

    - by Javier Rivera
    I have I computer that have no monitor attached. When I boot it X fails to start because there is no monitor detected. If I boot it with a monitor attached and after X is started I remove the monitor everything works fine. Details and Background: This computer is a kind of hardware consolidation server. It's only purpose is to run two Virtual Box VM's that run Windows XP and some important but seldom used (once or twice a month) programs. For a couple of time it has been lying in a corner with an old monitor attached to it and working great. But space in the office was getting scarce and I moved the computer to the server room. There is no monitor attached to it there (no space), and sometimes the computer is rebooted. When it boots without monitor X is not started, the vms don't start and I get called to solve the problem.

    Read the article

  • Please explain some of the features of URL Rewrite module for a newbie

    - by kunjaan
    I am learning to use the IIS Rewrite module and some of the "features" listed in the page is confusing me. It would be great if somebody could explain them to me and give a first hand account of when you would use the feature. Thanks a lot! Rewriting within the content of specific HTML tags Access to server variables and HTTP headers Rewriting of server variables and HTTP request headers What are the "server variables" and when would you redefine or define them? Rewriting of HTTP response headers HtmlEncode function Why would you use an HTMLEncode in the server? Reverse proxy rule template Support for IIS kernel-mode and user-mode output caching Failed Request Tracing support

    Read the article

  • Joomla Hide Menu Item, or: Using Rich Content as part of the navigation

    - by chiccodoro
    In my Joomla based web site, I have a two layer main menu. The page layout contains two sections whereas the left one displays the content and the right one displays some other kind of content which at the same time serves as a menu. For example, if the user clicks on the "Products" - "SomeCategory" 2nd level menu item, the left section displays an image. The right section lists all products of that category. Each product is represented by an image and text. The content is scrollable. This section is implemented by means of a custom module (mod_custom) assigned to the menu. The content is rich text (HTML). Each product is entered manually by adding a picture and a text in the WYSIWYG editor, and by inserting a link for the picture and text. Now the issue: When the user clicks on a product, I want to display the corresponding product description article ("SomeProduct") to the left, accounting for the following requirements: The bread crumb now displays "Products - SomeCategory - SomeProduct" The main menu still displays the 2nd level for "Products", and "SomeCategory" is still marked as selected. (I would love if the right section which lists the product would remain in the exact same scroll state, but that's a completely different story.) If I link the product entry from the right hand side directly to the article "SomeProduct", then the article appears to the left, but the breadcrumb and menu are reset. So I wanted to create a hidden menu item "SomeProduct" beneath "SomeCategory", and to link the product entry to that menu item. This way, if I click on the product entry, the article appears to the left, the breadcrumb behaves correctly, and the menu state is preserved. However, it is not possible to configure the SomeProduct menu item as "hidden", therefore it appears in the main menu. I found some resources that suggest to create another menu, called "hidden", which does not use any modules, and to create the "SomeProduct" menu item in that menu. Unfortunately this did not work for me: If I link that menu item from the product entry, and click on that entry, then the article appears to the left, but the menu is reset, and the breadcrumb displays "SomeProduct" instead of "Products SomeCategory SomeProduct". Lucky me! I found an appropriate stackexchange site where I can pour out my heart to you guys. Sure you can help me :-)

    Read the article

  • How does bing-bot( is that the right spider-name? ) and googlebot interpret 301 redirect?

    - by jbcurtin
    I've been looking for documentation on how the Microsoft and Google bots interpret 301 redirects. It seems that google-bot stores documents on a url based index system. But I haven't been able to figure out how bing works. Should I assume that they are still working towards coping everyone else and assume they use an algorithm close to google? Is it best to just forward a page to a new location via Javascript? I think this might be a blackhat trick, but how would I tell the bots that it's not? Is 301 redirect my best option and I just have to bit the bullet because said pages are no longer in existence? What other options do I have that I might not be aware of?

    Read the article

  • How should I track multi-valued page attributes (e.g. tags) using custom variables?

    - by Simon
    Our pages can each have many tags, e.g 'football', 'sms', 'nsfw', etc.. wich we would like to track in google analytics. We're already tracking things like category using google analytics custom variables. We've used three of the five available slots so far. How can we track tags the same way? If we just mush them all together - e.g. 'football, sms, nsfw' then can we track the ones that are tagged 'football'? What's the right way to track multi-valued page attributes using custom variables?

    Read the article

  • Projectiles in tile mapped turn-based tactics game?

    - by Petteri Hietavirta
    I am planning to make a Laser Squad clone and I think I have most of the aspects covered. But the major headache is the projectiles shot/thrown. The easy way would be to figure out the probability of hit and just mark miss/hit. But I want to be able to have the projectile to hit something eventually (collateral damage!). Currently everything is flat 2D tile map and there would be full (wall, door) and half height (desk, chair, window) obstacles. My idea is to draw an imaginary line from the shooter to the target and add some horizontal&vertical error based on the player skills. Then I would trace the modified path until it hits something. This is basically what the original Laser Squad seems to do. Can you recommend any algorithms or other approaches for this?

    Read the article

  • Pack of resources in one big file with XNA

    - by Cristian
    Is it possible to pack all the little .xnb files into one big file? Given the level of abstraction of the XNA Framework I though this would come out of the box but I can't find any well integrated solution. So far the best candidate is XnaZip but in addition to having to compile the resources in a post-build event, and a little trouble porting the game to XBOX I have to rename all the references to resources I have already implemented.

    Read the article

  • How to calculate vertext normals for a mesh in Java in OpenGL ES application?

    - by alan mc
    Can some one point me to Java code ( in Java not C or C++) that calculates all the normals for all the vertices of a mesh for OpenGL ES application. I need this for lighting. Lets say I have a cube with following vertices and indices: float vertices[] = { -width, -height, -depth, // 0 width, -height, -depth, // 1 width, height, -depth, // 2 -width, height, -depth, // 3 -width, -height, depth, // 4 width, -height, depth, // 5 width, height, depth, // 6 -width, height, depth // 7 }; short indices[] = { 0, 2, 1, 0, 3, 2, 1,2,6, 6,5,1, 4,5,6, 6,7,4, 2,3,6, 6,3,7, 0,7,3, 0,4,7, 0,1,5, 0,5,4 }; In above specific example how many normals we need ?

    Read the article

  • Is there any simple game that involves psychological factors?

    - by Roman
    I need to find a simple game in which several people need to interact with each other. The game should be simple for an analysis (it should be simple to describe what happens in the game, what players did). Because of the last reason, the video games are not appropriate for my purposes. I am thinking of a simple, schematic, strategic game where people can make a limited set of simple moves. Moreover, the moves of the game should be conditioned not only by a pure logic (like in chess or go). The behavior in the game should depend on psychological factors, on relations between people. In more details, I think it should be a cooperation game where people make their decisions based on mutual trust. It would be nice if players can express punishment and forgiveness in the game. Does anybody knows a game that is close to what I have described above? ADDED I need to add that I need a game where actions of players are simple and easy to formalize. Because of that I cannot use verbal games (where communication between players is important). By simple actions I understand, for example, moves on the board from one position to another one, or passing chips from one player to another one and so on.

    Read the article

  • Grails GORM on multiple Forms

    - by Fabien Barbier
    Usually I'm using One-to-many relationship by this way : class Subject { static hasMany = [ crfs : Crf ] String name ... } class Crf { String title String info ... } I can extend this relationship to others domains, Ex : static hasMany = [ crfs : Crf, crfb : CrfBlood ...] But in my case I have to link the Subject domain to 30 others domains, maybe more...(ex : CrfBlood, CrfMedical, crfFamily, etc...). What domain model implementation should I use in my case ? I would like to keep the dynamic finders usability in my project.

    Read the article

  • Render only the segment/area of a circle that intersects the main circle

    - by Greenhouse Gases
    I absolutely love maths (or 'math' as most of you would say!) but I haven't done it to a level where I know the answer to this problem. I have a main circle which could have a centre point at any x and y on a display. Other circles will move around the display at will but at any given call to a render method I want to render not only those circles that intersect the main circle, but also only render the segment of that circle that is visible inside the main circle. An analogy would be a shadow cast on a real life object, and I only want to draw the part of that object that is 'illuminated'. I want to do this preferably in Java, but if you have a raw formula that would be appreciated. I wonder how one might draw the shape and fill it in Java, I'm sure there must be some variation on a polyline with arcs or something? Many thanks

    Read the article

  • Returning more than 1000 rows in classic asp adodb.recordset

    - by peg_leg
    My code in asp classic, doing a mssql database query: rs.pagesize = 1000 ' this should enable paging rs.maxrecords = 0 ' 0 = unlimited maxrecords response.write "hello world 1<br>" rs.open strSql, conn response.write "hello world 2<br>" My output when there are fewer than 1000 rows returned is good. More than 1000 rows and I don't get the "hello world 2". I thought that setting pagesize sets up paging and thus allows all rows to be returned regardless of how many rows there are. Without setting pagesize, paging is not enable and the limit is 1000 rows. However my page is acting as if pagesize is not working at all. Please advise.

    Read the article

  • How do I use AutofacWebTypesModule to Resolve HttpServerUtilityBase

    - by Scott Weinstein
    I have the following registrations builder.RegisterModule(new AutofacWebTypesModule()); builder.Register<MyType>(ctx => { var server = ctx.Resolve<HttpServerUtilityBase>(); ... }); When I try to resolve MyType via a constructor on an Controller, I get the following exception. What am I doing wrong? Autofac.Core.DependencyResolutionException was unhandled by user code Message=No scope matching the expression 'value(Autofac.Builder.RegistrationBuilder`3+<c__DisplayClass0[System.Web.HttpServerUtilityBase,Autofac.Builder.SimpleActivatorData,Autofac.Builder.SingleRegistrationStyle]).lifetimeScopeTag.Equals(scope.Tag)' is visible from the scope in which the instance was requested.

    Read the article

  • Maintaing list order in binary tree.

    - by TheBigO
    Given a sequence of numbers, I want to insert the numbers into a balanced binary tree such that when I do a preorder traversal on the tree, it gives me the sequence back. How can I construct the insert method corresponding to this requirement? Remember that the tree must be balanced, so there isn't a completely trivial solution. I was trying to do this with a modified version of an AVL tree, but I'm not sure if this can work out.

    Read the article

  • SQL: Speed Improvement - Cluttered union query

    - by vol7ron
    SELECT * FROM ( SELECT a.user_id, a.f_name, a.l_name, b.user_id, b.f_name, b.l_name FROM current_tbl a INNER JOIN import_tbl b ON ( a.user_id = b.user_id ) UNION SELECT a.user_id, a.f_name, a.l_name, b.user_id, b.f_name, b.l_name FROM current_tbl a INNER JOIN import_tbl b ON ( lower(a.f_name)=lower(b.f_name) AND lower(a.l_name)=lower(b.l_name) ) ) foo -- UNION -- SELECT a.user_id , a.f_name , a.l_name , '' , '' , '' FROM current_tbl a WHERE a.user_id NOT IN ( select user_id from( SELECT a.user_id, a.f_name, a.l_name, b.user_id, b.f_name, b.l_name FROM current_tbl a INNER JOIN import_tbl b ON ( a.user_id = b.user_id ) UNION SELECT a.user_id, a.f_name, a.l_name, b.user_id, b.f_name, b.l_name FROM current_tbl a INNER JOIN import_tbl b ON ( lower(a.f_name)=lower(b.f_name) AND lower(a.l_name)=lower(b.l_name) ) ) bar ) ORDER BY user_id Example of table population: current_tbl: ------------------------------- user_id | f_name | l_name ---------+----------+---------- A1 | Adam | Acorn A2 | Beth | Berry A3 | Calv | Chard | | import_tbl: ------------------------------- user_id | f_name | l_name ---------+----------+---------- A1 | Adam | Acorn A2 | Beth | Butcher <- last_name different | | Expected Output: ----------------------------------------------------------------------- user_id1 | f_name1 | l_name1 | user_id2 | f_name2 | l_name2 ----------+-----------+-----------+------------+-----------+----------- A1 | Adam | Acorn | A1 | Adam | Acorn A2 | Beth | Berry | A2 | Beth | Butcher A3 | Calv | Chard | | | Doing this method gets rid of conditions where the row would be: A2 | Beth | Berry | A2 | Beth | Butcher But it keeps the A3 row I hope this makes sense and I haven't overly simplified it. This is a continuation question from my other question. The succession of these improvements has dropped the query down from ~32000ms to where it's at now ~1200ms - quite an improvement. I supect I can optimize by using UNION ALL in the subquery and of course the usual index optimizations, but I'm looking for the best SQL optimization. FYI this particular case is for PostgreSQL.

    Read the article

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