text:
/**
 *
 */
package edu.psu.compbio.seqcode.gse.datasets.function;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.Collection;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.Map;
import java.util.Set;
import java.util.SortedSet;
import java.util.TreeSet;
import java.io.*;

import edu.psu.compbio.seqcode.gse.datasets.function.parsing.MIPSTextFunctionalCategories;
import edu.psu.compbio.seqcode.gse.datasets.function.parsing.OBOParser;
import edu.psu.compbio.seqcode.gse.utils.Enrichment;
import edu.psu.compbio.seqcode.gse.utils.database.DatabaseFactory;
import edu.psu.compbio.seqcode.gse.utils.database.Sequence;
import edu.psu.compbio.seqcode.gse.utils.database.UnknownRoleException;

/**
 * @author Timothy Danford
 */
public class DatabaseFunctionLoader
    implements edu.psu.compbio.seqcode.gse.utils.Closeable, FunctionLoader {

    public static String dbRole;

    static {
        dbRole = "function";
    }

    public static void main(String[] args) {
        try {
            DatabaseFunctionLoader loader = new DatabaseFunctionLoader();
            FunctionalUtils utils = new FunctionalUtils(loader, "LiverAnnotations");

            BufferedReader br = new BufferedReader(new FileReader(new File(args[0])));

            Set<String> total = new HashSet<String>();
            Set<String> target = new HashSet<String>();

            String line = null;
            while((line = br.readLine()) != null) {
            	line = line.trim();
            	if(line.length() > 0) {
            		String[] array = line.split("\\s+");
            		boolean included = array[0].equals("1");
            		String val = array[1];
            		total.add(val);
            		if(included) { target.add(val); }
            	}
            }

            br.close();

            Map<String,Enrichment> enrs = utils.calculateTotalEnrichments(total, target);
            TreeSet<Enrichment> sorted = new TreeSet<Enrichment>(enrs.values());
            double logThresh = Math.log(0.01);

            for(Enrichment e : sorted) {
            	if(e.getLogPValue() <= logThresh) {
            		System.out.println(e);
            	}
            }

        } catch (SQLException e) {
            e.printStackTrace();
        } catch (UnknownRoleException e) {
            e.printStackTrace();
        } catch (IOException e) {
			e.printStackTrace();
		}

    }

    /**
     * func_assignment:
     * id number(10)
     * version number(10)
     * object varchar(100)
     * category number(10)
     */

    /**
     * func_category:
     * id number(10)
     * version number(10)
     * name varchar (100)
     * description varchar(1000)
     */

    /**
     * func_subcategory:
     * child_id number(10)
     * parent_id number(10)
     * version number(10)
     */

    /**
     * func_version:
     * id number(10)
     * name varchar(500)
     */

    private Map<Integer,FunctionVersion> id2Version;
    private Map<Integer,Collection<Category>> versionID2Categories;
    private Map<Integer,Category> id2Category;
    private Map<Integer,Collection<Assignment>> categoryID2Assignments;

    private java.sql.Connection cxn;

    private PreparedStatement loadAllVersions, loadVersionByID;
    private PreparedStatement loadCategByID, loadCategsByVersion, loadCategsByNameVersion, loadCategParentsByID, loadCategChildrenByID;
    private PreparedStatement loadAssignsByCategory, loadAssignsByObjVersion, loadAssignsByVersion;

    private PreparedStatement insertAssign, insertCategory, insertCategoryParent, insertVersion;

    public DatabaseFunctionLoader() throws SQLException, UnknownRoleException {
        cxn = DatabaseFactory.getConnection(dbRole);
        init();
    }

    private void init() throws SQLException {
        id2Version = new HashMap<Integer,FunctionVersion>();
        versionID2Categories = new HashMap<Integer,Collection<Category>>();
        id2Category = new HashMap<Integer,Category>();
        categoryID2Assignments = new HashMap<Integer,Collection<Assignment>>();

        loadAllVersions = FunctionVersion.prepareReadAll(cxn);
        loadVersionByID = FunctionVersion.prepareReadByID(cxn);
        loadCategByID = Category.prepareReadByID(cxn);
        loadCategsByNameVersion = Category.prepareReadByNameVersion(cxn);
        loadCategsByVersion = Category.prepareReadIDByVersion(cxn);
        loadCategParentsByID = Category.prepareReadParentsByID(cxn);
        loadCategChildrenByID = Category.prepareReadChildrenByID(cxn);
        loadAssignsByCategory = Assignment.createReadByCategory(cxn);
        loadAssignsByObjVersion = Assignment.createReadIDByObjectVersion(cxn);
        loadAssignsByVersion = Assignment.createReadByVersion(cxn);

        insertAssign = insertCategory = insertCategoryParent = insertVersion = null;
        insertAssign = Assignment.prepareInsert(cxn);
        insertCategory = Category.prepareInsert(cxn);
        insertCategoryParent = Category.prepareInsertParents(cxn);
        insertVersion = FunctionVersion.prepareInsertStatement(cxn);
	}

    public void close() {
        try {

            loadAllVersions.close(); loadAllVersions = null;
            loadVersionByID.close(); loadVersionByID = null;
            loadCategByID.close(); loadCategByID = null;
            loadCategsByVersion.close(); loadCategsByVersion = null;
            loadCategParentsByID.close(); loadCategParentsByID = null;
            loadCategChildrenByID.close(); loadCategChildrenByID = null;
            loadCategsByNameVersion.close(); loadCategsByNameVersion = null;
            loadAssignsByCategory.close(); loadAssignsByCategory = null;
            loadAssignsByObjVersion.close(); loadAssignsByObjVersion = null;
            loadAssignsByVersion.close(); loadAssignsByVersion = null;

			insertAssign.close(); insertAssign = null;
			insertCategory.close(); insertCategory = null;
			insertCategoryParent.close(); insertCategoryParent = null;
			insertVersion.close(); insertVersion = null;

			DatabaseFactory.freeConnection(cxn);

        } catch (SQLException e) {
            e.printStackTrace();
        }

        cxn = null;
    }

    public boolean isClosed() {
        return cxn == null;
    }

    /**
     * Deletes a given FunctionVersion (and all its associated data) from the database.
     * @param fv  The FunctionVersion to delete.
     * @throws SQLException
     */
    public void deleteFunctionVersion(FunctionVersion fv) throws SQLException {
        if(fv.getID() == -1) { throw new IllegalArgumentException(); }
        System.out.println("Deleting FunctionVersion \"" + fv.getName() + "\"");
        boolean oldCommit = cxn.getAutoCommit();
        cxn.setAutoCommit(false);
        Statement s = cxn.createStatement();

        System.out.println("\tDeleting Assignments...");
        s.executeUpdate("delete from func_assignment where version=" + fv.getID());

        System.out.println("\tDeleting Category Relationships...");
        s.executeUpdate("delete from func_subcategory where version=" + fv.getID());

        System.out.println("\tDeleting Categories...");
        s.executeUpdate("delete from func_category where version=" + fv.getID());

        System.out.println("\tDeleting FunctionVersion entry...");
        s.executeUpdate("delete from func_version where id="+ fv.getID());

        s.close();
        cxn.commit();
        cxn.setAutoCommit(oldCommit);
        System.out.println("Done.");
    }

    /**
     * Returns the list of *all* FunctionVersions that are available in the database.
     *
     * @return A collection of FunctionVersion objects.
     * @see edu.psu.compbio.seqcode.gse.datasets.function.FunctionLoader#getAllVersions()
     */
    public Collection<FunctionVersion> getAllVersions() throws SQLException {
        if(id2Version.size() == 0) {
            try {
                synchronized (loadAllVersions) {
                    ResultSet rs = loadAllVersions.executeQuery();
                    while(rs.next()) {
                        FunctionVersion fv = new FunctionVersion(rs);
                        if(fv != null) { getCategories(fv); }
                        id2Version.put(fv.getID(), fv);
                    }
                    rs.close();
                }
            } catch(Exception se) {
                id2Version.clear();
                //throw se;
				se.printStackTrace(System.err);
            }
        }
        return id2Version.values();
    }

    /**
     * Load a FunctionVersion object by database id.
     * @param vid The DBID of the function version.
     * @return The FunctionVersion object.
     * @throws SQLException
     */
    public FunctionVersion getVersion(int vid) throws SQLException {
		FunctionVersion fv = null;
        synchronized (loadVersionByID) {
            loadVersionByID.setInt(1, vid);
            ResultSet rs = loadVersionByID.executeQuery();
            if(rs.next()) {
                fv = new FunctionVersion(rs);
                id2Version.put(fv.getID(), fv);
            }
            if(fv != null) { getCategories(fv); }
            rs.close();
        }
        return fv;
    }

    /**
     * Load a FunctionVersion object by name.
     * @param n The name of the function version.
     * @return The FunctionVersion object.
     * @throws SQLException
     */
    public FunctionVersion getVersion(String n) throws SQLException {
        PreparedStatement ps = cxn.prepareStatement("select id from func_version where name = ?");
        ps.setString(1,n);
    	ResultSet rs = ps.executeQuery();
    	FunctionVersion fv = null;
    	if(rs.next()) {
    		int id = rs.getInt(1);
    		fv = getVersion(id);
    	}

    	rs.close();
    	ps.close();

    	if(fv != null) { getCategories(fv); }

    	return fv;
    }

    public void insertVersion(String n) throws SQLException {
        synchronized (insertVersion) {
            insertVersion.setString(1, n);
            insertVersion.executeUpdate();
        }
    }

    /**
     * Returns all the Category objects associated with a particular FunctionVersion.
     *
     * @param fv The name of the version.
     * @see edu.psu.compbio.seqcode.gse.datasets.function.FunctionLoader#getCategories(edu.psu.compbio.seqcode.gse.datasets.function.FunctionVersion)
     */
    public Collection<Category> getCategories(FunctionVersion fv) throws SQLException {
        if(!versionID2Categories.containsKey(fv.getID())) {
            LinkedList<Category> lst = new LinkedList<Category>();
            versionID2Categories.put(fv.getID(), lst);

            synchronized (loadCategsByVersion) {
                loadCategsByVersion.setInt(1, fv.getID());
                ResultSet rs = loadCategsByVersion.executeQuery();
                System.out.println("Loading categories (#" + fv.getID() + ")...");

                while(rs.next()) {
                    Category c = new Category(rs, this);
                    id2Category.put(c.getID(), c);
                    lst.addLast(c);
                }
                rs.close();
            }

            System.out.println("Loading category relationships...");
            Statement s = cxn.createStatement();
            ResultSet prs = s.executeQuery("select child_id, parent_id from func_subcategory");
            while(prs.next()) {
                int ci = prs.getInt(1), pi = prs.getInt(2);
                Category cp = id2Category.get(pi);
                cp.addParent(id2Category.get(ci));
            }

            prs.close();
            s.close();
			System.out.println("Done.");
        }

        return versionID2Categories.get(fv.getID());
    }

    Category getCategory(int id) {
    	return id2Category.get(id);
    }

    public Category getCategory(FunctionVersion fv, String n) throws SQLException {
    	for(Category c : versionID2Categories.get(fv.getID())) {
    		if(c.getName().equals(n)) {
    			return c;
    		}
    	}
    	return null;
    }

    public void insertCategoryRelationship(Category child, Category parent) throws SQLException {
        synchronized (insertCategoryParent) {
            insertCategoryParent.setInt(1, child.getID());
            insertCategoryParent.setInt(2, parent.getID());
            insertCategoryParent.executeUpdate();
        }
    }

    public void insertCategory(FunctionVersion version, String name, String description) throws SQLException {
        synchronized (insertCategory) {
            insertCategory.setInt(1, version.getID());
            insertCategory.setString(2, name);
            insertCategory.setString(3, description);
            insertCategory.executeUpdate();
        }
    }

    /**
     * Collects the set of *all* assignment objects which are assigned to either the
     * given category, or *any* descendant of this category.
     *
     * @param c  The given category.
     * @return The set of Assignment objects.
     * @throws SQLException
     */
    public Collection<Assignment> getAllAssignments(Category c) throws SQLException {
        HashSet<Assignment> assigns = new HashSet<Assignment>();
        HashSet<Category> seen = new HashSet<Category>();
        collectAllAssignments(c, assigns, seen);
        return assigns;
    }

    public void insertAssignment(Category c, String obj) throws SQLException {
        synchronized (insertAssign) {
            insertAssign.setString(1, obj);
            insertAssign.setInt(2, c.getID());
            insertAssign.executeUpdate();
        }
    }

    public void beginTransaction() throws SQLException {
    	cxn.setAutoCommit(false);
    }

    public void commitTransaction() throws SQLException {
    	cxn.commit();
    	cxn.setAutoCommit(true);
    }

    /**
     * Loads all the Assignment objects associated with this particular version.
     *
     * @param fv  The indicated FunctionVersion
     * @return A collection of Assignment objects loaded.
     * @throws SQLException
     */
    public Collection<Assignment> getAssignments(FunctionVersion fv) throws SQLException {
        HashSet<Assignment> assigns = new HashSet<Assignment>();
        synchronized (loadAssignsByVersion) {
            loadAssignsByVersion.setInt(1, fv.getID());
            ResultSet rs = loadAssignsByVersion.executeQuery();
            while(rs.next()) {
                Assignment assign = new Assignment(rs, this);
                assigns.add(assign);
            }
            rs.close();
        }
        return assigns;
    }

    /*
     * A helper method, for getAllAssignments().
     */
    private void collectAllAssignments(Category c,
                                       HashSet<Assignment> assigns, HashSet<Category> catsSeen) throws SQLException {

        if(!catsSeen.contains(c)) {
            catsSeen.add(c);
            assigns.addAll(getAssignments(c));
            Collection<Category> children = getChildCategories(c);
            for(Category child : children) {
                collectAllAssignments(child, assigns, catsSeen);
            }
        }
    }

    /**
     * Returns the Category objects which are the (immediate) children of the given Category.
     * @param c The given category.
     * @return A set of Category objects.
     * @throws SQLException
     */
    public Collection<Category> getChildCategories(Category c) throws SQLException {
        HashSet<Category> cats = new HashSet<Category>();
        synchronized (loadCategChildrenByID) {
            loadCategChildrenByID.setInt(1, c.getID());
            ResultSet rs = loadCategChildrenByID.executeQuery();
            while(rs.next()) {
                int cid = rs.getInt(1);
                Category cat = getCategory(cid);
                cats.add(cat);
            }
            rs.close();
        }
        return cats;
    }

    /**
     * Returns all the Assignment objects which are *immediately* associated with the
     * given Category.
     *
     * @param c The given Category.
     * @return The set of Assignment objects.
     * @throws SQLException
     */
    public Collection<Assignment> getAssignments(Category c)
        throws SQLException {

        if(c.getID() == -1) { throw new IllegalArgumentException(); }
        if(!categoryID2Assignments.containsKey(c.getID())) {
            LinkedList<Assignment> assigns = new LinkedList<Assignment>();
			synchronized (loadAssignsByCategory) {
                loadAssignsByCategory.setInt(1, c.getID());
                ResultSet rs = loadAssignsByCategory.executeQuery();
                try {
                while(rs.next()) {
                    Assignment a = new Assignment(rs, this);
                    assigns.addLast(a);
                }
                } catch(SQLException se) {
                    throw se;
                } finally {
                    rs.close();
                }
            }

            categoryID2Assignments.put(c.getID(), assigns);
        }
        return categoryID2Assignments.get(c.getID());
    }

    /**
     * Returns the set of all Assignment objects which correspond to a particular object.
     * In essence, this is used to get you all the Category objects to which a particular element
     * is assigned.
     *
     * @param obj The name of the object.
     * @param fv  The name of the version to search.
     * @return The set of Assignment objects, whose "Object" field is equal to obj
     */
    public Collection<Assignment> getAssignments(String obj, FunctionVersion fv)
        throws SQLException {

        //System.out.println("Searching for assignments \"" + obj + "\"");
        if(fv.getID() == -1) { throw new IllegalArgumentException(); }
        LinkedList<Assignment> assigns = new LinkedList<Assignment>();

        synchronized (loadAssignsByObjVersion) {
            loadAssignsByObjVersion.setString(1, obj);
            loadAssignsByObjVersion.setInt(2, fv.getID());

            ResultSet rs = loadAssignsByObjVersion.executeQuery();
            try {
                while(rs.next()) {
                    Assignment a = new Assignment(rs, this);
                    assigns.addLast(a);
                }
            } catch(SQLException se) {
                throw se;
            } finally {
                rs.close();
            }
        }

        return assigns;
    }

    private static class CategoryComparator implements Comparator<Category> {

        public CategoryComparator() {}

        public int compare(Category c1, Category c2) {
            if(c1.isChildCategory(c2)) { return 1; }
            if(c2.isChildCategory(c1)) { return -1; }
            return c1.getName().compareTo(c2.getName());
        }
    }
}

