Monday, July 24, 2017

Wait! What? How many years?

Holy Swiss Cheese Batman!


2013 was my last post. Need to fix that.
This week I will start a series on making outdoor games.
I will reference all tools and supplies  used, so maybe I can get a sponsor, and then forget all about this blog for another few years.
Having three jobs is difficult, adding a fourth, more difficulter.


Tomorrow-
Large Jenga Wood Stacking Game

Wednesday, March 20, 2013

The Best Part of Couchdb

When you finally get some data in your database, you can use the best feature of the couch web  app. That is the map and reduce functions. In the first post I had you write a map function for the first script. That is all well and good, but with the web interface you can write functions to your heart's content and get immediate feedback. A good source to start this can be found in the Couchdb definitive guide, Cookbook for SQL jockeys chapter. I seem to refer to this every now and then, if I have not used Couch for a few weeks.

Instant gratification while working with a database! Who could ask for more?
 A quick overview:
If you have a dataview you can call it up  in the web interface.  From here you can see the result of your query.


To view the code for the view, click the 'View Code' arrow on the left side of the windo





Here you can see the code and mess around with it

 Your results will show in the window below after you hit the run button. If you like it, use the save as or save buttons. If you use Temporary view, you pretty much have a blank slate. But do save this when you are done, temporary functions really don't work well in the programming.


Wednesday, March 13, 2013

Short post on CQ5 and Couchdb

The long and short of making the next stage of the Couchdb site involved the inital setup before putting in pull down menus--think I sorta started in the middle there.

Having to put together a batch of static websites for a client, what is even worse is they are having me use CQ5 (the pre-Adobe version). If you ever have had the pleasure of using a template based webpage builder, imagine one that does not work very well, and gives very little access to code. I often want to kick my laptop and things of this nature. But that is the way it is.

Some days it works OK, other days, ugh. Today is one of the ugh days. You can almost make it work, then.....whoops there goes a section....somewhere.

Have some Wikipedia deadlines coming up too, not as bad, except I have no access to the client's production server. Works great on the test and development servers, then a glitch on production, which then involves Emailing setting files back and fourth.  Does not happen often, Have a small issue now, but we will live.

While I wait for CQ5 to do what it supposed to do, I shall do some writing.

The next concept is to make files containing company information and region information. These are key areas for this database. Now due to the type of database we are running, which is really a pile of files, it is possible to store different patterns of data on files in the same folder.

There then is a need for input of information on files for Region and Client, and make these different from files which hold course information. Build the files based on the first file and name them what  you want, I named them Region.html and Client.html, along with their respective .js files. If you have questions, let me know.

But  how to easily differentiate the files from one another?
in the previous post, in the code line 160, I added the term "level 3" for the course database. So did the same for clinets "level1" and regions "level 2". Now it is just a matter of searching for level 1, 2 or 3 to pull up the type of file you want.

Brief but understandable?

The next problem. Pull down menus taken from the Client and Region database!

Until then I will be drop kicking my laptop

Tuesday, March 5, 2013

Will get back

Work has been busy, getting part of the house fixed, and I worked the FIRST robotics Finger Lakes regional this past weekend.....
Need to put together the post on setting up for inputting clients and other things. Only one trick, but you should be able to figure it out.
Hope to have the pulldown info written in about two weeks

Thursday, February 21, 2013

Couchdb part 3, the script

Today we will look at the script.I will put these files on the web somewhere and link at the bottom of this page.

Start a file named recordedit.js
Here is the top of it





This is what is happening in the first 28 lines

line 1 connect to the database named courses
lines 2-28 is a function called update courses.

div #courses is emptied
and the view named byname is called, this was built in the last episode. The file will be attached below.
We then have some data, the function itterates through the rows of data, looking for the client name and title.  If there is no data, as there will be the first time this is run, nothing will happen. But with data, we will get a line with the client name and course name. This is followed by links to Edit the course or Remove the course. The remove the course will show up on line 179 of the script and the edit will start on 211, but we have a bit more to do until then.

The next step will build the dataform, it will be blank if the new course from the html page is clicked or populated if the update course button is clicked above.

