Catch up on stories from the past week (and beyond) at the Slashdot story archive


Forgot your password?

Comment: Object-orientedness micro-lesson (Score 2) 263

by presidenteloco (#49746987) Attached to: Ask Slashdot: Career Advice For an Aging Perl Developer?

Jot down a circles-and-arrows model (diagram) of the types of entities that exist (and are important as far as your program will be concerned) in your problem domain. The circles, with an entity-type-name written in each, represent the important different kinds of objects/entities in your domain. The arrows, which you may refer to later when defining attributes or functions that work on the entity types, summarize the important relationships you have noticed between the different kinds of entities in your problem-domain. Look around for groups of entity-types in your domain model which are really just different subtypes of a common kind of general entity type in your domain. Create a named circle for the general type of entity, drawing it above the group of more specific subtype entity-type circles, and join the general-entity-type circle, to each of the entity-subtype circles separately, with a different kind/colour of arrow than you used to represent relationships between one kind of entity and a completely different kind in your domain model diagram.

      Organize data (variable) definitions in the program you are writing into "struct" definitions, where each kind of struct has a set of attributes that together represent the essential properties of some kind of entity in your problem domain.
  (And, for advanced credit, create an additional named struct-type to represent the properties of some kind of abstract record-keeping entity-type you are concocting as part of your "solution" domain. A "solution" domain model is an extension of your model of the problem domain, where you are adding abstractions (new variables) into your problem domain to create a computer model of the solution to whatever problem you've been asked to program a solution for in the problem domain. Some of those solution-domain entity types may not have occurred to you when you first looked around at the external "outside of the program" problem-domain to create your struct-definition-based data model of the problem domain entity types.)

        Use the common (but precise) name of each kind of domain entity as the type-name of the corresponding struct definition.

3. METHODS - are functions/procedures specifically applicable to the attributes of a single struct type.
        For each type of struct you have defined, define the interface signature of, and code for the implemention of, a set of functions which access the attributes of, set the attribute values of, or compute some function of the attributes of a single type of struct.

        Object-oriented languages let you create a struct-type which is meant to represent a specific subtype of domain entity, whenever you have already created a struct-type (and its functions) to represent the common attributes shared by several subtypes of entity. That is, you have already created an abstract supertype struct definition to represent general properties of a general category of domain entity, now you want to add attributes (or specific values of attributes) that describe how different subtypes of the general entity differ from each other.
In an object oriented programming language, the subtype of struct can be created so that its definition references (mentions) the supertype struct type by name.
Then any in-memory instance of that subtype struct inherits all the attributes and applicable functions of the supertype struct definition. Then you add more, specific attributes, attribute value settings, and function interfaces or function implementations to the new subtype of struct you are creating.

To represent as program data the state of the problem-domain or the values from your programmatic manipulations of it or calculations about it, allocate in-memory instances of the appropriate struct types, and set or read their attribute values. To access or manipulate attribute values of a struct instance (also called an object), use ONLY the functions you defined to apply to that type of struct. Do not access or assign to the struct attributes without going through one of the functions you defined. This discipline has several benefits, including allowing you to safely modify some details of each struct type's representation or state-maintenance logic without having to modify external program sections that refer to or set the attributes of the struct.

Some advantages of all this are:

A. The complexity of your program, as a representation of your problem domain, will be minimized by directly modelling, one-to-one, the obvious entity types that occur in that domain, as opposed to just creating a large set of individual, ungrouped variables to represent individual attributes of things in the domain.

B. Provided you do not go crazy creating super-abstract, impenetrable-to-understand supertype struct types, the creation of supertype struct types and supertype function definitions further reduces the complexity of your program, by representing common properties of, and general manipulations of the domain (model) only once in the program. Lack of repeated similar data-representations and code sections leads to a smaller program, and assists in program incremental development or maintenance, because it prevents error-prone and program-complicating partial-modifications where some but not all of the similar data definitions and code sections are modified.

C. The set of functions grouped to be applicable to each type of domain entity form a modular, loosely coupled program structure.

D. By restricting access to the domain model and modification of it to predefined and grouped functions only, you create a program that is easier and less risky to modify, Program modifications generally have fewer cascading dependent modifications and fewer dangerously randomly located sets of co-dependent modifications.

Comment: Let's not lose the plot (Score 1) 825

by presidenteloco (#49738629) Attached to: Oregon Testing Pay-Per-Mile Driving Fee To Replace Gas Tax

Currently, EVs represent 0.115 % of motor vehicles on US roads and 0.06% worldwide.

That is, roughly 1 out of 1000 vehicles in the US and 1 out of every 1700 vehicles worldwide.

Remember that we are trying to keep global warming below 2 degrees Celsius and so far epic failing on that.

My proposal, consistent with climate prudence, is to keep using increased gas taxes until EVs become 50% of vehicles on the road, then and only then start transitioning to distance-travelled fees.

You are SUPPOSED to be incentivising the switch away from fossil fuel transportation now, and as you can see, there are miles and miles and miles to go on the transition plan.

Stopping the various EV incentives now is the kind of short term thinking insanity that got us into this mess in the first place.

Comment: Voltage is wrong for my home project (Score 2) 317

by presidenteloco (#49613159) Attached to: Tesla's Household Battery: Costs, Prices, and Tradeoffs

Want to run a 24V DC "RV electrical system / yacht electrical system" from a DC sub-panel in my house running efficient DC fridge, LED lights, small inverter for laptops etc, and maybe a larger inverter for a diversion load in summer.

Also, our PV modules on our roof need to be entirely in parallel because lots of partial-array shading at various times of day.
So our input voltage range (to batteries) will be around 30V and the output should be 24V DC.

Anyone seen the spec. for input voltage range for the Tesla Powerwall?

Also, anyone know where one can get a 400V to 24V efficient and safe DC/DC converter for the output side of the Powerwall?

Comment: Re:Free the papers (Score 4, Insightful) 81

It's scientific knowledge.

It should be accessible to everyone, period, with the small exception, arguably, of extremely dangerous techniques such as methods of creating artificial super-viruses etc.

Science thrives by the collective discovery, review and improvement of knowledge. The more the disseminationof the knowledge is, the more valuable the knowledge becomes, and the more likely the knowledge is to improve faster.

Throughout history, some peoples' contribution has been to insert themselves as a toll troll on the bridge, even if the bridge was built by others. This is a despicable friction on the function of society.

Comment: Re:Help me out here a little... (Score 3, Interesting) 533

by presidenteloco (#49505913) Attached to: Utilities Battle Homeowners Over Solar Power

Why aren't there companies offering to put solar PV on your roof (e.g. even if you're poor), and you can pay them basically the standard utility rate for your electricity.
The company can make the difference in profit, after fixed costs. Such companies are operating in the US.

Meanwhile, solar infrastructure is built up, as it needs to be to reduce GHG emissions.

Comment: Re:Help me out here a little... (Score 4, Interesting) 533

by presidenteloco (#49505881) Attached to: Utilities Battle Homeowners Over Solar Power

If you have one large lake located up high somewhere and can pump water uphill to it, problem solved.

Does Hawaii have any high ground? Thought so.

Or if you're concerned about ecosystem alteration due to changing water flows, then

if you have one very large hydrogen tank facility somewhere with an electrolysis system (new efficient designs are here or almost here) and fuel cells, problem solved.

Or if you have an ocean floor where you can store a whole bunch of large balloon bags full of air, problem solved.

It's true that these storage methods have a low round-trip energy efficiency, but that energy is coming from the fricking sun - photosynthetic life is about 2% efficient at using solar energy). PV with inefficient storage of its peak generation is still a way better idea than continuing to burn coal and gas to make electricity.

Comment: Re:Varies, I suppose (Score 1, Flamebait) 533

by presidenteloco (#49505795) Attached to: Utilities Battle Homeowners Over Solar Power


Any batch of electrons with the same average voltage is fully substitutable for any other batch of the same number with the same average voltage, from an electrical power use perspective.

I'm not in favour of selling drinking water, but the situation is the same as if a water distribution network had N companies each pumping in water to the pipe network from their lake at a metered rate, and the water coming out the output pipes of the network was sold to a whole bunch of people. Not sure what you don't understand about how that should work as a market system, and how you would divide the revenues. Pretty damn simple really.

Comment: Be a translator, a general, and a good waiter (Score 1) 261

Mediate with reality as a guide between stakeholders and software/IT people.
Don't ever ask for an estimate then say something to the effect of let's try to get it done in half that time.
Live with the triangle and manage it. Something has to give. You decide what.

A really good waiter doesn't break my flow when I'm in the middle of a good conversation, and yet is there with useful solutions or suggestions when needed, and anticipates next needs. A good waiter facilitates a great meal experience for all concerned, by artful interventions and artful absence.

Wins by exploring for and prioritizing risks and opportunities, well in advance. Uses an 80-20 rule. Get's er done. Earns respect by good personal example of doing the job well and consistency in the decisions and commitments of leadership.

Comment: It doesn't matter how knowledgeable I am (Score 3, Interesting) 227

by presidenteloco (#49394929) Attached to: Google 'Makes People Think They Are Smarter Than They Are'

any more (or anyone for that matter).

What matters is how knowledgeable the cyborg comprised of me + net is.

There are two kinds of cases where it still does matter how well I can do on my own.
1. Where time is of the essence and I don't have time to hyper-learn.
2. When I have passed the "Warning: You are leaving the twitterverse" signs on the dirt track off the highway.

What's important in most cases today is how effective cyborg-me is at systematically formulating good questions then systematically acquiring, integrating, evaluating, and using knowledge.

Stop thinking what matters is how good a human individual is at doing something/knowing something. That doesn't matter that much anymore, and will matter less in the near future. I like maintaining my celestial navigation skills, but it's really just for nostalgic reasons.

The solution of this problem is trivial and is left as an exercise for the reader.