redpajama_set_name: RedPajamaGithub


text:
Power Rangers Lost Galaxy
Watch Power Rangers Lost Galaxy full episodes online kisscartoon.
Synopsis: Power-Packed Adventure! Action-Packed Fun! A time in the future. The space colony Terra Venture journeys beyond Earth in search of new worlds. Peace reigns throughout the cosmos…or does it? Far away, in a strange galaxy, the evil Scorpius attacks an innocent planet. Five courageous teens from Terra Venture rush to defend it and discover they've been "chosen" to be protectors of the universe. An all-new team of POWER RANGERS is born! Do they have what it takes? Can they defeat Scorpius even with the help of their mighty Galactazords? Take a quantum leap into the future as POWER RANGERS LOST GALAXY blasts you beyond time and space!
Stars: Archie Kao, Reggie Rolle, Danny Slavin
More info: IMDB, Wikipedia
Genres: Action, Adventure, Fantasy
Power Rangers Lost Galaxy-episode-1-
Power Rangers Lost Galaxy-episode-10-
FernGully The Last Rainforest (1992)
Watch FernGully: The Last Rainforest (1992) full movie. FernGully: The Last Rainforest storyline: The fairies live in a peaceful place in the forest called Fern Gully which has been protected for many years by Magi, a wise fairy with strong powers. Her grand-daughter Crysta is a charming, beautiful fairy that is very intrigued about the […]
Lego DC Comics Super Heroes: Justice League vs. Bizarro League (2015)
Watch Lego DC Comics Super Heroes: Justice League vs. Bizarro League (2015) full movie. Storyline: Wherever there is chaos and destruction, you will find Superman's mixed-up clone, Bizarro, who hears the opposite of what is said, says the opposite of what he means and does the opposite of what is right. The Man of Steel […]
Yashahime: Princess Half-Demon (Sub)
Watch Yashahime: Princess Half-Demon (Sub) free kisscartoon. Other name: Hanyou no Yashahime: Sengoku Otogizoushi Synopsis: The daughters of Sesshoumaru and Inuyasha set out on a journey transcending time! In Feudal Japan, Half-Demon twins Towa and Setsuna are separated from each other during a forest fire. While desperately searching for her younger sister, Towa wanders into […]
genres: Action, Adventure, Comedy, Demons, Historical, Magic, Supernatural
Star vs. the Forces of Evil Season 3
Watch Star vs. the Forces of Evil Season 3 full episodes cartoons online. Synopsis: When magical princess Star Butterfly receives a royal magic wand for her 14th birthday, she proves to her parents that she is not ready for the responsibility that comes with it. As a result, they send her to a place that […]
genres: Adventure, Comedy
Mia and Me Season 1
Watch Mia and Me Season 1 full episodes online kisscartoon. Synopsis: Mia is an awkward 12-year-old who recently arrived at a new boarding school, where she is given a book and bracelet that are more than they appear to be on the surface. The items have the power to transport Mia to a magical storybook […]
X-Men Animated Series Season 5
Watch X-Men Animated Series Season 5 full episodes online kisscartoon. Synopsis: In the Marvel Comics universe, mutants, people with genetically endowed superpowers, are a persecuted by a hateful and fearful populous. One shelter from this is Professor Xavier's Academy for Gifted Children. But the school has a secret function as a training centre for mutants […]
genres: Action, Animation, Sci-Fi
Tonikaku Kawaii (Dub)
Copyright © 2019 kiss-cartoon.me. All rights reserved.
Theme Design by https://www1.kiss-cartoon.me

redpajama_set_name: RedPajamaCommonCrawl


