ocschwar: (Default)
2017-04-20 11:48 pm

PANDAS rocks.

ess_p = demand_forecast-production_forecast
RTE = 0.8
CAPACITY = 500000
ess_p[ ess_p.rp > CAPACITY] = CAPACITY
ess_p[ ess_p.rp < -CAPACITY] = -CAPACITY
ess_p[ess_p.rp < 0 ] *= RTE
# hard coded initial SOE, needs to be made into something real.
# divided by sixty so we go from minutes to watt hours. 
soe = SOE * 60 -ess_p.cumsum()
soe[soe>CAPACITY*60]= CAPACITY*60
soe[soe<0]=0
ess_pd = -soe.diff()
#RT
ess_pd[ess_pd.rp<0]*=(1/RTE)


10 lines replacing insane amounts of Matlab code.
ocschwar: (Default)
2017-03-06 08:49 pm

Kaiten Nukariya: The Religion of the Samurai (1913)

Most bait & switch book title ever.

Go online and you will find lots of reviews complaining that, well, it has nothing to do with the religion of the samurai.

Still, I liked it.

It's a straight forward book on the history of Buddhism's progress and evolution from the life of the Buddha into the Zen Buddhism practiced in Japanese monasteries, step by step through China, with one foray to Vietnam. It goes enough into warts-and-all detail about abbots reconciling their devotion to practicing loving kindness with the imperative to murder rival abbots who aren't quite doing it right. It's a good book to read if you want to know about Zen Buddhism as more than a consumerist affectation labelled as spirituality, liberally salted with metajokes.

While the book goes into detail about how Japanese practices combined Buddhism with Taoism and Confucian ethics, there is nothing there about Shinto. Nothing about Bushido. Nothing about the Japanese caste system. Or the Samurai. Hence the complaints. Still, it's a Kindle freebie nd a good read.
ocschwar: (Default)
2017-02-20 09:36 pm

Cooo-weee!

If you know me and are reading this here on Dreamwidth, please comment.
ocschwar: (Doggie)
2016-12-09 11:56 pm

(no subject)

A few weeks ago I joked about watching Black Mirror to get cheered up.

I watched The Waldo Moment today.

2016 really has in fact beaten Charlie Brooker's darkest imaginations.

I am terrified.
ocschwar: (Doggie)
2016-12-05 07:05 pm

A modest request.

Could begin calling the present Global Embuggerance by this, its proper name?
ocschwar: (Doggie)
2016-10-18 10:46 am

"Professional SIPB member" is losing its charm as an idiom.

For my current project, I am cobbling together:

VoltTron, a Python server that does a whole lot of things that really don't belong at that level.

An OpenADR VTN written in JRuby and using Torquebox (and therefore Rails). This is a Web server that sends and receives HTTP POSTs of XML using a standard that is pre-GraphQL, pre-REST, pre-SOAP.

An OpenADR VEN written in C++ with some really bad threading issues that I need to edit out.

A JS/some-framework-or-other front end to VoltTron, writtein in part using Tornado.

Doing all this has qualified me to add (so far) to the bottom of my resume: Ruby, JRuby, CMake, C++. Tornado will follow, as will some JS buzzwords. And the whole thing will be put together with ZMQ duct tape and be powered by my hatred. I am thoroughly underwhemed by everything I've seen involving Ruby in this project, and infuriated by the treading issues, which have kept the ZMQ parts from working. If I had the man hours to spare, I'd rewrite a lot of this in Rust. At minimum, I've decided that my gotcha question for job interviews is to see if a new guy proposes a solution that involves introucing the potential for mutex mishaps where none existed prior. Instant "OK,No Way, Go Away" from me. 
ocschwar: (Doggie)
2016-05-16 11:29 am

(no subject)

FIrst full fledged Android app that's more than a Hello-World: done.

Next weekend, plan to write my first publically available app.

After that: writing a REST/CRUD/Flask-SQLAlchemy server that can fit on a BeagleBoard and present a front end to a Shotwell photo archive. It's to have the same basic capabilities as Shotwell itself, as well as a backup synchronizing capability with fellow servers, and ability to synchronize (and check against) Flickr, Google Photos, etc. Then adding a .onion capability to the board, so it can do it home-to-home (for example, grandparents' house and grandchildren's house). Finally, an Android app to talk to it.
ocschwar: (Doggie)
2016-05-13 10:08 pm

Time for an update.

So many of you have left LJ, but I don't have time to tinker with Facebook group settings and I'm supposed to be respectable there. So here, if you're still reading my stuff, here are a few updates.

Yesterday started with me cycling to the Wind Turbine Testing Center in Boston harbor, to tinker wiht a solar installation, in a secure area in the middle of the car terminal. I passed lots filled with used cars going for exports, and a lot wiht Subaru foresters that arrived earlier. At the gate I was greeted by a guy sporting a man-bun, who commuted there on his New Hampshire plated monster truck.  My life will never be interesting enough to warrant a movie script, but on occasion I can gather up enough visual cliches to fill a few minutes of screen time.

At the end of the day I had my hands into the innards of a several killowat inverter, to change the settings of a cloud connected component. So there I was, with this huge power source opened, wires sticking out everywhere, reaching to a set of four buttons to change that component's WPA password so it could phone home to its vendor. And it had an LCD display with a blinking "are you sure?" No, not really. Especially since each board there needed its own DC voltage level that had to come from a power supply connected to outside powe. And the damn thing talked to the cloud. For some of you, cloud computing means a computer somewhere halfway round the world stops you from getting work done. For some, cloud computing, also known as the Internet of things, means a computer halfway around the world will keep your solar panels from working properly.

