Saturday, 12 March 2011
This is UNIX!
matt@stanley:/proc$ find /proc -maxdepth 1 -mindepth 1 ! -regex '^.*?/?\([0-9]+\|self\)' | xargs grep -R 'wlan0' 2>/dev/null | less
Monday, 24 January 2011
Windows is appalling
Take a look at the installation method from USB stick using Windows XP. Why the hell do people keep using this crap?
THERE'S NO MICROSOFT-ENDORSED WAY TO INSTALL XP FROM USB?!
All the third-party utilities mash together the same core set of utilities using batch files. None of them are aware of Vista and later's administrator requirements. None of them work, and they're all excessively complicated.
Compare this to Ubuntu, which provides USB image files, and ISOs for installation from USB or CD/DVD. There are "single-click" applications that prepare your installation media for all operating systems.
I never made it this far, but it appears Microsoft acknowledges USB installs or install-froms for Windows 7, I can't tell. Won't this require a USB stick with OVER 4GB capacity? Ubuntu requires 700MB. There are smaller Linux installers (with full USB compatibility again), that only require 40-80MB.
THERE'S NO MICROSOFT-ENDORSED WAY TO INSTALL XP FROM USB?!
All the third-party utilities mash together the same core set of utilities using batch files. None of them are aware of Vista and later's administrator requirements. None of them work, and they're all excessively complicated.
Compare this to Ubuntu, which provides USB image files, and ISOs for installation from USB or CD/DVD. There are "single-click" applications that prepare your installation media for all operating systems.
I never made it this far, but it appears Microsoft acknowledges USB installs or install-froms for Windows 7, I can't tell. Won't this require a USB stick with OVER 4GB capacity? Ubuntu requires 700MB. There are smaller Linux installers (with full USB compatibility again), that only require 40-80MB.
Saturday, 4 December 2010
Installing linux 2.6.35 in Lucid
You can install Linux 2.6.35 (the default is 2.6.32) in Lucid from the Ubuntu repositories by installing the following packages:
linux-image-X-lts-backport-maverick
linux-headers-X-lts-backport-maverick
Where X is one {generic, generic-pae, server, virtual, ...} per your platform. The headers are required for recompiling of kernel modules. I also required a reinstallation of nvidia-current to trigger the rebuild.
linux-image-X-lts-backport-maverick
linux-headers-X-lts-backport-maverick
Where X is one {generic, generic-pae, server, virtual, ...} per your platform. The headers are required for recompiling of kernel modules. I also required a reinstallation of nvidia-current to trigger the rebuild.
Saturday, 27 November 2010
Golang review
Go is a new systems programming language driven by Google.
Disclaimer: All performance claims are from a combination of personal experimentation in several projects, and from the Ubuntu x64 quad-core benchmarks, which I believe to be the best indication of future performance contrasts.
The Good
Disclaimer: All performance claims are from a combination of personal experimentation in several projects, and from the Ubuntu x64 quad-core benchmarks, which I believe to be the best indication of future performance contrasts.
The Good
- Syntax is familiar and similar to C.
- Outperforms Python by an order and a half of magnitude.
- Compiles to binary.
- Standard library is Unix/POSIX inspired and broken up into modules.
- The standard is very short, and readable.
- Use of C-like primitives allows for cheap C interfaces.
- Replaces header/source paradigm for enormous compilation speed ups.
- Provides defer, an alternative to the exception/destructors of C++, and nested-if/goto chains of C.
- Does not have assertions. Coupled with easier resource management than C (and less boilerplate than C++), this is manageable and robust.
- Uses the := operator.
- Syntax not similar to Python. For a new language I'm not sure there is any reason to continue using C-syntax such as braces. Providing gofmt, and requiring leading braces were excellent decisions, and a large step towards whitespace formatting anyway.
- Preference for custom compiler bars adoption and integration with existing technologies.
- Limited support for Windows. Despite the pain of developing for Windows, this blocks mass adoption.
- Standard library is still evolving.
- Won't replace C in its current state. Some of the syntax and interface advances would be most welcome however.
- Performance is nowhere near C, or C++. The standard library is severely under-optimized.
- The LLVM toolchain was not chosen to build upon.
- Several years of tool chain development and optimization are required before Go will be a contender.
- Documentation of the toolchain is lacking.
- Go is much faster and has superior concurrency to Python. Retains many of strengths of Python's typing system but without dynamic typing. Python has easier syntax, and a much better standard library implementation.
- Go has better type safety than C. It also supports interfaces, closures, containers and many modern features that C lacks. Go is garbage collected, and has safe pointers. C is much faster, and has much better platform support.
- Go is much simpler than C++, and supports many modern features that are clunky and difficult to use in C++. There is far less boilerplate. C++ is faster and has better platform support.
- Go is faster than Java, and has less boilerplate. Its compilation speed, runtime size, and similarity to C will allow it to compete with Java's claim to portability.
Tuesday, 16 November 2010
Sunday, 14 November 2010
Thursday, 11 November 2010
Sneaky use of sequence points in c++
i've found a very interesting corner case where fiddly knowledge of
sequence points and STL are used.
apparently it's not possible to use remove_if on associate arrays but
this didn't stop me trying for a good 30 mins before i discovered this
workaround:
There's no evidence in the answer, but it's apparent after digging
through the numerous overloads and associated nastiness that its
apparently excusable simplicity comes down to sneaky use of sequence
points.
http://www.cplusplus.com/reference/algorithm/remove_if/
http://stackoverflow.com/questions/800955/remove-if-equivalent-for-stdmap/800984#800984
sequence points and STL are used.
apparently it's not possible to use remove_if on associate arrays but
this didn't stop me trying for a good 30 mins before i discovered this
workaround:
for(; iter != endIter; )
{
if(Some Condition)
{
// is it safe ?
aMap.erase(iter++);
}
else
{
++iter;
}
}
There's no evidence in the answer, but it's apparent after digging
through the numerous overloads and associated nastiness that its
apparently excusable simplicity comes down to sneaky use of sequence
points.
http://www.cplusplus.com/reference/algorithm/remove_if/
http://stackoverflow.com/questions/800955/remove-if-equivalent-for-stdmap/800984#800984
Subscribe to:
Posts (Atom)