menu
person
Welcome to summer-glau.com, your fan source for all things Summer on the web. Browse around the site and visit our growing GALLERY housing over 65,000 photos. Don’t forget to follow us on Twitter and Facebook and be sure to visit the site again!
Home » Charlie's blog
Category: Charlie's blog

How to log out when using basic access authentication

Suppose you logged into a site that uses basic access authentication and now you want to log out. If you are using Firefox browser you may go to "Tools" -> "Clear recent history" and then in the "Details" section make sure you have "Active Logins" checked and everything else you do not want to clean up is unchecked. But there is one problem: this will wipe authentication data for all sites. What if you are logged into two or more sites and you want to log out from one specific site only? In that case just type something followed by a '@' sign before the domain name and press 'Enter' smile For example if you are logged to the site

Code
https://restricted.com/

go to

Code
https://q@restricted.com/

or

Code
https://logout@restricted.com/

It does not matter what you type, it does not matter if the user with that name actually exists or not. The only thing that matters is that it should be something different from the name of the user you are currently logged in. After that the usual pop-up window will appear that prompts you for password. Just press the "Cancel" button and you are logged out.



Category: Charlie's blog

Optimizing raw Windows partition backup

I was going to do some experiments with Windows the other day. I do not use it much so I'm fine with complete reinstall. But after reinstalling it from CD, installing all updates, and tuning some settings I realized that it may be a good idea to look for another way of having a "clean" system set up and running. The obvious solution: use a "dd" command from your favorite *nix to copy raw partition on an external disk and then copy it back when you need it. The only problem: my Windows partition is 150GB and it almost empty (just installed and updated system), so the idea of wasting 150GB of my drive did not excite me. Of course I may try to compress that image but the blocks from unused space will most likely contain some random data (that partition was approx. 30GB before I started my experiments) and the compression may not be very efficient at this point. So the next step is to try to find a utility that will clean up partition by writing some simple pattern into all unused blocks. After a little googling I found an excellent solution: Eraser (http://www.heidi.ie/eraser/). ... Read full article



Category: Charlie's blog

ORA-00942 when calling dbms_mview.refresh in schema cloned by exp/imp

If you ever tried to refresh materialized view and got an error like this:
Code
BEGIN dbms_mview.refresh('MYMVIEW'); END;

*
ERROR at line 1:
ORA-00942: table or view does not exist
ORA-06512: at "SYS.DBMS_SNAPSHOT", line 2256
ORA-06512: at "SYS.DBMS_SNAPSHOT", line 2462
ORA-06512: at "SYS.DBMS_SNAPSHOT", line 2431
ORA-06512: at line 1

then it's probably because your schema was created by exporting and importing data from schema with another name. If you examine the content of a schema dump file like this:
Code
$ exp myschema@$ORACLE_SID file=myschema rows=n statistics=none
$ strings myschema.dmp|less

then you may see undocumented arguments in commands that create materialized views:
Code
CREATE SNAPSHOT "MYMVIEW" USING ("MYMVIEW", (8, 'DB.GLOBAL.NAME', 1, 0, 0, "MYSCHEMA", ...

The string "DB.GLOBAL.NAME" is obviously a global database name where you exported schema from. It is followed by a few digits and a name of the exported schema. There is also a lot of other stuff I have no idea about, but that probably does not matter.

The point is that if you import a dump file into schema with different name the "MYSCHEMA" argument will not be changed. So when you later try to refresh that materialized view Oracle will search for tables in schema "MYSCHEMA" instead of the current schema. And this is how we can get "ORA-00942: table or view does not exist" error.

So to fix that we should find where that "MYSCHEMA" is stored in the database and change it to the name of the schema the data was imported into. It turns out that it is stored in two tables: "SYS.SNAP$" and "SYS.SNAP_REFTIME$". Basically you need to connect to your database as SYSDBA and execute the following queries:
Code
update SYS.SNAP$ set MOWNER=SOWNER where MOWNER<>SOWNER;
update SYS.SNAP_REFTIME$ set MOWNER=SOWNER where MOWNER<>SOWNER;
commit;

Of course you should examine contents of those tables before executing these queries in case there is a legitimate reason for some materialized views to have differences in those values.

Disclaimer: I have no responsibility for this advice. If you crashed a production database executing code you found on a fan site you have no one to blame but yourself.


Category: Charlie's blog

Wacom Intuos4: first impressions

Wacom Intuos4: first impressions
20 Dec 2010

This Black Friday I decided to buy some photography-related stuff and among other things was the Wacom Intuos4 tablet. If you ever saw at least one episode of "The Complete Picture with Julieanne Kost" you should have noticed that she uses one of those tablets. She even explicitly suggested using a tablet in the "PS - Painting in Photoshop CS5 (part 1)" episode.

So the first question was which model to choose. There are four different sizes available: small, medium (also a wireless model is almost the same size), large and extra large. I've tried to google for recommendations and all I found was people saying that it's basically the matter of personal preferences: if you like to draw on a small area you should look for a smaller one, also the small is better if you are planning to use it in travel. After using it for a while I would add the following criteria:

  1. There is a "Lens Cursor" accessory that available for L and XL models only. So if you think you may ever need a digitizer then you should look at those two models.
  2. When you use a pen with the tablet by default it maps all screen to the whole tablet area, so for example if you want to use a scrollbar you should slide the pen along the right side of the tablet and to close a window you should tap in the upper left corner (assuming you are working on Mac and have maximized the window size). Even for a medium size tablet that means your hand should cover some significant distance.
  3. The small model has only 6 programmable Express Keys while all other models have 8 of them. In fact I did not use those keys much so this difference is probably not that important.
It seems like Mrs. Kost uses the small tablet. I've selected the medium one.

I've already mentioned that the tablet has programmable buttons. It also has a touch ring that has 4 different programmable modes. Besides a pen there is also a mouse that looks like a regular one except that you should use the tablet instead of a mouse pad. Not only you can program any button, but also you can program them for different applications. For example here is a custom radial menu I created that appears if I press one of the pen buttons when I work in Firefox:

Finally I want to warn Mac users that the driver that ships on a CD ROM is very outdated: it is 32-bit version and it has some bug when working with spaces. So you should download the latest driver from http://www.wacom.com/downloads/drivers.php .



Category: Charlie's blog

ORA-31634 and dbms_datapump

Today I tried to import some data into the database. I used dbms_datapump instead of impdp which I usually use for that. Unfortunately I forgot to chgrp oinstall *.dmp, so I've got an obvious error and after an obvious fix I've tried to run the job again... and got ORA-31634: job already exists. I did not want to rename a new job and after a little googling I found this nice blog post: http://arjudba.blogspot.com/2009/05/how-to-cleanup-orphaned-datapump-jobs.html. So I did like the post says:

> select * from user_datapump_jobs;
JOB_NAME OPERATION JOB_MODE STATE    DEGREE ATTACHED_SESSIONS DATAPUMP_SESSIONS
-------- --------- -------- -------- ------ ----------------- -----------------
MYJOB    IMPORT    SCHEMA   DEFINING      1                 1                 2

I tried:

drop table MYJOB;
purge recyclebin;

and I saw the job was still there. Then I did:

declare
 j number;
begin
 j := dbms_datapump.attach('MYJOB');
 dbms_datapump.stop_job(j);
end;
/

but the job obviously did not want to disappear. I had no idea what else I could do, so... I disconnected from the database. After I connected again the user_datapump_jobs was empty and I was able to import my data! I'm still wondering if it's because the job had attached sessions or it just takes some time to finish a job.