the setup for this

lines 30-40 are the naming of the form, then we build the form. line 40 says the form will be a table. Then we write some repdative code for each line of data we want.
Looking at lines 44-48, we make the form with the first cell having the text Client, the second cell is the input form for the id client. Line 47 looks odd at first, but what it is asking is if we are editing, then fill in the form with the data from the document we are editing. then we close the line of the table, and so on. This is where you are building  your JSON object, name these what you want, you can change the names later, this form has many lines....
Find all of the lines attached... but

here is the bottom of the table and the submit function.


Now we will either append the JSON file or build a new file. The lines starting in 144 just take the data from the form and put them into the doc. These match up with the form lines in the previous section. This is where errors can occur, make sure the input names match in both sections!



lines 160 and 161 are the last of the building of the doc lines. 161 will be used later as things get more complex, but it shows you can throw anything in there if you wish to help identify the data.
163 and 164 we finish up with the making the document.

166 starts the fun things that happen after the page is loaded--hence the document ready function.
From before, remember that the data has an Edit button and a Remove button next to it. The add new was part of the index file, so within the div # courses, we can either edit or remove. The clicking of one of these will start the events on 170. It takes the document id on 174 and gets ready to do something. If edit is chosen, it opens the document and populates it up in line 30.
181 starts the delete function, if Remove Course is chosen. By the way this was made in lines 20-23.


When delete is called, it gives a chance to cancel the command. Always a good idea. The user is given the option of Delete or Cancel. If cancel is chosen, line 203 happens and we go back to where we were. If delete is chosen, line 190 is called and the database removes the document with the id chosen earlier.


now the end..
Here we add to the database. in 217 it is checking to see if the document has an id, if it does, then we just rewrite the document in the database, then clear the update form. Otherwise, if there is no id, that is it is a new set of data, the database will assign it an id.
then back to where it was.

When making this version, I realized if I wanted the system to be really searchable, some pulldown menus would need to be created, to keep the data uniform.

So, you have a workable form now. Next steps will be to improve the form with pulldowns. And the pulldowns will be populated from the database!!

Link to documents

Thursday, February 14, 2013

Couchdb part 2

CYBERPOWERPC Gamer Xtreme GXi440 Gaming Computer (Google Affiliate Ad)
If you need help loading and starting Couchdb onto your server please go to one of these resources:

Couchdb the definitive guide http://guide.couchdb.org/
 Apache CouchDB http://couchdb.apache.org/
 and for
 Couchapp http://couchapp.org/page/index

 There are many more out there, but I have found these most useful.

 As stated in my earlier post, my programming skills are a bit rusty, and at times I need someone to walk me bit by bit into the processes. I will, hopefully do that walk through here. I don’t really use forums such as stackoverflow, as I feel like an idiot when some answers are given to me. If you have questions, please ask, I hope I will not talk down or up to you.

 Couchdb, with JQuery and Javascript should be easy to use, and most of what you read tells you how easy it is, and once you cross the first hurdle it is. Crossing that hurdle took me several hours of work. Many more than it should have.

 Enough whining Let’s get started.

