bytes 0f life .v2

Code

Tarotwicks.com: Defining the Reading Process

by version2 on Jun.07, 2008, under Code, WhatsGoingOn, theTwickster

This post is not meant to be very informative. It is more for my notes than anything else. I should make it private, but I am not going to do that. I have not been very good about keeping this blog active, so I am going to dish out anything I can to let folks know what I am up to. Especially people from mysticwicks.com.

So, let’s talk about Tarot readings.

As it pertains tarotwicks.com, a reading will be a totally different experience than what people are used to receiving. One could almost say (and I am sure some will) that we are twisting the Tarot. I say, if using every possible resource available to provide someone with the power to answer the questions they are asking themselves, then fine…we are twisting it. During the first wave of development, however, the tarotwicks project will deliver exactly what a person would need to provide a reading for themselves.

Let’s outline the Reading process.

The user does not have to register or sign up for anything to be able to request a reading. The user will be presented with a list of available spreads to choose from. Perhaps they will given some tips on which spread to choose depending on the question they are trying to answer. The spread choices will be limited. Registered (known) users will have many more spreads available and eventually will be able to design their own spreads to choose from. Spreads that are created by registered users can also be made available to the general community or even just specific friends.

Once the spread is chosen, then tarotwicks goes into action. I am not going to go into low level details at this point. Basically, some numbers are kicked out and the corresponding cards are displayed to the user. This would be a thumbnail type view at first. The user will be presented with the reading with the entire spread in view.

The user will then be able to click on a specific card. Clicking on a card brings up general details regarding the meaning of the card. It will be up to the user to correlate the meaning presented with the question they are trying to get answered.

As you can see, tarotwicks.com will not be giving a reading. The sole purpose of the site is to guide a user through the reading process. It could even be used as a tool for learning the ins and outs of giving a reading. We can even have dedicated users that could assist with questions that users have regarding a reading they have been given.

Users will be able to register with tarotwicks.com and this is encouraged. Known users will be able to save their readings, share them with other users, add notes, request help, add new spreads, etc.

Anyway, this is a brief overview. I have to get ready for band practice right now. I will start typing up the real requirements laid out for phase 1 development. Candice and I have already defined what is needed for the 1.0 release and it is time to make this happen. So, stay tuned.

Leave a Comment :, , , , , , more...

Introducing the Twickster

by version2 on Jun.07, 2008, under Code, Life, WhatsGoingOn, theTwickster

The tarotwicks.com project has now graduated from a small Mysticwicks.com project to something a bit more grandiose. The Twickster will be an online application that will assist users in guided readings. At first we will base everything completely on the Tarot. I have recruited 3 of the brightest engineers I know to assist me in this venture.

