Skip to main content

Posts

Showing posts with the label Programming

Things I Learend: github will display lines of code in issues

 Just a really quick note about documentation and revision control. Github will do this When the link to a line of code is 'just' pasted into an issue! Pretty Snazzy! Update This seems to work with Python, but not just plain old text.

Coding, Writing, and Organizing: Connecting Worlds

I’ve been re-reading The Organized Writer by Antony Johnston over the last few months. I love the book and the system it describes for focusing on writing by organizing away all non-writing (and writing for that matter) concerns. Of particular interset to me is the concept of never losing an idea. The author advocates for carrying a small notebook (or a phone or PDA) to jot down ideas as the arise, then reviewing those ideas later in the day. To me, this is genius!  There was a problem, however. Try as I might, I’ve been unable to stick to the rigor required to write down all my ideas as they occur to me. I’ll decide I’ll remember it later, (I won’t); I’ll decide to try extra-hard to review my notes at the end of the day, (I didn’t); and so on. The author of the book says that the reader should use whatever tool for writing and reviewing notes that they find to be the most useful. I loved the idea. I just couldn’t find the tool for me. Then, I saw this presentation that I’ve wr...

So Many Projects!

 I found an awesome presentation by Simon Willison at DjangoConUS yesterday . It talks all about how to manage multiple personal projects using things like code repositories, testing, issue threads, and documentation, all things near and dear to my heart. The first question though? How does one shoehorn a physical antenna into a code repository? There's a way! (I just have to figure it out.) And there is programming to be done for the unit test of the antenna! Using the reverse beacon network , I can count the number of rows corresponding to spots of the Rockmite. If there's one or more, the antenna test passed. If not, it failed. I want to be able to answer questions like the following: I was just operating at 6:00 AM PST on the 20 meter band under rain clouds using 250 mW at 14057 MHz. None of the reverse beacon network spotted me. Is it because the radio couldn't pierce the clouds, or because the ionosphere isn't ready yet, which the following resultls from that time...

Six Year-Old Deigns to Read for Programming

Today, an interesting thing happened today in the reading career of six year-old No. Two.  First, I should point out that Two doesn’t read yet.  He’s not really interested in it.  At least, he’s not passionate about it, (to say the least).  While he did express a desire to learn to read several months ago, since then, he’s worked at it only haltingly.  He’ll memorize a letter or two here and there, but really?  It’s just not his thing yet. So, getting back to today’s surprise.  I’m working on a programming project with the kids using the REST API to Google mail.  There’s been a call in our homeschooling group for parents to submit lists of playgrounds they’d like the group to attend for park days in the coming year.  The kids and I have frankly enjoyed almost every playground we’ve visited in the city, (there are dozens of them), so we didn't feel the need to be original, but we do need a list of all the playgrounds we have visit.  We ...

Learning in Waves

CS First studies started up at the house again this week!  If you’re not familiar with Google’s CS First program , if you have homeschooling, or unschooling kids who would like to learn programming for free, you should check it out.  The gang here is returning to it after a two month break.  Their break wasn’t inspired by any faults of the program, far from it.  They’ve loved every single class.  Working on their most recent lesson a few months back they spent hours figuring out different graphics schemes for their dancing program. A few days later, they simply became busy with other things.  That happens a lot here, and is one of the many outcomes of our unschooling practice.  Other things come up.  Some classes end, others start.  In the meantime the things the kids are learning fade in and out of their immediate focus. And that’s OK, because their focus returns to the things they really enjoy, every single time.  Earlier thi...

First Day of CSFirst Camp!