I've discovered that over the years I accumulated 5 different books on the finite element method. (Well, two of them I kind of bought pretty recently.) Of these, two are Springer Verlag, naturlich, two are Dover books, and one Prentice Hall. The mane takeaway is that OMFG, typesetting matters. I am trying to read all the way through them when I get the chance.

And on other notes: Rust is awesome. Github is awesome. Erlang, well, Elixier is nice.
ocschwar: (Doggie)
2015-08-28 10:34 pm

(no subject)

Well, hello there, LJ.

It's been a year. Last year, I was playing with a RESTful service with ISO-NE to look at how smart grid information exchange standards work. Now I am working full time on a project to write a first version of a new standard for this sector of industry. I am writing a server with some RESTful interfaces that [embargoed] to hasten adoption of small scale [embargoed] with full compliance with existing standards for [embargoed].
And the best part is yes, it's embargoed. Soon I will blab. And brag.

And how are you all?

I'll go away shortly, just before pointing out that where I am, "move fast and break things" is NOT the modus operandi, for both good and ill. This keeps the lights on. It also means I will be drawing a salary for a long time for a project that in other contexts would be finished in a month.
ocschwar: (Doggie)
2014-09-04 10:38 pm

Geeking out.

Things I want to play with: PANDAS. Time series data. RESTful interfaces. Machine learning algorithms.

To that end, I downloaded the WADL spec for data coming from ISO-NE.com. It's complete. There is no point meddling with WADL here, as all the service is read-only for yours truly. The important part of the WADL spec is the < grammars %gt; section, which is an XMLSchema.

That schema is complete, so I need something to parse it. I just tried generateDS.py, which almost does everything I need. The first failing is that it generates Python objects from the XML data I receive, and the objects all have the right attribute names and values, but it does not retain information about attribute types. I specifically need to know which attribute types are unique IDs (location IDs, mostly) so that I can make them columns in the PANDAS files I'm generating. The other failing is that it can only parse XML inputs. The JSON inputs which ISO-NE also provides, I cannot parse yet.
ocschwar: (Doggie)
2014-02-17 09:31 pm

Sic transit gloria mundi

Over the last 20 years I spent many evenings at McIntyre & Moore's bookshop. There's just something about the stacks of used books in the carefully measured level of disorganization, that makes used books in general and M&M in particular a perfect place to unwind. And while I bought books there every once in a while, it was a fact that every visit there I would leave the store feeling sad that I could not buy all the titles I ogled there. There was the issue of time to read these books (as it stands right now if I don't figure out a good schedule for these things I will not be able to read what I have in my hosue right now, within my lifetime.) And the issue of space. And the issue of weight. But there was also the problem that while M&M had the best selection for good scholarly books, they were not priced to move. I could, and sometimes did, put my name in a bookmark, place it in a book in that store, and the bookmark would stay there for years. $30 dollars for a Springer Verlag book on physics. THat kind of thing.

A couple weeks ago I visited the new bookstore in Ball Square. It's a nice store, and the owner's a good guy. But the books, well, imagine an airport bookstore where the good books have all sold and not been replaced. And the ones that didn't sell never got remaindered. There was not a single title I could see there that I could find myself buying.

Don't it always seem to go..
That you don't know what you got till it's gone.
ocschwar: (Doggie)
2014-01-06 09:51 pm

Fun with Kindles.

I got myself a Kindle Paperwhite specifically to stop my habit of printing scientific PDFs and lugging them around like dead weight literally for years as I read through them.

And quickly learned that while the Paperwhite is one of the best PDF readers on the market at the moment, that is not saying much. But every once in a while I develop an outright obsession, and this was one of those times. So some notes about this:

1. Elsevier is the spawn of Satan in so many ways, but they have one very nice feature: for any article they offer full text, they offer to generate MOBI files (as well as PDF and EPub). The service is flaky, but when it works, it just works, and the result is a scientific paper that displays properly.

2. Multicolumn PDFs suck. Single column PDFs are okay. And there is a Java app that converts the former into the latter: cut2col.

3. For IEEE papers, the HTML formatting is pretty nice. So:
a. Install Zotero, Calibre and pygnotero.
b. Take a snapshot of the HTML full text.
3. This script will then let you manipulate the snapshot into a MOBI:

from pygnotero import libzotero
import sys
import os
import subprocess

zotero_folder = '/home/omri/.mozilla/firefox/seb4oddc.default/zotero/'
z = libzotero.libzotero(zotero_folder)


The z.index structure holds all the metadata on your Zotero snapshots, with which you can manipulate the files into a MOBI. An example of what I did earlier:

z.update(True)
I =  z.index.items()
L = [ (i[1].key,i[1].title,i[1].authors) for i in I if i[1].key and  
     os.path.isfile(zotero_folder+'/storage/'+i[1].key+'/icp.mobi')]
print L
for i in L:
    a=  ["/usr/bin/ebook-meta" , "-t", i[1], 
           zotero_folder+'/storage/'+i[0]+'/icp.mobi']
    #p = subprocess.Popen(a,stdin=None,stderr=None,stdout=None)
    #p.wait()
    print a[-1]
    pass
ocschwar: (Doggie)
2013-10-31 12:20 pm

(no subject)



Here's to you, JIRA.
ocschwar: (Doggie)
2013-10-26 05:48 pm

minotaur dong

This attempt to provide for your delectation an actual example of a minotaur dong was foiled by the failure of the Android LJ appp when uploading photos.