Archive for the ‘Machine fix’ Category

Working with Time on Oracle

March 29, 2013 Leave a comment

As I’ve mentioned in my previous post, we were working on a hospital database for our case study, and that includes storage of Appointments (that’s future date + time). I noticed it odd for Oracle that it doesn’t display time, by default. And it doesn’t have a datatype specialized for time. So I found this tweak using SQL, which you might consider helpful as well.

Let’s say my APPOINTMENT table looks like this:




You may need to enter this before every session, because Oracle’s default setting doesn’t include time at all. HH24 means you will be using a 24-hour time setting – that’s less troublesome than having to deal with AM/PM texts, which you need to parse (I think).

INSERT INTO appointment (appt_no, appt_date, confirm_status, cpt_code, patient_no, prov_no, room_no)
VALUES('APT0011', TO_DATE('05-Feb-2013 14:30', 'DD-MON-YYYY HH24:MI'), 'T', '97810', 'P00019', 'PR0008', '102');
SELECT appt_no, TO_CHAR(appt_date, 'DD-MON-YYYY HH24:MI') appt_date, patient_no
FROM appointment;

Notice that I used the TO_DATE() function to store the time data and the TO_CHAR() to retrieve/display it.


NOTE: The Time data will be displayed only upon query (via TO_CHAR()), not in the Object Browser. Well, at least we know it’s stored.

Let me know if it worked for you (or not).

Categories: Machine fix Tags: , ,

Correcting optionalities at MS Visio

March 29, 2013 3 comments

The past month, I was studying the basics of databases, and among the things I had to learn along the way are Entity Relations (ER). Databases are composed of tables (called entities) that are to be connected based on their dependencies towards each other. Our instructor introduced us Microsoft Visio as a good tool to make Entity Relationship Diagrams.

In an ERD, each table has its own columns (called attributes) with at least one of them set as primary key to identify uniquely to that table. Depending on the relationship between entities, a table can inherit the primary key of another table as foreign key, and thus become a child to the table (parent) it is referencing to. Out-bound parent links can be set as mandatory or optional, and the child link cardinalities can be set such that parent-to-child relationships are:



1 TO 0 or more

0 or 1 TO 0 or more
1 TO 1 or more

0 or 1 TO 1 or more
1 TO 0 or 1

0 or 1 TO 0 or 1
1 TO 1

0 or 1 TO 1
1 to Range [at least N, at most M]

0 or 1 to Range [at least N, at most M]

In visual representation, the entity closest to the crow’s feet is the child.

When we were doing our case study on a hospital database, I had trouble trying to create a mandatory link from the parent entity (which should be displayed as two straight lines, instead of just a line and a ring). (Shown below)


In this scenario, ROOM is the parent entity and MEDICAL_SERVICE is the child entity and we need to fix their relation (highlighted below).


Under Miscellaneous > Child has parent, what we are supposed to do is to uncheck Optional.


The problem (the problem!) is that it’s grayed out (disabled). So …

Here’s the workaround:
Under Definition, disconnect associated relations. Make sure the key you choose is the one being inherited (in this case, Room_No)


Go back to Miscellaneous > Relationship type, make sure it’s set to Non-identifying. Under Child has parent, you can now (finally) uncheck Optional.


and voila!


There’s the mandatory relation right there.

“GLX” missing on display

June 27, 2010 25 comments

I’ve recently upgraded to Ubuntu 10.04, and the first time I ran SciLab I got no graphics.  I’m using an Intel Corporation Mobile GM965/GL960 video card, and when I check the implementation this is what I get:

tisza@tisza-ubuntu:~$ sudo lspci | grep VGA
00:02.0 VGA compatible controller: Intel Corporation Mobile GM965/GL960 Integrated Graphics Controller (rev 0c)
tisza@tisza-ubuntu:~$ glxinfo
name of display: :0.0
Xlib:  extension "GLX" missing on display ":0.0".
Xlib:  extension "GLX" missing on display ":0.0".
Xlib:  extension "GLX" missing on display ":0.0".
Xlib:  extension "GLX" missing on display ":0.0".
Xlib:  extension "GLX" missing on display ":0.0".
Error: couldn't find RGB GLX visual or fbconfig

Xlib:  extension "GLX" missing on display ":0.0".
Xlib:  extension "GLX" missing on display ":0.0".
Xlib:  extension "GLX" missing on display ":0.0".
Xlib:  extension "GLX" missing on display ":0.0".
Xlib:  extension "GLX" missing on display ":0.0".
Xlib:  extension "GLX" missing on display ":0.0".
Xlib:  extension "GLX" missing on display ":0.0".
3 GLXFBConfigs:
visual  x  bf lv rg d st colorbuffer ax dp st accumbuffer  ms  cav
id dep cl sp sz l  ci b ro  r  g  b  a bf th cl  r  g  b  a ns b eat

After poking around a couple of forum pages, I finally got a workaround.  Thank you ~witekk for the fix.  So here’s how to do it. On the terminal (as root):

sudo apt-get purge nvidia*
sudo apt-get install --reinstall xserver-xorg-video-intel  libgl1-mesa-glx libgl1-mesa-dri xserver-xorg-core
sudo dpkg-reconfigure xserver-xorg
sudo update-alternatives --remove gl_conf /usr/lib/nvidia-current/

Luckily, this solves the same problem with two other graphic controllers:


  • Intel Corporation Mobile 945GM/GMS, 943/940GML Express Integrated Graphics Controller (rev 03)
  • Intel Corporation Mobile 4 Series Chipset Integrated Graphics Controller (rev 07)

There you have it. Enjoy!

Categories: Machine fix Tags: , , ,