While I was out of town for work, the gang—7 y.o. No. One, 5 y.o. No. Two, and 3 y.o. No. Three—continued their CSFirst work with my partner.  Google cleverly refers to CSFirst as a club.  No. One took it a step further and decided the club was in fact a camp, you know, like summer camp.  One decided that as a camp they of course needed a banner, and went to work. I heard during the day that the gang had worked together to set up One’s sandbox—the web app where CSFirst students do their programming work. I also heard that they were pair-programming; I’m a huge fan of pair-programming, so I was excited to get home last night to find out how everything went. NOTE:  For those who aren’t into programming in general, or agile programming methodologies in particular, pair-programming is the practice of two programmers sitting down at one screen to work on a piece of code.  As one programmer types, the other checks their work.  They both discuss ideas for the...

Setting up our Unschooling Google CS First Class

The gang—7 y.o. No. 1, 5 y.o. No. 2, and 3 y.o. No. 3—and I received our materials for our CSFirst computer club from Google in the mail last week!  Google had indicated it might take as many as three weeks for the materials to arrive, but I suppose since we’re only 40 miles or so from Google headquarters, the materials arrived in a few days.  If you haven’t heard of CSFirst yet, it’s a program from Google to teach kids how to program. We’re trying out the Music and Sound theme.  With a group of kids, some of whom aren’t reading yet, this seemed the better choice for us.  I’m hoping the outcome of the programming activities will be aural output each member of the gang can appreciate on their own.  Also, one of the activities is a dance party.  Everyone in the gang loves a good dance party as evidenced by the number of times we’ve watched Xanadu in the last seven years. When it arrived last week, we dug through our box of materials.  There was...

SageMath, Where Objects Rock and Scripts Don't

I moved the Sage simulation of the can crusher to an object oriented implementation today.  A few days ago,I was worried this might have been a bit of overkill and just a subconcious desire on my part to place the project in a code format I'm used to seeing things in.  I hit an example yesterday that convinced me otherwiser, and only a few short, OK,  and somewhat grueling, hours later, I had a much easier to use OO simulator. Prior to yesterday, my usage mode of the can crusher code was as follows: 1.  Evaluate the cell that contained the initializaiton code.  There were some declarations of global varaibles and a little bit of code that atually ran on evaluation to place values in these variables. 2.  Evaluate the cells that contained the current calculating function and the can moving function separately. 3.  Evaluate the cell that contained the simulation code. This, as far as I knew had to be done every time I wanted to change any values a...

Embedding Sage Cells in HTML Pages

Update:   I finally found what looks like very complete documentation on the Sage cell server . I'm taking a little break from the Alcubierre work [1] and jotting down a few notes on how to embed  +Sage Mathematical Software System  cells into html pages.  I couldn't find any documentation or howto pages for this, so here are my instructions for the next time I get ready to do this. Insert Sage Javascript at the Bottom of the Page For whatever reason, my blogspot entries will erease code placed at the top of a post.  They will however allow scripts that are included at the end of the page, go figure.  So, at the bottom of the page place the following html code: <script> $(function() { sagecell.makeSagecell({ inputLocation: '#graphdemo', evalButtonText: 'Analyze the Alcubierre tophat function'}); }); </script> In the position on the page where you want your actualy sage cell to be displayed insert a div wrapping your sage code...

Unintended Benefits of Unit Testing: Documentation for Nothing and Testing for Free

I'm working on the geochrono[1]  project a little bit at the time.  I unexpectedly came across a benefit of unit testing I'd forgotten about, documentation by testcase.  One of the first requirements for geochrono is: The user will be allowed to add events or person chrono-locations by adding markers to a map at the appropriate location. First implementation  The user will be required to enter the year, month, and day of the month in three distinct textboxes before clicking on OK. The date will be checked as valid using code available at stackexchange [2]. Testcase: Send bad and good dates to date checker code. Something like this: The requirements and testcsases seemed simple enough.  Form a bad date and pass it into the date checking function.  Something like this should have done the trick: assert.equal(isValidDate(new Date(1980, 100, 150)), false); You get the idea, pass in a month that doesn't exist, (100), and a day of the month ...

Mapping Historical Events in Chronological Order: geochrono

