Search Results

Search found 3798 results on 152 pages for 'col zero'.

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

  • VS C++ throwing divide by zero exception after a specific check

    - by Dr. Monkey
    In the following C++ code, it should be impossible for ain integer division by zero to occur: // gradedUnits and totalGrades are both of type int if (gradedUnits == 0) { return 0; } else { return totalGrades/gradedUnits; //call stack points to this line } however Visual Studio is popping up this error: Unhandled exception at 0x001712c0 in DSA_asgn1.exe: 0xC0000094: Integer division by zero. And the stack trace points to the line indicated in the code. It seems like VS might just do this with any integer division, without checking whether a divide by zero is possible. Do I need to catch this exception even though the code should never be able to throw it? If so, what's the best way to go about this? This is for an assignment that specifies VS 2005/2008 with C++. I would prefer not to make things more complicated than I need to, but at the same time I like to do things properly where possible.

    Read the article

  • Bootstrap: show/hide column divs with checkbox and change column span

    - by Berto Alvaro
    I'm using Bootstrap 3.2. I'm trying to figure out if there's a way to show/hide a "col-sz-#" div AND change the "col-sz-#" class in visible divs to resize them to fit the container using checkbox style buttons for each column. For example, if I start with <div class="row"> <div class="col-md-2">...</div> <div class="col-md-2">...</div> <div class="col-md-2">...</div> <div class="col-md-2">...</div> <div class="col-md-2">...</div> <div class="col-md-2">...</div> </div> Then if hide 2 of them and the others resize: <div class="row"> <div class="col-md-2 hidden">...</div> <div class="col-md-2 hidden">...</div> <div class="col-md-3">...</div> <div class="col-md-3">...</div> <div class="col-md-3">...</div> <div class="col-md-3">...</div> </div> if the total columns can't divide 12 evenly like 5, then it wouldn't change.

    Read the article

  • Why is address zero used for null pointer?

    - by Joel
    In C (or C++ for that matter), pointers are special if they have the value zero: I am adviced to set pointers to zero after freeing their memory, because it means freeing the pointer again isn't dangerous; when I call malloc it returns a pointer with the value zero if it can't get me memory; I use if (p != 0) all the time to make sure passed pointers are valid etc. But since memory addressing starts at 0, isn't 0 just as a valid address as any other? How can 0 be used for handling null pointers if that is the case? Why isn't a negative number null instead?

    Read the article

  • TCP Zero Window with no corresponding Window Update

    - by Gandalf
    I am trying to debug a network issue and am using Wireshark and tcpdump to grab packets from my server. I have one client application that is grabbing all my available connections and then holding them, trying to send A LOT of data and essentially causing an unintentional DOS attack. While debugging I notice that I see my server sending "Window Closed" and "Zero Window" TCP packets - but never sending any "Window Update" packets. I am guessing this is why the client never lets go of the connections (it still has more data to send and is waiting). Has anyone ever seen this type of behavior before? Let's not get into the reasons why I haven't set up an iptables rule to limit concurrent connections (yeah I know). I also recently changed the MTU from 1500 to 9000 - could this have such a negative effect? (Linux) Thanks.

    Read the article

  • Data Recovery needed with a Sector Zero problem on a HDD

    - by Jay Robins
    Left my computer (running XP) copying files to an external drive. Came back a few hours later, and the laptop was pretty hot and had frozen (Ironic aint it). Forced a reboot, and the laptop HDD hasnt worked since. Set it up in an external enclosure, but XP cant mount the HDD to a drive letter, but is able to recognize the manufacturer and drive size (Hitachi-320GB). No noise or rattling when the drive is spinning, but I cant get anything off of it, since i cant mount it, or see much of anything. Computer repair shop ran some software tests and says it came back with a "Zero Sector bad" message, and need to send it to a professional data recovery service. Any other options or ideas, before I have to spend thousands of dollars to recover my data? Any help would be GREATLY appreciated!!! I'm desperate and a poor student! Thanks in Advance, -Jay

    Read the article

  • Need leading zero for batch script using %time% variable

    - by Ira
    Hi, I came across a bug in my DOS script that uses date and time data for file naming. The problem was I ended up with a gap because the time variable didn't automatically provide leading zero for hour < 10. So running echo %time% gives back: ' 9:29:17.88'. Does anyone know of a way to conditionally pad leading zeros to fix this? More info: My filename set command is: set logfile=C:\Temp\robolog_%date:~-4%%date:~4,2%%date:~7,2%_%time:~0,2%%time:~3,2%%time:~6,2%.log which ends up being: C:\Temp\robolog_20100602_ 93208.log (for 9:23 in the morning). This question is related to this one. Thanks

    Read the article

  • Convert RAID-0 to RAID-1 on HP ML350G6 with P410i zero memory

    - by JLe
    I have an HP ML350 G6 with a P410i zero memory RAID controller. As far as I can understand that means I can't expand a current single drive "RAID-0" configuration to a RAID-1 using the HP Offline ACU without installing memory and BBWC. Is that correct? What makes me think about this is the fact that expanding RAID-0 to RAID-1 should be pretty similar to replacing a failed drive in an already existing RAID-1? So then why can't I expand without memory and BBWC? Is my best option otherwise to (i) use Ghost to capture the disk, create a new RAID-1 with the existing drive and a new one or (ii) buy memory+BBWC and do it online? Thanks

    Read the article

  • Windows XP volume control spontaneously slides to zero

    - by Paul Dixon
    Was listening to a podcast in iTunes at my desk, left my desk briefly and as I sat down, the volume faded. If I scrolled the volume back up, using my keyboard or the volume tray icon, it would smoothly scroll back down again. I rebooted, same thing occurred. Figuring maybe I had a stuck keyboard or hitherto undiscovered mouse function, I unplugged each in turn. Volume still wanted to go to zero! Anyone know what might cause this? It's driving me nuts!

    Read the article

  • Using VLC to Unicast High Definition Webcam over local gigabit LAN with low/zero delay

    - by Robin Day
    We're setting up a webcam "window" between two offices in the same buildilng. The two PC's are connected to the same gigabit switch. We're using VLC to stream the webcam over HTTP using the following commands. vlc dshow:// :dshow-caching="0" :dshow-size="640x480" :sout=#transcode{vcodec=h264,vb=0,scale=0}:http{mux=ffmpeg{mux=flv},dst=:8080/} :no-sout-rtp-sap :no-sout-standard-sap :ttl=1 :sout-keep vlc http://192.168.0.1:8080 :http-caching="0" Even with the caching set to zero, the delay in the image is a good 2-3 seconds. The CPU usage of each pc is also maxed. I'm guessing it's the transcoding that's causing much of the delay. Can anyone give me some changes to these command lines that will reduce the transcoding power, or send the webcam over a different protocol, or anything that will reduce the delay of the cameras? Bandwidth is not an issue at all as the pc's can be connected to a dedicated switch/vlan if required.

    Read the article

  • DB time always showing as zero in Rails development log timings

    - by Olly
    I've noticed that the Rails log correctly displays the time taken to execute an action in the logs, and that the View: part of that is also rendered correctly. However, the DB: value is always zero: Aug 11 13:00:22 [2326] INFO: Completed in 2072ms (View: 94, DB: 0) | 200 OK In fact, all my DB timings are being logged as zero. I'm logging at DEBUG level, in development mode, running Rails 2.3.2. Apologies in advance if the answer is blatantly obvious.

    Read the article

  • display unsigned zerofill autoincrement value without leading zero

    - by I Like PHP
    my primay key is user_id which is auto incremant UNSIGNED ZERO FILL, i want to display user_id on a page without leading Zero( means 1 instead of 0000000001 ).. how can we do that in php or in mysql one more question... if i delete last record( let user_id=21) wwhich have highest id of that table then can we adjust auto increment value to 21 instead of 22 of that table.

    Read the article

  • Separating positive values from 'zero' values in an XSLT for-each statement

    - by danielle
    I am traversing an XML file (that contains multiple tables) using XSLT. Part of the job of the page is to get the title of each table, and present that title with along with the number of items that table contains (i.e. "Problems (5)"). I am able to get the number of items, but I now need to separate the sections with 0 (zero) items in them, and put them at the bottom of the list of table titles. I'm having trouble with this because the other items with positive numbers need to be left in their original order/not sorted. Here is the code for the list of titles: <ul> <xsl:for-each select="n1:component/n1:structuredBody/n1:component/n1:section/n1:title"> <li style="list-style-type:none;"> <div style = "padding:3px"><a href="#{generate-id(.)}"> <xsl:variable name ="count" select ="count(../n1:entry)"/> <xsl:choose> <xsl:when test = "$count != 0"> <xsl:value-of select="."/> (<xsl:value-of select="$count"/>) </xsl:when> <xsl:otherwise> <div id = "zero"><xsl:value-of select="."/> (<xsl:value-of select="$count"/>)</div> </xsl:otherwise> </xsl:choose> </a> </div> </li> </xsl:for-each> </ul> Right now, the "zero" div just marks each link as gray. Any help regarding how to place the "zero" divs at the bottom of the list would be greatly appreciated. Thank you!

    Read the article

  • what does it mean to be "terminated by a zero"

    - by numerical25
    I am getting into C/C++ and alot of terms are popping up unfamiliar to me. one of them is a varible or pointer that is terminated by a zero. What does it mean for a space in memory to be terminated by a zero. I am not sure if I am saying it correctly, if not then please correct me. Thanks!

    Read the article

  • javascript search and replace prefix zero

    - by Bharanikumar
    Hi , i have few numbers like 0011,0101,0123,1234,5245,0052,3265,0047,0124 How replace prefix zero only, like no number should start with zero , exactly like 0011 should be 11 , 0101 should be 101 , 0123 should be 123 How to do this ? Is ther any javascript function there , Thanks

    Read the article

  • stack panel width and height to zero in .cs

    - by prince23
    hi , have an stack panel defined in my design page <StackPanel Width="973" x:Name="spmarks" > </StackPanel> now in .cs page i need to set the width and height of the stack panel to zero spmarks.ActualWidth ="0"; spmarks.ActualWidth ="0"; here i am getting error. how can i set width and height to zero now any solution on this would be great thank you

    Read the article

  • Python PLY zero or more occurrences of a parsing item

    - by None
    I am using Python with PLY to parse LISP-like S-Expressions and when parsing a function call there can be zero or more arguments. How can I put this into the yacc code. This is my function so far: def p_EXPR(p): '''EXPR : NUMBER | STRING | LPAREN funcname [EXPR] RPAREN''' if len(p) == 2: p[0] = p[1] else: p[0] = ("Call", p[2], p[3:-1]) I need to replace "[EXPR]" with something that allows zero or more EXPR's. How can I do this?

    Read the article

  • High apache load but zero traffic

    - by Adie
    I have a problem with new server.. I use VPS Centos with 1GB of ram and I use wordpress CMS. The traffic <100 visitor/hour, but the apache have high load and make the server hang with zero free of ram and can't connect through ssh. I should reboot the vps to make it works here is the load on Apache looks like Tasks: 66 total, 1 running, 65 sleeping, 0 stopped, 0 zombie Cpu(s): 1.6%us, 12.3%sy, 0.0%ni, 48.1%id, 23.0%wa, 4.8%hi, 10.2%si, 0.0% Mem: 1018776k total, 116620k used, 902156k free, 1236k buffers Swap: 1048568k total, 1013052k used, 35516k free, 26628k cached 2949 apache 20 0 459m 42m 3732 D 3.0 4.2 0:09.23 httpd 2959 apache 20 0 460m 29m 3744 D 2.0 3.0 0:02.72 httpd 2968 apache 20 0 460m 26m 3808 D 2.0 2.6 0:02.27 httpd 2972 apache 20 0 460m 24m 3784 D 2.0 2.5 0:02.44 httpd 2986 apache 20 0 460m 29m 3784 R 2.0 2.9 0:02.40 httpd 2969 apache 20 0 458m 29m 3864 D 1.6 3.0 0:02.63 httpd 2974 apache 20 0 460m 25m 3820 D 1.6 2.6 0:02.43 httpd 2990 apache 20 0 460m 23m 3920 D 1.6 2.4 0:02.36 httpd 2994 apache 20 0 460m 31m 3756 D 1.6 3.2 0:02.62 httpd 2956 apache 20 0 460m 26m 3740 D 1.3 2.7 0:02.73 httpd 2957 apache 20 0 465m 22m 3644 D 1.3 2.3 0:02.80 httpd 2967 apache 20 0 458m 24m 3764 D 1.3 2.5 0:02.60 httpd 2970 apache 20 0 463m 25m 3764 D 1.3 2.6 0:03.07 httpd 2971 apache 20 0 451m 22m 3792 D 1.3 2.3 0:02.47 httpd 2973 apache 20 0 458m 25m 3768 D 1.3 2.6 0:02.52 httpd 2987 apache 20 0 465m 20m 3772 D 1.3 2.1 0:03.02 httpd But sometimes the server have uptime more than 5-10hrs but after that the problems start

    Read the article

  • emacs public/protected/private label indentation of C++ header file not working for zero offset

    - by murrekatt
    I cannot get zero offset for some things for my C++ header files in emacs even if I have it defined in my .emacs file. The header file below shows a class definition inside two namespaces and most importantly the public keyword I would like to have with zero offset like below. namespace n1 { namespace n2 { class SomeClass { public: // this line with zero offset SomeClass(); ... }; } // n2 } // n2 In my .emacs file I have added label like this: (c-set-offset 'label 0) I used Ctrl-C Ctrl-S to find out what to modify. Other offsets I have defined in the .emacs file are working fine and also values other than 0 work for label. When I set offset 0 for label it turns out to be 1 when hitting tab for that line. This is strange and looks like something else is overriding or adding a minimum of 1. Can anyone explain how I can achieve what I want and maybe also an explanation what is happening currently? Phew, this was my first question here. Thanks :)

    Read the article

  • Checkers board structure

    - by Ockonal
    Hello guys, I'm implement checkers (game) board with python. Here is how I switch it to the need structure [8][8] array: _matrix = [] for i in xrange(8): _matrix.append( [' '] * 8 ) for row in xrange(0, 8): for col in xrange(0, 8): if _darkQuad(row, col) == True: _matrix[row][col] = '#' else: _matrix[row][col] = '-' def _darkQuad(row, col): return ((row%2) == (col%2)) def _printDebugBoard(): for row in xrange(0, 8): for col in xrange(0, 8): print _matrix[row][col] print '' This should do my board like: # - # - # - # - - # - # - # - # ... But the result is: - - - - - - - - # # # # # # # # - - - - - - - - # # # # # # # # - - - - - - - - # # # # # # # # - - - - - - - - # # # # # # # # What's wrong?

    Read the article

  • All possible combinations of length 8 in a 2d array

    - by CodeJunki
    Hi, I've been trying to solve a problem in combinations. I have a matrix 6X6 i'm trying to find all combinations of length 8 in the matrix. I have to move from neighbor to neighbor form each row,column position and i wrote a recursive program which generates the combination but the problem is it generates a lot of duplicates as well and hence is inefficient. I would like to know how could i eliminate calculating duplicates and save time. int a={{1,2,3,4,5,6}, {8,9,1,2,3,4}, {5,6,7,8,9,1}, {2,3,4,5,6,7}, {8,9,1,2,3,4}, {5,6,7,8,9,1}, } void genSeq(int row,int col,int length,int combi) { if(length==8) { printf("%d\n",combi); return; } combi = (combi * 10) + a[row][col]; if((row-1)>=0) genSeq(row-1,col,length+1,combi); if((col-1)>=0) genSeq(row,col-1,length+1,combi); if((row+1)<6) genSeq(row+1,col,length+1,combi); if((col+1)<6) genSeq(row,col+1,length+1,combi); if((row+1)<6&&(col+1)<6) genSeq(row+1,col+1,length+1,combi); if((row-1)>=0&&(col+1)<6) genSeq(row-1,col+1,length+1,combi); if((row+1)<6&&(row-1)>=0) genSeq(row+1,col-1,length+1,combi); if((row-1)>=0&&(col-1)>=0) genSeq(row-1,col-1,length+1,combi); } I was also thinking of writing a dynamic program basically recursion with memorization. Is it a better choice?? if yes than I'm not clear how to implement it in recursion. Have i really hit a dead end with approach??? Thankyou Edit Eg result 12121212,12121218,12121219,12121211,12121213. the restrictions are that you have to move to your neighbor from any point, you have to start for each position in the matrix i.e each row,col. you can move one step at a time, i.e right, left, up, down and the both diagonal positions. Check the if conditions. i.e if your in (0,0) you can move to either (1,0) or (1,1) or (0,1) i.e three neighbors. if your in (2,2) you can move to eight neighbors. so on...

    Read the article

  • zeroing a disk with dd vs Disk Utility

    - by jdizzle
    I'm attempting to zero a disk on my Mac OS X machine. I'm going for complete zeros and unformatted, so I think of dd. Unfortunately the maximum throughput I've managed to get out of dd is 7MB/s. Just for grins I tried disk utility and it has a throughput of 19MB/s. What gives? I've tried changing the bs option on dd to all sorts of values, but it still hovers around 7MB/s. Why is disk utility so much faster?

    Read the article

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