You need to have Couchdb and Couchapp installed, and if you are a normal computer person, I would assume you messed around a bit with both. You will be using the command line and the Couchdb web interface for most of this work. You will also need a text editing program. I use either notepad ++ or Komodo.

 These examples are done on a Linux Ubuntu box, not that it really makes too much of a difference.

 If you go to your web interface (http://127.0.0.1/_utils) and make a new database, for this example call it ‘courses’ as this project is a catalog of training courses.
 Or you can use the curl command in the command line $ curl -X PUT http://127.0.0.1:5984/courses 

If you messed with the security settings of couchdb, you may need to modify this command, something along the lines of: 

After that step, it is time to start making our application.

 Using the command line, change to a directory will want to work out of, I usually use the documents, or a subdirectory in documents, but have used others, just whatever you feel best using and does not get you confused.

This will be one of commands you will use over and over again, so learn to love it!
 $ couchapp generate app courses
What this does is makes a folder named courses.
The folder is full of many wonderful confusing things, most of which we will not deal with. There should be a few documents on the top level, couchappignore, couchapprc, README.md, _id, couchapp.json, language. Not doing much with these for this tutorial. The folders in the directory should be _attachments, evently, lists, shows, updates, vendor, views.

 We will be dealing with the _attachements and views folders, the others are useful to poke around in, and will be useful for future projects.

 If you did not know already, Couchdb stores its data as JSON documents, which means that each piece of data can be searched by itself, and each set of data is its own document, no mucking about with too many key and making sure everything is set before starting. You can change you search and fields at anytime. If you need help understanding what JSON is there are many articles out there to help you.

 INDEX.html 
We will start in the _attachments folder, specifically with the index.html file. As with most web applications, the index file is opened by default by a web browser. Right now the file is fairly boring, but we will change it. In a later part of this tutorial we will replace this index file with another, rename this file something else, and make a few similar copies of this index file. I am sure smarter people could get by with one index file, but I am not one. I am more of a code basher, than a finesse person. finesse is good. Bashing works for me

 This is what the index.html file should be changed to.

Now let us break this down to its parts. The header:



 Gives us the title , the css file location and loads up some scripts. As you can see there is a loader script named loader.js which loads most things, the recordedit.js script will be written by you soon, and I threw in a link to a general jquery library, as things were not working quite right before doing that.

 Now to the body:

 From the .css file we have a div named account. The title on the page will be “Course Data” The next line will make a link with the term Add Courses, to a form to add courses to our database. The next two divs will make a list of the current data or make a form to edit or add data to the database. The last two lines are used to maneuver between forms we will make later, feel free to leave them off for the time being. Ta-da one of three documents finished .

 The second document is even simpler. Making a view Views are how we, well, view the data. Please hang with me for a bit, as this may be a tiny bit confusing, hopefully not. When we make our database, we of course will have many named fields, the view allows us to search the JSON documents for that particular field, or a value in one of the fields. This file will go into the application in the views folder, in a folder named “byname” and name the file map.js, or using the command line, $couchapp generate view courses byname you will still need to edit the map file in the application as follows




 That is it What this looks for is a JSON document with the field named title, it will then ,gather this document for use. The web interface of Couchdb is an easier way to make views, we will use these the next time.

With that cliffhanger, I will quit. Next time, making the recordedit.js file, the heart of the application.

Friday, February 8, 2013

CouchDB success

It has been a year from my last post, goodness, not a good year, that may be part of it. I have been working with a learning development company for a few months as an interactive developer. Pretty much write code for html courses and work on articulate courses. I was hired to do a MediaWiki site for a major international company. I do some of their web pages too. The other week, I was given an opportunity to develop a site for another company which lists all of their training and is searchable. Simple database, no? No. So my meager MySQL skills were of no use. The programming lingua fraca here are javascript and JQuery, the other developer wanted the output to be a JSON object, and have the database small enough to live anywhere. Soooooo... I did some research and found Couchdb, it is not new and some are moving away from it, but thought I would give it a whirl. What I wanted was a simple input, edit save interface, and the ability to get different readouts of data. Again, nothing too difficult with MySQL, and one would hope not to hard with Couchdb. It turns out to be not too difficult, but getting useful information from most couchdb sites for this project was not easy. The part that was lacking, was how to make an input form. Almost all of the sites wanted you to bulk upload JSON objects to the database. Not going to happen. Most of the examples found were using a command line interface for doing work with the data, not what I wanted. What I will do over a few blog posts is to give simple instructions on how to build this interface and make it work. There are thousands of tutorials on how to install couchdb, so I won't go into that. Before the next post, download and install couchdb and couchapps.

Monday, January 9, 2012

The moon is down


The moon is down
Originally uploaded by tsakshaug

Continuing 366 photos for 2012. Moonset in our backyard this morning.

Sunday, January 8, 2012

First meeting of the build season


First meeting of the build season
Originally uploaded by tsakshaug

Missed a day of photos. Yesterday was the first day of FIRST robotics. After we found out what the game was we worked all afternoon figuring out the game and some possible strategies to use. Good start.

Thursday, January 5, 2012

Day 5 colorful cat


Day 5 colorful cat
Originally uploaded by tsakshaug

Day 5 of 366. This is a drawing that my wife's son's girlfriend's daughter made for my wife. Very nice.

Wednesday, January 4, 2012

stuff in my pockets


stuff in my pockets
Originally uploaded by tsakshaug

At the end of the day I empty my pockets, find the usual stuff. Phone, keys, bandana, knife. Sometimes change. Not tonight. Day 4 of 366

Tuesday, January 3, 2012

Time to put away the grill?


Time to put away the grill?
Originally uploaded by tsakshaug

This is the first grill to come out in the spring and the last to be put away. Yes, I have multiple grills and smokers. I like this one for quick meals, which is what I would do in this weather. Might be in the 40's by the weekend, time to get some burgers together.

Monday, January 2, 2012

Tea seeping


Tea seeping
Originally uploaded by tsakshaug

Day two of 366. Sally received some tea for christmas that opens up while seeping. Sort of neat looking

Sunday, January 1, 2012

Nuts


Nuts
Originally uploaded by tsakshaug

Day one of 2012 365 photos. Or photo a day for 2011. We were making cranberry coffee cake this morning. Here are the nuts

Tuesday, November 29, 2011

Still Looking

As the one or two readers of this blog know, I am still looking for a job. Right now I am working phone support and making about 1/3 of the money I was making last year, which is really not a good thing. What I am not liking, and I may have written about this before, is how some companies handle their applicants and their hiring processes. Maybe I am a bit old fashioned, but I do like getting some feedback. A couple of weeks ago is a case in point. One night after work, I sent in an application to an outsourcing firm that handles technical support for many well known companies around the world. They called me within 12 hours to set up a couple of screening interviews for the next day. I went in, did well on the interviews, and as I was driving home, they called to tell me that they had sent an online test to me and asked me to fill it out as soon as possible, and could I come for another interview the next day. When I got home from work, around midnight, I did the 24 page test, involving UNIX, windows and other commands, server, SQL and various other questions, I did well, at least that is what they told me the next day during my 2 hour interview and tour. So a few hours later they called and asked if I could have a phone interview with someone from the vendor. My feedback from that interview was good, we even discussed pay and benefits. So after that whirlwind recruiting extravaganza, I hear nothing. I was at their beck and call for two and a half days, and nothing. Not even a letter, Email or voice mail saying "never mind". I am a little put out by all of that. My time is worth something, but they did give me a doughnut, so I guess that paid for it. The pay would have gotten me up to 50% of what I was making last year, which would have been nice. Nothing. Give me some feedback. Is that too much to ask?

Sunday, November 27, 2011

What I have learned

What I have learned in my short career outside of education. Working in a warehouse: Warehouse work may not be good for us folks with ADD. Too many flashing lights. I noticed when working on “the line” with my back turned toward the warehouse, I made few errors, but facing the warehouse...I was too distracted, with the forklifts and their blinking lights zipping around. Too much to take in. Found it was hard to let my mind wander too far while stacking pallets, or whatever else I did, made it hard to enjoy the movies and voices in my head. Phone support: I would think that working with numbers is hard enough without having dyslexia. But reading phone numbers, taking credit card information and writing dollar amounts is very hard with it. I don’t make too many mistakes, and usually it is caught by the system or the customer. It gets worse as the day grows longer. I have also learned that I am not cut out for second shift work. I would prefer going in early and getting the day done. My most productive part of the day is around 10 am, and working second shift means I am just getting some stuff done around the house at that time. It is possible to make it thorough anything.

Friday, November 4, 2011

On Call

It has been a long and difficult job search, but I have found a job that may be somewhat long term. I am still looking, schools, business and with my current employer. I am happy to be working, and have been working at this position for a month, and still upset that I did not get some of the jobs I interviewed for, but so it goes.

This past spring and summer were taken up by looking for jobs on-line and in the newspapers, remember newspapers? So many applications, so few call backs. Finally in desperation, I went to the local temporary job agency. That was an eye opener into the world of entry level jobs. Part of the hiring process involved a questionnaire, as most do, but this was different. Other pre-employment questions usually involve something along the lines of, ‘have you ever been convicted of a crime?’ or ‘Have you ever been fired?’, this was more interesting, it presented scenarios to react to.

For instance- You have a disagreement with your supervisor do you:
a) Punch him
b) Storm off the job
c) Do what you are told
d) Stay at work, but don’t work hard