Some time ago I wrote about power losses as a means to explain why a motor driver circuit gets hot. You can read the details of this article at the "My Chip Is Running Hot" posting. On this previous article, I detail how we can compute power dissipation by using the I^2*R (from now on ISR for I Squared R) equation. This is all pretty easy to digest as we can imagine a current "I" flowing through two FETs which happen to have an RDSon "R". Hence filling the previous equation up has to be a piece of cake.
2. You enable another FET to take the current. It can either be both of the opposing FETs (as in fast decay) or the opposing low side FET (as in slow decay).
Option 1 is hardly ever used anymore as it is not the most efficient mechanism. If you use it, though, you will need to use two equations: ISR during the TIME ON and I*Vf during the TIME OFF, where Vf is the diode's forward voltage.
What you will find on a fair majority of today's available goodies, is the use of an alternate FET based path to take on the current. The reason behind this logic is that if you use the opposing FETs you can obtain controlled current flow and optimize things. In other words, you can choose when the FETs are enabled/disabled. It will become apparent later why this is important. Just to keep with the nomenclature, if you use the diode mechanism, since you cannot control when the diode starts/stop conducting, we will call this current recirculation asynchronous, whereas on the opposing FET scenario, since you control enablement/disablement, we will call this current recirculation synchronous (it is synchronized to your controller).
Whether we use diodes or FETs does not change the fact that we are conducting current at all times. Granted that if we use diodes, we will be adding power dissipation in the form of IVf being greater than ISR. Why? Well, because the Vf on a diode is often pretty big whereas the RDSON on a FET is made to be tiny. Precissely because of this! If the RDSON was huge, you might as well use the diodes and go with the asynchronous decay.
With all that being said, when we use the opposing FETs to recirculate current, even if we are PWMing the outputs, we can still use the ISR equation. Really??? On your favorite's device datasheet you will be given the RDSon for both FETs. If you are assuming the FETs are ON at all times (no PWM is employed), you use the ISR equation with the continuous current and the two RDSON resistances added together. For example, on a DRV8818's at room temp, its high side FET RDSON is 220 mOhms whereas its low side FET RDSON is 150 mOhms. During TIME ON, you would use the ISR equation with each H Bridge having an R = 370 mOhms.
But what happens when we PWM? Sure, we can use the very same equation as before during TIME ON, but what about during the eventual occurrence of a TIME OFF period? Here is where you will need to know whether you are using FAST or SLOW decay. If you are using FAST Decay then you can use the exact same numbers on the ISR equation whether you are on TIME ON or TIME OFF because as you utilize opposing FETs, the resistance will match in both case. On our previous example, if the right high side and left low side FETs were ON during TIME OFF, the left high side FET and right low side FET would have been ON during TIME OFF.
If you are using slow decay, on the other hand, then you will need to take into consideration which FET is the one maintained ON as the resistance term will in esence double (e.g. you will have either both low side FETs or both high side FETs).
(if on slow decay), where SlowDecayFET is the RDSON for the FET that is used for the slow decay. You will need to check the device's datasheet as each H Bridge is different and some will use high side FET recirculation, while others will use low side FET recirculation during slow decay.
Notice you will need to know what the duty cycle is, as this will define what the TIME ON and TIME OFF are. To be honest, I would personally do not even bother with this. Because chances are that if you have a PWM, the duty cycle will be changing at all times. For example, what if you have a PID loop? What if you are microstepping? There is no way to easily model what the duty cycle will be doing at all times. Well, I can tell you it will be changing. But how? Beats me! Logically, this can all be modeled if you have the time and the resources. If you are going to go this route, make sure to rent some time at the Large Hadron Collider computer so you can take into consideration solar flares, floor vibrations as Elephants stampede across the African terrains and most importantly quantum fluctuations cause by alien invasion on a nearby parallel universe. Heck, those can mess any simulation results in a flash!
OK, so now we have all the considerations (at least the ones I can think off) when it comes to TIME ON and TIME OFF. There is one dinky little problem. To think an H Bridge can only operate in TIME ON and TIME OFF is as naive as a 15 year old thinking their new Android App will surely make him an overnight millionaire. The truth is FETs cannot just be turned ON and OFF in no time. I mean, we could if we had infinite current. Do you happen to have some of that? Because that could truly make you an overnight millionaire! Forget about the Android App!
No, neither you nor me have the slightest idea on how to get infinite current. And even if we had it, we shouldn't use it. Because when you use lots and lots of current, parasitics start to creep up from the very same fiery pits of electro-hell! Remember that ISR applies for everything and that includes traces, PCB structures, bond wires, etc. If you have a heinuous current flowing into the transistor gate so you can enable it in no time, what was construed as GND will most likely no longer behave like the aforementioned GND. This is what is called Ground Bouncing and although there are ways to diminish this problem, the real solution is to ensure current does not change abruptly. In other words, making sure the FETs are not turned ON and OFF as fast as we would want, or an infinitesimaly small time.
OK, if we cannot switch our FETs ON and OFF as soon as zero femtoseconds, then this means we have to incorporate yet another period of time to turn the FETs ON and OFF. In other words, what we need is a transition. And these transitions happen to have a name. And a last name too! Exagerated on the image below (as in real life we try to make these times as small as siliconely possible), when the power output goes HI, such transition will be referred to as the rising edge and how long it takes for the FET to reach full enablement (and hence its lowest RDSON value) is the Rise Time. On the same token, when the output is made LO, then we are looking at the falling edge and how long it takes for the FET to be fully disabled is measured as the Fall Time. Device's datasheet should tell you what these time parameters are, as you will need them to compute the next part of the puzzle.
Also known as Switching Losses, or the losses associated with the power stage continuous switching, these are often ignored as they are most of the time negligible when compared with the actual ISR component. Why would that be true? For starters, really efficient power stages will have Rise and Fall times being so small (think nano seconds), the result of this equation is tiny. Granted that these power stages have to be designed in with the uttermost care or the ground bouncing is going to knock you out of your sockets, but if done properly, you can have a system for which the switching losses are literally not a problem needing to worry yourself with. Either way, even on an amazing power stage you should expect Rise and Fall times in the order of 50 ns, whereas more economical versions will be designed with anywhere in the vicinity of 100 ns to 300 ns. So as you can see, this time is rather small.
The other reason why switching losses are often ignored is because the switching frequency is not that high. Notice that the switching losses are directly proportional to the frequency so clearly the higher the frequency the worst the power dissipation gets! However, motor H Bridges are hardly PWM'd at anything more than 30 KHz. In some systems, 30 KHz is prohibitely large and you see frequencies lower than 20 KHz. Heck, if it is a cheapo toy, where the cost of the processor has been squeezed so much the cost is almost negative, I can assure you the frequency will most likely be 1 KHz or 2 KHz if at all. On applications of this sort, it really doesn't matter that much.
With all that being said, it could come to be that the switching losses do matter. For example, on some applications you will need the rise and the fall time to be huge. Think for example a gargantuan application like a battery operated drill or an RC plane. You would not imagine this, but currents on these guys can go up to a few dozen amps! To switch this much current ON and OFF quickly is like pulling on your nose hair. Painfull like hell! You just can't! Hence, the rise and the fall times may easily be taken to as much as 500 ns or more. This same phenomenon often plagues very large drives, such as industrial drives, in which heinuous currents in the hundreds of amps must be switched. An an application of this sort, to go above 16 KHz is like hitting your face with a shovel.
Then there are those applications suffering from an ego boost and wanting to run on so fast frequencies, even dogs get to squeal like a puppy. For example, some time ago a customer was incquiring about using 400 KHz. What was the application in question is irrelevant. In my experience, for any frequency higher than 80 KHz, the switching losses start to become noticeably high and ignoring them is no longer a good idea.
All this mayhem and I haven't mentioned voltage. Do we care about it? Unfortunately, yes. Do note that on our lovely Switching Losses equation, this power dissipation will in fact be directly proportional with application voltage! So say you are driving a stepper with a 12V power supply and then the same stepper with an 80V power supply. Maybe you think that because in both cases you are putting 1A across the stepper the power dissipation should be pretty much the same. ERRR!!! That will not be the case. The ISR component may be quite similar, but the switching losses on the 80V will super squash the 12V counterpart losses. This is one of the tradeoffs of using higher voltages to drive a stepper: Yes, you can increase current throughout the winding faster and hence move the stepper faster, but the switching losses will also be larger.
Thank you! Does this phenomena occur in BJTs too? If so, why are inverter BJTs circuits used to improve the rise/fall times of the waveform? In my case, I was recommended that I should insert a BJT inverter between the output of the comparator and the input of the MOSFET. There is a resistor connected between the collector and power supply. This resistor ends up making a RC circuit with the input capacitance of the MOSFET and due to a time constant of 1uS, the rise/fall time is much faster. Does this make sense? Also, do slow rise/fall times affect the switch speed of a transistor? Exactly, an inverter circuit would be able to source/sink more current than the comperator, allowing the mosfet to switch on and off more quickly, meaning that it will be in the linear range for a shorter amount of time, thus reducing switching losses.
I don't think this phenomena applies to BJT's, but to be honest I am not a BJT expert. What I know is this: a Bipolar transistor is not modeled as a resistor for which you can control its resistance value by opening and closing the N (or the P) channel. That is how FETs work. A bipolar transistor works by creating an area of polarization which enhances current flow across an structure which would be otherwise a reversed diode. With that being said, however, bipolar transistors still have losses, or better stated, power dissipation. The saturation voltage VCE is about 0.2V and if you multiply that by the current, that gives you the amount of Watts dissipated on the BJT.
The BJT inverter is basically a Pre Driver and it is necessary to supply large currents into the FET gate. The FET can only turn as fast as how much current you are pumping into its structure which is in essence a cap. The more current you pump in, the faster the FET turns on. This is why this Pre Drive stage is precisely what defines what the rise and the fall time is.
The resistor at the gate is also crucial, as just like you described it will form an RC filter and slow the Turn On response. In fact, on external FET drivers, many designers will put a resistor in series with the gate precisely to be able to tune the rise and the fall time. If these times are too fast, the amount of current can cause ground bounce and bring all sorts of havoc into the design.
The rise and the fall time ARE the switch speed of that transistor. Basically you want to tune this time to be as short as possible without causing other problems such as EMI, ground bouncing, etc.
Whether an inverter circuit has more current capability than a comparator will depend on the inverter circuit and the comparator. Some comparators can supply lots of currents very fast. It all depends on how the comparator output has been designed. Have in mind that a comparator is often a general purpose device. There are high bandwidth comparators or operational amplifiers which turn faster so I imagine they should be able to drive a FET faster as well (as long as they can supply the current the power FET requires!).
But yes, if the MOSFET is enabled/disabled quicker, then the switching losses are reduced. Do note you will increase EMI and ground bouncing by definition. Not to mention you will need more current and the power supply will need to be able to supply this without incurring in a voltage droop.


text:
Graphiopsis is a genus of fungi belonging to the family Davidiellaceae.

The species of this genus are found in Europe, Japan, Northern America and New Zealand.

Species:
 Graphiopsis ceratostomoides
 Graphiopsis chlorocephala
 Graphiopsis desmazieri
 Graphiopsis sacchari
 Graphiopsis verticillata

References

Fungi

redpajama_set_name: RedPajamaWikipedia


text:
The Alleged Armie Hammer Screenshots Keep Coming & We've Reached The 'Cut Off A Toe' Stage
By Alex Bruce-Smith
WARNING: This piece contains graphic references to rape and cannibalism.
The alleged Armie Hammer screenshots won't stop leaking until the Hollywood actor apologises to his 'kittens', the woman responsible for a majority of the leaks has said – and we're already at the 'cutting off a toe and keeping it' stage. Buckle up for the screenshot apocalypse.
The woman behind the @houseofeffie Instagram account has been sharing screenshots of the DMs for several days, which allegedly show Armie Hammer sending sexually explicit (and sometimes disturbing) messages to a number of women he was seeing while still with his estranged wife, Elizabeth Chambers.
"Someone wrote about me, 'Can you imagine how much dirt she must have on him after four years?'" @houseofeffie said on her Instagram Story.
"Yah we gon be here all year.
"Unless @ArmieHammer owns up to all the incomprehensible suffering he's caused us, apologises, and gets help."
Essentially, @houseofeffie claims Armie was engaged in a consensual affair with her for four years, while also having other affairs and/or hooking up with countless women around the globe. She says she thought she was the only one until recently, when some of the women began to get in contact with one another and put together the pieces.
And so, screenshots began appearing online.
Armie Hammer is at the centre of a screenshot scandal – and he has yet to speak about it. Photo: Getty.
She's demanding an apology for what she appears to be saying was a manipulative relationship.
"So we all got told we are perfect. That he wants to run away with us. That it's our world and fuck everyone else. That he loved us. So he fucked us all in his and [Elizabeth's] bed and made us a cute omelette after," she said.
Instead, Armie was allegedly messaging countless women very similar things – and some of those screenshots are disturbing as hell.
"I am 100% a cannibal. I want to eat you," he appears to say in one.
"I'm going to cum thinking of breaking your bones," he appears to say in another. "Text me about me breaking your bones while raping you. And I'll send you the voice note while I cum while reading it."
In a third, he appears to ask a woman if she would let him "cut off one of your toes and keep it with me in my pocket so I always had a piece of you in my possession".
At this point, we need to stress that Armie Hammer has not released a statement on the screenshots at all. In fact, he hasn't posted on social media since the screenshots were leaked.
And while the language is violent, we're also not suggesting the actions were carried out or that the language used was non-consensual. (In a video showing her bruised neck, @houseofeffie said that you cannot do CNC – consensual non-consensual, otherwise known as a rape kink – without aftercare.)
However, some women are alluding to abuse – or at the very least, a manipulative relationship.
Writer Jessica Ciencin Henriquez, who was linked to Armie last year, posted on Twitter:
"If you are still questioning whether or not those Armie Hammer DMs are real (and they are) maybe you should start questioning why we live in a culture willing to give abusers the benefit of the doubt instead of victims."
She also posted:
"Stop defending men who abuse women ?????"
It's a messy situation – and it looks like we might only be at the beginning. We'll keep you posted.
Armie Hammer Apologises For Controversial Instagram Video & Confirms That The Finsta Is His


text:
abstract type _geodesic end
mutable struct null_geodesic <: _geodesic end

struct PJ_INFO
	major::Cint
	minor::Cint
	patch::Cint
	release::Cstring
	version::Cstring
	searchpath::Cstring
	paths::Ptr{Cstring}
	path_count::Csize_t
end

struct PJ_ELLPS
	id::Cstring
	major::Cstring
	ell::Cstring
	name::Cstring
end

mutable struct geod_geodesic <: _geodesic
	a::Cdouble
	f::Cdouble
	f1::Cdouble
	e2::Cdouble
	ep2::Cdouble
	n::Cdouble
	b::Cdouble
	c2::Cdouble
	etol2::Cdouble
	A3x::NTuple{6, Cdouble}
	C3x::NTuple{15,Cdouble}
	C4x::NTuple{21,Cdouble}
	geod_geodesic() = new()
end