In my history of physics research, I've come up with a data visualization application I need that I can't find.  It would be nice to be able to author a list of events and people tied to places and dates and then display them on a map in chronological order.  Using this visualization of information, I'm hoping to find individuals in my research who may have known or worked with each other, or who might have been instrumental in, or related to events in the history of physics.  I did my due diligence and tried to find a free application that already existed, but was unsuccessful.  Here's the open source GitHub for the new application  https://github.com/hcarter333/geochrono  .  The details follow. Failing that, I wrote down a very brief description of what I'd like the app to do: I'm trying to find relationships between individuals that may not be obvious based on their chronological locations. I find myself in need of a tool that will let me map t...

Uploading Videos to Google Plus Events

We've been trying to decipher the video upload system for Google+ events over at the  +STEM on Google+ Community  share your story event.  It's messy and doesn't work as you might expect it to on first glance.  The short version of the story is this: 1.  You can upload videos into events, but it seems they have to be encapsulated in albums that already exist. 2.  You won't see the video in your album, but go ahead and add the album to the event anyway. The video will be added. 3.  Each photo in 'Photos from Posts' is its own album.  Consequently, the easiest way to share a single video to an event is to first share it to your stream to get it into the 'Photos from Posts' album and then, add the video to your event from there. Gory Testing Detail Now, here are all the gory testing details so you know what we saw and also so you'll know you're not going crazy when you run across these problems. OK, here's the latest.  I tried to do...

Adding A JavaScript Controlled Google Plus Interactive Post Button

While learning all about adding a Google+ sign-in button, I noticed a new Google+ sevice, the interactive post.  An interactive post is the same as a normal Google+ post with the addition of a button that performs some 'action' on the target web site.  For an example Google+ interactive post, look here [4].  The Copasetic Flow web sites don't lend themselves to most social networking APIs, there's nothing to buy here yet, and there's no music or movies, but it occurred to me that there is somethinng to watch, the APRS tours[1].  Finally, I have an excuse to play with a social networking API! The mechanisms for using Google+ interactive posts are fairly well described by Google on their docuementation page [2], so I won't walk you back through that.  Where I ran into a few simple problems, (two to be exact), was with trying to influence the post contents using JavaScript. First, when trying to write to a button on the fly [3] using gapi.interactivepost...

Adding Google+ Sign-In to a Web Site

I just added Google+ sign in to the Copasetic Flows ham radio license exam practice site [2].  Unlike friend connect from Google which ultimately disappeared, it was pretty easy!  I used the instructions at Google Plus Daily [1].  The instructions there outline in a very  nice and very complete way how to get sign-in up and working using only JavaScript.  They also demonstrate how to access user information using JavaScript.  The insructions worked very well for me with a few notable exceptions that I'm cataloging here before I forget: 1.  In step 2, adding a sign-in button, I had to add a span around the button html with an id of 'signinButton' to get the button to properly disappear upon login. 2.  The last line of the disconnect code had to be commented out since revokeButton didn't exist in my html. 3.  The profile information code didn't quite work for me.  It's not that it's necessarily bad code so much as it employed bits ...

Radiating Superconductors, Arduinos, and Data Acquisition

While doing research for the NMSU Superconductor Gravity Experiment, I came across an article published by J.E. Hirsch of UCSD . He writes that his 'hole theory of superconductivity', (more on this in a later post), predicts that x-ray photons should be emitted by a superconductor similar in size to our sample when it changes from the superconducting to the non-superconducting state. The superconducting sample I'm using cycles between states each time a set of levitation force data is taken, so I decided to go ahead and try to detect the radiation predicted by Dr. Hirsch as a side project. A Geiger counter is being used as the radiation detector because it was readily available. Data acquisition with the Geiger detector turned out to be a little more work than I expected. My first thought was that I could simply record the beeps coming from the Geiger counter and then use Audacity to analyze the resulting audio file. There were a few issues that cropped up with thi...

Secure Facebook Apps on Google App Engine