We are using Trac to manage the project. (http://dev.tarotwicks.com)

I need to post my notes on the Trac install. It was actually quite a nightmare because I didn’t want to run the standalone version. Bleh. Anyway, its up and running now and that’s what matters. We are going through some push and pull right now at work regarding project management software.

Anyway, I don’t know if I have a document that outlines the entire Twickster experience from start to finish. I have been writing documentation on the project wiki, but it is not a complete and total view. It also uses buzzwords, which have to be explained. G asked me to explain the project to him on Friday WITHOUT the terms and I almost couldn’t do it. This is my attempt to outline the project using everyday language, not Twisms.

Where did the Twickster come from?

Ok, so my wife asked me if it would be hard to develop a tarot reading generator for the Tarot forum on Mysticwicks.com. I said, not really. And then a few weeks later (yah, I’m slow) I started thinking of the best way to do it. At first I was just going to write a Vbulletin plug-in that would do the job. Then I started thinking it might be fun to have a separate site which Mysticwicks.com users could log in and get readings, even save them. My first notes even required Vbulletin user integration at phase I.

From there my thought started whirring around about how best to build the application to produce the best readings. I started thinking about the possibilities of running information obtained by the user through various routines that would find correspondences via various numerological and modern Kabbalistic. These correspondences could then be used to weight the chances of drawing a particular card in a reading.

This Suggestive Randomness would give the application an edge when producing the right user experience to strengthen the psychological aspects of a reading. This also changes the way one would have to think about divination. The assisted reading is based on you and ultimately done by you. The Twickster is a genius at math and able to perform complex equations that would take us forever to complete in a blink. The Twickster gives us a medium and an opportunity to get the best reading we could ever have. It is the best reading because it is done by the only person that could ever really tell you what is going to happen to you.

You.

So, from the small reading vbulletin plug-in springs the might Twickster which will be a very unique site in the social genre. Next post I will explain just exactly what the Twickster is.

Leave a Comment :, , , , , , , , , , more...

Learning ncurses using C / CPP

by version2 on May.27, 2008, under Code, Life

Life after initscr()…

Strolling through the ncurses howto we learn the basics of initilization. raw() and cbreak() are used to take control of the buffer while echo() and noecho() takes control of the echoing of user typed characters back to the terminal. When I say ‘take control of the buffer’ I mean that user input is immediately made availiable to the program.

Most of the interactive programs call
noecho() at initialization and do the echoing
of characters in a controlled manner. It gives the programmer the flexibility
of echoing characters at any place in the window without updating current (y,x)
co-ordinates. (ref)

If you want to use the function keys, etc then you will need to call keypad() to set that up.

The fucntion halfdelay() is pretty interesting. Like cbreak(), input is made availiable to the program however a delay can be set to allow the input request to break if no inpout is given.

This function, though not used very often, is a useful one at times.
halfdelay()is called to enable the half-delay mode, which is similar to the
cbreak() mode in that characters typed are immediately available to program.
However, it waits for ‘X’ tenths of a second for input and then returns ERR, if
no input is available. ‘X’ is the timeout value passed to the function
halfdelay(). This function is useful when you want to ask the user for input,
and if he doesn’t respond with in certain time, we can do some thing else. One
possible example is a timeout at the password prompt.
(ref)

My first problems came up when whipping up the simple example of using the different initialization functions. It seems that keypad() is not behaving as the HOWTO suggests. Here is my version of the simple program that takes user input (1 char) and prints it back in bold and if the input is F1 then say so to prove we have control of the keyboard.

#include <ncurses.h>

int main() {
int ch;

initscr();
raw();
keypad(stdscr, TRUE);
noecho();

printw(“Bold something?”);
ch = getch();

if ( ch == KEY_F(1) ) {
printw(“f1 pressed”);
} else {
printw(“Key is “);
attron(A_BOLD);
printw(“%c”, ch);
attroff(A_BOLD);
}

refresh();
getch();
endwin();

return 0;
}

This is a simple routine and very hard to fuck up. Running the compiled program and pressing F1 does not yield the desired results, however. Instead the program ends and a tilde (~) is displayed. So, the question now is ‘Do I move on with this tutorial?’ or do I figure what the fuck is wrong with the keypad() init?

It’s always something.

*hours later*

Work had me off doing other things, but as I get back to this I have discovered that getch() is not returning the expected value according to the ncurses HOWTO. Either the howto needs to be updated or, well, no…the HOWTO needs to be updated.

After further testing I have found that F1-F4 are not returning the expected integer. The rest of the keys seems to be mapping fine.

I will update with my progress later.

Leave a Comment :, , , , more...

Adodb, PHP, and Character Large Objects

by version2 on May.13, 2008, under Code

Oh, clobs, how I hate you so. I remember researching this problem once before and here I am again! Well, this time, I am writing this shit down.

Scenario is that clob data is not be successfully retrieved from an Oracle 10g database. The language is PHP and the database library being used is adodb.

Some good references on clobs, php, and adodb (and probably adodb in general):

  1. http://phplens.com/lens/adodb/docs-oracle.htm
  2. http://google.com

SELECT BLOBFIELD FROM SCHEMA.BLOBTABLE WHERE id=’4818bc6c02b1a2.78029321′ fails to retrieve the object when executed via the application, however if you run the query in sql developer then it returns the expected data.

This sheds some unhappy light: http://docs.moodle.org/en/XMLDB_Problems

Running under Oracle, it seems that it’s impossible to handle fields having CLOB/BLOB data. While it’s possible to send data to LOB columns, it cannot be retrieved from them and the PHP script ends with a timeout.

Process: After spending a lot of time tracing the problem under ADOdb internals, it seemed to be produced by the OCI function: ocifetchinto() when used with the OCI_RETURN_LOBS setting in order to retrieve contents of LOB columns in a single pass. We’ve tried some alternatives like ociloadlob(), OCI-Lob->read() and OCI-Lob->load() but all them were crashing. Finally we found one bug documented in PHP. So the solution seems to avoid PHP <= 5.1.4 completely if Oracle is going to be used. Just trying it now.

Bad news, 5.1.6 doesn’t seems to solve the problem. :-( Testing with 4.3.11 now. Also we’ve filled this PHP Bug trying to get a solution for PHP 5.1.x).

More news: Oracle LOBs seem to be working back with PHP 5.2.x (release candidate at the time of writing this). I hope they’ll back-port it to 5.1.x series too. Stay tuned on http://bugs.php.net/bug.php?id=38612

Solution: To use PHP 4.3.x, 4.4.x or PHP 5.2 standard distributions or to build PHP 5.1.x with oci8-1.2.2 or later (download it from http://pecl.php.net/package/oci8 or install it dynamically with PEAR/PECL).

That is not a yay.

It seems that OCI_RETURN_LOBS is the current bane of my existence. That, and quite a few nasty PHP bugs. The problem about using a slow release cycle OS is that it IS a slow release cycle. Time to dig deeper into the adodb documentation. Here are some general adodb references. You need to read these. Note: most all of the documentation you see here will have a Oracle slant.

  1. http://phplens.com/adodb/
  2. http://phplens.com/lens/adodb/docs-oracle.htm
  3. http://adodb.sourceforge.net/

Have you see adodb lite? If not, check it out: http://adodblite.sourceforge.net/index.php

So, as far as I can tell, this has to be some fucked up bug in php or the adodb layer. After re-reading the original bug ticket I have discovered that the current problem of empty clob strings being returned is NOT happening in production. That really makes a mess of things. So, this COULD be an environment issue now.

What a depressing issue. It’s 3:39 pm and I still don’t have any answers. I started this as soon as I got to work this morning. The only remaining answer is to follow the advice given by the guys at moodle. I am off to recompile the oci extension.

And now for something completely different.

What?

So, it’s off to download the Oracle instaclient libraries which can be found here. Ladie and gentleman, I would like to introduce to you the next roadblock in our show today:

[ ~]$ sudo rpm -Uvh oracle-instantclient-basic-11.1.0.1-1.i386.rpm
Password:
error: Failed dependencies:
libclntsh.so.10.1 is needed by (installed) libsqlora8-2.3.3-2.el5.i386
libclntsh.so.10.1 is needed by (installed) oracle-instantclient-devel-10.2.0.3-1.i386
libclntsh.so.10.1 is needed by (installed) oracle-instantclient-jdbc-10.2.0.3-1.i386
libclntsh.so.10.1 is needed by (installed) oracle-instantclient-odbc-10.2.0.3-1.i386
libclntsh.so.10.1 is needed by (installed) oracle-instantclient-sqlplus-10.2.0.3-1.i386
libclntsh.so.10.1 is needed by (installed) php-oci8-5.1.6-1.el5.i386
libnnz10.so is needed by (installed) oracle-instantclient-jdbc-10.2.0.3-1.i386
libnnz10.so is needed by (installed) oracle-instantclient-sqlplus-10.2.0.3-1.i386
libocci.so.10.1 is needed by (installed) oracle-instantclient-devel-10.2.0.3-1.i386
oracle-instantclient = 10.2.0.3 is needed by (installed) libsqlora8-2.3.3-2.el5.i386
oracle-instantclient = 10.2.0.3-1 is needed by (installed) oracle-instantclient-devel-10.2.0.3-1.i386
oracle-instantclient = 10.2.0.3-1 is needed by (installed) oracle-instantclient-jdbc-10.2.0.3-1.i386
oracle-instantclient = 10.2.0.3-1 is needed by (installed) oracle-instantclient-odbc-10.2.0.3-1.i386
oracle-instantclient = 10.2.0.3-1 is needed by (installed) oracle-instantclient-sqlplus-10.2.0.3-1.i386
oracle-instantclient = 10.2.0.3 is needed by (installed) php-oci8-5.1.6-1.el5.i386

Wonderful. Let’s get the source. Ugh. Don’t download the basic package you dipshit! What is wrong with you!? Get the *dk!

Compiled.

Installed.

Working. Thank you and good night.

Leave a Comment :, , , , , , , , , more...

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Visit our friends!

A few highly recommended friends...