# -------------------------------------------------------------------------------------------------
"""
    geod(lonlat, azim, distance; proj::String="", s_srs::String="", epsg::Integer=0, dataset=false, unit=:m)

Solve the direct geodesic problem.

Args:

- `lonlat`:   - longitude, latitude (degrees). This can be a vector or a matrix with one row only.
- `azimuth`:  - azimuth (degrees) ∈ [-540, 540)
- `distance`: - distance to move from (lat,lon); can be negative, Default is meters but see `unit`
- `proj` or `s_srs`:  - the given projection whose ellipsoid we move along. Can be a proj4 string or an WKT
- `epsg`:     - Alternative way of specifying the projection [Default is WGS84]
- `dataset`:  - If true returns a GMTdataset instead of matrix
- `unit`:     - If `distance` is not in meters use one of `unit=:km`, or `unit=:Nautical` or `unit=:Miles`

The `distance` argument can be a scalar, a Vector, a Vector{Vector} or an AbstractRange. The `azimuth` can be
a scalar or a Vector.

When `azimuth` is a Vector we always return a GMTdataset with the multiple lines. Use this together with a
non-scalar `distance` to get lines with multiple points along the line. The number of points along line does
not even need to be the same. For data, give the `distance` as a Vector{Vector} where each element of `distance`
is a vector with the distances of the points along a line. In this case the number of `distance` elements
must be equal to the number of `azimuth`.

### Returns
- dest - destination after moving for [distance] metres in [azimuth] direction.
- azi  - forward azimuth (degrees) at destination [dest].

## Example: Compute two lines starting at (0,0) with lengths 111100 & 50000, heading at 15 and 45 degrees.

    geod([0., 0], [15., 45], [[0, 10000, 50000, 111100.], [0., 50000]])[1]
"""
geod(lonlat::Vector{<:Real}, azim, distance; proj::String="", s_srs::String="", epsg::Integer=0, dataset=false, unit=:m) =
	geod([lonlat[1] lonlat[2]], azim, distance; proj=proj, s_srs=s_srs, epsg=epsg, dataset=dataset, unit=unit)
function geod(lonlat::Matrix{<:Real}, azim, distance; proj::String="", s_srs::String="", epsg::Integer=0, dataset=false, unit=:m)
	f = unit_factor(unit)
	_dist = isa(distance, AbstractRange) ? collect(Float64, distance) .* f : distance .* f

	proj_string, projPJ_ptr, isgeog = helper_geod(proj, s_srs, epsg)
	dest, azi = helper_gdirect(projPJ_ptr, lonlat, azim, _dist, proj_string, isgeog, dataset)
	proj_destroy(projPJ_ptr)
	return dest, azi
end

function unit_factor(unit=:m)
	# Returns the factor that converts a length to meters, or 1 if unit is unknown
	f = 1.0
	if (unit != :m)
		_u = lowercase(string(unit))		# Parse the units arg
		f = (_u[1] == 'k') ? 1000. : ((_u[1] == 'n') ? 1852.0 : (startswith(_u, "mi") ? 1609.344 : 1.0))
	end
	(unit != :m && f == 1.0) && @warn("Unknown unit ($_u). Ignoring it")
	f
end

# -------------------------------------------------------------------------------------------------
"""
    d, az1, az2 = invgeod(lonlat1::Vector{<:Real}, lonlat2::Vector{<:Real}; proj::String="", s_srs::String="", epsg::Integer=0)

Solve the inverse geodesic problem.

Args:

- `lonlat1`:  - coordinates of point 1 in the given projection
- `lonlat2`:  - coordinates of point 2 in the given projection
- `proj` or `s_srs`:  - the given projection whose ellipsoid we move along. Can be a proj4 string or an WKT
- `epsg`:     - Alternative way of specifying the projection [Default is WGS84]

### Returns
dist - distance between point 1 and point 2 (meters).
azi1 - azimuth at point 1 (degrees) ∈ [-180, 180)
azi2 - (forward) azimuth at point 2 (degrees) ∈ [-180, 180)

Remarks:

If either point is at a pole, the azimuth is defined by keeping the longitude fixed,
writing lat = 90 +/- eps, and taking the limit as eps -> 0+.
"""
invgeod(lonlat1::Vector{<:Real}, lonlat2::Vector{<:Real}; proj::String="", s_srs::String="", epsg::Integer=0) =
	invgeod([lonlat1[1] lonlat1[2]], [lonlat2[1] lonlat2[2]]; proj=proj, s_srs=s_srs, epsg=epsg)
function invgeod(lonlat1::Matrix{<:Real}, lonlat2::Matrix{<:Real}; proj::String="", s_srs::String="", epsg::Integer=0)
	@assert (size(lonlat1) == size(lonlat2) || size(lonlat2,1) == 1) "Both matrices must have same size or second have one row"
	proj_string, projPJ_ptr, isgeog = helper_geod(proj, s_srs, epsg)
	(!isgeog) && (lonlat1 = xy2lonlat(lonlat1, proj_string);	lonlat2 = xy2lonlat(lonlat2, proj_string))	# Convert to geogd first
	d   = Vector{Float64}(undef, size(lonlat1,1))
	az1 = Vector{Float64}(undef, size(lonlat1,1))
	az2 = Vector{Float64}(undef, size(lonlat1,1))
	dist, azi1, azi2 = Ref{Cdouble}(), Ref{Cdouble}(), Ref{Cdouble}()
	for k = 1:size(lonlat1,1)
		kk = (size(lonlat2,1) == 1) ? 1 : k			# To allow the "all against one" case
		ccall((:geod_inverse, libproj), Cvoid, (Ptr{Cvoid},Cdouble,Cdouble,Cdouble, Cdouble,Ptr{Cdouble},Ptr{Cdouble},Ptr{Cdouble}),
			  pointer_from_objref(get_ellipsoid(projPJ_ptr)), lonlat1[k,2], lonlat1[k,1], lonlat2[kk,2], lonlat2[kk,1], dist, azi1, azi2)
		d[k], az1[k], az2[k] = dist[], azi1[], azi2[]
	end
	proj_destroy(projPJ_ptr)
	return d, az1, az2
end

# -------------------------------------------------------------------------------------------------
"""
    circgeo(lon, lat; radius=X, proj="", s_srs="", epsg=0, dataset=false, unit=:m, np=120, shape="")
or

    circgeo(lonlat; radius=X, proj="", s_srs="", epsg=0, dataset=false, unit=:m, np=120, shape="")

Args:

- `lonlat`:   - longitude, latitude (degrees). If a Mx2 matrix, returns as many segments as number of rows.
                Use this to compute multiple shapes at different positions. In this case output type is
				always a vector of GMTdatasets.
- `radius`:   - The circle radius in meters (but see `unit`) or circumscribing circle for the other shapes
- `proj` or `s_srs`:  - the given projection whose ellipsoid we move along. Can be a proj4 string or an WKT
- `epsg`:     - Alternative way of specifying the projection [Default is WGS84]
- `dataset`:  - If true returns a GMTdataset instead of matrix (with single shapes)
- `unit`:     - If `radius` is not in meters use one of `unit=:km`, or `unit=:Nautical` or `unit=:Miles`
- `np`:       - Number of points into which the circle is descretized (Default = 120)
- `shape`:    - Optional string/symbol with "triangle", "square", "pentagon" or "hexagon" (or just the first char)
                to compute one of those geometries instead of a circle. `np` is ignored in these cases.

### Returns
- circ - A Mx2 matrix or GMTdataset with the circle coordinates

## Example: Compute circle about the (0,0) point with a radius of 50 km

    c = circgeo([0.,0], radius=50, unit=:k)
"""
circgeo(lon::Real, lat::Real; radius::Real=0., proj::String="", s_srs::String="", epsg::Integer=0, dataset::Bool=false, unit=:m, np::Int=120, shape="") =
	circgeo([lon lat]; radius=radius, proj=proj, s_srs=s_srs, epsg=epsg, dataset=dataset, unit=unit, np=np, shape=shape)
circgeo(lonlat::Vector{<:Real}; radius::Real=0., proj::String="", s_srs::String="", epsg::Integer=0, dataset::Bool=false, unit=:m, np::Int=120, shape="") =
	circgeo([lonlat[1] lonlat[2]]; radius=radius, proj=proj, s_srs=s_srs, epsg=epsg, dataset=dataset, unit=unit, np=np, shape=shape)

function circgeo(lonlat::Matrix{<:Real}; radius::Real=0., proj::String="", s_srs::String="", epsg::Integer=0, dataset::Bool=false, unit=:m, np::Int=120, shape="")
	(radius == 0) && error("Must provide circle Radius. Obvious, not?")
	_shape = lowercase(string(shape))
	if     (_shape == "")     azim = collect(Float64, linspace(0, 360, np))	# The default (circle)
	elseif (_shape[1] == 't') azim = [0.,  120, 240, 0]				# Triangle
	elseif (_shape[1] == 's') azim = [45., 135, 225, 315, 45]		# Square
	elseif (_shape[1] == 'p') azim = [0.,  72, 144, 216, 288, 360]	# Pentagon
	elseif (_shape[1] == 'h') azim = [0.,  60, 120, 180, 240, 300, 360]	# Hexagon
	else   error("Bad shape name ($(shape))")
	end
	n_shapes = size(lonlat, 1)
	if (n_shapes > 1)	# Multiple shapes require a GMTdataset output
		D = Array{GMTdataset}(undef, n_shapes)
		for k = 1:n_shapes
			D[k] = geod(lonlat[k,:], azim, radius; proj=proj, s_srs=s_srs, epsg=epsg, dataset=true, unit=unit)[1]
		end
	else		# Here the output may be a GMTdadaset or a simple Mx2 matrix depending on the 'dataset' value.
		D = geod(lonlat[1,:], azim, radius; proj=proj, s_srs=s_srs, epsg=epsg, dataset=dataset, unit=unit)[1]
	end
	D
end

# -------------------------------------------------------------------------------------------------
"""
    buffergeo(D::GMTdataset; width=0, unit=:m, np=120, flatstart=false, flatend=false, epsg::Integer=0, tol=0.01)
or

    buffergeo(line::Matrix; width=0, unit=:m, np=120, flatstart=false, flatend=false, proj::String="", epsg::Integer=0, tol=0.01)
or

    buffergeo(fname::String; width=0, unit=:m, np=120, flatstart=false, flatend=false, proj::String="", epsg::Integer=0, tol=0.01)

Computes a buffer arround a poly-line. This calculation is performed on a ellipsoidal Earth (or other planet)
using the GeographicLib (via PROJ4) so it should be very accurate.

### Parameters
- `D` | `line` | fname: - the geometry. This can either be a GMTdataset (or vector of it), a Mx2 matrix, the name
                          of file that can be read as a GMTdataset by `gmtread()` or a GDAL AbstractDataset object
- `width`:  - the buffer width to be applied. Expressed meters (the default), km or Miles (see `unit`)
- `unit`:   - If `width` is not in meters use one of `unit=:km`, or `unit=:Nautical` or `unit=:Miles`
- `np`:     - Number of points into which circles are descretized (Default = 120)
- `flatstart` - When computing buffers arround poly-lines make the start *flat* (no half-circle)
- `flatend`   - Same as `flatstart` but for the buffer end
- `proj`  - If line data is in Cartesians but with a known projection pass in a PROJ4 string to allow computing the buffer
- `epsg`  - Same as `proj` but using an EPSG code
- `tol`   - At the end simplify the buffer line with a Douglas-Peucker procedure. Use TOL=0 to NOT do the line
            simplification, or use any other value in degrees. Default computes it as 0.5% of buffer width.

### Returns
A GMT dataset or a vector of it (when input is Vector{GMTdataset})

## Example: Compute a buffer with 50000 m width

    D = buffergeo([0 0; 10 10; 15 20], width=50000);
"""
buffergeo(fname::String; width=0, unit=:m, np=120, flatstart=false, flatend=false, epsg::Integer=0, tol=-1.0) =
	buffergeo(gmtread(fname); width=width, unit=unit, np=np, flatstart=flatstart, flatend=flatend, epsg=epsg, tol=tol)

buffergeo(ds::Gdal.AbstractDataset; width=0, unit=:m, np=120, flatstart=false, flatend=false, epsg::Integer=0, tol=-1.0) =
	buffergeo(gmt2gd(ds); width=width, unit=unit, np=np, flatstart=flatstart, flatend=flatend, epsg=epsg, tol=tol)

buffergeo(D::GMTdataset; width=0, unit=:m, np=120, flatstart=false, flatend=false, epsg::Integer=0, tol=-1.0) =
	buffergeo(D.data; width=width, unit=unit, np=np, flatstart=flatstart, flatend=flatend, proj=D.proj4, epsg=epsg, tol=tol)[1]

function buffergeo(D::Vector{<:GMTdataset}; width=0, unit=:m, np=120, flatstart=false, flatend=false, epsg::Integer=0, tol=-1.0)
	_D = Vector{GMTdataset}(undef, length(D))
	for k = 1:length(D)
		_D[k], = buffergeo(D[k].data; width=width, unit=unit, np=np, flatstart=flatstart, flatend=flatend,
		                   proj=D[1].proj4, epsg=epsg, tol=tol)
	end
	return (length(_D) == 1) ? _D[1] : _D		# Drop the damn Vector singletons
