All posts by jeff

Rails pluralization / uncountable nouns

I was building a Rails application today with a noun that has interesting pluralization rules: fish. Fish is both singular and plural, which causes a little complexity for the “convention over configuration” strategy of Ruby. In the past I’ve worked around this by using nouns that don’t have this characteristic, but wanted to figure this out this time.

The issue is that for a noun like “bird”, the convention is that we list all the birds in the database by going to a url like http://app/birds, and a specific bird by selecting its ID in the URL like so: http://app/bird/27. That’s the convention in the routing logic. The challenge then, for “uncountable nouns” like fish, is that the routing logic thinks that http://app/fish is an error, because it’s singular and needs a trailing /ID.

I stumbled over this posting, which is excellent and helped me understand more about what Rails is doing under the hood. So after I removed all my hacky workarounds that didn’t work (include forcing a “Fishes” controller) I noticed that “rake routes” has some lines of interest (reduced for brevity):

            birds GET    /birds(.:format)                  birds#index
             bird GET    /birds/:id(.:format)              birds#show           
       fish_index GET    /fish(.:format)                   fish#index             
             fish GET    /fish/:id(.:format)               fish#show

Note that we have birds and bird for paths, and we have fish_index and fish! My ultimate problem was that fish_path wasn’t working in a link_to:

	<%= link_to 'Fish List', fish_path, class: "btn btn-large btn-primary" %>

that is to say, it rendered the link in the containing page, but when clicked, gave an error because of the missing ID. The solution is obvious now: replace with fish_index_path:

	<%= link_to 'Fish List', fish_index_path, class: "btn btn-large btn-primary" %>

By the way, the work is for a non profit that I’m helping out dealing with water pollution. I’ll update more later when there is something concrete to talk about.

Supplemental Examination Provisions under AIA

I’m struggling a bit to understand this new section 35 USC 257:

(1) IN GENERAL.—A patent shall not be held unenforceable on the basis of conduct relating to information that had not been considered, was inadequately considered, or was incorrect in a prior examination of the patent if the information was considered, reconsidered, or corrected during a supplemental examination of the patent. The making of a request under subsection (a), or the absence thereof, shall not be relevant to enforceability of the patent under section 282.

I think all it is saying is that there are no consequences for the patent owner submitting the request itself.   The second sentence says this pretty clearly.   The first sentence only covers the cases where there is a supplemental examination.  Since the only way that wouldn’t happen (no more than 3 months later) is when the Director decides that the information raises no  substantial question of patentability; I guess in that case it is obviously still enforceable.

I think it only leaves the question of enforceability unclear for the three month period.  I think.

AIA changes: ReExams and Pre-Issuance Submissions

The Leahy-Smith America Invents Act (AIA) created some hard-to-remember changes to the process of ReExams and Pre-Issuance Submissions.   I’ve gone through the Federal Register and highlighted what I thought was notable, but the major changes can be summarized.

Reexaminations

Inter Parte Re-Exam changes were phased.   They actually don’t exist now, having been replaced by petitions to do Inter-Partes Review.    There was  a small window (2011-2012) wherein the process was different, but for most of us this is barely interesting.   Bottom line: Ex Parte ReExam: Doesn’t change.  Inter Parte ReExam: Doesn’t exist.

Pre-Issuance Submissions and Protests

 Pre-Issuance Submissions

Section 1.290.  Only allowed submission methods are paper and EFS-WEB (no fax); the submission date is the received at PTO date, not the sent date.   The information submitted need not be prior art, and anything goes as long as it’s not protected information.  The submission must be done before notice of allowance, and otherwise no later the latest of 6 months after publication or date of first rejection of any claim.   In other words, you always get six months, as long as it’s pre-NOA.   You’ll get more time if it takes the office more time to issue a rejection… assuming there is one.   Kind of a strange effect if I understand correctly – if you want to file at 8 months after publication, it would only be allowed if there is a first claim rejection later.   Submission includes a document list and the application number to which it applies must appear on every page.   If you don’t have a publication date, you must provide evidence of publication.   The third party need not identify themselves.

Protests

Section 1.291(c), similar process, except it can be filed after NOA.   If filed before NOA or publication per 37 CFR 1.211, it will become part of the record of the application.  There does not seem to be an end event beyond which a protest can not be filed.   Different from the 1.290, you are not limited to documents.   It refers to an “information list”,  i.e. facts or information adverse to patentability.  And instead of a “concise description of relevance”, you are allowed a “concise explanation” which can include arguments against patentability.

The applicant need not reply to a protest unless requested to do so by the PTO.  There is also an interesting provision that if the applicant consents,  the protest may be filed prior to notice of allowance.

Severely Annoying

This post is also the subject of a “leadership Minute” video.  When I became a director at Sun Microsystems,  I got to go to “Director School” to teach me to be an executive.   There were multiple teachers but unfortunately I have forgotten all of their names.   The concept that I remember most vividly is that of the SAPWAGI (săp-WĂG-ee).

I have asked scores of other people if they know what a SAPWAGI is, and the reaction is always perplexed bemusement.   SAPWAGI stands for “Severely Annoying Person With A Good Idea”.   The acronym and concept works in my mind because it’s funny and therefore memorable, and embedded in its seven words is the lesson itself. I’ve remembered it some thirteen years later and try to live by its lesson.

