Reverts all opened files. Useful if you can’t force delete a client.
p4 revert `p4 opened | sed ‘s!#.*!!’`
Reverts all opened files. Useful if you can’t force delete a client.
p4 revert `p4 opened | sed ‘s!#.*!!’`
Don’t hit publish on the blog when you just want to save a draft.
Big Builds are Bad. Software should be developed and distributed in small packages. Linux is successful due to things like apt, yum, and yast.
Interface Specifications need to be more specific. Just saying that something is a string is not really helpful if that something needs to conform to a pattern.
Programming and blogging requires sugar in the brain.
Interviews are tricky…on both sides of the table. Career fairs are worse.
C++ Has a lot of magic in it. Can we make type level programming more transparent?
Microsoft purchasing Yahoo would be good for Google, but bad for just about everyone else.
Being a Dad is really cool. Even when it sucks, it is great. Sometimes kids refuse to go to sleep. This leads to sleep deprivation, but also leads to really wonderful moments in rocking chair in the middle of the night.
Pool is a great Geek game. Lower left-hand English is neat.
Snowshoes are good off the trail. Not so good on the trail. If your going on the trail, take the cross country skis. Snowmobiles smell funny.
New Hampshire winter weather is still as brutal today as it was when I left the area in the early ’90s.
It is hard to sing a Jazzy version of Old MacDonald had a Farm. It is harder to do after the tenth repetition while trying to get a child to fall asleep.
If you listen to Children’s CDs long enough, you will develop favorite children’s songs. I like the hippo song.
Is there really a difference between the Ethernet and SCSI protocols? I don’t know, but it would be fun to find out.
The compiler is your friend. Let it check your work for you.
Why write code on a white board if you have a computer available? Especially if you have an overhead projector?
Where do the local peregrine falcons sleep? Where would they be sleeping if we hadn’t built up the whole area?
If I could have a redo on which language to take as a Sophomore, I would probably would have liked to take Chinese. Russian and Arabic would also do. German was not a good choice for me.
If Bush Senior had insisted on pushing to Baghdad, it would have been my generation in this mess as opposed to the current set of junior officers. Instead of Haiti, I would have gone to Basra or something.
There are too many interesting topics in the world to pursue them all, or even a small fraction of them.
Every philosopher I’ve read, especially the ones I disagree with, ave said something that is valuable and true.
No matter how old you are, when you get together with your parents, you revert to teenager status.
This list should never see the light of day.
Not sure if I should post this or not. So many people are in a better position to really understand the situation than I am. Really, what I want is for people to respond to this to expand, clarify, correct and elucidate me.
Maybe we won’t be in Iraq forever. Maybe the real yardstick we need for success is the amount of oil flowing out of the country. Iraq is producing a small fraction of it’s capacity. If it ramped up to several times it’s prewar amount, it could be the largest producer in the world. Considering the current cost of oil is $3.00/gal at the pumps in Massachusetts, It is possible that there could be a healthy dose of currency flowing into Iraq that is not coming out of the US Treasury. There are several factors at play:
Sunni-Shiite-Kurd political contention. If any one of these groups gains power over the majority of the Oil revenue, it will be significantly threatening to the other two.
OPEC. The nearest nations to Iraq are the ones with the most to lose from a large capacity, non-OPEC nation in their midst. Iraq is a founding member of OPEC, but it may not be perceived as an independent entity by the others, and more as a puppet of the US. Any move to substantially increase oil production will bring up the global supply, drop the price, and decrease profits across the board.
China and India: These two nations are growing fast, and demand for Oil from these nations has kept the cost of oil high. Both have a vested interest in increasing global supply to decrease price.
France: Much of Iraq’s pre-war debt was owned by France. The US invasion changed France’s relationship to Iraq from insider to outsider. They have their own problems with Muslims both at home and across the Mediterranean in Algeria.
Australia: Currently planning on pulling out of Iraq. Fewer troops to patrol means a higher possibility of successful insurgent attacks.
Russia: Russia is now a huge supplier of Oil to Europe. While Russia is not a part of OPEC, it still has a lot on the line in terms of Oil Revenue.
Turkey: Oil revenue to the Kurds means more money that can flow over the border to Kurd separatists in Turkey. However, stability on Turkey’s southern border will be beneficial to Turkey overall. Mosul, in Northern Iraq, is one of the most violent locations, with a major operation underway even as I type this. Turkey has performed operations across the border into Norther Iraq targeted at Kurdish fighters.
US Economy: The cost of maintaining troops in Iraq may prove too high. The US may have to withdraw before a critical mass of oil extraction infrastructure is in place. The US is anticipating the oil influx. Most of the companies that will benefit from Iraq oil are based in the US or Britain, and thus have a lot to gain. The US President and many in his administration are primarily oil-men, but with the election coming up, that may change.
Middle East Nations: Saudi Arabia and Iran both have a vested interest in supporting their allies in the Iraqi Government. If A Sunni Majority again emerged, it would be more closely allied with Saudi Arabia. A Shiite Majority would be allied with Iran. Either case would lead to increased domestic strife and a decrease in oil production. With a Sunni majority, Iran would have the “moral high-ground” of supporting Shiites against their oppressors. The reverse would be true with a Shiite majority and Saudi Arabia supporting their side. I realize that this is a vast oversimplification, but the a part of the broad trends.
The path forward needs to walk a tight rope of a balance of power that will lead to stability. Both sides need to believe that they have more to gain from getting oil set up than they will lose in relative power and status. But even if Iraq is able to produce a substantial quantity of oil, it won’t necessarily work wonders for Iraqi society. Typically, Oil is run by a few companies. It may be possible that an Iraqi Wildcatting culture will grow up, but that can’t happen until there is a long term education amongst Iraqis in oil extraction. Oil has several offshoot industries. So there should be growth of the competitive/cooperative spirit that is the product of a healthy capitalist system. But it will still be centered around a single industry with major fluctuations based on global events. If we look to Saudi Arabia, we see that oil wealth does not necessarily carry with it human rights.
Here is a dark scenario. Iraq will get enough of its oil infrastructure up and running to make US involvement essential, but not stabilize enough that we can pull out. We will have a force in Iraq in perpetuity, drawing fire and making enemies. That force will be essential to defending the Oil extraction facilitated in Iraq.
I don’t know what will really happen. I certainly don’t have the perspective to see that clearly. Just trying to layout the situation based on the limited info that I have.
I am currently working with a long block of code that uses && (logical and) to a long list of functions. The idea is to run all of the functions and short circuit if any of them fail. The problem is that there is no consistant mechanism for error reportin. If any of the functions fail, I have no way of knowing which one. This is my planned approach.
#include <iostream>
#include <stdexcept>
using namespace std;bool invert(bool val){
return !val;
}#define attempt( X ){ if (!X){ throw runtime_error(#X);}}
int main(){
cout << “OK” << endl;
try{
attempt(invert(true));
}catch(runtime_error& re){
cout << “runtime_error exception:” << re.what() <<endl;
}
return 0;
}
A younger friend at work has recently completed reading Atlas Shrugged. He is fairly close to the age I was at when I got enthralled with Ayn Rand. Something about her writing appeals to the emerging man. “You can do anything. The world will try to hold you down, but you can create.” At the time of my transition from Army Officer to civilian programmer, nothing was more comforting to hear.
Using a non-virtual method in C++ is syntactic sugar: It doesn’t allow you to do anything you could not as easily do BY using a static member function and passing in the object instance as the first parameter. If you don’t fully qualify the name of the function, the type checking of the first parameter will make sure you call the right version, or at least get a compilation error until you do fully qualify.The only reason you would need to use one is for template programming, where some classes have the method you wish to call as a virtual, and you want to be consistent across all classes passed to the template.
This is not to say that all non-virtual functions are bad, just an observation about what the language provides.
I keep getting comments from people along the lines of: I just found you on Google search and added you to my Reader. When I follow the links back to their web pages, they are marketing sites. This is my blanket apology to all people who send such links:
I am more than willing to post your responses, and give you the links back you so desire. But this blog has a minimum requirement for comments: You have to show that you read the article, and then contribute something to a discussion on the topic at hand. Note that just reading the article is not enough. I am not going to make this a vehicle for spam.
If you are genuinely interested in the topic, by all means post, even if it is just to ask for more information. I will certainly try to answer your question. But again, don’t just fire off questions hoping to get the affiliate links. I’m sorry, but that is just not how I am managing this site. The questions have to be something where the discussion would expand on the topic of the post.
I suspect that Google is smart enough at this point to identify blog sites and filter out links from them when calculating web page standings.
I understand now why so many people that have cut their teeth on C coding in Unix/Linux hate C++. A coder can get her job done in C without needing significant tool support. An editor, a build toolchain, and limited reverse engineering support a-la objdump and you are good to go. Tag support makes navigation a lot easier, and suddenly, you have decent productivity.
When I started in the professional world, I learned C++ using Microsoft Visual Studio. I had, prior to then, been a big fan of Borland for Pascal, and had even purchased a copy of Borland C++. But, unlike the MS product, it did not then have an integrated debugger, and my learning curve was quite steep. MSVC took me through the steps, provided decent navigation, and easy to use wizards for MS technology. I did have the frustration of trying to work through libraries without having the source code, but this wasn’t the VC developers fault.
When I left the MS world for the Java world, the first thing I noticed was the lack of an IDE. I was just so productive with all of the tools integrated, that it took me a while to get used to coding in EMACS. I had long since learned the value of stepping through code after I wrote it to make sure it was doing what I expected. Using gdb, while effective, was much slower than an integrated debugger. It wasn’t until I got my hands on Intellij’s Idea that I felt a return to the productivity I had under MSVC.
When refactoring support hit in Eclipse, I was stunned at the ease of maintaining code. I can’t say enough about this, and may try to recreate some of my earlier writings on Refactoring in order to show how valuable the approach can be. Suffice to say, it is now a go-to tool for coding that I miss when forced to do without.
Now I am trying to figure out how best to do C++ development on Linux. etags just does not handle context well enough, and CScope’s navigation is fairly clunky. I’ve got a demo of Visual Slickedit, and the Eclipse platform with C/C++ support built in, but I have yet to find a smooth working environment. My problem comes from dealing with an alien code base, tightly coupled dependencies and byzantine makefiles that I haven’t had time to spelunk. I’ve not been able to get automated refactoring support to work and even base navigation is problematic. As I work out the solution, I will record my approaches here so that I will be able to recreate them in the future.
First of all, I am running a 64 bit Ubuntu 7.04 but I need a 32 Bit Oracle for the application I am using. I have a 32 bit chroot setup. The setup for this is beyond the scope of this article. This version of Ubuntu ships with unixodbc version 2.2.11-13 . There is a symbol, SQLGetPrivateProfileStringW, defined in later versions that the Oracle 11g driver requires. This symbol is not defined in unixodbc version 2.2.11-13. Thus, you have to use the 10.2 Oracle Drivers.
I Downloaded 3 files from The Oracle tech download page for 32bit Linux: the instantclient, SQL Plus, and ODBC packages. I unzipped these in my directory ~/apps/oracle32 Which now looks like this:
adyoung@adyoung-laptop$ pwd
/home/adyoung/apps/oracle32/instantclient_10_2
adyoung@adyoung-laptop$ ls
classes12.jar libocci.so.10.1 libsqora.so.10.1 ojdbc14.jar
genezi libociei.so ODBC_IC_Readme_Linux.html sqlplus
glogin.sql libocijdbc10.so ODBCRelnotesJA.htm
libclntsh.so.10.1 libsqlplusic.so ODBCRelnotesUS.htm
libnnz10.so libsqlplus.so odbc_update_ini.sh
I created an entry in /chroot/etc/odbcinst.ini:
[Oracle 10g ODBC driver]
Description = Oracle ODBC driver for Oracle 10g
Driver = /home/adyoung/apps/oracle32/instantclient_10_2/libsqora.so.10.1
Setup =
FileUsage =
CPTimeout =
CPReuse =
And another in /chroot/etc/odbc.ini
[EMO]
Application Attributes = T
Attributes = W
BatchAutocommitMode = IfAllSuccessful
BindAsFLOAT = F
CloseCursor = F
DisableDPM = F
DisableMTS = T
Driver = Oracle 10g ODBC driver
DSN = EMO
EXECSchemaOpt =
EXECSyntax = T
Failover = T
FailoverDelay = 10
FailoverRetryCount = 10
FetchBufferSize = 64000
ForceWCHAR = F
Lobs = T
Longs = T
MetadataIdDefault = F
QueryTimeout = T
ResultSets = T
ServerName = 10.10.15.15/DRORACLE
SQLGetData extensions = F
Translation DLL =
Translation Option = 0
DisableRULEHint = T
UserID = adyoung
StatementCache=F
CacheBufferSize=20
Once again, DSN and IP Address have been changed to protect the guilty. To test the datasource, run:
sudo dchroot -d LD_LIBRARY_PATH=/home/adyoung/apps/oracle32/instantclient_10_2 DataManagerII
To just test sqlplus connectivity, from inside the chroot, run:
./sqlplus adyoung/adyoung@10.10.15.15/DRORACLE
Note that using the instant client, no TNSNAMES.ORA file is required.
For the base config tools:
sudo apt-get install unixodbc-bin unixodbc odbcinst1debian1
For Postgres
sudo apt-get install odbc-postgresql
Use the template file provided to setup the odbc driver entries:
sudo odbcinst -i -d -f /usr/share/psqlodbc/odbcinst.ini.template
And this sets up the sample DSNs. (all one line)
 sudo odbcinst -i -s -l -n adyoung-pg -f /usr/share/doc/odbc-postgresql/examples/odbc.ini.template
Then modify /etc/odbc.ini to suit your DB.
For MSSQL Server and Sybase:
 sudo apt-get install tdsodbc
sudo odbcinst -i -d -f /usr/share/doc/freetds-dev/examples/odbcinst.ini
Unfortunately, this does not have a sample ODBC setup template.