Image Image Image Image Image Image Image Image Image
johan

By

April 15, 2014

Turning a Chair into a Puzzle

April 15, 2014 | By | No Comments

pieces

I’ve been having a look at making the chair more comfortable, which meant adjusting the angle of seat and backrest, as well as the height of the seat and the height of the backrest.  One of the consequences is that the chair is now no longer just a bunch of horizontal and vertical lines.  There are many diagonal lines (and some diagonal on two planes), moving at an angle through space, which skews the assembly of the chair. This didn’t really matter until I started breaking the chair up into parts, with the eye on getting a feel for what parts would be needed to assemble it.  I’ve been reading “Design Secrets: Furniture: 50 Real-Life Projects Uncovered”, which talks a lot about the materials and construction used in design projects, and now I’m thinking more about how to practically put this idea together, as a physical object.  I really hope to really make one of these one day.

The beginning of the breaking into parts is what you can see in the image, and the chair in the background is the version that has been adjusted to be more comfortable.

johan

By

April 6, 2014

The Leaf Chair – In Colour

April 6, 2014 | By | No Comments

Adding a little more depth and colour starts to emphasize the core idea.  This doesn’t strike me as anything comfortable to sit on yet, but that can probably be remedied.  I prefer looking at chairs to sitting in them in any case.

leaf_chair_in_colour

johan

By

March 30, 2014

The Leaf Chair – Birth

March 30, 2014 | By | No Comments

I’ve wanted to design a chair for ages. With that in mind, I started work on the leaf chair. This very rough first draft shows the basic idea, of the left front chair-leg forming the stalk of the leaf, and the body of the leaf stretching across the seat and up the back of the chair.

first_rough_draft

johan

By

March 30, 2014

Note: Oracle Related posts are moving

March 30, 2014 | By | No Comments

The Oracle Related posts will probably be moving from shockinggrey.com to jkb.name/oracle (or a similar URL). This blog will be used for some of my other interests. I’ve been planning on a site for what I refer to as DBA “Kata” for a while, and I think the Oracle content will fit better there.

johan

By

June 13, 2013

A little SQL trick

June 13, 2013 | By | No Comments

I’ve been toying with the idea of a wrapper script for generating output in html format with the key goal being to quickly plot the output of a SQL statement as a time-series chart. To this end I wanted to figure out a way where I can execute a query, with some flexibility to control the output format. It was at that point that I figured out a little trick. This may be common knowledge, but to me it was new, so humour me.

In this example I’m using the method to geneare a csv file, not very imaginative and there are easier and more flexible ways of doing this, but it’s a simple place to start.

Here we go. First you have a file called “load_query.sql” which looks like the one below:

with q as
(
@&1
)

Pretty simple stuff. Next we have a file called “csv.sql”, which starts by defining some of the sqlplus output display properties.

-- Parameters
-- 1. Script to execute
-- 2. Output File

-- Settings
alter session set NLS_DATE_FORMAT='DD-MON-YYYY HH24:MI:SS';
alter session set NLS_TIMESTAMP_FORMAT='DD-MON-YYYY HH24:MI:SS';
set heading on
set underline off
set pagesize 50000
set linesize 144
set feedback off
set echo off
set trimout on
set verify off

spool &2

-- Load query and execute
@load_query.sql &1
select q.time || ',' || q.value from q;

spool off

Line 20 & 21 above is where the “trick” comes into play.
In line 20 we execute the load_query.sql script, passing the name of the script that we want to generate csv output for. Note that this script has the following properties:

  • It returns two columns. As the end-goal will be time-series data, we only need time and value columns
  • The query doesn’t end with a semi-colon, that is key, because line 21 is a continuation of the same SQL statement

As an example of a SQL script that can be passed as a parameter when executing csv.sql we can use the query below which shows the number of log switches per hour:

select trunc(first_time, 'hh24') as time ,count(*) as value
from v$log_history
group by trunc(first_time, 'hh24')
order by trunc(first_time,'hh24')

So basically, the csv.sql and load_query.sql files work together to turn the query into the following output:

with q as
(
select trunc(first_time, 'hh24') as time ,count(*) as value
from v$log_history
group by trunc(first_time, 'hh24')
order by trunc(first_time,'hh24')
)
select q.time || ',' || q.value from q;

This forms the basis of a system for working with your script-set in a more dynamic way, giving you control of the form that the output takes. In the next post I’ll show how to use the same principal to create a dygraph plot from query output.

johan

By

November 17, 2011

By Popular Demand – Reventer Detail View

November 17, 2011 | By | No Comments

Reventer users have been asking for a way to view Reventer data in more detail, or at a smaller interval.

Even though it’s always an option to send a csv file to Google Docs and further explore your data there, I agree that it would be good to be able to check out the details on your phone.
The image below is my first stab at figuring out how to make a detailed view for Reventer that will work well on a mobile phone.


Let me know what you think on google+

johan

By

October 18, 2011

Introducing jiTree

October 18, 2011 | By | No Comments

I originally started work on jiTree as a way to improve my understanding of Oracle Indexes. Being a visual person, I often find that more complicated concepts are easier to master when I can see them visualised. So at it’s heart this is intended as an educational tool, to make understanding Oracle indexes more accessible.

A long term goal of the project is to improve the speed and accuracy of the visualisation to a degree where it can be used as a general purpose tool for investigating indexes, but whether this is practical (or can be accomplished in a browser) is not clear yet.
The key to jiTree
Using jiTree is simple. All you have to do is paste an Oracle Index Treedump into the box provided and hit the “Draw Index” button. Once drawn you can view and save an image of the visualisation by clicking the “View as Image” button at the bottom of the page.