end

function buffergeo(line::Matrix{<:Real}; width=0, unit=:m, np=120, flatstart=false, flatend=false, proj::String="", epsg::Integer=0, tol=-1.0)
	# This function can be a bit optimized with a clever choice of which points to compute on the circle.
	# Points close to the segment axis are ofc nover needed.
	(width == 0) && error("Must provide the buffer width. Obvious, not?")
	dist, azim, = invgeod(line[1:end-1, :], line[2:end, :], proj=proj, epsg=epsg)	# distances and azimuths between the polyline vertices
	#(line[1, 1:2] == line[end, 1:2]) && (flatstart = flatend = false)		# Polygons can't have start/end flat edges
	width *= unit_factor(unit)
	n_seg = length(azim)
	for n = 1:n_seg
		seg = [geod(line[n,:], azim[n], 0:width/4:dist[n], proj=proj, epsg=epsg)[1]; line[n+1:n+1,:]]
		n_vert = size(seg,1)
		for k = 2:n_vert
			if (k == 2)
				c0 = circgeo(seg[1,:], radius=width, np=np, proj=proj, epsg=epsg);	trim_dateline!(c0, seg[1,1])
				c  = circgeo(seg[2,:], radius=width, np=np, proj=proj, epsg=epsg);	trim_dateline!(c , seg[2,1])
				global _D = polyunion(c0, c)
				continue
			end
			c = circgeo(seg[k,:], radius=width, np=np, proj=proj, epsg=epsg)
			trim_dateline!(c, seg[k,1])
			_D = polyunion(_D, c)
		end
		if (n == 1)  global D = _D
		else         D = polyunion(_D, D)
		end
	end

	# At this point we still have a "wavy" buffer resulting from the union of the circles. Ideally we should
	# be able to use GMT's mapproject to find only the points that are at the exact 'width' distance from the
	# line, but at this moment there seems to be an issue in GMT and distances are shorter. However with can
	# do some cheap statistics to get read of the more inner points a get an almost perfec buffer.
	Ddist2line = mapproject(D, L=(line=line, unit=:e))		# Find the distance from buffer points to input line
	d_mean = mean(view(Ddist2line[1].data, :, 3))
	ind = view(Ddist2line[1].data, :, 3) .>= d_mean
	ind[1], ind[end] = true, true			# Ensure first and last are not removed
	D[1].data = D[1].data[ind, :]			# Remove all points that are less 1% above the mean

	(proj == "" && epsg == 0) && (D[1].proj4 == "+proj=longlat +datum=WGS84 +no_defs")
	(proj != "") && (D[1].proj4 = proj)
	(epsg != 0) && (D[1].proj4 = toPROJ4(importEPSG(epsg)))
	(tol < 0) && (tol = width * 0.005 / 111111)		# Tolerance as 0.5% of buffer with converted to degrees
	return (tol > 0) ? simplify(D, tol) : D			# If TOL > 0 do a DP simplify on final buffer
end

function trim_dateline!(mat, lon0)
	# When the the mat polygon (a circle normally) crosses the dateline, trim it from the standpoint of its centroid
	mi, ma = extrema(view(mat,:,1))
	if ((ma - mi) > 180)		# Polygon crosses the dateline
		if (lon0 > 0)  mat[view(mat,:,1) .< 0, 1] .= 180.  # and centroid is at the 11:xxx side
		else           mat[view(mat,:,1) .> 0, 1] .= -180.
		end
	end
end

# -------------------------------------------------------------------------------------------------
"""
    function orthodrome(D; step=0, unit=:m, np=0, proj::String="", epsg::Integer=0)

Generate a orthodrome line(s) (shortest distace) on an ellipsoid. Input data can be two or more points.
In later case each line segment is descretized at `step` increments,

### Parameters

- `D`: - the input points. This can either be a GMTdataset (or vector of it), a Mx2 matrix, the name
         of file that can be read as a GMTdataset by `gmtread()` or a GDAL AbstractDataset object
- `step`:  - Incremental distance at which the segment line is descretized in meters(the default), but see `unit`
- `unit`:  - If `step` is not in meters use one of `unit=:km`, or `unit=:Nautical` or `unit=:Miles`
- `np`:    - Number of intermediate points between poly-line vertices (alternative to `step`)
- `proj`  - If line data is in Cartesians but with a known projection pass in a PROJ4 string
- `epsg`  - Same as `proj` but using an EPSG code

### Returns
A Mx2 matrix with the lon lat of the points along the orthodrome when input is a matrix. A GMT dataset
or a vector of it (when input is Vector{GMTdataset}).

## Example: Compute an orthodrome between points (0,0) and (30,50) discretized at 100 km steps.

    mat = orthodrome([0 0; 30 50], step=100, unit=:k);
"""
orthodrome(fname::String; step=0, unit=:m, np=0, proj::String="", epsg::Integer=0) =
	orthodrome(gmtread(fname); step=step, unit=unit, np=np, proj=proj, epsg=epsg)

orthodrome(lon1::Real, lat1::Real, lon2::Real, lat2::Real; step=0, unit=:m, np=0, proj::String="", epsg::Integer=0) =
	orthodrome([lon1 lat1; lon2 lat2]; step=step, unit=unit, np=np, proj=proj, epsg=epsg)

orthodrome(ds::Gdal.AbstractDataset; step=0, unit=:m, np=0, proj::String="", epsg::Integer=0) =
	orthodrome(gmt2gd(ds); step=step, unit=unit, np=np, proj=proj, epsg=epsg)

function orthodrome(D::Vector{<:GMTdataset}; step=0, unit=:m, np=0, proj::String="", epsg::Integer=0)
	_D = Vector{GMTdataset}(undef, length(D))
	for k = 1:length(D)
		_D[k] = mat2ds(orthodrome(D[k].data; step=step, unit=unit, np=np, proj = (proj == "") ? D[k].proj4 : proj, epsg=epsg))[1]
	end
	return (length(_D) == 1) ? _D[1] : _D		# Drop the damn Vector singletons
end
function orthodrome(D::GMTdataset; step=0, unit=:m, np=0, proj::String="", epsg::Integer=0)
	mat2ds(orthodrome(D.data; step=step, unit=unit, np=np, proj = (proj == "") ? D.proj4 : proj, epsg=epsg))[1]
end

function orthodrome(line::Matrix{<:Real}; step=0, unit=:m, np=0, proj::String="", epsg::Integer=0)
	(step == 0 && np == 0) && error("Must provide either a 'step' or a 'np' (number of points).")
	(size(line, 1) == 1) && error("Lines cannot have a single point.")
	(np > 0 && size(line, 1) != 2) && error("Number of intermediate points cannot be used with polylines.")
	step *= unit_factor(unit)
	dist, azim, = invgeod(line[1:end-1, :], line[2:end, :], proj=proj, epsg=epsg)	# dist and azims between the polyline vertices
	(np > 0) && (step = dist[1] / (np + 1))
	seg = geod(line[1,:], azim[1], 0:step:dist[1], proj=proj, epsg=epsg)[1]
	if (size(line, 1) == 2)
		(hypot((seg[end,:] .- line[2,:])...) > 1) && (seg = [seg; line[2:2, :]])	# If increment does not land exactly in end point
	else
		for n = 2:size(line,1)-1
			_seg = geod(line[n,:], azim[n], 0:step:dist[n], proj=proj, epsg=epsg)[1]
			(hypot((_seg[end,:] .- line[n,:])...) > 1) && (_seg = [_seg; line[n+1:n+1, :]])
			seg = [seg; _seg]			# Horrible but we can't know in advance the number of final points
		end
	end
	seg
end

# -------------------------------------------------------------------------------------------------
"""
    function loxodrome(lon1,lat1,lon2,lat2; step=0, unit=:m, np=0, proj::String="", epsg::Integer=0)
or

    function loxodrome(D; step=0, unit=:m, np=0, proj::String="", epsg::Integer=0)

Generate a loxodrome (rhumb line) on an ellipsoid. Input data can be two or more points.
In later case each line segment is descretized at `step` increments,

### Parameters

- `D`: - the input points. This can either be a 2x2 matrix or a GMTdataset. Note that only the first 2 points are used.
- `step`:  - Incremental distance at which the segment line is descretized in meters(the default), but see `unit`
- `unit`:  - If `step` is not in meters use one of `unit=:km`, or `unit=:Nautical` or `unit=:Miles`
- `np`:    - Number of intermediate points to be generated between end points (alternative to `step`)
- `proj`  - If line data is in Cartesians but with a known projection pass in a PROJ4 string
- `epsg`  - Same as `proj` but using an EPSG code

### Returns
A Mx2 matrix with the on lat of the points along the loxodrome when input is a matrix or the 2 pairs of points.
A GMTdataset when the input is GMTdataset.

## Example: Compute an loxodrome between points (0,0) and (30,50) discretized at 100 km steps.

    loxo = loxodrome([0 0; 30 50], step=100, unit=:k);
"""
loxodrome(lon1::Real, lat1::Real, lon2::Real, lat2::Real; step=0, unit=:m, np=0, proj::String="", epsg::Integer=0) =
	loxodrome([lon1 lat1; lon2 lat2]; step=step, unit=unit, np=np, proj=proj, epsg=epsg)

function loxodrome(D::GMTdataset; step=0, unit=:m, np=0, proj::String="", epsg::Integer=0)
	mat2ds(loxodrome(D.data; step=step, unit=unit, np=np, proj = (proj == "") ? D.proj4 : proj, epsg=epsg))[1]
end

function loxodrome(line::Matrix{<:Real}; step=0, np=0, unit=:m, proj::String="", epsg::Integer=0)
	(step == 0 && np == 0) && error("Must provide either a 'step' or a 'np' (number of points).")
	(size(line, 1) == 1) && error("Lines cannot have a single point.")
	step *= unit_factor(unit)
	dist, azim = loxodrome_inverse(line[1,1], line[1,2], line[2,1], line[2,2])
	(np > 0) && (step = dist / (np + 1))
	distances = collect(1:step:dist)
	((dist - distances[end]) > 1) && append!(distances, dist)	# Make sure we don't loose destiny point
	loxo = Array{Float64,2}(undef, length(distances), 2)
	for k = 1:length(distances)
		loxo[k, :] = loxodrome_direct(line[1,1], line[1,2], azim, distances[k])
	end
	loxo
end