The lesson is not too dissimilar from the “Insane Dude Problem“.   The point is that there are many people for whom it takes effort, sometimes extraordinary effort, to understand.   The difference is that a SAPWAGI is simply annoying, whereas the “insane dude” might be subversive. The approach for a SAPWAGI is generally patience and perseverance; it’s totally under your control.

I have worked with a number of SAGWAGIs in my career, far more than “insane dudes”.   There are multiple reasons they may be annoying; for me, the worst is condescension.   Maybe the SAPWAGI is smarter, more seasoned, more capable, more accomplished.   You’ll have to assume they might be, and let them be themselves, in order to engage them. Ask them to tell you more, and don’t be afraid to drill in. They might be annoying because they are hiding their fear that they really don’t know more than you.

As a leader, you are probably more capable of bringing people together, getting them to change things, do things better, and work together.   The SAPWAGI, generally,  does not have that capability. You can keep that in mind as you take the high road and look for the benefit.

What the teacher at Sun taught us somewhere near the year 2000, was that we would reap enormous rewards by bucking up and engaging the SAPWAGI.  Since Sun, at the time, had a Darwinistic organization full of a lots of really smart people, I think someone figured out that we had to engage the SAPWAGI or go home.  It didn’t work out perfectly for them in the end, but that wasn’t because we weren’t able to work together and harness some incredible talent.

JQuery in a webapp created with Dashcode

Don’t ask me why I keep trying to make Dashcode develop a real web application. I’m about to bail on it, but I have this one webapp that I had worked on already, and I wanted to add Jquery.  For one thing, it will make the code cleaner. For another, I needed to add some more code which required that the user wait for a response from the service, and I wanted a spinner. I found a neat way to do that with Jquery (more on that later). The most frustrating thing was that this worked in the browser emulator while debugging, but would fail in the physical device.

First off, most information about how to debug a browser app in the phone is out of date.   What you need to do, on IOS 7, is go to settings-> safari -> advanced -> web inspector and make sure it is slid to green.   Then you need to run Safari on your Mac, and under preferences, select “Show Develop menu in menu bar”.

dev

Then you connect your IOS device to your mac with a USB cable, and start your web app on the IOS device.   Hopefully it doesn’t die, because now you select it under Develop->(your device)->(your app).

Screen Shot 2014-03-13 at 4.12.16 PM
You can then set it to breakpoint on exceptions.

In my case, it simply couldn’t find “$” in most of the errors.   I tried a variety of solutions, including local copies of Jquery.   The way I finally got it to work, was to go to http://code.jquery.com, find the latest core library and the latest mobile library, uncompressed versions, and got the latest released links, and placed them as the first of the real code includes in my header. See lines 13 and 14 below:

<head>
    <!--[if IE]><script>document.write('<base href="' + location.protocol + '//' + location.host + location.pathname.replace(/\/[^\/]*$/, '/mobile/') + '"/>')</script><![endif]-->
    <base href="mobile/">
    <script id="DC_baseScript">if(navigator.userAgent.indexOf('AppleWebKit/') == -1) document.write('<base href="' + location.protocol + '//' + location.host + location.pathname.replace(/\/[^\/]*$/, '/mobile/') + '"/>')</script>
    <title>RGapp</title>
    <meta http-equiv="content-type" content="text/html; charset=utf-8">
    <meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1.0">
    <meta name="apple-mobile-web-app-capable" content="YES">
    <link rel="apple-touch-icon" href="Images/WebClipIcon.png">
    <link rel="stylesheet" href="main.css">
    <link rel="stylesheet" type="text/css" href="../Parts/Transitions.css">
    <link rel="stylesheet" type="text/css" href="../Parts/ActivityIndicator.css">
    <script type="text/javascript" src="https://code.jquery.com/jquery-2.1.0.js" charset="utf-8"></script>
    <script type="text/javascript" src="https://code.jquery.com/mobile/1.4.2/jquery.mobile-1.4.2.js" charset="utf-8"></script>
    <script type="text/javascript" src="Parts/parts.js" charset="utf-8"></script>
    <script type="text/javascript" src="RGincls.js" charset="utf-8"></script>
    <script type="text/javascript" src="Locations.js" charset="utf-8"></script>
    <script type="text/javascript" src="transport.js" charset="utf-8"></script>
    <script type="text/javascript" src="createLocation.js" charset="utf-8"></script>
    <script type="text/javascript" src="main.js" charset="utf-8"></script>
    <script type="text/javascript" src="matches.js" charset="utf-8"></script>
    <script type="text/javascript" src="RideDrive.js" charset="utf-8"></script>
</head>

The next thing after that was getting an animated gif to work, which is where I started. I found this solution: http://blog.oio.de/2010/11/08/how-to-create-a-loading-animation-spinner-using-jquery/ and an appropriate spinner to show when I was waiting for the service to respond. The application has an inherent delay and the application implements a 30 second timeout in the client to catch the event not occurring. The gif works fine in the simulated browser, but doesn’t show up in the real IOS device. After trying a number of things, I took out the <div> from the solution I copied, and used the Dashcode “parts” library to add an Activity Indicator. I named the element the same thing I had named <div> in the example, hoping that $(“#spinner”).show() would work – and it does. I should add, startAnimation() and StopAnimation, as mentioned in the Dashcode documentation, did not work for me.

Sometimes the simplest of things can be really hard. But I think it’s the css in the code coming from Dashcode in this case.