Search Results

Search found 706 results on 29 pages for 'loose'.

Page 16/29 | < Previous Page | 12 13 14 15 16 17 18 19 20 21 22 23  | Next Page >

  • cant find div element in ajax data find

    - by Shrey
    This is my whole Ajax page which is returned <!DOCTYPE div PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <div class="CareerAjaxData">Simple Div Content</div> The jQuery script in the Main page which calls this Ajax page is $.ajax({ type : 'POST', url : url, data : data, datatype : 'html', success : function(ajaxdata) { var $tabcontent = $(ajaxdata).find('.CareerAjaxData'); console.log($tabcontent.html()); } }); But the output of Console gives: undefined I get proper response from the server. But there some problem with js I guess. whats wrong here..??

    Read the article

  • Looking for a new PHP website framework

    - by Glycerine
    I built many a website, and my own 'custom' framework is just a general box of scripts cobbled together with loose ideas. I would love to progress to a framework which allows me to pass it onto the client for freedom. Someone suggested using wordpress but I'm not sure how general this can be. A current site I need to build is a fancy kitchen company, price lists, flash gallery (with backend driven pics) and well designed home. How could I bend the the will of wordpress? Alternatively, does anyone have a suggestion for an alternative. Thanks in advance guys -

    Read the article

  • Why RichTextBox lose format after appending new String?

    - by user556526
    Hi guys I have aproblem with rich text box string color: I have the richtexbox that user type a message in it. I mark up each word that exist in my dictionary. I use this code for it: this.inputTextAreaRtb.Text=this.inputTextAreaRtb.Text.Remove(startCoordinate, endCoordinate - startCoordinate); this.inputTextAreaRtb.SelectionStart = this.inputTextAreaRtb.Text.Length; this.inputTextAreaRtb.SelectionLength = 0; this.inputTextAreaRtb.SelectionFont = new System.Drawing.Font( "David", 12, FontStyle.Underline); this.inputTextAreaRtb.SelectionColor = Color.DarkBlue; this.inputTextAreaRtb.AppendText(_word); this.inputTextAreaRtb.SelectionColor = this.inputTextAreaRtb.ForeColor; this.inputTextAreaRtb.SelectionFont = new System.Drawing.Font( "David", 12, FontStyle.Regular); But each time if I already marked up a word a loose formatting of words that already formatted. Any ideas of this problem?

    Read the article

  • CruiseControl.NET Silverlight Unit Tests Interact with Desktop Windows Server 2008

    - by user292195
    Hi, Currently we have CCService running as a Domain account because the build scripts deploy to a network location. However this causes any unit tests that test the view to fail. Due to not being allowed to interact with desktop. I can change the CCService to run as local system which works however i loose network connectivity. I also have tried setting up a /interactive cmd.exe but this has been deprecated in Windows Server 2008. Any Ideas on this one? Thanks Jeremy

    Read the article

  • Static assembly initialization

    - by ph0enix
    I'm attempting to develop an Interceptor framework (in C#) where I can simply implement some interfaces, and through the use of some static initialization, register all my Interceptors with a common Dispatcher to be invoked at a later time. The problem lies in the fact that my Interceptor implementations are never actually referenced by my application so the static constructors never get called, and as a result, the Interceptors are never registered. If possible, I would like to keep all references to my Interceptor libraries out of my application, as this is my way of (hopefully) enforcing loose coupling across different modules. Hopefully this makes some sense. Let me know if there's anything I can clarify... Does anyone have any ideas, or perhaps a better way to go about implementing my Interceptor pattern? TIA, Jeremy

    Read the article

  • Get location from where the Java code is executed

    - by drasto
    I have a swing Java application that preserves a lot of data (you can think of a game and its saves for example). Those data are stored in files rather then in database. I would like to keep this files near installation files(.jar file) of my application.Some users(like me) are used to delete default application folder of OS when it comes to large and I don't want them to loose their data this way. Any ideas how to do this easily ? How do I get the folder of the .jar file from program that is executing form that .jar file? Or how do I output files directly into some package? How do I create packages(folders inside jar) dynamically ? Or is there a simple way to distribute Java application in other formats then .jar and then store generated data in installation (sub)folder ? Thanks for reading

    Read the article

  • SVN: change a past revision and have the change in current

    - by John Isaacks
    ok say I am on revision 4. I check it out, make some change and commit it. I am not on revision 5. I check it out again, am making some changes, but I am informed that there was a typo from revision 5 that needs to be changed right away. I don't want to fix it in my current working copy because I am in the middle of something and it wont be ready to commit yet. But I don't want to revert back to revision 5 and loose all my work. what I want to do is go back to revision 5, make the small change, commit it. And ALSO have that change made to my current working copy as well. I hope that makes sense. Is there a way to do that?

    Read the article

  • Flex list-controls - maintain remote data

    - by artemb
    Hello. I have a TileList which represents some remote data. I also have a form which allows me to change the data. And the data may be changed by someone else too. What is the best way to maintain data in the list in an up-to-date state? The simplest option I see is the following: Select an item in the list Edit it in the form Save it. The form submits the data to the server When the server reports success the list re-fetches it's data The very bad thing about this workflow is that the list loses selection (a tree would also loose the nodes' expanded/collapsed state). I would really love to find out another option which would enable the list to maintain it's selection state. Any guesses on how it may be done?

    Read the article

  • how to use ByteArrayOutputStream and DataOutputStream simultaneously (Java)

    - by Manuel
    Hi! I'm having quite a problem here, and I think it is because I don't understand very much how I should use the API provided by Java. I need to write an int and a byte[] into a byte[] I thought of using a DataOutputStream to solve the data writing with writeInt(int i) and write(byte[] b), and to be able to put that into a byte array, I should use ByteArrayOutputStream's method toByteArray(). I understand that this classes use the Wrapper pattern, so I had two options: DataOutputStream w = new DataOutputStream(new ByteArrayOutputStream()); or ByteArrayOutputStream w = new ByteArrayOutputStream(new DataOutputStream()); but in both cases, I "loose" a method. in the first case, I can't access the toByteArray method, and in the second, I can't access the writeInt method. How should I use this classes together?

    Read the article

  • Just how much do I want to make virtual?

    - by Alex
    I am writing an abstract superclass where literally every method is going to be overridden. There is some default functionality I could implement, but most of the time it's enough to leave the implementation to the subclass writer. Since just about every method is going to be overwritten, how much should I make virtual and how much should I just leave as regular methods? In the current incarnation, everything is virtual, but I still haven't let this loose to anyone to use, so the design is flexible. What advantages/disadvantages are there to virtual functions? Links to good reading material about this would be appreciated.

    Read the article

  • saving value selected in a list when submit button is cliked

    - by kawtousse
    Hi everyone, In my JSP I have a dropdownlist and a submit button when clicking the submit button I loose the value already selected in my list. I am using the jstl because i need to construct other table corresponding the value selected in my list.For that I must call a submit button but the problem; it reset the value selected I want to know if there is a way to save the value selected in my list even I click a submit button. I work with JSP and eclipse environment. Think you for your help.

    Read the article

  • How to restore data on Power Failure using C++ programming on windows.

    - by Tarun
    Hi, In my program I am writing a file of my programs states. I am writing the file many times to the file during the program run, because the program changes some variables that that i need to store very frequently. Now, if , for some reasons my power fails. Then most of the time I loose data in that file. Please, tell me any mechanism which can protect data even if the power fails. (I have written C++ program on windows). Thank you

    Read the article

  • Hibernate mysql groupe by day whith 0 entities

    - by Touhami
    I have this function i need to do that in sql (hibernate or mysql) or a java function that interpert the array of results select DAY(affaire.docCreationDate), count(affaire.docfullName) from CRMAffaireCode.AffaireClass as affaire where affaire.docfullName like 'CRMAffaire.Affaire%' and affaire.docCreationDate = '" + startDate + " 00:00:00' and affaire.docCreationDate <= '" + endDate + " 23:59:59' GROUP BY DAY(affaire.docCreationDate)" i have this entitie count in my table 2012-10-05 3 2012-10-06 0 2012-10-07 7 2012-10-08 13 2012-10-09 9 2012-10-10 0 2012-10-11 0 2012-10-12 3 the request return me this values 5 3 7 7 8 13 9 9 12 3 in this way i loose three lignes that have 0 as value, i need a request that return me this 5 3 6 0 7 7 8 13 9 9 10 0 11 0 12 3

    Read the article

  • How to perform .select() on jQuery masked text input

    - by dllhell
    I'm using http://digitalbush.com/projects/masked-input-plugin/ plugin. There is an input text with defined mask: <input type="text" id="txtMyInput" class="FocusSense"/> and a script: $(document).ready(function () { jQuery(function ($) { $("#txtMyInput").mask("?9.99"); }); $(".FocusSense").focus(function () { this.select(); }); }) As you can see, I would like select all in txtMyInput on focus but but alas! On focus, mask appears and loose .select(). What should I do to preserve mask and .select()?

    Read the article

  • Desktop Fun: Abstract Icon Packs

    - by Asian Angel
    Do you prefer a more unique, artistic, or alternative look for your desktop setup? Then you will definitely want to have a look through our Abstract Icon Packs collection. Just set your imagination loose and enjoy the wonderful desktops that these icon packs can inspire for you. Note: To customize the icon setup on your Windows 7 & Vista systems see our article here. Using Windows XP? We have you covered here. Sneak Preview For this week’s preview desktop we created an Alien Desert Planet theme using the Abstract Symbol Icons pack shown below. Note: The original, unmodified version of this wallpaper can be found here. Here is a closer look at the icons we used for our new theme… The Icon Packs Match-stick-play Icons *.ico format only Download Abstract Symbol Icons *.ico format only Download Allomantic Metals *.ico format only Download Mutated Snowflake Icon Set *.ico format only Download Shades of Geometry *.ico format only Download Starry Objects Icons *.ico format only Download New Sin – Abstract Human Icons *.ico, .png, and .psd format Note: While most of the icons in this pack look similar at first glance, there are differences when viewed at a larger size. Download Mysterious Icons *.ico format only Download Alien Icons *.ico format only Download Beads Icons *.ico format only Download Magic Flowers Icons *.ico format only Download Circle Shapes Icons *.ico format only Download geometric doc icons *.png format only Download alumina *.png format only Download Citiscape dockicons *.png format only Download Wanting more great icon sets to look through? Be certain to visit our Desktop Fun section for more icon goodness! Latest Features How-To Geek ETC How to Use the Avira Rescue CD to Clean Your Infected PC The Complete List of iPad Tips, Tricks, and Tutorials Is Your Desktop Printer More Expensive Than Printing Services? 20 OS X Keyboard Shortcuts You Might Not Know HTG Explains: Which Linux File System Should You Choose? HTG Explains: Why Does Photo Paper Improve Print Quality? Add Falling Snow to Webpages with the Snowfall Extension for Opera [Browser Fun] Automatically Keep Up With the Latest Releases from Mozilla Labs in Firefox 4.0 A Look Back at 2010 Through Infographics Monitor the Weather with the Weather Forecast Extension for Opera Orbiting at the Edge of the Atmosphere Wallpaper Simon’s Cat Explores the Christmas Tree! [Video]

    Read the article

  • BUILD 2013 - Microsoft Set to Unveil It&rsquo;s Reinvention

    - by D'Arcy Lussier
    Originally posted on: http://geekswithblogs.net/dlussier/archive/2013/06/24/153211.aspxSome thoughts as we head into BUILD this week… This week in San Francisco Microsoft will be hosting the BUILD conference. They’ll be talking up Windows 8.1 (Windows Blue), more Azure, some Windows Phone, XBox, Office 365… actually, they told us on the original BUILD announcement site what we’d be seeing:           While looking at this, consider a recent article from The Verge that talks about the speculation of a huge shake up at Microsoft . From the article: All Things D quotes one insider as saying they're "titanic" changes, noting they might be attached to Ballmer's legacy at the company. "It’s the first time in a long time that it feels like that there will be some major shifts, including some departures," says the alleged insider. Considering Ballmer let Sinofsky go right after the Windows 8 launch, the idea of Microsoft cutting loose some executives doesn’t seem to be big news. But the next piece of the article frames things more interestingly: Ballmer is reportedly considering a new structure that would create four separate divisions: enterprise business, hardware, applications and services, and an operating systems group. This statement got me thinking…what would this new structure look like? Below is one possibility: At a recent (this year or last year, I can’t recall which) Microsoft shareholder’s meeting, Ballmer made the statement that Microsoft is now a products and services company. At the time I don’t think I really let that statement sink in. Partially because I really liked the Microsoft of my professional youth – the one that was a software and platform company. In Canada, Microsoft has been pushing three platform areas: Lync, Azure, and SQL Server. I would expect those to change moving forward as Microsoft continues to look for Partners that will help them increase their Services revenue through solutions that incorporate/are based on Azure, Office 365, Lync, and Dynamics. I also wonder if we’re not seeing a culling of partners through changes to the Microsoft Partner Program. In addition to the changing certification requirements that align more to Microsoft’s goals (i.e. There is no desktop development based MCSD, only Windows 8 Store Apps), competencies that partners can qualify for are being merged, requirements changed, and licenses provided reduced. Ballmer warned as much at the last WPC though that they were looking for partners who were “all in” with Microsoft, and these programs seem to support that sentiment. Heading into BUILD this week, I’ll be looking to answer one question – what does it mean to be a Microsoft developer here in the 2010’s? What is the future of the Microsoft development platform? Sure, Visual Studio is still alive and well and Microsoft realizes that there’s a huge install base of .NET developers actively working on solutions. But they’ve ratcheted down the messaging around their development stack and instead focussed on promoting development for their platforms and services. Last year at BUILD with the release of Windows 8, Microsoft just breached the walls of its cocoon. After this BUILD and the organizational change announcements in July, we’ll see what Microsoft looks like fully emerged from its metamorphosis.

    Read the article

  • How to Write an E-Book

    A few days ago my attention was drawn to a tweet spat between Karl Seguin and Scott Hanselman around the relaunch of ASP.NET and the title element in HTML. Tempest in a teapot of course, but worthwhile as I did some googling on Karl and found his blog at codebetter.com. From there it was a short jump to his free e-book, The Foundations of Programming. This short book is distinguished by its orientation, opinionated, its tone, mentoring and its honesty, which is refreshing. In Foundations, Karl covers what he considers the basics of programming and good design, including test driven development, dependency injection and domain driven design. Karl is opinionated, as the topics suggest, and doesnt bother to pretend that he doesnt think what hes suggesting is the better way, not just another way. He is aligned with ALT.NET, and gives an excellent overview of what that means; an overview more enlightening than the ALT.NET site. ALT.NET has its critics, but presenting a strong opinion grabbed my attention as a reader. It is a short walk from opinionated to hectoring,  but Karl held my attention without insulting me. He takes the time to explain, with examples, from the ground up, the problems that test driven development and dependency injection solve. So for dependency injection he builds it up from no DI, to a hand crafted approach, to a full fledged DI framework. This approach is more persuasive than just proscriptive and engaged me as the reader to follow along with his train of thought. Foundations is not as pedantic as I am making it sound. The final ingredient in Karls mix is honesty. He acknowledges that sometimes unit testing does cost more up front and take more time. He admits that sometimes he designs something a certain way just to be testable. He also warns that focusing too much on DI and loose coupling can lead to the poor design you are trying to avoid. These points add depth to his argument as I could tell hes speaking from experience, with some hard won lessons. I enjoyed The Foundations of Programming. When I was done with it, I was amazed how much I got a lot out of its 80 some pages. It is a rarity to come across something worthwhile that is longer then a tweet, but shorter than a tome these days. Well done Karl.   -- Relevant Links -- The now titled and newly relaunched page in question: http://www.asp.net/ The pleasantly confusing ALT.NET homepage: http://altdotnet.org/ A longer review, with details, chapter listings and all that important stuff: http://accidentaltechnologist.com/book-reviews/book-review-foundations-of-programming-by-karl-seguin/Did you know that DotNetSlackers also publishes .net articles written by top known .net Authors? We already have over 80 articles in several categories including Silverlight. Take a look: here.

    Read the article

  • How do I (tactfully) tell my project manager or lead developer that the project's codebase needs serious work?

    - by Adam Maras
    I just joined a (relatively) small development team that's been working on a project for several months, if not a year. As with most developer joining a project, I spent my first couple of days reviewing the project's codebase. The project (a medium- to large-sized ASP.NET WebForms internal line of business application) is, for lack of a more descriptive term, a disaster. There are three immediately noticeable problems with the coding standards: The standard is very loose. It describes more of what not to do (don't use Hungarian notation, etc..) than what to do. The standard isn't always followed. There are inconsistencies with the code formatting everywhere. The standard doesn't follow Microsoft's style guidelines. In my opinion, there's no value in deviating from the guidelines that were set forth by the developer of the framework and the largest contributor to the language specification. As for point 3, perhaps it bothers me more because I've taken the time to get my MCPD with a focus on web applications (specifically, ASP.NET). I'm also the only Microsoft Certified Professional on the team. Because of what I learned in all of my schooling, self-teaching, and on-the-job learning (including my preparation for the certification exams) I've also spotted several instances in the project's code where things are simply not done in the best way. I've only been on this team for a week, but I see so many issues with their codebase that I imagine I'll be spending more time fighting with what's already written to do things in "their way" than I would if I were working on a project that, for example, followed more widely accepted coding standards, architecture patterns, and best practices. This brings me to my question: Should I (and if so, how do I) propose to my project manager and team lead that the project needs to be majorly renovated? I don't want to walk into their office, waving my MCTS and MCPD certificates around, saying that their project's codebase is crap. But I also don't want to have to stay silent and have to write kludgey code atop their kludgey code, because I actually want to write quality software and I want the end product to be stable and easily maintainable.

    Read the article

  • Meet Peter, 80 years old today

    - by AdamRG
    You have to arrive at the office early in the morning to meet Peter. He arrives at 5am and by 8:30am he's gone. Peter has been a cleaner here for several years. He is 80 years old today. Peter was born only a couple of km from our office in Cambridge, England and was for many years an Engineer for Pye Electronics. I'm lucky enough to arrive in the office early enough to catch Peter, dressed smarter than most of us in shirt and tie, and he tells stories of how Cambridge was years ago. He says the site of our office is on land between what would have been a prisoner of war camp (camp 1025), and a few hundred metres North, a camp of American allies. In February 1944, Peter was 13 years old. One night, a Dornier Do 217 heavy bomber heading towards London was hit by anti-aircraft fire and the crew of four parachuted from the plane. The plane however, continued on autopilot for over 50km. Gradually dropping lower and lower, narrowly missing the spires of Cambridge, it eventually came to land, largely intact, in allotment gardens by Peter's house near Milton Road. He told me that he was quick to the scene, along with some other young lads, and grabbed parts of the plane as souvenirs. It's one of many tales that Peter recounts, but I happened to discover a chapter about this particular plane crash in a history book called the War Torn Skies of Great Britain by Julian Evan-Hart. It reads: 'It slid to a halt in the allotment gardens of Milton Road. The cockpit ended up crumpled against a wooden fence and several incendiary bombs that had broken loose from their containers in the ruptured bomb bay were strewn over the ground behind the Dornier.' I smiled when I read the following line: 'Many residents came to see the Dornier in the allotments. Several lads made off with souvenirs' It seems a young Peter has been captured in print! For his birthday, among other things, we gave him a copy of the book. Working for a software company and rushing headlong through the 21st century, it's easy to forget even our recent history, or what feet stood on the same ground before us. That aircraft crashed only 700 metres from where our office now stands. The disused and overgrown railway line that runs down the side of the office closed to passengers 30 years ago. The industrial estate the other side was the site of a farm, Trinity Hall Farm, as recently as 60 years ago. Roman rings and Palaeolithic handaxes have been unearthed nearby. I suppose Peter will be one of the last people I'll ever hear talking first-hand about Cambridge during the war. It's a privilege to know him. Happy birthday Peter.

    Read the article

  • how to reinstall/repair ubuntu 12.04 after dual boot installation fails with windows 7

    - by Rini
    I have installed Ubuntu 12.04 on my preinstalled windows 7 Sony vaio s series laptop following instructions here: http://www.linuxbsdos.com/2012/05/17/how-to-dual-boot-ubuntu-12-04-and-windows-7/ Everything went well and I am able to boot in to windows after complete installation of Ubuntu. Now following instructions on web I tried to add Ubuntu to my BIOS using Easy BCD (but forget to add windows 7 entry). As a result, I loose windows 7 OS and can't boot in to either OS then I successfully repaired windows 7 using recovery CD. Now my problem is that I can't reinstall Ubuntu 12.04 using Live CD it halts every time before disk partition step giving error. "ubi-partman crashed". "ubi-partman failed with exit code 141. further information may be found in /var/log/syslog. Do you want to try running this step again before continuing? If you do not, your installation may fail entirely or may be broken." and, any choice to continue will result in the same error. I looked in to /var/log/syslog but not able to understand what is error. Then, I ran sudo fdisk -l to view my partitions and it shows me only one partition. Probably, all the partitions I created for Ubuntu 12.04 are lost while running windows 7 recovery CD. So, I don't know whether the Ubuntu is still there or probably corrupted. My boot-info URL is: http://paste.ubuntu.com/1202146/ Please tell me how to remove this error so that I can reinstall/repair Ubuntu 12.04 Thanks in advance. R Shukla My boot-info URL is: http://paste.ubuntu.com/1202146/ Please tell me how to remove this error so that I can reinstall/repair Ubuntu 12.04 Thanks for your help! I tried to boot from the CD but I every time it give me error before disk partitioning step. Also, I am unable to start Gparted. "ubi-partman crashed". "ubi-partman failed with exit code 141. further information may be found in /var/log/syslog. Do you want to try running this step again before continuing? If you do not, your installation may fail entirely or may be broken." and, any choice to continue will result in the same error. I looked in to /var/log/syslog but not able to understand what is error. Then, I ran sudo fdisk -l to view my partitions and it shows me only ne partition. Probaply, all the partitions I created for Ubuntu 12.04 are lost while running windows 7 recovery CD. Please tell me how to remove this error. Best Regards, R S

    Read the article

  • How to detect collisions in AS3?

    - by Gabriel Meono
    I'm trying to make a simple game, when the ball falls into certain block, you win. Mechanics: The ball falls through several obstacles, in the end there are two blocks, if the ball touches the left block you win, the next level will contain more blocks and less space between them. Test the movie (click on the screen to drop the ball): http://gabrielmeono.com/downloads/Lucky_Hit_Alpha.swf These are the main variables: var winBox:QuickObject;//You win var looseBox:QuickObject;//You loose var gameBall:QuickObject;//Ball dropped Question: How do I trigger a collision function if the ball hits the winBox? (Win message/Next level) Thanks, here is the full code: package { import flash.display.MovieClip; import com.actionsnippet.qbox.*; import flash.events.MouseEvent; [SWF(width = 600, height = 600, frameRate = 60)] public class LuckyHit extends MovieClip { public var sim:QuickBox2D; var winBox:QuickObject; var looseBox:QuickObject; var gameBall:QuickObject; /** * Constructor */ public function LuckyHit() { sim = new QuickBox2D(this); //sim.createStageWalls(); winBox = sim.addBox({x:5,y:600/30, width:300/30, height:10/30, density:0}); looseBox = sim.addBox({x:15,y:600/30, width:300/30, height:10/30, density:0}); // make obstacles for (var i:int = 0; i<(stage.stageWidth/50); i++){ //End sim.addCircle({x:1 + i * 1.5, y:16, radius:0.1, density:0}); sim.addCircle({x:2 + i * 1.5, y:15, radius:0.1, density:0}); //Mid End sim.addCircle({x:0 + i * 2, y:14, radius:0.1, density:0}); sim.addCircle({x:0 + i * 2, y:13, radius:0.1, density:0}); sim.addCircle({x:0 + i * 2, y:12, radius:0.1, density:0}); sim.addCircle({x:0 + i * 2, y:11, radius:0.1, density:0}); sim.addCircle({x:0 + i * 2, y:10, radius:0.1, density:0}); //Middle Start sim.addCircle({x:0 + i * 1.5, y:09, radius:0.1, density:0}); sim.addCircle({x:1 + i * 1.5, y:08, radius:0.1, density:0}); sim.addCircle({x:0 + i * 1.5, y:07, radius:0.1, density:0}); sim.addCircle({x:1 + i * 1.5, y:06, radius:0.1, density:0}); } sim.start(); stage.addEventListener(MouseEvent.CLICK, _clicked); } /** * .. * @param e MouseEvent.CLICK */ private function _clicked(e:MouseEvent) { gameBall = sim.addCircle({x:(mouseX/30), y:(1), radius:0.25, density:5}); } } }

    Read the article

  • Is commented out code really always bad?

    - by nikie
    Practically every text on code quality I've read agrees that commented out code is a bad thing. The usual example is that someone changed a line of code and left the old line there as a comment, apparently to confuse people who read the code later on. Of course, that's a bad thing. But I often find myself leaving commented out code in another situation: I write a computational-geometry or image processing algorithm. To understand this kind of code, and to find potential bugs in it, it's often very helpful to display intermediate results (e.g. draw a set of points to the screen or save a bitmap file). Looking at these values in the debugger usually means looking at a wall of numbers (coordinates, raw pixel values). Not very helpful. Writing a debugger visualizer every time would be overkill. I don't want to leave the visualization code in the final product (it hurts performance, and usually just confuses the end user), but I don't want to loose it, either. In C++, I can use #ifdef to conditionally compile that code, but I don't see much differnce between this: /* // Debug Visualization: draw set of found interest points for (int i=0; i<count; i++) DrawBox(pts[i].X, pts[i].Y, 5,5); */ and this: #ifdef DEBUG_VISUALIZATION_DRAW_INTEREST_POINTS for (int i=0; i<count; i++) DrawBox(pts[i].X, pts[i].Y, 5,5); #endif So, most of the time, I just leave the visualization code commented out, with a comment saying what is being visualized. When I read the code a year later, I'm usually happy I can just uncomment the visualization code and literally "see what's going on". Should I feel bad about that? Why? Is there a superior solution? Update: S. Lott asks in a comment Are you somehow "over-generalizing" all commented code to include debugging as well as senseless, obsolete code? Why are you making that overly-generalized conclusion? I recently read Robert Glass' "Clean Code", which says: Few practices are as odious as commenting-out code. Don't do this!. I've looked at the paragraph in the book again (p. 68), there's no qualification, no distinction made between different reasons for commenting out code. So I wondered if this rule is over-generalizing (or if I misunderstood the book) or if what I do is bad practice, for some reason I didn't know.

    Read the article

  • What Is Nuclear Meltdown?

    - by Gopinath
    Japan was first hit by a massive earth quake, then a ruthless tsunami washed away thousands of homes and now they fear the worst – meltdown of nuclear power stations in the quake hit year. Nuclear meltdowns are horrifying – remember the Chernobyl incident in Russia? The Chernobyl reactor meltdown released 400 times more radio active material than the atomic bombing of Hiroshima. The effects of nuclear meltdowns are beyond imagination of a common man, thousands of people loose their lives and many more lakhs of people suffer with radiation related diseases for many years. Nuclear Meltdowns are dangerous, but how do they happen? What causes a nuclear meltdown? In simple terms – Nuclear meltdown is an accident that happens due to severe overheating of a nuclear reactor and results in release of nuclear radiation into the environment.  How A Nuclear Meltdown Happens? According to Wikipedia A meltdown occurs when a severe failure of a nuclear power plant system prevents proper cooling of the reactor core, to the extent that the nuclear fuel assemblies overheat and melt. A meltdown is considered very serious because of the potential that radioactive materials could be released into the environment. The fuel assemblies in a reactor core can melt if heat is not removed. A nuclear reactor does not have to remain critical for a core damage incident to occur, because decay heat continues to heat the reactor fuel assemblies after the reactor has shut down, though this heat decreases with time. A core damage accident is caused by the loss of sufficient cooling for the nuclear fuel within the reactor core. The reason may be one of several factors, including a loss of pressure control accident, a loss of coolant accident (LOCA), an uncontrolled power excursion or, in some types, a fire within the reactor core. Failures in control systems may cause a series of events resulting in loss of cooling. Contemporary safety principles of defense in depth, ensure that multiple layers of safety systems are always present to make such accidents unlikely. Video – What Causes Nuclear Meltdown AlJazeera news has a good analysis on feared nuclear meltdown of Japan’s nuclear plants and also an animation on what causes Nuclear Meltdown. cc image credit: flickr/jtjdt This article titled,What Is Nuclear Meltdown?, was originally published at Tech Dreams. Grab our rss feed or fan us on Facebook to get updates from us.

    Read the article

  • A few questions about integrating AudioKinetic Wwise and Unity

    - by SaldaVonSchwartz
    I'm new to Wwise and to using it with Unity, and though I have gotten the integration to work, I'm still dealing with some loose ends and have a few questions: (I'm on Unity 4.3 as of now but I think it shouldn't make any difference) The base path: The Wwise documentation implies you set this in the AkGlobalSoundEngineInitializer basePath public ivar, which is exposed to the editor. However, I found that this variable is not really used. Instead, the path is hardcoded to /Audio/GeneratedSoundBanks in AkBankPath. I had to modify both scripts to actually look in the path that I set in the editor property. What's the deal with this? Just sloppyness or am I missing something? Also about paths: since I'm on Mac, I'm using Unity natively under OS X and in tadem, the Wwise authoring tool via VMWare and I share the OS X Unity project folder so I can generate the soundbanks into the assets folder. However, the authoring tool (downloaded the latest one for Windows) doesn't automatically generate any "platform-specific" subfolders for my wwise files. That is, again, the Unity integration scripts assume the path to be /Audio/GeneratedSoundBanks/<my-platform>/ which in my case would be Mac (I set the authoring tool to generate for Mac). The documentation says wwise will automatically generate the platform-specific folders but it just dumps all the stuff in GeneratedSoundBanks. Am I missing some setting? cause right now I just manually create the /Mac folder. The C# methods AkSoundEngine.PostEvent and AkSoundEngine.LoadBank for instance, have a few overloads, including ones where I can refer to the soundbanks or events by their ID. However, if I try to use these, for instance: AkSoundEngine.LoadBank(, AkSoundEngine.AK_DEFAULT_POOL_ID) where the int I got from the .h header, I get Ak_Fail. If I use the overloads that reference the objects by string name then it works. What gives? Converting the ID header to C#: The integration comes with a C# script that seems to fork a process to call Python in turn to covert the C++ header into a C# script. This always fails unless I manually execute the Python script myself from outside Unity. Might be a permissions thing, but has anyone experienced this? The Profiler: I set up the Unity player to run in the background and am using the "Profile" version of the plugin. However, when I start the Unity OS X standalone app, the profiler in VMWare does not see it. This I'm thinking might just be that I'm trying to see a running instance of the sound engine inside an OS X binary from a Windows virtual machine. But I'm just wondering if anyone has gotten the Windows profiler to see an OS X Unity binary. Different versions of the integration plugin: It's not clear to me from the documentation whether I have to manually (or write a script to do it) remove the "Profile" version and install the "Release" version when I'm going to do a Release build or if I should install both version in Unity and it'll select the right one. Thanks!

    Read the article

  • Diagnosing the problem when Canon printer fails to print under Ubuntu

    - by MMA
    I understand that the issue of Canon printer under Linux has a number of posts. Actually one of these, was started by me. After inputs from others I have successfully printed using Canon LBP6000 from my Ubuntu machine for around a year. If it failed to print, restarting the daemon using this homemade script coaxed the printer to print. #!/bin/bash pkill -9 -x ccpd pkill -9 -x captmoncnabc /etc/init.d/ccpd start /etc/init.d/ccpd status Recently, I am not successful any more, or successful on a limited and sporadic basis. Sometimes it prints when turned on after logging in, sometimes when the driver is reinstalled. I keep on trying the random steps (call abracadabras) until I get success. Again, not always success comes. I frustrate on for hours only to get single page printed. I loose precious time on the issue of printing. I have read and read all the documents available over the Internet. However, if you please notice, none of the guides, articles, tutorials (these are too many to list here) seem to be dealing with diagnosing the problem when it fails to print. They tell you where to find the drivers, how to install them, or which script to run to make the installation process automatic. Yes, some of the articles or comments suggest a step to try, without any systematic order. But these fail to suggest a step based on symptoms, mostly. This morning, my Canon LBP6000 failed to print. After sometime, there was a message for system error, details of which was found to be something like this. When I search for this error (c3pldrv crashed with SIGSEGV in write ()), I find a number of articles including this one. None of these are actually helpful. Mostly, these are 'me too', 'tell me if you find anything'. Running captstatusui -P LBP6000 produced this, Yes, the printer is connected and actually turned on. I believe that there a number of frustrated Canon printer users out there like me. But there is not a step by step definitive guide to systematically diagnose a non-printing printer. Do you think that you can provide your diagnosing inputs so that a systematic document can be built? May be we will want the Ubuntu users to stay away from Canon printers. But as I believe, as a Linux user for more than fifteen years, such a scenario is not acceptable any more. May be this was acceptable in the infancy days of Linux, but not today. I am using Ubuntu 12.04, by the way, I prefer LTS versions.

    Read the article

< Previous Page | 12 13 14 15 16 17 18 19 20 21 22 23  | Next Page >