Use jiTree

johan

By

October 4, 2011

Oracle Index Tree Dump Visualisation

October 4, 2011 | By | No Comments

 Update: JiTree is an online tool for visualising your indexes.

I’ve been working on a Processing project to visualise Oracle Index Tree Dumps. This is a quick example of the progress. It’s still very much a work in progress, so there are problems to address.

For the test table I’m just copying the dba_objects view into a table.

SQL> select count(*) from dba_objects;

COUNT(*)
----------
68913

SQL> create table test_o as select * from dba_objects;

Table created.

SQL> create index test_o_idx on test_o(object_id);

Index created.

Next I get the treedump as follows:


SQL> select object_id
2 from dba_objects
3 where object_name = 'TEST_O_IDX';

OBJECT_ID
----------
71227

SQL> alter session set events 'immediate trace name treedump level 71227';

Session altered.

Plugging the treedump into my visualisation tool (as I said, it’s a work in progress) gives this view. A very simple tree consisting of only a root node (red) and leaf nodes (clustered around the yellow core).



Now I delete 20000 rows from the test_o table:

SQL> delete from test_o where object_id between 40000 and 60000;

19565 rows deleted.

SQL> alter session set events 'immediate trace name treedump level 71227';

Loading the new treedump shows us where leaf nodes have been deleted.


johan

By

September 22, 2011

one tube minute

September 22, 2011 | By | No Comments

Click here to view the visualisation

When waiting on the platform a minute on the London Underground often feels longer than you’d expect. I decided to investigate this, and get some clarity on the length of one tube minute.

To do this I had to start by gathering the required data.

Data Gathering

Before I could record the duration of one minute according to the arrivals displays on the Underground, I needed to decide how I would measure this minute. Determining the start of the minute was easy. A minute starts when the arrival display switches to show that there is one minute remaining. The end of a minute was trickier to choose.

As far as I could tell there would be three options here:
- When the train enters the station
- When the train doors open
- When the train departs from the station

Because I wasn’t sure that I could always accurately record the point at which the train entered the station, and train departures can be delayed by people stuck in the tube doors, I chose to measure a minute as the time from when the arrivals display switches to one minute, and the time that the tube doors open.

With the method sorted I continued to record data using Reventer.

Visualisation

Having gathered the data I sent it to Google Docs (easy to do in Reventer) and started thinking about the best way to visualise this data. I’d recently read some good blogs about Processing.js, and having played with Processing in the past, I decided to use this to create the animation. I was also reading Nathan Yau’s Visualise This, which emphasizes using data to tell a story. To give readers the chance to experience the duration of the various tube minutes for themselves, I decided on using the animated balls to represent “minutes”.



johan

By

June 21, 2011

Reventer Tutorial

June 21, 2011 | By | 3 Comments

At present Reventer is still in early development. For those who would like to use it and give feedback, here is a quick tutorial to get you started.

First Start

Until you have created at least one event, the first screen you will get when you start Reventer will look like this:



Click on the “add event” button to create a new event. An event is anything that can happen, like getting a headache, traveling somewhere or measuring something like a payment.

Adding an event

After you’ve clicked on the “add event” button you will be presented with a screen where you have to provide 2 details about the event:

  • What it is called
  • What type of event it is


  • There are three types of events available at the moment:

  • Timestamp – Any event for which you only want to record the time that it happened. Like keeping track of when you get headaches
  • Number – An event for which you want to record when it happened
    along with some numerical value, like your temperature or blood pressure (this doesn’t all need to be medical, and I’ll hopefully come up with some better examples soon)
  • Duration – Any event for which you want to record the duration, like the start and end times for a journey.



    After entering the name, just press the button identifying which type of event you are creating.

    Adding More Events

    To add more events, press the menu button on your phone or device, which will give you the option to manage events:



    Adding Event Instances

    Event instances refer to whenever an event actually happens.

    For timestamp events it is easy to add an event instance, just hit the big red + button next to the appropriate event. For our example using headaches, you would hit the + button every time you get a headache.

    IMPORTANT NOTE: Because events are grouped by either hours or days you will only have a dot to begin with. As you add more event instances over time your graph will get more interesting.

    For number events you will get a prompt to enter a value like below:



    To record a duration event instance, just push the play button next to the event.



    Once the event ends, you hit the stop button and the duration will be recorded in minutes.



    Grouping Event Instances

    This is where it gets interesting. Say you are keeping track of when you are getting headaches. It may be useful to get some idea of whether this is happening at certain times of day. This is where grouping comes in. To change what event instances are grouped by, just tap on the green graph on the main screen, and you will be presented with four options:



  • Hour: The event instances are grouped by the number of occurrences per hour, or, for number and duration events, by the number or duration of the event instance per hour
  • Day: The event instances are grouped by the number of occurrences per day, or, for number and duration events, by the number or duration of the event instances per day
  • Hour of Day: Here grouping is by the hour of the day in 24 hour format. Useful for seeing if event instances are occurring at specific times of day.
  • Day of Week: Here grouping is by the day of the week. Useful for seeing if event instances are occuring on specific days of the week

  • Exporting Events

    To export events wih all there instances you have two options. Either export to the SD Card(Export to CSV) or Export to any of your installed application on your Android device (send CSV).

    Once exported you have all the details of every recorded event instance.