Daily Archives

Articles indexed Wednesday November 16 2011

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

  • Is anyone doing "real" TDD with Visual-C++, and if yes, how do they do it?

    - by Martin
    Test Driven Development implies writing the test before the code and following a certain cycle: Write Test Check Test (run) Write Production Code Check Test (run) Clean up Production Code Check test (run) As far as I'm concerned, this is only possible if your development solution allows you to very quickly switch between the production and test code, and to execute the test for a certain production code part extremely quickly. Now, while there exist lots of Unit Testing Frameworks for C++ (I'm using Bost.Test atm.) it does seem that there doesn't really exist any decent (for native C++) Visual Studio (Plugin) solution that makes the TDD cycle bearable regardless of framework used. "Bearable" means that it's a one-click action to run a test for a certain cpp file without having to manually set up a separate testing project etc. "Bearable" also means that a simple test starts (linking!) and runs very quickly. So, what tools (plugins) and techniques are out there that make the TDD cycle possible for native C++ development with Visual Studio? Note: I'm fine with free or "commercial" tools. Please: No framework recommendations. (Unless the framework has a dedicated Visual Studio plugin and you want to recommend the plugin.) Edit Note: The answers so far have provided links on how to integrate a Unit Testing framework into Visual Studio. The resources more or less describe how to get the UT framework to compile and get your first Tests running. This is not what this question is about. I'm of the opinion that to really work productively, having the Unit Tests in a manually maintained(!), separate vcproj from your production classes will add so much overhead that TDD "isn't possible". As far as I am aware, you do not add extra "projects" to a Java or C# thing to enable Unit Tests and TDD, and for a good reason. This should be possible with C++ given the right tools, but it seems (this question is about) that there are very little tools for TDD/C++/VS. Googling around, I've found one tool, VisualAssert, that seems to aim in the right direction. However, afaiks, it doesn't seem to be in widespread use (compared to CppUnit, Boost.Test etc.). Edit: I would like to add a comment to the context for this question. I think it does a good summary of outlining (part of) the problem: (comment by Billy ONeal) Visual Studio does not use "build scripts" that are reasonably editable by the user. One project produces one binary. Moreover, Java has the property that Java never builds a complete binary -- the binary you build is just a ZIP of the class files. Therefore it's possible to compile separately then JAR together manually (using e.g. 7z). C++ and C# both actually link their binaries, so generally speaking you can't write a script like that. The closest you can get is to compile everything separately and then do two linkings (one for production, one for testing).

    Read the article

  • Are there any companies using BDD in a .NET environment?

    - by Nick
    I've seen BDD in action (in this case using SpecFlow and Selenium in a .NET environment) for a small test project. I was very impressed - mainly due to the fact that the language used to specify the acceptance tests meant they engaged with the product owner much more easily. I'm now keen to bring this into my current organisation. However I'm asked 'who else uses this?' and 'show me some case-studies'. Unfortunately I cannot find any 'big names' (or even 'small names' for that matter!) of companies who are actively using BDD. I have two questions really: Is BDD adopted by companies out there? Who are they? How can BDD be implemented in an agile .NET environment and are there any significant drawbacks to doing it?

    Read the article

  • Does syntax really matter in a programming language?

    - by Saif al Harthi
    One of my professors says "the syntax is the UI of a programming language", languages like Ruby have great readability and it's growing, but we see a lot of programmers productive with C\C++, so as programmers does it really matter that the syntax should be acceptable? I would love to know your opinion on that. Disclaimer: I'm not trying to start an argument. I thought this is a good topic of discussion. Update: This turns out to be a good topic. I'm glad you are all participating in it.

    Read the article

  • Is it bad idea to use flag variable to search MAX element in array?

    - by Boris Treukhov
    Over my programming career I formed a habit to introduce a flag variable that indicates that the first comparison has occured, just like Msft does in its linq Max() extension method implementation public static int Max(this IEnumerable<int> source) { if (source == null) { throw Error.ArgumentNull("source"); } int num = 0; bool flag = false; foreach (int num2 in source) { if (flag) { if (num2 > num) { num = num2; } } else { num = num2; flag = true; } } if (!flag) { throw Error.NoElements(); } return num; } However I have met some heretics lately, who implement this by just starting with the first element and assigning it to result, and oh no - it turned out that STL and Java authors have preferred the latter method. Java: public static <T extends Object & Comparable<? super T>> T max(Collection<? extends T> coll) { Iterator<? extends T> i = coll.iterator(); T candidate = i.next(); while (i.hasNext()) { T next = i.next(); if (next.compareTo(candidate) > 0) candidate = next; } return candidate; } STL: template<class _FwdIt> inline _FwdIt _Max_element(_FwdIt _First, _FwdIt _Last) { // find largest element, using operator< _FwdIt _Found = _First; if (_First != _Last) for (; ++_First != _Last; ) if (_DEBUG_LT(*_Found, *_First)) _Found = _First; return (_Found); } Are there any preferences between one method or another? Are there any historical reasons for this? Is one method more dangerous than another?

    Read the article

  • Why would I learn C++11, having known C and C++?

    - by Shahbaz
    I am a programmer in C and C++, although I don't stick to either language and write a mixture of the two. Sometimes having code in classes, possibly with operator overloading, or templates and the oh so great STL is obviously a better way. Sometimes use of a simple C function pointer is much much more readable and clear. So I find beauty and practicality in both languages. I don't want to get into the discussion of "If you mix them and compile with a C++ compiler, it's not a mix anymore, it's all C++" I think we all understand what I mean by mixing them. Also, I don't want to talk about C vs C++, this question is all about C++11. C++11 introduces what I think are significant changes to how C++ works, but it has introduced many special cases that change how different features behave in different circumstances, placing restrictions on multiple inheritance, adding lambda functions, etc. I know that at some point in the future, when you say C++ everyone would assume C++11. Much like when you say C nowadays, you most probably mean C99. That makes me consider learning C++11. After all, if I want to continue writing code in C++, I may at some point need to start using those features simply because my colleagues have. Take C for example. After so many years, there are still many people learning and writing code in C. Why? Because the language is good. What good means is that, it follows many of the rules to create a good programming language. So besides being powerful (which easy or hard, almost all programming languages are), C is regular and has few exceptions, if any. C++11 however, I don't think so. I'm not sure that the changes introduced in C++11 are making the language better. So the question is: Why would I learn C++11? Update: My original question in short was: "I like C++, but the new C++11 doesn't look good because of this and this and this. However, deep down something tells me I need to learn it. So, I asked this question here so that someone would help convince me to learn it." However, the zealous people here can't tolerate pointing out a flaw in their language and were not at all constructive in this manner. After the moderator edited the question, it became more like a "So, how about this new C++11?" which was not at all my question. Therefore, in a day or too I am going to delete this question if no one comes up with an actual convincing argument. P.S. If you are interested in knowing what flaws I was talking about, you can edit my question and see the previous edits.

    Read the article

  • Generate Multiple Choice Questions [closed]

    - by Daniel
    I'm working on a quiz application that will have a number of multiple choice questions. I'm waiting on the content from the client, but I'm hoping to start testing with some placeholder data for the time being. In order for the tests to be worthwhile, I probably need at least 100 multiple choice questions. I wanted to see if anyone knows of a resource or tool that can generate questions/multiple choice answers or propose another creative way to fill my quiz application with placeholder content. Ultimately the data will be in a MySQL database, but I don't really care what format the sample data is in (Excel, Word, JSON, etc.).

    Read the article

  • Are RSS feeds used? [closed]

    - by acidzombie24
    I was thinking about implementing RSS feeds on my site. The one thing that came to mind is Are RSS feeds ever used?! I don't use them nor know anyone who does. I know to use them it must be through an rss feed program or built in with the browser. I like my browser clean and i know many ppl dont know how to use/configure their browser. So with my thoughts i deducted that rss are not used 99.9999% of people (thats 4 decimal places which is really saying something). Now twitter on the other hand or even email may be used. But I have doubts about rss feeds. Can anyone give me statistics or change my mind on implementing it? I suspect it would be simple but i dont think i should bother if no one will ever use it. I dont even use SE/SO RSS feeds.

    Read the article

  • Is there an alternative to the term "calling object"?

    - by ybakos
    Let's suppose you've got a class defined (in pseudocode): class Puppy { // ... string sound = "Rawr!"; void bark() { print(sound); } } And say, given a Puppy instance, you call it's bark() method: Puppy p; p.bark(); Notice how bark() uses the member variable sound. In many contexts, I've seen folks describe sound as the member variable of the "calling object." My question is, what's a better term to use than "calling object?" To me, the object is not doing any calling. We know that member functions are in a way just functions with an implicit this or self parameter. I've come up with "receiving object," or "message recipient," which makes sense if you're down with the "messaging" paradigm. Do any of you happy hackers have a term that you like to use? I feel it should mean "the object upon which a method is called" and TOUWAMIC just doesn't cut it.

    Read the article

  • Is IronScheme complete enough or stable enough to be worth learning?

    - by World Engineer
    IronScheme is mentioned on Wikipedia as a successor to a failed project called IronLisp, bringing Lisp to CLR and .NET, the way Clojure does for the JVM. Does anyone have experience with this language? It looks fairly complete (99%) but I'm not sure how to judge whether it's worth my time to fiddle with getting it set up or not. By stable or complete, I mean using it for actual projects rather than just fiddling with tools and Project Euler style problems.

    Read the article

  • Are there any empirical studies on the effect of different languages on software quality?

    - by jgre
    The proponents of functional programming languages assert that functional programming makes it easier to reason about code. Those in favor of statically typed languages say that their compilers catch enough errors to make up for the additional complexity of type systems. But everything I read on these topics is based on rational argument, not on empirical data. Are there any empirical studies on what effects the different categories of programming languages have on defect rates or other quality metrics? (The answers to this question seem to indicate that there are no such studies, at least not for the dynamic vs. static debate)

    Read the article

  • Switching from Visual Studio to Eclipse [closed]

    - by Jouke van der Maas
    I've been using Visual Studio for about 6 years now, which is enough time to know most useful keyboard shortcuts and little features. I recently had to switch to Eclipse and java for school, and now I'm constantly searching for the right keys to press. I have searched around for a definitve guide on this, but I couldn't find any. Here's what I want to know: For any feature in Visual Studio, what is the equivalent feature in Eclipse called and what is it's default keyboard shortcut? Are there any things that work very differently in Eclipse, that one might misunderstand or do wrong at first when switching? Are there features in Visual Studio that Eclipse does not have, and is there a workaround? I hope we can create a guide to make life easier for future developers that have to make this switch. You can answer any of the three questions above (no need to do all three), and multiple per answer if you want. I can't mark questions as community wiki anymore, but I do think that's appropriate here.

    Read the article

  • Why does my RAID configuration with mdadm fail on reboots?

    - by Andy B
    I have been running Ubuntu server on my machine for 2 years and it has worked ok. I would like to speed it up by raiding a few drives. The machine is used to host my Mysql databases internally. using MDADM raid.. I have tried 2 schemes so far with the 3 drives. 2 partitions on each drive 1 for the swap 1 for the O/S both of them turned into drives raid level 5 3 partitions on each drive 1 for the boot 1 for the swap and 1 for the root. The boot I set to raid level1 and the swap and root raid drives were set to level5 Both setup worked fine for about a week, then on a reboot things fall apart. by fall apart I mean I end up with a bunch of hard drive errors on the screen and then get a grub prompt. Why do they fail on reboots? I am eager to understand what I am doing wrong thanks!

    Read the article

  • syslog not showing log levels in messages

    - by user837208
    Here is sample output of my syslog messages in /var/log/syslog : Nov 15 20:20:48 ubuntu winbindd[915]: [2011/11/15 20:20:48.940063, 0] winbindd/idmap_tdb.c:287(idmap_tdb_open_db) Nov 15 20:20:48 ubuntu winbindd[915]: Upgrade of IDMAP_VERSION from -1 to 2 is not possible with incomplete configuration How do I see what was the level of message? like info, warn, error etc? I am using Ubuntu 10.04 LTS with rsyslog package version 5.8.1-1ubuntu2

    Read the article

  • Garbled screen after sleep/suspend with nVidia 8800M GTS Ubuntu 11.10

    - by user34062
    Just did a clean install of 11.10, have been using it (and enjoying it!) for about a day now. But it seems that every time I resume from a sleep or blank screen after idling for a while, my desktop, as well as any programs on the screen get "garbled" I had a few windows open and all displayed the same gui glitching except for Chromium (I am guessing because it was minimized to the Unity Launcher, and not currently on the screen when I woke the PC up.) Anyone know what might be causing this, and how I might be able to fix it? I am using a Gateway P-6860FX with a C2D 1.8GHz, and nVidia 8800M GTS 512mb. Screenshot: http://dl.dropbox.com/u/28188839/Screenshot%20at%202011-11-15%2018%3A53%3A25.png NOTE: Yes, I know I misspelled Lothlorien.... .<

    Read the article

  • Can't get whole picture on the screen of a new monitor

    - by Gillian
    I have a 24inch, VM2453mh-LED, Viewsonic monitor using a Radeon 6570HD video card. Both are new. Viewsonic says the optimum size is 1920x1080. At this size the picture is beautiful, but it overlaps the screen vertically and horizontally. I am using Ubuntu 11.10, the Gnome 3 version, not Unity. On the Overview screen, the vertical icons are nearly off screen. Only the right edge shows. I opened the monitor's control menus to see if I could adjust it, but both the H/V Position and Horizontal Size are grayed out. I tried a 1600x1200 setting, and the picture was in bounds, but the quality was less, and it was stretched horizontally. The two monitor menu options were grayed out just like with the 1920x1080 setting. Can someone tell me how to resolve this problem?

    Read the article

  • How to run MU ONLINE?

    - by vytka11
    hi i am new in ubuntu still. i want to run mu online it is just 1 game with i play, but still can not run it. i downloaded wine program, but it looks that i need to download more or to do something. when i go to webzen page and click start game they offer me download webzen game starter. i downloaded it and instaled, but whne i press again start game it sed that i must download webzen game starter again. =( can somene help me?

    Read the article

  • How do I export banshee library settings to another machine?

    - by nityabaddha
    I am trying to downgrade my distro. The thing is, I have spent some few hours organising my music library and I do not want to lose my database. I have checked 'write meta data to files'. And so, my understanding is, that if I just import those same mp3s into a new library, those files will be arranged in the same order in the library. But this doesn't sound like a safe enough option. I'm moving from 11.10 to 10.04. Any help would be greatly appreciated. newbie

    Read the article

  • How do I fix a garbled screen on a Gateway LT3103u?

    - by paracaudex
    I've been having garbled screen problems on a Gateway LT3103u on Ubuntu for a while. I just did a fresh install of Ubuntu 11.10 and continue to have issues. I installed xubuntu-desktop in case the issues had to do with the sophisticated GNOME graphics. The problem is less bad, but it's still there. After a few minutes of using XFCE, the screen gets garbled. I assume this has something to do with the graphics card, but I don't know how to go about troubleshooting something like this. Where should I start? Update: Here is the description of the VGA card from lspci -vvv: 01:05.0 VGA compatible controller: ATI Technologies Inc RS690M [Radeon X1200 Series] (prog-if 00 [VGA controller]) Subsystem: Acer Incorporated [ALI] Device 028c Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx- Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast TAbort- SERR- [disabled] Capabilities: [50] Power Management version 2 Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot-,D3cold-) Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME- Capabilities: [80] MSI: Enable- Count=1/1 Maskable- 64bit+ Address: 0000000000000000 Data: 0000 Kernel driver in use: radeon Kernel modules: radeon Update: Setting GRUB_CMDLINE_LINUX="nomodeset" in /etc/default/grub seems to have fixed it in both Ubuntu and xubuntu-desktop. I will test it for a day or so to see if the problems recur and then post more detail with some links to an explanation. Update 2: It is possible to use this fix for Nvidia card (GTX 260) when graphics is defective after 11.10 upgrade/install? First few restarts was graphic ok, then after few restarts begins suddenly be defective and it stay so. I must returned to 11.04 because this problem and I wait for 12.04. So I hope in this fix.

    Read the article

  • Banshee won't play correct tracks

    - by Jaykay55
    I've just installed Banshee on Ubuntu 10.04 LTS, and manually imported 2 CDs. I needed to manually insert the track information as I haven't figured out how to access an online database. When I try to play track 17 from CD1, it always plays track 17 from CD2. The metadata should have been enough to differentiate between these tracks. How do I manually alter what is recorded in Banshee's database?

    Read the article

  • Please help restore my crashed launcher/compizconfig

    - by Will
    I have just upgraded from 11.04 to 11.10. Everything worked fine at first, but at one point when I was editing some CompizConfig settings (just something basic like 'number of desktops'), CompizConfig crashed. Then the whole launcher disappeared, along with most of the buttons in the top panel. The shutdown button, calendar, etc. all went, leaving just the tabs from File to Help. Also, windows now have the title and File, Edit..(etc) tabs on 2 separate lines, instead of the new format where hovering over the bar switches which one is visible. I have since been using Ctrl+Alt+T to open a terminal and open applications, shut down, etc, from there. I have typed in the command: unity --reset which has some effect, but the terminal never reaches the end of the task. I've also done apt-get update, which completed fine. Can anyone help me restore the launcher and panel functions?? I am getting most frustrated by the fact that once I have opened Firefox, I can't enter any other commands!

    Read the article

  • Keep only essential packages

    - by Stijn
    In an attempt to learn more about Ubuntu and its packages, I want to remove all non-essential packages, so I can install what I need, when I need them and know what they do. I'm using the commands dpkg --clear-selections and apt-get dselect-upgrade for this. I also slightly modify the selection by setting apt libstdc++6 (due to apt) install-info (due to grep) to install again (somehow dpkg thinks they are not essential, but apt-get complains). Is this ok, or is this bad? If it's ok, what do I do with the large list of packages with "deinstall" status in dpkg? An additional note, I'm doing this on a VPS template so I have no control over the initially installed packages.

    Read the article

  • Internet stops working after heavy downloading, video/audio streaming etc

    - by Kuba Szwed
    As mentioned in title, Internet stops working on my PC after heavy downloading, video/audio streaming etc. There are no errors, no disconnections etc. Simply after some time (certain amount of data downloaded) I can't get any more. If I try using ping afterwards nothing happens. If ping is running simultaneously with streaming/downloading I get some correct responses and then it keeps showing an error. What helps is re-plugging my Pentagram USB wifi card, but I hope there is a better solution. Edit: One more thing: my friend who works in IT suggested that it might have something to do with cache (DNS cache? I don't remember him specifying) getting filled while it should be emptied automatically.

    Read the article

  • Auto Login not working unless keyboard is plugged in

    - by Palani
    I want to use Ubuntu+Unity(11.10) in a kiosk computer (touchscreen all-in-one pc). I want to use touchscreen for all user input (like ATM). During Installation I have created only one account and enabled auto Login. Auto Login works perfectely when the keyboard connected. I don't have to press any key or use mouse, it logs in automatically. But Its not working when keyboard is not connected. OS boots and stops on login screen. I can't connect keyboard in final kiosk hardware installation.

    Read the article

  • No client internet access when setting up these iptables rules

    - by Siriss
    I have read many other posts but cannot figure this out. eth0 is my external connected to a Comcast modem. The server has internet access with no issues. eth1 is internal and running DHCP for the clients. I have DHCP working just fine, all my clients can get an IP and ping the server but they cannot access the internet. I am using ISC-DHCP-SERVER and have set /etc/default/isc-dhcp-server to INTERFACE="eht1" Here is my dhcpd.conf file located in /etc/dhcp/dhcpd.conf ddns-update-style interim; ignore client-updates; subnet 10.0.10.0 netmask 255.255.255.0 { range 10.0.10.10 10.0.10.200; option routers 10.0.10.2; option subnet-mask 255.255.255.0; option domain-name-servers 208.67.222.222, 208.67.220.220; #OpenDNS # option domain-name "example.com"; default-lease-time 21600; max-lease-time 43200; authoritative; } I have made the *net.ipv4.ip_forward=1* change in /etc/sysctl.conf here is my interfaces file: auto lo iface lo inet loopback auto eth0 iface eth0 inet dhcp iface eth1 inet static address 10.0.10.2 netmask 255.255.255.0 network 10.0.10.0 auto eth1 And finally- here is my iptables.conf file: # Firewall configuration written by system-config-firewall # Manual customization of this file is not recommended. *nat :PREROUTING ACCEPT [0:0] :OUTPUT ACCEPT [0:0] :POSTROUTING ACCEPT [0:0] -A POSTROUTING -s 10.0.10.0/24 -o eth0 -j MASQUERADE #-A PREROUTING -i eth0 -p tcp --dport 59668 -j DNAT --to-destination 10.0.10.2:59668 COMMIT *filter :INPUT ACCEPT [0:0] :FORWARD ACCEPT [0:0] :OUTPUT ACCEPT [0:0] -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT -A INPUT -p icmp -j ACCEPT -A INPUT -i lo -j ACCEPT -A INPUT -i eth1 -j ACCEPT -A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT -A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT -A INPUT -m state --state NEW -m tcp -p tcp --dport 443 -j ACCEPT -A INPUT -m state --state NEW -m tcp -p tcp --dport 53 -j ACCEPT -A INPUT -m state --state NEW -m udp -p udp --dport 53 -j ACCEPT -A FORWARD -s 10.0.10.0/24 -o eth0 -j ACCEPT -A FORWARD -d 10.0.10.0/24 -m state --state ESTABLISHED,RELATED -i eth0 -j ACCEPT -A FORWARD -p icmp -j ACCEPT -A FORWARD -i lo -j ACCEPT -A FORWARD -i eth1 -j ACCEPT #-A FORWARD -i eth0 -m state --state NEW -m tcp -p tcp -d 10.0.10.2 --dport 59668 -j ACCEPT -A INPUT -j REJECT --reject-with icmp-host-prohibited -A FORWARD -j REJECT --reject-with icmp-host-prohibited COMMIT I am completely stuck. I cannot figure out why the clients cannot access the internet. Am I missing a service? Is a service not running? Any help would be greatly appreciated. I tried to be as thorough as possible but please let me know if I have missed something. Thank you!

    Read the article

  • Unity 3D does not work on Dell system with a AMD Radeon HD 6470M

    - by VeeKay
    I am running 64 bit Ubuntu on Dell with 1GB graphic card. I login with "Ubuntu" hoping to see Unity 3d but it doesn't. Unity 2D runs instead. when I type in echo "$DESKTOP_SESSION" it confirms the Unity-2D. I've checked the System info that shows like : The graphics row shows itself as empty. SO I've presumed that the graphic drivers aren't detected and hence I went to Unity- Additional Drivers and installed the fglrx driver that the UI has suggested. Even after installing so, the graphics part in System info details shows nothing and still Unity 2D runs in spite of all the effort. Please help! How can I get my Unity 3D back? Hardware Info Video Card : AMD Radeon™ HD 6470M - 1GB (For ICC) RAM : 6GB (1 X 2GB + 1 X 4GB) 2 DIMM DDR3 1333Mhz OS : 64 bit Ubuntu 11.10 Edit : Output for /usr/lib/nux/unity_support_test -p X Error of failed request: BadRequest (invalid request code or no such operation) Major opcode of failed request: 155 (GLX) Minor opcode of failed request: 19 (X_GLXQueryServerString) Serial number of failed request: 21 Current serial number in output stream: 21

    Read the article

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