# -------------------------------------------------------------------------------------------------
function helper_gdirect(projPJ_ptr, lonlat, azim, dist, proj_string, isgeog, dataset)
	lonlat = Float64.(lonlat)
	(!isgeog) && (lonlat = xy2lonlat(lonlat, proj_string))		# Need to convert to geogd first
	ggd = get_ellipsoid(projPJ_ptr)

	(isvector(azim) && isa(dist, Real)) && (dist = [dist,])		# multi-points. Just make 'dist' a vector to reuse a case below

	if (isa(azim, Real) && isa(dist, Real))						# One line only with one end-point
		dest, azi = _geod_direct!(ggd, copy(lonlat), azim, dist)
		(!isgeog) && (dest = lonlat2xy(dest, proj_string))
		(dataset) && (dest = helper_gdirect_SRS(dest, proj_string, wkbPoint))
	elseif (isa(azim, Real) && isvector(dist))					# One line only with several points along it
		dest, azi = Array{Float64}(undef, length(dist), 2), Vector{Float64}(undef, length(dist))
		for k = 1:length(dist)
			d, azi[k] = _geod_direct!(ggd, copy(lonlat), azim, dist[k])
			dest[k, :] = (isgeog) ? d : lonlat2xy(d, proj_string)
		end
		(dataset) && (dest = helper_gdirect_SRS([dest azi], proj_string, wkbLineString))	# Return a GMTdataset
	elseif (isvector(azim) && length(dist) == 1)				# A circle (dist has became a vector in 4rth line)
		dest = Array{Float64}(undef, length(azim), 2)
		for np = 1:length(azim)
			d = _geod_direct!(ggd, copy(lonlat), azim[np], dist[1])[1]
			dest[np, 1:2] = (isgeog) ? d : lonlat2xy(d, proj_string)
		end
		(dataset) &&		# Return a GMTdataset
			(dest = GMTdataset(dest, Vector{String}(), "", Vector{String}(), startswith(proj_string, "+proj") ? proj_string : "", "", wkbPolygon))
		azi = nothing
	elseif (isvector(azim) && isvector(dist))					# Multi-lines with variable length and/or number of points
		n_lines = length(azim)							# Number of lines
		(!isa(dist, Vector)) && (dist = vec(dist))
		(!isa(dist, Vector) && !isa(dist, Vector{<:Vector})) && error("The 'distances' input MUST be a Vector or a Vector{Vector}")
		if (!isa(dist, Vector{<:Vector}))				# If not, make it a Vector{Vector} to use the same algo below
			isa(dist, Matrix) && (dist = vec(dist))		# Because we accepted also 1-row or 1-col matrices
			Vdist = Vector{Vector{Float64}}(undef, n_lines)
			[Vdist[k] = dist for k = 1:n_lines]
		else
			(length(dist) != n_lines) && (proj_destroy(projPJ_ptr);error("Number of distance vectors MUST be equal to number of azimuths"))
			Vdist = dist
		end
		D = Vector{GMTdataset}(undef, n_lines)
		for nl = 1:n_lines
			n_pts = length(Vdist[nl])					# Number of points in this line
			dest = Array{Float64}(undef, n_pts, 3)		# Azimuth goes into the D too
			for np = 1:n_pts
				d, azi = _geod_direct!(ggd, copy(lonlat), azim[nl], Vdist[nl][np])
				dest[np, 1:2] = (isgeog) ? d : lonlat2xy(d, proj_string)
				dest[np, 3] = azi		# Fck language that makes it a pain to try anything vectorized
			end
			D[nl] = GMTdataset(dest, Vector{String}(), "", Vector{String}(), "", "", wkbLineString)
			helper_gdirect_SRS(dest, proj_string, wkbLineString, D[nl])	# Just assign the SRS
		end
		return D, nothing		# Here both the point coordinates and the azim are in the GMTdataset
	else
		error("'azimuth' MUST be either a scalar or a 1-dim array, and 'distance' may also be a Vector{Vector}")
	end
	return dest, azi
end

# -------------------------------------------------------------------------------------------------
function helper_gdirect_SRS(mat, proj_string::String, geom, D=GMTdataset())
	# Convert the output of geod_direct into a GMTdataset and, if possible, assign it a SRS
	# If a 'D' is sent in, we only (eventually) assign it an SRS
	isempty(D) && (D = GMTdataset([mat[1] mat[2]], Vector{String}(), "", Vector{String}(), "", "", geom))
	(startswith(proj_string, "+proj")) && (D.proj4 = proj_string)
	D
end

# -------------------------------------------------------------------------------------------------
function _geod_direct!(geod::geod_geodesic, lonlat, azim, distance)
	p = pointer(lonlat)
	azi = Ref{Cdouble}()		# the (forward) azimuth at the destination
	ccall((:geod_direct, libproj), Cvoid, (Ptr{Cvoid},Cdouble,Cdouble,Cdouble,Cdouble,Ptr{Cdouble},Ptr{Cdouble}, Ptr{Cdouble}),
		  pointer_from_objref(geod), lonlat[2], lonlat[1], azim, distance, p+sizeof(Cdouble), p, azi)
	lonlat, azi[]
end

# -------------------------------------------------------------------------------------------------
function helper_geod(proj::String, s_srs::String, epsg::Integer)::Tuple{String, Ptr{Nothing}, Bool}
	# 'proj' and 's_srs' are synonyms.
	# Return the projection string ans also if the projection is geogs.
	if     (proj  != "")  prj_string = proj
	elseif (s_srs != "")  prj_string = s_srs
	elseif (epsg > 0)     prj_string = toPROJ4(importEPSG(epsg))
	else                  prj_string = "+proj=longlat +datum=WGS84 +no_defs"
	end
	(startswith(prj_string, "GEOGC")) && (prj_string = toPROJ4(importWKT(prj_string)))
	prj_string, proj_create(prj_string), (startswith(prj_string, "+proj=longl") || startswith(prj_string, "+proj=latl") || epsg == 4326)
end

# -------------------------------------------------------------------------------------------------
function geod_geodesic(a::Cdouble, f::Cdouble)::geod_geodesic
	geod = geod_geodesic()
	ccall((:geod_init, libproj), Cvoid, (Ptr{Cvoid}, Cdouble, Cdouble), pointer_from_objref(geod), a, f)
	geod
end

# -------------------------------------------------------------------------------------------------
function get_ellipsoid(projPJ_ptr::Ptr{Cvoid})::geod_geodesic
	#a, ecc2 = pj_get_spheroid_defn(projPJ_ptr)
	#geod_geodesic(a, 1-sqrt(1-ecc2))
	a, inv_f, = proj_ellipsoid_get_parameters(C_NULL, projPJ_ptr)
	geod_geodesic(a, 1/inv_f)
end

# -------------------------------------------------------------------------------------------------
function proj_create(proj_str::String, ctx=C_NULL)
	# Returns an Object that must be unreferenced with proj_destroy()
	# THIS GUY IS VERY EXPENSIVE. TRY TO MINIMIZE ITS USAGE.
	#projPJ_ptr = ccall((:proj_create, libproj), Ptr{Cvoid}, (Ptr{Cvoid}, Cstring), ctx, proj_str)
	projPJ_ptr = ccall((:proj_create, libproj), Ptr{Cvoid}, (Ptr{Cvoid}, Cstring), ctx, proj2wkt(proj_str))
	(projPJ_ptr == C_NULL) && error("Could not parse projection: \"$proj_str\"")
	projPJ_ptr
end

proj_create_crs_to_crs(s_crs, t_crs, area, ctx=C_NULL) =
	ccall((:proj_create_crs_to_crs, libproj), Ptr{Cvoid}, (Ptr{Cvoid}, Cstring, Cstring, Ptr{Cvoid}), ctx, s_crs, t_crs, area)

# -------------------------------------------------------------------------------------------------
function proj_destroy(projPJ_ptr::Ptr{Cvoid})	# Free C datastructure associated with a projection.
	@assert projPJ_ptr != C_NULL
	ccall((:proj_destroy, libproj), Ptr{Cvoid}, (Ptr{Cvoid},), projPJ_ptr)
end

#= -------------------------------------------------------------------------------------------------
function pj_get_spheroid_defn(proj_ptr::Ptr{Cvoid})
	a = Ref{Cdouble}()		# major_axis
	ecc2 = Ref{Cdouble}()	# eccentricity squared
	ccall((:pj_get_spheroid_defn, libproj), Cvoid, (Ptr{Cvoid}, Ptr{Cdouble}, Ptr{Cdouble}), proj_ptr, a, ecc2)
	a[], ecc2[]
end
=#

# -------------------------------------------------------------------------------------------------
function proj_info()
	pji = ccall((:proj_info, libproj), PJ_INFO, ())
	println(unsafe_string(pji.release), "\n", "Located at: ", unsafe_string(pji.searchpath))
end

#=
function _transform!(src_ptr::Ptr{Cvoid}, dest_ptr::Ptr{Cvoid}, point_count::Integer, point_stride::Integer,
                     x::Ptr{Cdouble}, y::Ptr{Cdouble}, z::Ptr{Cdouble})
	@assert src_ptr != C_NULL && dest_ptr != C_NULL
	err = ccall((:pj_transform, libproj), Cint, (Ptr{Cvoid}, Ptr{Cvoid}, Clong, Cint, Ptr{Cdouble}, Ptr{Cdouble},
                Ptr{Cdouble}), src_ptr, dest_ptr, point_count, point_stride, x, y, z)
	err != 0 && error("transform error: $(_strerrno(err))")
end

_transform!(s_ptr::Ptr{Cvoid}, t_ptr::Ptr{Cvoid}, pos::Vector{Cdouble}) = _transform!(s_ptr, t_ptr, reshape(pos, 1, length(pos)))
function _transform!(s_ptr::Ptr{Cvoid}, t_ptr::Ptr{Cvoid}, position::Array{Cdouble,2})
	@assert s_ptr != C_NULL && t_ptr != C_NULL
	npoints, ndim = size(position)
	@assert ndim >= 2

	x = pointer(position)
	y = x + sizeof(Cdouble)*npoints
	z = (ndim == 2) ? Ptr{Cdouble}(C_NULL) : x + 2*sizeof(Cdouble)*npoints

	_transform!(s_ptr, t_ptr, npoints, 1, x, y, z)
	position
end

mutable struct Projection
    #ctx::Context   # Projection context object
    rep::Ptr{Cvoid} # Pointer to internal projPJ struct
    geod::_geodesic
end

function Projection(proj_ptr::Ptr{Cvoid})
    proj = Projection(proj_ptr, null_geodesic())
    finalizer(freeProjection, proj)
    proj
end

Projection(proj_string::String) = Projection(proj_create(proj_string))
function freeProjection(proj::Projection)
    proj_destroy(proj.rep)
    proj.rep = C_NULL
end

function is_latlong(proj_ptr::Ptr{Cvoid})
	@assert proj_ptr != C_NULL
	ccall((:pj_is_latlong, libproj), Cint, (Ptr{Cvoid},), proj_ptr) != 0
end
=#

function proj_get_ellipsoid(proj_ptr::Ptr{Cvoid}, ctx=C_NULL)
	# Returned object must be unreferenced with proj_destroy()
	ccall((:proj_get_ellipsoid, libproj), Ptr{Cvoid}, (Ptr{Cvoid}, Ptr{Cvoid}), ctx, proj_ptr)
end

function proj_ellipsoid_get_parameters(ellipsoid::Ptr{Cvoid}=NULL, proj_ptr::Ptr{Cvoid}=NULL, ctx=NULL)
	# proj_ellipsoid_get_parameters(PJ_CONTEXT *ctx, const PJ *ellipsoid, double *out_semi_major_metre, double *out_semi_minor_metre, int *out_is_semi_minor_computed, double *out_inv_flattening)
	semi_major = Ref{Cdouble}()		# semi-major axis in meters
	semi_minor = Ref{Cdouble}()		# semi-minor axis in meters
	inv_flattening = Ref{Cdouble}()		# semi-minor axis in meters
	is_semi_minor_computed = Ref{Cint}()		#
	need_destroy = (ellipsoid == NULL)
	(ellipsoid == NULL) && (ellipsoid = proj_get_ellipsoid(proj_ptr))
	ccall((:proj_ellipsoid_get_parameters, libproj), Cint, (Ptr{Cvoid}, Ptr{Cvoid}, Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Cint}, Ptr{Cdouble}), ctx, ellipsoid, semi_major, semi_minor, is_semi_minor_computed, inv_flattening)
	need_destroy && proj_destroy(ellipsoid)		# If it was created above
	semi_major[], inv_flattening[], semi_minor[]
end

"""
    proj2wkt(proj4_str::String, pretty::Bool=false)

Convert a PROJ4 string into the WKT form. Use `pretty=true` to return a more human readable text.
"""
function proj2wkt(proj4_str::String; pretty::Bool=false)
	!startswith(proj4_str, "+proj=") && error("$(proj4_str) is not a valid proj4 string")
	toWKT(importPROJ4(proj4_str), pretty)
end

"""
    wkt2proj(wkt_str::String)

Convert a WKT SRS string into the PROJ4 form.
"""
wkt2proj(wkt_str::String) = toPROJ4(importWKT(wkt_str))

"""
    epsg2proj(code::Integer)

Convert a EPSG code into the PROJ4 form.
"""
epsg2proj(code::Integer)  = toPROJ4(importEPSG(code))

"""
    epsg2wkt(code::Integer, pretty::Bool=false)

Convert a EPSG code into the WKT form. Use `pretty=true` to return a more human readable text.
"""
epsg2wkt(code::Integer; pretty::Bool=false) = toWKT(importEPSG(code), pretty)


