Posts Tagged ‘clear’

Using memset or bzero on structs in C is a common way to clear the values contained within that struct. This generally works well in C as your structs will contain POD types, unions and other structs. However, in C++, these structs (or struct members) may also contain methods which assume the struct is in […]

Formatting a usb drive in linux

Posted: 11th July 2012 by Tim in Linux
Tags: , , , , , , , ,

So you’ve got a USB drive, and you need to reformat it. You can do this all quite easily on the command line using the fdisk utility. First, get the device location. This will be something like /dev/sdd. You want the location of the device, not a partition on the device ie: /dev/sdd instead of […]

There are times when you want to explicitly set or reset the counter value on a SERIAL (auto incrementing) field or on a SEQUENCE. This may be done using a SELECT SETVAL(…) command. If you’re using a SERIAL field, PostgreSQL will actually create a SEQUENCE for you, which increments every time you insert a row. […]