If you feel that a fellow employee has disrespected you, you should:
a) ignore it, if it continues, contact your supervisor
b) wait until after work and fight him in the parking lot
c) start yelling at him to draw attention to how bad he is
d) slap him

Have you ever taken drugs or drunk alcohol while on the job?
a) during lunch only
b) only before work
c) never
d) I sneak some in and use it now and then

and so on for about 50 questions. It was strange. But I did pass that test, and got a call to work in a warehouse at $9 and hour. I was there for a few weeks, but was subsequently offered this position, and a $3 an hour raise! I have many stories to tell about the three weeks “on the line” but, may just let them fade away, like my aches and pains from working there.

Now I answer phones.
Talk to people. Someone is paying me to talk on the phone. I really do not like talking on the phone. But you have to do something or it would not be called work. I work for a multi-level marketing firm, actually a subsidiary of them, which sells VoIP services. I work in billing. So I get calls from folks who need to change credit card numbers, stop service, start service, check balances. These are all good calls. We of course get others who are angry when they call in.

I have noticed that some of my co-workers take that type of caller to heart, and start arguing or being defensive. I don’t. I understand their frustration, and manage to keep everyone calm or calm people down. Then after the call is over, I forget it. I average about 50 calls in a shift, and can remember very little about any of them. I wonder how I would have reacted a few years ago, I think I would have been like some of the others and gotten into arguments. Being calm is good for the blood pressure.....