Having the autonomy to make your own decisions about your health and finances can be an important part of your identity.
When Josh first came to see us at a LawRight legal clinic, he faced a number of challenges: he was a homeless young person, had a history of mental illness, had difficulty reading or writing and had a physical disability arising from an abusive childhood. He was also under an Administration Order.
Josh had been working closely with his support team to improve his life and independence. He was distressed about decisions the Public Trustee had made about his money, and he wanted our help to apply to have his administration order reviewed.
Josh's volunteer lawyers gave him advice about the process, explained what he would need to show the Tribunal and helped him write his application. With our help Josh could show that he had the capacity to make his own financial decisions and now manages his own finances. He is paying his bills on time and saving to buy a house.


text:
Ива́н Ива́нович Ганы́кин (10 сентября 1915, Москва — 1984, там же) — советский боксёр средних весовых категорий, выступал на всесоюзном уровне в 1930-х — 1940-х годах. Четырёхкратный чемпион СССР, призёр многих турниров и матчевых встреч. На соревнованиях представлял спортивное общество «Спартак», заслуженный мастер спорта. Отличник физической культуры (1947).

Биография
Родился 10 сентября 1915 года в Москве. Активно заниматься боксом начал в раннем детстве, проходил подготовку в столичном спортивном клубе «Промкооперация», позже переименованном в «Спартак», где тренировался под руководством Вячеслава Самойлова. Первого серьёзного успеха на ринге добился в 1935 году, когда дебютировал в зачёте национального первенства и сразу же завоевал звание чемпиона полусредней весовой категории — в финале победил опытнейшего ленинградца Сергея Емельянова.

На чемпионате СССР 1937 года Ганыкин вновь стал лучшим, кроме того, он принял участие в матчевой встрече со сборной Франции, победил француза Рожера Трита, занявшего четвёртое место на прошедших Олимпийских играх в Берлине. В 1938 и 1939 годах защитил звание всесоюзного чемпиона, но в 1940-м поднялся в средний вес и вынужден был довольствоваться серебром. На абсолютном первенстве Советского Союза в 1943 году победил тяжеловеса Андрея Навасардова, но проиграл Евгению Огуренкову и Николаю Королёву. В 1944 году в очередной раз хотел добиться чемпионского звания, был близок к первому месту, тем не менее, в решающем матче по очкам уступил Огуренкову.

Последний раз Иван Ганыкин выходил на ринг в качестве действующего спортсмена в 1946 году. Он пытался вернуть себе лидерство в средней весовой категории, однако на стадии полуфиналов потерпел поражение от Огуренкова, а матч за третье место проиграл железнодорожнику Василию Чудинову. Вскоре после этих соревнований принял решение оставить бокс — всего имеет в послужном списке 157 боёв, из них 123 окончил победой. В 1948 году за свои спортивные достижения удостоен почётного звания «Заслуженный мастер спорта СССР» и включён в число «Выдающихся боксёров СССР».

Умер в 1984 году, похоронен на Донском кладбище в Москве, участок за 19-м колумбарием.

Примечания

Ссылки
 Ганыкин Иван Иванович — страница на сайте Федерации бокса России

Боксёры СССР
Боксёры 1930-х годов
Боксёры 1940-х годов
Боксёры полусредней весовой категории
Боксёры средней весовой категории
Чемпионы СССР по боксу
Заслуженные мастера спорта СССР
Похороненные на Донском кладбище


BPC 11 Embedded Master Data Planning Feature.
How to update Dimension properties (Master Data attributes) & texts from Analysis for Office using Master data Planning feature in BW/4 HANA & BPC 11.
In this Blog we will look on various options in updating BPC Master data and look on how to update master data attributes/properties via Analysis for Office usingBW/4 HANA Master data planning feature.
Extracting Master data attributes & texts via Flat file interface from Non-Sap source systems.
Update Dimension properties & descriptions from Analysis for Office.
In BPC Embedded, Dimensions & Properties are added when you create Models. Dimensions and Properties are Infoobjects and their attributes. These bpc properties and descriptions will be updated manually via option 3 or 4 or loaded from source systems via option 1 or 2. We will see one more option to update dimension properties and descriptions that can be used by BPC Admin and Business users.
Option 5 : We will use Master data planning feature to update Master Data (dimension members and attributes/properties) from Analysis for Office.
Step 1 : Infoobject with Master data attributes and text.
Create/copy an InfoObject (ZMDTPLN) switch on master data & texts and then add attributes. In my example I am copying existing infoobject.
Step 2 : Enable Planning mode for the infoobject and activate the infoobject.
An infoprovider is generated with the same name as the infoobject, in this case à ZBPC11MD.
Step 3 : Create an aggregation level on top of the generated infoprovider ZBPC11MD.
Go to transaction RSPLAN, enter the ZBPC11MD in infoprovider to view the fields of generated infoprovider.
Create aggregation level on top of the infoprovider ZBPC11MD.
Add Characteristics and Keyfigures to the aggregation level.
Add all the properties and texts that are available as keyfigures.
Add Characteristics in the Rows and keyfigures in the Columns.
Change all the keyfigures to Input ready by going to the planning tab.
Enable the Start query in Input mode and save the query.
Open the query in analysis for office by inserting data source.
Enter the corresponding values to the attributes and texts and Click save to update the master data.
The properties and texts updates will be reflected in BW infoobject and BPC Dimensions.
Now you just learnt how to update Dimension properties (Master Data attributes) & texts from Analysis for Office using Master data Planning feature in BW/4 HANA & BPC 11. You can find the benefits of this as mentioned below.
enable Master data update via AFO with authorization.
Looking forward for reading your comments. I hope you will find this blog useful.
in fact you need BW/4HANA SP08 and AO version 2.7,cf. note 2508938.
and below are the service pack details.
Explained nicely step by step.


Tees are being progressively top dressed starting with the 1st Tee.
Low profile diversion barriers installed in a number of locations to reduce wear and tear on bare patches.
Road base added to paths which tend to be a problem in wet weather e.g. path leading off 2nd Tee.
Road base cart stand installed at 4th Tee to overcome water pooling problem.
Respect traffic management directions and exclusion areas.
Avoid driving through wet areas in motorised carts as this forms a depression where water will sit.
Respect and take care of the environment and last but by no means least…..
LEAVE THE COURSE AS YOU WOULD LIKE TO FIND IT!


Good-Bye Def Leppard: I'll Miss Those Jeans by Stef Kramer is the story of Amy Gaer, a small-town girl with big dreams. She is at a crossroads in her life and decides that returning to her home town to work is the perfect way to decide what happens next in her life. Music and literature are her passions, but she finds her new job in a bank is also fulfilling and could influence her future plans. A run-in with her ex-boyfriend convinces her that Fox Plains is not the place to seek a romantic attachment, at least that is until she meets Nick. His baseball uniform only highlights his classic good looks and Amy is definitely interested, especially when she finds out he works for her dad. What could be better than a family connection? However, as with all classic love stories, there are obstacles to overcome. Will love conquer all or will Amy follow her career path that leads away from Nick?
I loved this book! Amy is the epitome of a modern woman who must decide the path her life takes while considering all her options. Her mother shamelessly pushes her to pursue a law degree, while her best friend Jean wants her to move to Chicago and join her there. Nick, however, refuses to influence her decisions and says she must decide her future without considering him. Good-Bye Def Leppard is beautifully written and describes the early nineties culture perfectly. Stef Kramer writes her characters so they jump off the page and into your mind. Amy's gran was a particular favorite of mine with her tattoos and her trailer in the woods. A great read and I look forward to discovering more works by the same author.


MicroRNAs (miRNA) significantly contribute to bone formation by post-transcriptional regulation of gene expression. Mature miRNAs are generated following sequential cleavage by DROSHA/DGCR8 and DICER. However, recent studies have identified that some miRNAs require only one of these enzymes. Most studies seeking to clarify the role of miRNA during bone formation have been performed using DICER deletion strategies, but little is known regarding the role of DGCR8. To study the function of DGCR8 in osteogenesis, we generated mice in which Dgcr8 is conditionally deleted in osteoprogenitor cells by Col1a1-Cre. Dgcr8-cKO mice showed increased bone volume (BV/TV), trabecular number (Tb/N), and trabecular thickness (Tb.Th), but decreased trabecular separation (Tb.Sp) in the femur. Von Kossa, tartrate-resistant acid phosphatase staining, and calcein double labeling identified that osteoblast activity is increased in Dgcr8-cKO mice. In an effort to elucidate a detailed cellular mechanism, we found that miR-22 was downregulated in Dgcr8-cKO mice, leading to upregulation of the osteocalcin transcript, a key marker of osteoblasts. Interestingly, the mRNA expression level of Dgcr8 was decreased during osteoblast differentiation. Taken together, these results strongly indicate that DGCR8-dependent generation of miR-22 is essential for bone formation and that miR-22 could be a therapeutic target for individuals with bone disease.


text:
define(["nifty"], function (nifty) {
    module("nifty.establish", {});
    test("test can establish a function from a mocked object", 1, function () {
        var FooClass = nifty.compose({}, {
            nifty: function () {
            }
        });

        var foo = nifty.mock("foo", FooClass);
        foo.nifty("hello world");

        nifty.establish(foo, 1).nifty("hello world");
    });
    test("test can only establish on a mocked object", 1, function () {
        var caughtException = false;
        try {
            nifty.establish({}, 1);
        } catch (e) {
            caughtException = true;
        }
        ok(caughtException, "establish throws exception on anything but a mocked object");
    });
    test("test not specifying num times means one", 1, function () {
        var FooClass = nifty.compose({}, {
            nifty: function () {
            }
        });

        var foo = nifty.mock("foo", FooClass);
        foo.nifty("hello world");

        nifty.establish(foo).nifty("hello world");
    });
    test("test can establish a function inside a pretend object", 1, function () {
        var FooClass = nifty.compose({}, {
            nifty: function () {
            }
        });

        var BarClass = nifty.compose({foo: FooClass}, {
            init: function () {
                this.foo.nifty("hello world");
            }
        });

        var bar = nifty.pretend(BarClass);

        nifty.establish(bar.foo, 1).nifty("hello world");
    });
    test("test can establish a function was called 0 times with partial arguments", 1, function () {
        var FooClass = nifty.compose({}, {
            nifty: function (arg1, arg2) {
            }
        });

        var BarClass = nifty.compose({foo: FooClass}, {
            init: function () {
                this.foo.nifty("hello world", "hi there");
            }
        });

        var bar = nifty.pretend(BarClass);

        nifty.establish(bar.foo, 0).nifty(anything(), "hows it going?");
    });
});


text:
All posts tagged "Football"
Home / Posts tagged "Football"
McNair's Death Ruled a Homicide by Tennessee Police
By Dr Mark Boguski on July 5, 2009
Police have not yet concluded that Sahel Kazemi's death was a suicide and are awaiting additional laboratory tests. They are not, however, looking for another...
Eagles Offensive Lineman Shawn Andrews is in a Bad Mood
By Dr Mark Boguski on May 14, 2009
Source: www.nytimes.com/2009/05/14/sports/football/14eagles.html?emc=eta1 Every year, 44 million Americans suffer from a mood disorder, the most common of which are major depression and bipolar (manic) depression. This...
Jack Kemp, 73, quarterback, congressman dies from cancer
By Dr Mark Boguski on May 3, 2009
Kemp's office announced in January that he had been diagnosed with an unspecified type of cancer. By then, however, the cancer was in an advanced...
Refrigerator Perry is Inflamed by GBS
By Dr Mark Boguski on April 22, 2009
Former Chicago Bears defensive lineman William "The Refrigerator" Perry was admitted to a South Carolina hospital in serious condition with Guillain-Barre Syndrome. Perry was a...