A few weeks ago, I asked a friend of mine if he'd mind testing a Facebook app, ( MapMyFriends ) that I was working on. It's a simple little app that maps the locations of your Faceboook friends on a Google Earth plugin. the app has grown and now it will fly you through a global tour of all your friend's photos displaying them on the globe where they were taken... But I digress. My buddy came back with the rather unexpected response that my app wasn't setup for secure browsing on Facebook and he couldn't see it at all. This led me into a few days of work to make the app secure. I've included my notes below in case you run into the same issues I did. First: It's not difficult You'll find lots of documentation on OAuth 2.0 and user authentication, but at the end of the day you probably don't need it. You've already setup account login however you want it in Facebook right? If all you want is an application that communicates back to the...

The Javascript Google URL Shortener Client API

I was working with the Google API Javascript Client this week to shorten the URLs of Google static maps generated by my ham radio QSL mapper . The client interface provided by Google is very useful. It took me a while to work through some of the less clear documentation, so I thought I'd add a few notes that would have helped me here. First, you only need to authenticate your application to the url shortener application if you want to track statistics on your shortened urls. If you just want the shortened URL, you don't need to worry about this. The worst part for me was that the smaple code only showed how to get a long url from an already shortened rul. If you follow the doucmentaiotn on the insert method , (the method for getting a shortened url from a long one), there is a reference to a rather nebulous  Url resource required argument. It's not at all clear how to create one of these in Javascript. The following example code shows how: var request = gap...

Amateur Satellite Tracking Part III

Part I , Part II . I'm still playing around with building a satellite tracking application. I'm helping with a special event station to help raise awareness for the Friends of Science East's effort to restore Tesla's last lab, Wardenclyffe, in Shoreham, NY . When reading through the Google Earth API documenation on linestrings, I noticed that they could be 'extruded'. This means that a plane is drawn down from the line to the ground. This seemed like an odd option at the time, but now I see the use for it. It turns out that it's difficult to tilt the view back far enough on Google Earth to see the satellite above from ground level. A wall that extends from the satellite to the ground though? Well, that's a different matter! (See the video below). There are two next steps. One is to identify the horizon for a satellite. With this information, we can make a sort of automated siting scope to determine if a satellite is worth investigating further....

Satellite Tracking: Initial Succeess

New Tracking App N2YO site As I mentioned yesterday , I'm playing around with building a satellite tracking application. I'm helping with a special event station to help raise awareness for the Friends of Science East's effort to restore Tesla's last lab, Wardenclyffe, in Shoreham, NY . After a few very minor issues, the first satellite is being tracked! First, the satellites in the AMSAT Keplerian data are named in a different fashion than they are on N2YO's site, (the site I'm using to verify my results). So, LO-19 in Amsats Keplerian data table : LO-19 1 20442U 90005G 11187.94329143 -.00000024 00000-0 64087-5 0 01550 2 20442 098.3466 141.1781 0012855 097.5464 262.7179 14.32152423120621 is designated as Oscar19 (LUSAT) on the N2Y0 site . At first, I thought there just weren't actually any amateur satellites in the Amsat data, but soon realized the different naming after performing a ' Search By Satellite Name ' on N2YO's site. I'll...

Getting Started with Amateur Satellites and Satellite Mapping

Progress! See Part II. I'm helping to plan an amateur radio special event on November 5th to raise awareness of the effort by The Friends of Science East to save Tesla's last lab, Wardenclyffe, in Shoreham, NY. One idea for the event is to operate from some of the buildings that Tesla occupied either as labs or as homes in Manhattan. I'm thinking an easy means of operation from there might be satellite. This brings up the interesting question of "which satellites are visible from which rooftops?" I've perused the net a bit and haven't found a program that will display amateur satellite orbits in relation to the NYC skyline, so I decided to plunk around and see if I could come up with my own. So far, I have a list of references I intend to start with and I know what technology I'm going to try to use. Google Earth is now avaiable on web pages as a JavaScript plugin. I'll be using that as the programming framework. The docs for the portion o...