more later

Monday, August 22, 2011

So much to do

In case the one or two of you that actually look at this blog are wondering. I have a job interview on Friday. It looks like a good job, two small districts share a technology director. That sort of sounded like the beginning of a joke. Both schools seem to have a good amount of technology installed, so it will be interesting to hear what they are looking for, and all that stuff. Hopefully training and working with teachers and students.

While driving I write many blog posts in my head. I usually do not write about religion or politics here, and will try not to. But some politics are popping in my brain wanting to be written. Baseball, now that is what I will write about next, have so many ideas on how to fix the game. Not that it is broken, mind you, but it needs some fixing.

So to let you know what is coming, fair warning.

Wednesday, August 10, 2011

Time moves on

It has been a long summer. I have no idea about the number of applications sent out. On the bright side, I now can say I know Articulate and Captivate. I am trying to get in touch with a local company about doing some training for them.

Have gotten a fair number of rejection letters, and several no contacts. Hoping to hear something in a few days. Time is getting tight.

Just applied for a nice job which is in two near by school districts, splitting my time between the two as their technology director. That would be a good job. Small districts. There is always worries about being split, with both groups feeling slighted, but that will work out. Just need to be clear about schedule and responsibilities.

A larger district was looking for a tech director, as a school admin, they re-posted as a civil service job, they have an inside guy they want to hire.

There seem to be a bunch of PE jobs out there this year. Now an then I think about applying to the state and giving them my money for that licence. Then I fight back the urge.

Something will happen in the next few weeks.
I know it will
really

Tuesday, July 12, 2011

Another week

Things are moving slowly on the job front. Taught myself Articulate and Captivate, nice programs. Prefer Captivate, Articulate has some clunky features, and does not really look like they have done much updating in 4 years or so. Captivate just seems easier to use, perhaps because it is an Adobe product, and runs like one.
Sent off three examples of my work with these programs to a recruiter, who then sent them off to a company looking for an instructional designer. Will see what happens. Only have about 10 days left of the free trial with both software packages, so need to finish learning what I need to learn.
Have heard nothing back from any school jobs....frustrating.
Keep going through the various job posting to find something new.
Middle of July, September is roaring around the corner. Medical insurance goes to COBRA at that point.
But did have a good week in the mountains last week.