Luo, Xiao-Hua; Ren, Wei-Jun; Jin, Wei; Zhang, Zhi-Dong; Ren, WJ (reprint author), Chinese Acad Sci, Shenyang Natl Lab Mat Sci, Inst Met Res, Shenyang 110016, Peoples R China.
Abstract Solid refrigeration technology based on the elastocaloric effect has a great potential alternative to the conventional vapor compression cooling. Here we report the large elastocaloric effect in Ti-Ni (50 at%) shape memory alloy below its austenite finish temperature A(f) under different strain. Both Maxwell's and Clausius-Clapeyron equations are used to estimate the entropy change. The strain-induced entropy change increases with raising the strain and gets a maximum value at a few kelvins below A(f). The maximum entropy changes Delta S-max are -20.44 and -53.70 J/kg.K, respectively for 1% and 2% strain changes. Large entropy change may be obtained down to 20 K below A(f). The temperature of the maximum entropy change remains unchanged before the plastic deformation appears but moves towards low temperature when the plastic deformation happens.; Solid refrigeration technology based on the elastocaloric effect has a great potential alternative to the conventional vapor compression cooling. Here we report the large elastocaloric effect in Ti-Ni (50 at%) shape memory alloy below its austenite finish temperature A(f) under different strain. Both Maxwell's and Clausius-Clapeyron equations are used to estimate the entropy change. The strain-induced entropy change increases with raising the strain and gets a maximum value at a few kelvins below A(f). The maximum entropy changes Delta S-max are -20.44 and -53.70 J/kg.K, respectively for 1% and 2% strain changes. Large entropy change may be obtained down to 20 K below A(f). The temperature of the maximum entropy change remains unchanged before the plastic deformation appears but moves towards low temperature when the plastic deformation happens.
Corresponding Author Ren, WJ (reprint author), Chinese Acad Sci, Shenyang Natl Lab Mat Sci, Inst Met Res, Shenyang 110016, Peoples R China.
GB/T 7714 Luo, Xiao-Hua,Ren, Wei-Jun,Jin, Wei,et al. Large elastocaloric effect in Ti-Ni shape memory alloy below austenite finish temperature[J]. CHINESE PHYSICS B,2017,26(3):-.
APA Luo, Xiao-Hua,Ren, Wei-Jun,Jin, Wei,Zhang, Zhi-Dong,&Ren, WJ .(2017).Large elastocaloric effect in Ti-Ni shape memory alloy below austenite finish temperature.CHINESE PHYSICS B,26(3),-.
MLA Luo, Xiao-Hua,et al."Large elastocaloric effect in Ti-Ni shape memory alloy below austenite finish temperature".CHINESE PHYSICS B 26.3(2017):-.


text:
Family-Friendly Concerts
Las Vegas Concerts
R&B and Soul
Duchess Theatre Schedule & Tickets for 2021/2022 Events
Duchess Theatre Tickets On Sale at CheapoTicketing
Show Me Discount Tickets...
We are a resale marketplace, not a box office or venue. Ticket prices may be above or below face value.
Duchess Theatre: Events Schedule, Tickets and more...
The Duchess Theatre is a theatre in London's West End. The theatre opened on 25th November, 1929 and is one of the smallest ''proscenium arched'' West End theatres. It has 479 seats on two levels...
Notable productions at The Duchess Theatre include Noel Coward's Blithe Spirit, which transferred from the Piccadilly Theatre to the St. James Theatre before moving to the Duchess Theatre where it completed a record run of 1,997 performances in 1942. Tom Eyen's The Dirtiest Show in Town, which ran for just under 800 performances in the 1970s. Oh! Calcutta! transferred to The Duchess Theatre from the Royalty Theatre in December 1974, and remained there until 1980.
The Players Theatre Company presented their Late Joys Victorian Music Hall programme between 1987 and 1990 Marc Camoletti's Don't Dress For Dinner, which transferred to the Duchess from the Apollo Theatre in October 1992 and stayed until 1st March, 1997.
The Royal Shakespeare Company's The Herbal Bed by Peter Whelan ran for six months from April to October 1997. For the latest production, please check below for the schedule and tickets for the Play That Goes Wrong.
Recommended Events:
• Beauty and the Beast Tickets & Tour
• Carrot Top Tickets & Tour
• Cirque du Soleil - Mystere Tickets & Tour
• Cirque du Soleil - Zumanity Tickets & Tour
• Disney On Ice Tickets & Tour
• Harlem Globetrotters Tickets & Tour
• Human Nature Tickets & Tour
• Le Reve Tickets & Tour
• Million Dollar Quartet Tickets & Tour
• Paw Patrol Live Tickets & Tour
• Shen Yun Performing Arts Tickets & Tour
• The Band's Visit Tickets & Tour
• Waitress Tickets & Tour
• Zombie Burlesque Tickets & Tour
Other Top Venues:
• American Airlines Center (Dallas, TX) - Events Schedule & Tickets
• BOK Center (Tulsa, OK) - Events Schedule & Tickets
• CIBC Theatre (Chicago, IL) - Events Schedule & Tickets
• Grand Ole Opry House (Nashville, TN) - Events Schedule & Tickets
• Little Caesars Arena (Detroit, MI) - Events Schedule & Tickets
• Mercedes-Benz Superdome (New Orleans, LA) - Events Schedule & Tickets
• Music Box Theatre (New York, NY) - Events Schedule & Tickets
• Radio City Music Hall (New York, NY) - Events Schedule & Tickets
• Rocket Mortgage FieldHouse (Cleveland, OH) - Events Schedule & Tickets
• Spectrum Center (Charlotte, NC) - Events Schedule & Tickets
• TD Garden (Boston, MA) - Events Schedule & Tickets
• The Smith Center (Las Vegas, NV) - Events Schedule & Tickets
• United Center (Chicago, IL) - Events Schedule & Tickets
• Walt Disney Concert Hall (Los Angeles, CA) - Events Schedule & Tickets
• Wrigley Field (Chicago, IL) - Events Schedule & Tickets
Duchess Theatre Schedule
Duchess Theatre - London, GL
Phone Support: 10 am – 6 pm (EST)
Duchess Theatre Events & Shows
Buy Inexpensive Tickets for Duchess Theatre Online at Cheapo Ticketing! Full Event Calendar Available.
100% Money-Back Guarantee, Instant Download, Secure & Fast Checkout for All Upcoming 2021/2022 Shows & Events for Duchess Theatre.
Interactive Seating Charts will be shown once you choose tickets for a specific event.
Ticket prices may be below or above face value.
Stay safe and informed: U.S States Reopening Map, CDC (Centers for Disease Control and Prevention), WHO (World Health Organization)


CENTRA is an employee-owned company defined by its people. Led by Harold Rosenbaum, an astronautical engineer, CENTRA has been providing its clients with exceptional support since 1997. Harold built CENTRA by recruiting smart, hardworking people with advanced technical skills and extensive professional experience. Our company fosters collaboration and initiative. Over the years, we have expanded from applying our skills to aerospace engineering issues to serving a broad range of clients with critical defense, intelligence, and security missions. We are proud of the trust our clients place in us and the consistency with which they turn to us for assistance.
We have assembled a team of dedicated people with exceptional educational backgrounds and diverse career experiences. Over 50 percent of our staff holds advanced degrees. Our employees boast service in all branches of the US military, as well as work experience in the national security agencies of the US Government, academia, and industry. We support our employees' continued growth through education funding for advanced degrees, specialized certifications, language training, and substantive collaboration in the workforce. We invest in our employees to support a team and spirit that is unparalleled in both career satisfaction and its ability to deliver for our clients.
CIPCO is Iowa's largest cooperative energy provider serving 13 rural electric cooperatives and associations spanning 58 of Iowa's 99 counties. CIPCOs' members distribute power to nearly 300,000 Iowans and more than 12,000 commercial and industrial accounts.
CIPCO is a state-of-the-art energy provider with a diverse fuel mix of coal, nuclear, hydro, wind, landfill gas, natural gas, and oil energy resources. We continue to invest in new technology and renewable energy production, supporting Iowa's development of renewable energy resources. Over half of our electricity is generated from emission- and carbon-free resources, minimizing the impact to the environment.
CH2MHILL BWXT West Valley, LLC (CHBWV) is an environmental cleanup contractor under contract to the Department of Energy (DOE) whose mission is to decommission a former nuclear fuel reprocessing facility. CHBWV is located 35 miles south of Buffalo, New York, close to excellent ski resorts, boating, and fishing on Lakes Erie, Ontario and Chautauqua.
Headquartered in Alton, Illinois Challenge Unlimited, Inc., and its affiliate company Residential Options, Inc., is a multi-tiered organization.
For more than 50 years, the organization has been committed to serving individuals with disabilities, while earning a reputation as a trusted business partner to private commercial companies and federal and state government agencies.
As a Commission on Accreditation of Rehabilitation Facilities (CARF) accredited Community Rehabilitation Program (CRP) provider, Challenge Unlimited fulfills its mission through adult and youth programs, work skills training centers, employment services, and community-integrated living options. Promoting people to achieve their highest level of independence through opportunities.
As a social entrepreneur, Challenge Unlimited has grown its business services from a single custodial contract to over 50 service and production contracts. We deliver quality solutions in facility management, production services and staffing services. An authorized partner of the AbilityOne Program, Challenge Unlimited manages operations across four states: Illinois, Missouri, Wisconsin and South Carolina.
Today, Challenge Unlimited employs over 900 workers; of which approximately 600 are individuals with disabilities. Click here to learn more about our award-winning services.
Today, there is an increasing need for conservation leaders to guide, teach, and motivate people to protect the world's wildlife and the environment. We operate under the premise that the decisions each person makes as an individual and that we make as a society regarding the natural world will have a profound impact on our future and that of our children. The Society works to inspire and engage all people to make a positive impact on the natural world around us. In building its conservation legacy, the Society has launched two Centers of Excellence, the Center for Conservation Leadership and the Center for the Science of Animal Welfare. These innovative learning and research hubs integrate a wide variety of disciplines, changing the way animal conservation issues are addressed and advancing the science of animal care around the world.
The Society pursues its important mission through its management of the Brookfield Zoo for the Forest Preserves of Cook County and through its programs in animal care, education, science and research, both here and abroad. Brookfield Zoo, is a prime Chicagoland leisure destination and one of the world's top zoos, hosting over 2 million visitors each year.
Our core institutional values--People, Results, Innovation, Diversity, and Enthusiasm (or "PRIDE") are emphasized in all aspects of our operations. Through our commitment to these values and our prudent use of resources, the Chicago Zoological Society has established a leadership role as a conservation center with a superior quality of service for the communities we serve.
The Chicago Zoological Society is an Equal Opportunity Employer / Affirmative Action Employer - Minorities/Women/Veterans/Disabled.
The Chicago Zoological Society is a private nonprofit organization that operates Brookfield Zoo on land owned by the Forest Preserves of Cook County.
The Chicago Zoological Society is a private, non-profit corporation whose mission is to inspire conservation leadership by connecting people to wildlife and nature. We operate under the premise that the decisions we make as individuals and as a society regarding the natural world will have a profound impact on our future and that of our children. Through our Center for Conservation Leadership and Center for the Science of Animal Welfare, we work to deepen people's relationship with nature and equip them with the knowledge, skills, and motivation to take positive conservation action and to inspire others to do so. The Society pursues its important mission through its management of the award-winning Brookfield Zoo for the Forest Preserve District of Cook County and through its community and field-based programs in animal care, education, science and research, both here and abroad. Brookfield Zoo, a prime Chicagoland leisure destination, is also one of the world's top zoos, hosting 2 million visitors each year and proud to have one of the largest number of member households amongst cultural institutions in Chicagoland.
Children's Home + Aid is a leading child and family service agency in Illinois. The organization helps children recover their health, their hope, and their faith in the people around them.
We link children to a network of opportunity and care, to extended family, teachers, mentors, and the resources of the neighborhood and community. For more than 130 years, the organization has gone wherever children and families need them, and where that work has been proven to be most effective: at home, in the classroom, in the neighborhood, in the course of daily life. The organization has offices located across Illinois and serves more than 40,000 children and families each year in over 60 counties.
Church & Dwight Co., Inc., founded in 1846, and headquartered in Princeton, New Jersey, is the world's leading producer of Sodium Bicarbonate. This natural product, popularly known as Baking Soda, cleans, deodorizes, leavens and buffers. Our Company's famous ARM & HAMMER® Brand is one of the nation's most trusted trademarks for a variety of household and personal care uses. Today, Church & Dwight is a leader in the Household Consumer Products and Personal Care industry, with such brands as ARM & HAMMER, Trojan, First Response, Arrid, Nair, Mentadent, Spinbrush, Close-Up, Scrub Free, Oxi Clean and more.