content
stringlengths
7
2.61M
############################### # Color Bar # ############################### # color bar ref: http://stackoverflow.com/questions/32614953/can-i-plot-a-colorbar-for-a-bokeh-heatmap # seaborn color palette: https://stanford.edu/~mwaskom/software/seaborn/tutorial/color_palettes.html # covert seaborn color palette to hex: http://stackoverflow.com/questions/33395638/python-sns-color-palette-output-to-hex-number-for-bokeh # right y axis ref to twin axes: http://bokeh.pydata.org/en/latest/docs/user_guide/plotting.html#twin-axes from bokeh.plotting import figure from bokeh.models import Range1d, LinearAxis import seaborn as sns def generate_colorbar( palette, low = 0, high = 1, plot_height = 400, plot_width = 80, orientation = 'v'): y = np.linspace( low, high,len(palette)) dy = y[1]-y[0] if orientation.lower()=='v': fig = figure( x_range = [0, 1], y_range = [low, high], width = plot_width, height = plot_height ) fig.toolbar_location='left' fig.axis.visible = False fig.extra_y_ranges = { 'raxis': Range1d( start = low, end = high )} fig.rect( x = 0.5, y = y, color=palette, width=1, height = dy ) fig.add_layout( LinearAxis( y_range_name = 'raxis', major_label_text_font_size = '10pt' ), 'right' ) elif orientation.lower()=='h': fig = figure( y_range = [0, 1], x_range = [low, high], plot_width = plot_width, plot_height=plot_height ) fig.toolbar_location='above' fig.yaxis.visible = False fig.rect(x=y, y=0.5, color=palette, width=dy, height = 1) return fig ############################### # Polar Plot # ############################### # bokeh single polar plot ref: https://github.com/GCBallesteros/Bokeh_Examples/blob/master/polar.py # bokeh 2 polar plot ref: https://github.com/GCBallesteros/Bokeh_Examples/blob/master/polar_fight.py # hovertools: http://bokeh.pydata.org/en/latest/docs/user_guide/tools.html import numpy as np import math from bokeh.plotting import figure, ColumnDataSource from bokeh.models import HoverTool def polar( phi, r, values = None, plot_height = 400, plot_width = 400, palette = 'orange', palette_max = 1, palette_min = 0, hover_tool = False ): min_angle = 0 max_angle = np.pi/2 max_radius, r_interval = 90, 15 max_phi, phi_interval = 90, 15 # Coordinates in cartesian coordinates normalized x = r * np.cos(phi) y = r * np.sin(phi) # Create the figure if hover_tool: source = ColumnDataSource(data=dict( x = x, y = y, values = values )) hover = HoverTool( tooltips=[("", "@values")]) tools = "pan,wheel_zoom,reset,save,box_select" p = figure( plot_width=plot_width, plot_height=plot_height, tools = [hover, tools], x_range=( -12, 97 ), y_range=( -12, 97)) else: p = figure( plot_width=plot_width, plot_height=plot_height, x_range=( -12, 97 ), y_range=( -12, 97)) p.axis.visible = False p.grid.grid_line_color = None # Plot the line and set ranges and eliminate the cartesian grid pal_size = len(palette) if pal_size > 1 and values: #val_pal = [ palette[int(v*pal_size)] for v in values ] val_interval = ( palette_max - palette_min ) / pal_size pal_index = [ ( v - palette_min ) / val_interval for v in values ] pal_index = [ pal_size - 1 if v >= pal_size else 0 if v < 0 else v for v in pal_index ] val_pal = [ palette[math.ceil(ind)] for ind in pal_index ] if hover_tool: p.scatter( 'x', 'y', size=15, radius = 3, line_color = None, fill_color = val_pal, source = source ) else: p.scatter( x, y, size=15, radius = 3, line_color = None, fill_color = val_pal ) else: p.scatter( x, y, size=15, radius = 3, line_color = None, fill_color = palette ) # Draw the radial coordinates grid radius = list( range( 0, max_radius+1, r_interval )) zeros = np.zeros( len( radius )) p.annular_wedge(zeros, zeros, zeros, radius, 0, np.pi/2, fill_color=None, line_color="gray", line_dash="4 4", line_width=0.5) p.annular_wedge([0.0], [0.0], [0.], [max_radius], 0, np.pi/2, fill_color=None, line_color="#37435E", line_width=1.5) # Radial Labels x_labels = -3.5 y_labels = np.linspace(0, max_radius, len( radius )) number_labels = ["%.0f°" % s for s in y_labels ] # - y label p.text( x_labels, y_labels, number_labels, angle=np.zeros( int( max_radius/r_interval )), text_font_size="11pt", text_align="right", text_baseline="middle", text_color="gray") # - x label p.text( [ y+3.5 for y in y_labels ], x_labels-2, number_labels, angle=np.zeros( int( max_radius/r_interval )), text_font_size="11pt", text_align="right", text_baseline="middle", text_color="gray") #Draw angular grid phi_angles = list( range( 0, max_phi+1, phi_interval ) ) n_spokes = len( phi_angles ) angles_spokes = np.linspace( min_angle, max_angle, n_spokes) p.ray( np.zeros(n_spokes), np.zeros(n_spokes), np.ones(n_spokes)*max_radius, angles_spokes, line_color="gray", line_width=0.5, line_dash="4 4") # Angle Labels x_labels = max_radius * np.cos(angles_spokes) y_labels = max_radius * np.sin(angles_spokes) p.text(x_labels, y_labels, [ str(a)+'°' for a in phi_angles ], angle=-np.pi/2+angles_spokes, text_font_size="11pt", text_align="center", text_baseline="bottom", text_color="gray") return p
The present invention relates to the field of electric lamps, and more particularly to candle-shaped lamps. Specialized electric lamps may be designed to look like wax candles. Such lamps are used in the home as decorative elements and are often placed on windowsills for display. In accordance with a principal feature of the present invention, a lamp apparatus includes a vertically elongated, candle-shaped lamp structure including a battery powered source of light. The apparatus further includes a horizontally elongated base configured to support the lamp structure. The base defines a horizontally elongated battery compartment configured to receive batteries in a row in end-to-end horizontal positions, and includes battery contacts at opposite ends of the battery compartment. In accordance with another principal feature of the invention, the candle-shaped lamp structure has a candlestick portion with a cylindrical side wall centered on an axis. A pair of opposed guide structures are located at an inner surface of the side wall. A vertically elongated circuit board is received upward through an upper lower end of the side wall, and has opposite vertical side edges received by the guide structures. In this arrangement, the circuit board divides the interior of the candlestick into two vertically elongated compartments on opposite sides of the circuit board. A source of light is electrically connected to the circuit board in a position located above an upper end edge of the circuit board, and is centered on the cylindrical axis. This enables light from the source to have an uninterrupted path from the source upward through an aperture at the upper end of the candlestick, and also downward through the compartments in the candlestick.
#include "gnpch.h" #include "Graphen/Core/Input.h" #include "Application.h" namespace gn { Scope<Input> Input::s_Instance = Input::Create(); Input::Input() : m_PrevMousePos(FLT_MAX, FLT_MAX), m_CurMousePos(FLT_MAX, FLT_MAX), m_MouseDiff(0.f, 0.f) { ZeroMemory(m_KeyStates, sizeof(m_KeyStates)); ZeroMemory(m_MouseStates, sizeof(m_MouseStates)); } bool Input::IsKeyPressed(KeyCode key) { return s_Instance->m_KeyStates[(int)key]; // return GetKeyState((int)key) >> 15; } bool Input::IsMouseButtonPressed(MouseCode button) { return s_Instance->m_MouseStates[(int)button]; // return GetKeyState((int)button) >> 15; } Vector2 Input::GetMousePosition() { if (s_Instance->m_CurMousePos.x == FLT_MAX) { s_Instance->m_PrevMousePos = s_Instance->m_CurMousePos = s_Instance->GetNativeMousePos(); } return s_Instance->m_CurMousePos; } Vector2 Input::GetMouseAnalog() { return s_Instance->m_MouseDiff; } void Input::SetKeyboardPressed(KeyCode code, bool pressed) { s_Instance->m_KeyStates[(int)code] = pressed; } void Input::SetMousePressed(MouseCode code, bool pressed) { s_Instance->m_MouseStates[(int)code] = pressed; } void Input::SetMousePos(Vector2 pos) { s_Instance->m_CurMousePos = pos; } void Input::Update(float dt) { if (s_Instance->m_PrevMousePos.x == FLT_MAX) { s_Instance->m_PrevMousePos = s_Instance->GetMousePosition(); } s_Instance->m_MouseDiff = (s_Instance->GetMousePosition() - s_Instance->m_PrevMousePos) * Vector2(1, -1) * dt; s_Instance->m_PrevMousePos = s_Instance->m_CurMousePos; } Scope<Input> Input::Create() { return CreateScope<Input>(); } Vector2 Input::GetNativeMousePos() { HWND hWnd = *(HWND*)Application::Get().GetWindow().GetNativeWindow(); POINT p; if (GetCursorPos(&p)) { //cursor position now in p.x and p.y if (ScreenToClient(hWnd, &p)) { //p.x and p.y are now relative to hwnd's client area return Vector2{ (float)p.x, (float)p.y }; } } return { 0, 0 }; } bool Input::GetNativeKeyState(int key) { return ::GetKeyState((int)key) >> 15; } }
<reponame>alvinwkwang/surferpedia package views.formdata; import java.util.ArrayList; import java.util.List; import play.data.validation.ValidationError; import models.Surfer; import models.SurferDB; /** * Java backing class for Surfer's form data. * * @author <NAME> * */ public class SurferFormData { /** The surfer's name. */ public String name = ""; /** The surfer's home-town. */ public String home = ""; /** The surfer's country of origin. */ public String country = ""; /** The surfer's awards. */ public String awards = ""; /** Image URL for carousel. */ public String carouselURL = ""; /** Image URL for biography. */ public String bioURL = ""; /** The surfer's biography. */ public String bio = ""; /** The surfer's slug field. */ public String slug = ""; /** The surfer's type. */ public String type = ""; /** The surfer's footystyle. */ public String footstyle = ""; /** If surfer page is editing. */ public boolean isEditing = false; /** * Empty arg constructor. */ public SurferFormData() { } /** * Constructor that creates a SurferFormData of an existing surfer. * * @param surfer An existing surfer. */ public SurferFormData(Surfer surfer) { this.name = surfer.getName(); this.home = surfer.getHome(); this.country = surfer.getCountry(); this.awards = surfer.getAwards(); this.carouselURL = surfer.getCarouselURL(); this.bioURL = surfer.getBioURL(); this.bio = surfer.getBio(); this.slug = surfer.getSlug(); this.type = surfer.getType(); this.footstyle = surfer.getFootstyle(); this.isEditing = true; } /** * Create a new SurferFormData object manually. * * @param name The surfer's name. * @param home THe surfer's home town. * @param country The surfer's country of origin. * @param awards The surfer's awards. * @param carouselURL The surfer's carousel URL. * @param bioURL THe surfer's bio URL. * @param bio THe surfer's bio. * @param slug The surfer's slug. * @param type The surfer's type. * @param footstyle THe surfer's footstyle. */ public SurferFormData(String name, String home, String country, String awards, String carouselURL, String bioURL, String bio, String slug, String type, String footstyle) { this.name = name; this.home = home; this.country = country; this.awards = awards; this.carouselURL = carouselURL; this.bioURL = bioURL; this.bio = bio; this.slug = slug; this.type = type; this.footstyle = footstyle; } /** * Checks all form fields are valid. * * @return null if valid, a list of ValidationErrors if invalid. */ public List<ValidationError> validate() { List<ValidationError> errors = new ArrayList<>(); if (name == null || name.length() == 0) { errors.add(new ValidationError("name", "Name is required.")); } if (home == null || home.length() == 0) { errors.add(new ValidationError("home", "Home is required.")); } if (country == null || country.length() == 0) { errors.add(new ValidationError("country", "Country is required.")); } if (carouselURL == null || carouselURL.length() == 0) { errors.add(new ValidationError("carouselURL", "Carousel URL is required.")); } if (bioURL == null || bioURL.length() == 0) { errors.add(new ValidationError("bioURL", "Bio URL is required.")); } if (bio == null || bio.length() == 0) { errors.add(new ValidationError("bio", "Bio is required.")); } if (slug == null || slug.length() == 0) { errors.add(new ValidationError("slug", "Slug is required.")); } if (SurferDB.isRepeatSlug(slug) && !isEditing) { errors.add(new ValidationError("slug", "Slug '" + slug + "' already exists.")); } if (!SurferDB.isAlphaNumeric(slug)) { errors.add(new ValidationError("slug", "Slug must be only letters and digits.")); } if (!SurferTypes.isType(type)) { errors.add(new ValidationError("type", "Type is required.")); } if (footstyle == null || footstyle.length() == 0) { errors.add(new ValidationError("footstyle", "Footstyle is required.")); } return errors.isEmpty() ? null : errors; } }
def add_job_set(self, job_list): assert not self._closed results = Results(loop=self._loop) js = JobSet(job_list, results, self, loop=self._loop) if not js.is_done(): if self._active_js is None: self._active_js = js logger.debug("activated job set") self._distribute_jobs() else: self._js_queue.append(js) else: logger.debug("new job set has no jobs") return JobSetHandle(js, results)
Robert Patrick (playwright) Early life O'Connor was born to migrant workers in Texas. Because his parents constantly moved around the southwestern United States looking for work, he never went to one school for a full year until his senior year of high school, in Roswell, New Mexico. Books, film, and radio were the only constants in his early life. His mother made sure he learned to read, and arranged for him to start school a year early. He lacked friendships due to the constant moving, and didn't do well in school. He dropped out of college after two years. He did not experience live theater, beyond a few school productions, until he was working one summer as a dishwasher at the Kennebunkport Playhouse in Kennebunkport, Maine and fell in love with the theater. He stopped in New York City on his way back to Roswell from Maine and happened upon the Caffe Cino, the first Off-Off Broadway theatre, on September 14, 1961. He stayed in New York, working for free at the Caffe Cino, La Mama ETC, and other early Off-Off Broadway theaters in any capacity, and supported himself with temporary typing jobs while observing and participating in dozens of productions, including Lanford Wilson's So Long at the Fair. He had already been writing poetry, and in 1964 wrote his first play, The Haunted Host. The play was soon produced at Caffe Cino, and playwriting became his main focus. Career Patrick has written and published over sixty plays. 1960s His first play, The Haunted Host, premiered at Caffe Cino in 1964. Patrick denied Neil Flanagan, the Caffe Cino's star performer, the title role (because Flanagan had recently played Lanford Wilson's gay character, Lady Bright), and after other prominent Off-Off actors refused the role because they feared playing a gay character might damage their careers, Patrick appeared in the play himself alongside fellow playwright William M. Hoffman. He also worked at La MaMa Experimental Theatre Club, another of the first Off-Off-Broadway theatres. Neil Flanagan directed a production of Patrick's play Mirage at La MaMa in July 1965. In November 1965, Patrick was production coordinator for BbAaNnGg, a benefit to raise money for electrical work at La MaMa's 122 Second Avenue theatre, which included plays, spoken word, performance art, and film by many prominent Off-Off artists.. In 1969, he won the Show Business magazine Best Play Award for Joyce Dynel, Salvation Army, and Fog. Also in 1969, his play Camera Obscura was produced on PBS, starring Marge Champion, and was chosen to be in the well-known playwright revue "Collision Course". Patrick was a prolific pioneer in Off-Off-Broadway and gay theatre, with over 300 productions of his plays during the 1960s in New York City alone. In 1972, the publisher and licensing company Samuel French called Patrick "New York's Most-Produced Playwright". 1970s Patrick directed a production of his own play, The Richest Girl in the World Finds Happiness, at La MaMa in 1970. He directed his own plays, Valentine Rainbow at La MaMa and The Golden Circle at 119 Spring Street, both in 1972. He directed holiday shows at La MaMa in 1971, 1972, and 1974. The 1971 production was called La MaMa Christmas Show, the 1972 production was Play-by-Play, and the 1974 production was Play-by-Play: A Spectacle of Ourselves. In 1973, he directed Paul Foster's Silver Queen, which featured music by John Braden, at La MaMa. In 1973, Patrick's Kennedy's Children had an obscure opening in the back of a London pub theatre called the King's Head, in Islington. The production was instantly successful and was signed for the West End and other international productions. 1974 was the first season of gay theatre in the United Kingdom, to which Patrick contributed three plays. His play Cleaning House was produced in California during the summer of 1974. A 1974 Boston production of The Haunted Host was the first time Harvey Fierstein appeared on the professional stage as a man. Years later, Fierstein included a recording of Patrick's monologue "Pouf Positive" on his compact disc This Is Not Going to Be Pretty. "Pouf Positive" was also filmed by Dov Hechtman in 1989. The 1975 Broadway production of Kennedy's Children earned Shirley Knight a 1976 Tony Award for Best Performance by a Featured Actress in a Play. She reprised her role in the 1979 CBS production of the play. Patrick traveled widely, from Anchorage to Cape Town, to see productions of Kennedy's Children. For ten years, he visited high schools and high school theatre conventions nationwide on behalf of the International Thespian Society. In 1976, Marlo Thomas commissioned Patrick to write My Cup Ranneth Over for her and Lily Tomlin. Although they never performed in the play, it would become Patrick's most produced work. Patrick co-wrote Da Nutrcracker in Da Bronx with Jeannine O'Reilly and Paul Foster; the production was directed by Powell Shepard at La MaMa in 1977. T-Shirts was first produced in 1979, starring Jack Wrangler, and was later chosen as the opening piece in the anthology Gay Plays: A First Collection. 1980s Patrick directed The Richest Girl in the World Finds Happiness at La MaMa again in 1981. His Blue Is For Boys was the first play about gay teenagers, and the Manhattan borough president declared a Blue is for Boys Weekend in honor of the play in 1983 and again in 1986. The Trial of Socrates was the first gay play presented by New York. Hello Bob, an account of Patrick's experiences with the production of Kennedy's Children, was the last play he directed before leaving New York for California. Later work Other work by Patrick includes Untold Decades (1988), seven one-act plays giving a humorous history of gay life in the United States, and Temple Slave, a novel about the early days of Off-Off-Broadway and gay theatre. Patrick has also ghostwritten several screenplays for film and television; contributed poems and reviews to Playbill, FirstHand, and Adult Video News; and had his short stories published in anthologies. Patrick has appeared in the documentaries Resident Alien, with Quentin Crisp, and Wrangler: Anatomy of an Icon, and in the videos O is for Orgy: The Sequel and O Boys: Parties, Porn, and Politics, both produced by the O Boys Network. Most recently, he published his memoir Film Moi or Narcissus in the Dark and the plays Hollywood at Sunset and Michelangelo's Models. He retired from theatre in 1990, and has lived in Los Angeles since 1993. In 2010, he published a DVD of his lecture "Caffe Cino: Birthplace of Gay Theatre" and two books of poems, A Strain of Laughter and Bitter with the Sweet, with Lulu.com. In 2013, he was brought back onto the stage by young Los Angeles underground theatre artists, appearing as a reader, singer, and actor. In March 2014, he gave a solo performance about his career entitled, "What Doesn't Kill Me Makes a Great Story Later," which featured a capella renditions of many of his original songs This was followed by two more solo evenings of song, entitled "Bob Capella" and "New Songs for Old Movies.".
/** * a dao for testing. * it configures the connection pool to use a single connection without auto commit. * all operations are performed on that single connection and when it is discarded the connection is rolled back * * @author aronen 8/25/14. */ public class BasicTestingDao extends BasicDao implements AutoCloseable { public BasicTestingDao(final String host, final int port, final String database, final String userName, final String password, final long connectTimeoutMilliSeconds, final long queryTimeoutMilliSeconds) throws Exception { // using a single connection in the pool so that every command will run on it. super(createTestConnectionPool(host, port, database, userName, password, connectTimeoutMilliSeconds, queryTimeoutMilliSeconds)); } private static DbConnectionPool createTestConnectionPool(final String host, final int port, final String database, final String userName, final String password, final long connectTimeoutMilliSeconds, final long queryTimeoutMilliSeconds) throws Exception { return MySqlConnectionPoolBuilder.newBuilder( createNonCommittingSingleConnectionFactory(host, port, database, userName, password, connectTimeoutMilliSeconds, queryTimeoutMilliSeconds) ).maxConnections(1).build(); } private static NonCommittingSingleConnectionFactory createNonCommittingSingleConnectionFactory(final String host, final int port, final String database, final String userName, final String password, final long connectTimeoutMilliSeconds, final long queryTimeoutMilliSeconds) throws Exception { return new NonCommittingSingleConnectionFactory( MySqlAsyncConnection.createConfiguration(host, port, Option.apply(database), userName, Option.apply(password), connectTimeoutMilliSeconds, queryTimeoutMilliSeconds)); } @Override public <T> ComposableFuture<T> withTransaction(final TransactionHandler<T> handler) { return withConnection(handler); } @Override public void close() throws Exception { execute("rollback;").alwaysWith(result -> shutdown()).get(); } private static class NonCommittingSingleConnectionFactory extends MySQLConnectionFactory { private int numOfCreations = 0; private final Configuration configuration; public NonCommittingSingleConnectionFactory(final Configuration configuration) throws Exception { super(configuration); this.configuration = configuration; } @Override public MySQLConnection create() { numOfCreations++; if (numOfCreations > 1) { throw new IllegalStateException("trying to create more that one connection per test"); } final MySQLConnection conn = super.create(); final Future<QueryResult> futureRes = conn.sendQuery("start transaction;"); try { Await.result(futureRes, configuration.connectTimeout()); return conn; } catch (final Exception e) { throw new IllegalStateException("can't start transaction on the connection", e); } } @Override public Try<MySQLConnection> validate(final MySQLConnection item) { if (!item.isConnected()) { return new Failure<>(new ConnectionNotConnectedException(item)); } if (item.isQuerying()) { return new Failure<>(new ConnectionStillRunningQueryException(item.count(), false)); } return new Success<>(item); } } }
An Experimental Investigation into the Effective Permeability of Porous Media whose Matrices are Composed of Obstacles of Different Sizes A comprehensive experimental investigation has been conducted to determine the effective permeability of fluid saturated porous media consisting of small and large spherical particles. Small and large particles were mixed uniformly at a certain mixture ratio so as to form a vertical porous column. Water was drawn from a reservoir to flow through the vertical tube filled with particles of different sizes. The resulting pressure drops between the inlet and outlet sections of the test column were measured at various flow rates to determine the effective permeability. The results were compared with the present theoretical model generalized on the basis of the analysis reported by Liu, Sano and Nakayama for fractured porous media. It has been confirmed that the present mathematical model agrees very well with the experimental data and thus can be used to estimate the permeability of porous media consisting of obstacles of different sizes.
package com.vmware.action.filesystem; import java.io.File; import com.vmware.action.BaseAction; import com.vmware.config.ActionDescription; import com.vmware.config.WorkflowConfig; import com.vmware.util.IOUtils; @ActionDescription("Saves file data to a specified file.") public class SaveFileData extends BaseAction { public SaveFileData(WorkflowConfig config) { super(config); super.addFailWorkflowIfBlankProperties("destinationFile", "fileData"); } @Override public void process() { log.info("Saving to {}", fileSystemConfig.destinationFile); IOUtils.write(new File(fileSystemConfig.destinationFile), fileSystemConfig.fileData); } }
To Stroop or not to Stroop: Sex-related differences in brain-behavior associations during early childhood. Executive functions (EFs) are linked with optimal cognitive and social-emotional development. Despite behavioral evidence of sex differences in early childhood EF, little is known about potential sex differences in corresponding brain-behavior associations. The present study examined changes in 4-year-olds' 6-9 Hz EEG power in response to increased executive processing demands (i.e., "Stroop-like" vs. "non-Stroop" day-night tasks). Although there were no sex differences in task performance, an examination of multiple scalp electrode sites revealed that boys exhibited more widespread changes in EEG power as compared to girls. Further, multiple regression analyses controlling for maternal education and non-EF performance indicated that individual differences in boys' and girls' EF performance were associated with different frontal neural correlates (i.e., different frontal scalp sites and different measures of EEG power). These data reveal valuable information concerning sex differences in the neural systems underlying executive processing during early childhood.
Survival Benefit of Kidney Transplantation in HIV-infected Patients Objective: To determine the survival benefit of kidney transplantation in human immunodeficiency virus (HIV)-infected patients with end-stage renal disease (ESRD). Summary Background Data: Although kidney transplantation (KT) has emerged as a viable option for select HIV-infected patients, concerns have been raised that risks of KT in HIV-infected patients are higher than those in their HIV-negative counterparts. Despite these increased risks, KT may provide survival benefit for the HIV-infected patient with ESRD, yet this important clinical question remains unanswered. Methods: Data from the Scientific Registry of Transplant Recipients were linked to IMS pharmacy fills (January 1, 2001 to October 1, 2012) to identify and study 1431 HIV-infected KT candidates from the first point of active status on the waiting list. Time-dependent Cox regression was used to establish a counterfactual framework for estimating survival benefit of KT. Results: Adjusted relative risk (aRR) of mortality at 5 years was 79% lower after KT compared with dialysis (aRR 0.21; 95% CI 0.100.42; P <0.001), and statistically significant survival benefit was achieved by 194 days of KT. Among patients coinfected with hepatitis C, aRR of mortality at 5 years was 91% lower after KT compared with dialysis (aRR 0.09; 95% CI 0.020.46; P < 0.004); however, statistically significant survival benefit was not achieved until 392 days after KT. Conclusions: Evidence suggests that for HIV-infected ESRD patients, KT is associated with a significant survival benefit compared with remaining on dialysis.
<filename>romp/src/compares_complex_values.h #pragma once #include <cstddef> #include <rumur/rumur.h> // Determine whether the given AST contains any comparisons of records or // arrays. See main.cc for why this is interesting/relevant. bool compares_complex_values(const rumur::Node &n);
A healthy climate is not always as it seems. Redkill Lodgepole Pine stand behind a field of Douglas’ Sunflower at Steamboat Lake State Park, Colorado. Less than 0.7 degree Celsius of average warming across the globe was responsible for allowing the native mountain pine beetle to kill 20 percent of western US forests between the late 1990s and 2010. The attack continues today with the addition of spruce and fir beetles to the infestation. (Photo: Bruce Melton) We can have a healthy climate — a climate with zero warming — in our lifetimes. The message for the last 20 years has been that we have to reduce emissions drastically to prevent dangerous climate change of more than 2 degrees C (3.6 F). This strategy would have likely worked when it was first suggested, but we have delayed far too long since then. Now, even stringent emissions reductions allow our warming to at least double and likely triple before finally beginning to cool. We must begin to reduce the load of already-emitted, long-lived carbon dioxide (CO2) climate pollution in the sky, regardless of costs. The good news is that, not only will costs be very similar to many things we do in our society today whose costs are taken for granted, but by disconnecting emissions reductions strategies from the removal of already-emitted climate pollution in our sky, we vastly simplify the myriad strategies that have been developed to avoid dangerous climate change. Haven’t We Begun to Deal With Climate Pollution? The Clean Power Plan, implemented by the Environmental Protection Agency (EPA) in February 2016 seeks to limit emissions to Kyoto Protocol Era levels by 2030 — 18 years later than Kyoto’s 2012 target. Meanwhile, at the UN Paris Climate Conference in 2015, President Obama committed the US to an emissions reduction of 80 percent below 2005 levels by 2050. This is 30 years behind Kyoto Phase 2 goals of 80 percent emissions reductions by 2020. Clearly, current rules and commitments are far behind those set 20 years ago. Moreover, since the beginning of the Kyoto Era, we have emitted almost as much climate pollution as we emitted in the previous 230 years. The Clean Power Plan has been stayed by an unprecedented Supreme Court decision pending a decision in the lower courts, but will likely be upheld. Because of the great delay in action, current US emission reduction policy — along with 80 percent commitments around the globe — would allow the concentration of CO2 in our atmosphere to rise to 440 ppm by 2050-60, and would allow the temperature to rise by anywhere from 1.6 to 2.7 degrees C, or double to triple our current warming. Under this best-case scenario of aggressive emissions reductions, global temperature still would not fall back to today’s levels for 400 to 500 years and would not fall back to preindustrial “zero warming” for thousands of years. Is 2 Degrees C Safe? The demarcation of the “2 degrees C” threshold for dangerous climate change — set in 1990 by the Intergovernmental Panel on Climate Change (IPCC) — was an effort to put real numbers to the concept of “dangerous climate change.” The IPCC’s 166-page document is summarized by two sentences that spell out the risks of climate change with a certain warming: Beyond 1.0 °C may elicit rapid, unpredictable, and non-linear responses that could lead to extensive ecosystem damage…. An absolute temperature limit of 2.0°C can be viewed as an upper limit beyond which the risks of grave damage to ecosystems, and of non-linear responses, are expected to increase rapidly. The wording of the two statements above sheds light on just how “safe” 2 degrees C actually is. In contrast to these statements from 26 years ago, current extreme events are happening with less than a degree of warming. Even the most aggressive emissions reduction strategies allow for warming that is over double what has already occurred. Plus, warming-caused feedbacks generally grow more profound with increased heat, meaning that impacts will increase faster and become more extreme relative to impacts happening already. What Is the Safe Target? The Paris climate talks last year — the 21st meeting of the IPCC — made the strong suggestion that we stop using 2 degrees C of warming as a description of a “safe threshold” to dangerous climate change; and it was agreed that efforts would be made to limit warming to 1.5 degrees C or less. But is this sufficient? The IPCC has a long and significant history in the academic literature of badly underestimating the impacts of climate change. An excellent example is that as late as the 2007 IPCC report, Antarctica was not supposed to begin losing ice until after 2100. In the 2013 report, however, Antarctic ice loss is now approaching that of Greenland. Importantly, the first academic findings on Antarctic ice loss were published in 1994. The consensus process of the IPCC causes their statements to lag recently published science; in this case, by 20 years. Meanwhile, in 2008, James Hansen, the former 32-year director of the US climate modeling agency at NASA, lowered his threshold for dangerous climate change to 300-350 ppm CO2, or about 0.5 to 1.0 degree C of warming. We are at 400 ppm today; preindustrial CO2 was 280 ppm. The rapid increase in extreme weather events we have been experiencing could hardly be viewed as “safe.” However, other dramatic impacts are quickly making themselves apparent. Reports of the initiation of the collapse of the West Antarctic Ice Sheet (WAIS) are becoming frequent. Megafires, according to an article in National Geographic, have grown to sizes that National Forest Service Chief Tom Tidwell says would have been “unimaginable” two decades ago. NASA and Columbia University say heat extremes, such as the $12.7 billion Texas/Southern Plains drought in 2011, are made 10 to 100 times more likely with already experienced warming. This work also says that these extreme heat events, that once happened across 0.1 to 0.2 percent of the Northern Hemisphere, now happen across 10 percent of the Northern Hemisphere every year. Prehistoric evidence of abrupt sea level rise when Earth was about as warm as it is today — about 121,000 years ago — shows that the collapse of the WAIS resulted in 6.5 to 10 feet of sea level rise in what could be as little as 10 to 24 years. After more than two decades of IPCC sea level rise estimates of about two feet in 100 years, modeling is finally beginning to approach prehistoric evidence. The challenge has been that the IPCC rely on modeling that they themselves admit is underestimated. The former modeling of only four inches from Antarctica by 2100 is now at three feet. It is important to understand that this new modeling work is in its infancy and like the IPCC, likely underestimates. The good news is that modeling has broken free of the previous constraints that so badly underestimated ice sheet collapse relative to actual prehistoric evidence. With the latest ice sheet collapse warning in April 2016, the National Oceanic and Atmospheric Administration (NOAA) is looking forward to upcoming publication of ongoing research from multiple sources. NOAA says that because the lag in time between academic research and inclusion of that research in the scientific consensus can be as much as “ten years,” in the next few years we will see academic publication that shows 10 feet of sea level rise from Antarctica will happen in the next 50 years. This rate is far greater than the adaptability threshold of three feet per century. With only two meters of total sea level rise (6.5 feet), 187 million people would be physically displaced. Work from the German National Science Academy says that flooding from only 1.2 meters (4 feet) of sea level rise would impact up to 310 million people and cause up to $210 trillion in damages by 2100. The excessive heat and flooding extremes that we have already endured — as well as the unimaginable impacts from the 10 feet of sea level rise that is set to occur — have been caused by warming of 0.7 degrees C or less. That current policy and commitments allow additional warming that is more than double what we have already seen is ample evidence that current climate pollution strategy is far behind. Zero Warming — a Primer This brings us back to that question: How do we move forward? Some of the tools for getting us there are widely known: efficiency increases, alternative energy, agriculture improvements, reforestation, electric cars, smart grids, DC power transmission, showering with a friend. These are all important and critically so, because of the great risk of further increasing extremes. But these tools all allow warming of double to more than triple our current level before the temperature begins to very, very slowly cool. Emissions reductions help — in that they reduce the amount of CO2 that we are releasing into the sky — but even with aggressive emissions along the lines of the greatest reductions feasible, our climate continues to warm for at least 50 years. What is needed, if we are going to leave our children a healthy climate, are tools that can immediately begin to reduce the very long-lived CO2 that is already in our sky. Fortunately, science has advanced a bit over the past 20 years. There is now a set of technologies out there that have been proven to do the job of atmospheric carbon removal. For $21 trillion (the cost of US health care from 2000 to 2009), we could create an infrastructure that would remove 50 ppm CO2 from our sky and make a huge dent in the atmospheric loading that is causing the warming. This cost is about $200 per ton of CO2. Newer technologies hold even more exciting prospects cost-wise. The best estimates for new technologies are at $20 per ton for capture and 20 percent more for disposal. The company, Global Thermostat, in Menlo Park, California, has a full-scale industrial pilot project that uses waste heat and is reportedly capturing CO2 at $10 per ton. Some of the new technologies are even more compelling. One new line of research shows that CO2 captured directly from the sky can be used to create carbon nanofibers, a very advanced material that could be used to build almost anything from automobiles to homes. Production costs are similar to that of aluminum and the carbon fibers have a value 1,000 times that of aluminum. There is a fuel cell technology that can capture carbon dioxide from direct fossil fuel generation emissions that does not require additional energy and actually increases the generation capacity of the energy facility. Then there are the solar radiation management technologies (SRM), such as injecting sulfates or tiny mirror-like particles into the upper atmosphere to reflect sunlight. There is some very important work ongoing in this field of geoengineering that could be revolutionary as well. But whereas the climate pollution removal techniques described above are relatively simple, the implications of SRM are no less significant than the greenhouse gas experiment we have been implementing for centuries. Take sulfate injection, for example. This technique is often suggested to have grave acid rain consequences but the amount of sulfates used is 100 times less than what is required to create significant acid rain. Maybe more importantly, once sulfate injection ceases, impacts to the atmosphere are completely gone after two years or less. The bottom line, however, is that atmospheric geoengineering is little studied and fraught with challenges, and far more work needs to be done before implementation is seriously considered. The Next Steps to a Healthy Climate We need to give ourselves permission to go beyond emissions reductions alone and seek a healthy zero-warming climate. A group of dedicated academics and climate science outreach specialists are doing just that. The Healthy Climate Project is the first to approach the issue of a zero-warming healthy climate. What we can do as individuals is vitally important because policy grows from public will. Discuss healthy climate goals with your peers. Mainstream the concept. We need to fund development and increased research for even more compelling technologies than already exist, build a safety monitoring organization (like the Food and Drug Administration, but for carbon removal), and scale up these technologies. The Healthy Climate Project is the first of its kind. Its “Declaration” asks President Obama to authorize research to complete the industrialization of new atmospheric CO2 removal and storage technology and commit to a healthy climate for America. We have the tools. Now we need to allow ourselves to go beyond emissions reductions alone, in order to leave our children a planet free from dangerous climate change. Note: Detailed references for the claims in this article can be found here.
How do people recover from war — especially a conflagration as catastrophic as World War II? In many ways that is the question at the heart of “An American in Paris,” the Broadway musical that (quite literally) danced its way onto the stage of Chicago’s Oriental Theatre on Wednesday night and made a glorious case for the power of art, friendship and romance as catalysts of rebirth. Although based on the 1951 film, this stage version, with a book by Craig Lucas that puts the post-war years in France in far starker relief, is far from a carbon copy. Of course the peerless songs of George and Ira Gershwin (along with the grand sweep of George’s orchestral music), sets the rhythm. But paired with the sinuous direction and brilliantly varied choreography by Christopher Wheeldon, and the fluid sets by Bob Crowley that have a sinuous dance style all their own, this show might well be described as “a danced-through musical,” just as others are dubbed “sung-through” shows. For dance — an exuberant mix of ballet, modern, jazz, tap and classic Broadway styles — is the most essential language of the storytelling here. And that constant flow of movement not only suggests the power of love (troubled as it might be), but captures an entire society’s healing in the wake of death and destruction. And then there is the cast, whose leads — McGee Maddox (a principal dancer with the National Ballet of Canada) and Sara Esty (a former soloist with the Miami City Ballet) — are not just classical dancers at the very top of their game, but actor-singers with Broadway level chops. It is difficult to believe this is the first musical venture for both. Talk about “triple threat” performers. The story begins with nothing but a shadowy image of the Arc de Triomphe and a piano. The young composer at work is Adam Hochberg (Etai Benson in a deft, tragicomic turn), a Jewish-American veteran who suffered a leg injury during the war and now has a limp. He reminds us that “some things about the war don’t change overnight,” and indeed, the scene immediately shifts to show Nazi flags being torn down, French flags being raised, Parisians standing in a bread line and a Vichy collaborator attacked. Out of that darkness comes Jerry Mulligan, a talented young American artist who decides to stay in Paris after serving in the war, and who catches a glimpse of an enchanting little gamin in a mint green coat. Instantly smitten, he only later will learn she is a ballerina named Lise Dassin. Meanwhile, he becomes friends with Adam and is introduced to Henri Baurel (neatly played by Nick Spangler), the son of a wealthy French textile manufacturer who dreams of being a song-and-dance man. As Jerry will tell us, he has “Beginner’s Luck,” continually running into the enigmatic Lise as if the two were fated for each other, even if she repeatedly resists his entreaties. It is only later that he learns she is to marry Henri, whose proper mother (Gayton Scott) is determined he keep up appearances, even if she senses he is gay. Also in love with Lise is the painfully self-conscious and bumbling Adam, though he knows it is hopeless. It is the long-thwarted romance between Jerry and Lise that dominates the story, and their connection is indisputable for anyone who watches the two dance together, with the tall, impossibly fleet, naturally graceful Maddox almost too expansive for the stage to contain him, and the petite, wonderfully expressive Lise so beguiling in every move that her dancing sings. Of course there are major complications. One is Lise’s devotion to Henri (the secret behind this should not be divulged here). The other is Milo Davenport (a superb performance by Emily Ferranti), a striking American blonde “cougar” who has moved to Paris and become a patroness of the arts. She is hot for Jerry, and tries to seduce him by supporting his career, but Lise has his heart. In scene after scene, with such songs as “I’ve Got Rhythm,” “Fidgety Feet, “I’ll Build a Stairway to Paradise” — realistic moments subtly shift into fantasy dance sequences. The grand finale, set to “An American in Paris,” is a modernist ballet with a Mondrian-inspired design — a quintessential blend of American energy and French elan fused by Wheeldon’s endless invention. Crowley’s perspective-shifting sets and ingenious costumes move in perfect tandem with Wheeldon’s choreography. And Rob Fisher’s terrific musical arrangements are exuberantly played by a first-rate orchestra led by David Andrews Rogers. As Ira Gershwin put it: ‘S Wonderful.
Why do Americans have shorter life expectancy and worse health than do people in other high-income countries? Americans lead shorter and less healthy lives than do people in other high-income countries. We review the evidence and explanations for these variations in longevity and health. Our overview suggests that the US health disadvantage applies to multiple mortality and morbidity outcomes. The American health disadvantage begins at birth and extends across the life course, and it is particularly marked for American women and for regions in the US South and Midwest. Proposed explanations include differences in health care, individual behaviors, socioeconomic inequalities, and the built physical environment. Although these factors may contribute to poorer health in America, a focus on proximal causes fails to adequately account for the ubiquity of the US health disadvantage across the life course. We discuss the role of specific public policies and conclude that while multiple causes are implicated, crucial differences in social policy might underlie an important part of the US health disadvantage.
<reponame>trc492/Frc2011Logomotion /*----------------------------------------------------------------------------*/ /* Copyright (c) FIRST 2008. All Rights Reserved. */ /* Open Source Software - may be modified and shared by FRC teams. The code */ /* must be accompanied by the FIRST BSD license file in $(WIND_BASE)/WPILib. */ /*----------------------------------------------------------------------------*/ #include "AnalogTriggerOutput.h" #include "AnalogTrigger.h" #include "Utility.h" #include "WPIStatus.h" /** * Create an object that represents one of the four outputs from an analog trigger. * * Because this class derives from DigitalSource, it can be passed into routing functions * for Counter, Encoder, etc. * * @param trigger A pointer to the trigger for which this is an output. * @param outputType An enum that specifies the output on the trigger to represent. */ AnalogTriggerOutput::AnalogTriggerOutput(AnalogTrigger *trigger, AnalogTriggerOutput::Type outputType) : m_trigger (trigger) , m_outputType (outputType) { } AnalogTriggerOutput::~AnalogTriggerOutput() { } /** * Get the state of the analog trigger output. * @return The state of the analog trigger output. */ bool AnalogTriggerOutput::Get() { switch(m_outputType) { case kInWindow: return m_trigger->m_trigger->readOutput_InHysteresis(m_trigger->m_index, &status); case kState: return m_trigger->m_trigger->readOutput_OverLimit(m_trigger->m_index, &status); case kRisingPulse: case kFallingPulse: wpi_fatal(AnalogTriggerPulseOutputError); } // Should never get here. wpi_assert(false); return false; } /** * @return The value to be written to the channel field of a routing mux. */ UINT32 AnalogTriggerOutput::GetChannelForRouting() { return (m_trigger->m_index << 2) + m_outputType; } /** * @return The value to be written to the module field of a routing mux. */ UINT32 AnalogTriggerOutput::GetModuleForRouting() { return m_trigger->m_index >> 2; } /** * @return The value to be written to the module field of a routing mux. */ bool AnalogTriggerOutput::GetAnalogTriggerForRouting() { return true; } /** * Request interrupts asynchronously on this analog trigger output. * TODO: Hardware supports interrupts on Analog Trigger outputs... WPILib should too */ void AnalogTriggerOutput::RequestInterrupts(tInterruptHandler handler, void *param) { wpi_assert(false); } /** * Request interrupts synchronously on this analog trigger output. * TODO: Hardware supports interrupts on Analog Trigger outputs... WPILib should too */ void AnalogTriggerOutput::RequestInterrupts() { wpi_assert(false); }
<reponame>vabalcar/Todolister<filename>Todolister/StringUtils.h #pragma once #include <memory> #include <vector> #include <string> #include <set> using namespace std; typedef unique_ptr<string> stringPtr; string toString(char c); vector<string> split(const string& stringToSplit, const string& delimiters); vector<string> preserveSplit(string& stringToSplit, const string& delimiters, set<char> criticalSequenceMarks, char charToPreserve, bool preserveCriticalSequenceMarks); vector<int> parseInts(const string& source, const string& delimiters); vector<int> parseInts(const string& source, const char delimiter); string readLine(istream& in); string readAllLines(istream& in); void toLower(string& s); void toUpper(string& s);
Hemolytic anemia blunts the cytokine response to transfusion of older red blood cells in mice and dogs Transfusion of red blood cells (RBCs) stored for longer durations induces hemolysis and inflammatory cytokine production in murine and canine models. Despite immune system activation by stored RBCs, human randomized trials suggest that fresher RBC transfusions do not improve clinical outcomes. We hypothesized that underlying recipient hemolysis may affect cytokine responses to older RBC transfusions.
/// Run synchronously an instance `fidl_fuchsia_diagnostics/Archive` that allows clients to open /// reader session to diagnostics data. pub async fn send( result_stream: ServerEnd<diagnostics::BatchIteratorMarker>, inspect_data: &String, ) -> Result<(), Error> { let (requests, control) = match result_stream.into_stream_and_control_handle() { Ok(r) => r, Err(e) => { warn!("Couldn't bind results channel to executor: {:?}", e); bail!("Couldn't bind results channel to executor: {:?}", e); } }; if let Err(e) = AccessorServer::new(requests).send(inspect_data).await { e.close(control); } Ok(()) }
Wondermints History The group formed in 1992, and released a vinyl single, "Proto Pretty", which was later compiled on Rhino Records' "Poptopia" series of power pop compilations. They followed this with the albums Wondermints (1995), Wonderful World of the Wondermints (an album of cover versions from 1996), Bali (1998) and Mind If We Make Love to You (2002). Most of these albums were released in Japan prior to release in the United States. The group also contributed to the soundtrack of the first Austin Powers movie at the request of Mike Myers. In 1999, the group signed on to be part of Brian Wilson's touring band. Walusko and Gregory have played with him continuously ever since, with D'Amico only having toured with Wilson in 1999, 2000, 2002, and 2003. When D'Amico left to spend time with his family, he was replaced in 2001 and early 2002 by Andy Paley, and in 2004 by Nelson Bragg. D'Amico rejoined Wilson's band in the summer of 2008, replacing Jim Hines on drums after relieving fellow multi-instrumentalist Scott Bennett of his temporary drumming duties. Sahanaja also missed a few shows in 2003 and 2008, being replaced by Gary Griffin, and in 2016, when Billy Hinsche took his place. All Wondermints can be heard on Wilson's CDs and DVDs Live at the Roxy Theatre, Brian Wilson on Tour, Pet Sounds Live, and Brian Wilson Reimagines Gershwin, with Sahanaja, Walusko, and Gregory also appearing on the Pet Sounds Live in London album and the studio albums Gettin' in Over My Head and Brian Wilson Presents Smile. The band is part of a power pop scene in Los Angeles, many of whose members play on each other's records. All of the members of Wondermints, especially Gregory, have made frequent guest appearances and have several side projects, some of the more notable of which are Love, The Eels, Baby Lemonade, The Negro Problem, Stew and Kim Fox. On August 7, 2019, Walusko died at the age of 59.
Israeli intelligence are scaling down their covert operations in Iran and spy recruitment, Israeli security officials say. This would also imply a cutback in alleged high-profile missions such as assassinations and detonations at missile bases. ­ Senior security officials told TIME magazine that the move was met with “increased dissatisfaction” by Mossad, Israel’s national intelligence agency. One security official said Prime Minister Benjamin Netanyahu was afraid that the operations would get exposed by Iran. The official notes that this fear is primarily driven by Mossad’s failure to assassinate Hamas leader Khaled Mashaal back in 1997, when Netanyahu served his first term as Prime Minister. Western intelligence officials told TIME that Iran had uncovered one cell trained and equipped by Mossad. They also said that the televised confession of Majid Jamali Fashid, who admitted to being an Israeli spy behind the plot to assassinate nuclear scientist Massoud Ali Mohmmadi, was genuine. If similar revelations emerge now, they could undermine the international effort to pressure Iran to give up its nuclear program via sanctions and diplomacy. Iran could effectively blame Israel for an aggressive spy campaign. This could also have ramifications for Israel’s relations with the United States, which has lately been opposed to a preliminary Israeli strike against Iran. Mark Fitzpatrick is a former State Department nuclear proliferation specialist who opposes Israel’s shady spy tactic, which is said to have involved assassinations. ”It undercuts the consensus; the international consensus on [anti-Iran] sanctions,” he stresses. Western intelligence officials’ confirmation of Israel’s involvement in the killing of an Iranian scientist casts doubt on Israel’s claim that it was not involved in the murder of another nuclear scientist, Mostafa Ahmadi Roshan. U.S. President Barack Obama has said that all options are open with regards to Iran. In his meeting with Netanyahu in early March, he called on Israel to refrain from striking Iran and give time for sanctions to work. The U.S. and the EU have imposed sanctions on Iranian oil imports and financial transactions in an effort to convince it to halt its nuclear program. IAEA inspectors have visited Iran on a number of occasions, although teams said they were barred from sites suspected of harboring nuclear weapon development programs. Tehran has maintained that its nuclear program is for peaceful purposes only, but Israel, the United States and many other Western countries debate this. Did the US just break the secret Israeli-Azerbaijani alliance against Iran?
Endothelin During Cardiovascular Surgery: The Effect of Diltiazem and Nitroglycerin Summary: To investigate whether the vasoconstrictor peptide endothelin (ET) is elevated during cardiovascular surgery and might predispose to perioperative vasoconstriction and ischemia, we compared the effect of the calcium channel blocker diltiazem with that of the nitric oxide (NO) donor nitroglycerin on ET and hemodynamics in 32 patients undergoing coronary artery bypass grafting (CABG). Following a double-blind protocol, 16 patients (3 women, 13 men; ages 63 ± 10 years) received 1 g/kg/min nitroglycerin and 16 patients (5 women, 11 men; ages 64 ± 8 years) received 3 n,g/kg/min diltiazem intravenously 30 min before until 12 h after CABG. ET was measured in the superior vena cava before, during, and 1 h after CABG. Compared with ET levels before CABG, ET was significantly elevated during CABG and further increased after CABG (p < 0.05). During and after surgery, ET levels were lower in patients receiving diltiazem than in those receiving nitroglycerin (both p < 0.01). Mean arterial blood pressure and heart rate were lower in patients receiving diltiazem compared with those receiving nitroglycerin (bothp<0.05). These data demonstrate that diltiazem is more effective than nitroglycerin in preventing ET increase during cardiovascular surgery. Studies using ET receptor antagonists may be useful in assessing the clinical relevance of ET levels with respect to the risk for perioperative vasoconstriction and ischemia.
/******************************************************************************* * Copyright (c) 2002, 2015 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at * https://www.eclipse.org/legal/epl-2.0/ * * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ package org.eclipse.ui.internal.cheatsheets.views; import org.eclipse.swt.graphics.Color; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Control; import org.eclipse.swt.widgets.Display; import org.eclipse.ui.forms.widgets.FormToolkit; import org.eclipse.ui.forms.widgets.ScrolledForm; import org.eclipse.ui.forms.widgets.TableWrapLayout; import org.eclipse.ui.internal.cheatsheets.CheatSheetStopWatch; public abstract class Page { protected final static int HORZ_SCROLL_INCREMENT = 20; protected final static int VERT_SCROLL_INCREMENT = 20; // Colors protected Color backgroundColor; protected FormToolkit toolkit; protected ScrolledForm form; public Page() { } public Control getControl() { return form; } public void createPart(Composite parent) { init(parent.getDisplay()); CheatSheetStopWatch.startStopWatch("Page.createInfoArea()"); //$NON-NLS-1$ CheatSheetStopWatch .printLapTime( "Page.createInfoArea()", "Time in Page.createInfoArea() after new FormToolkit(): "); //$NON-NLS-1$ //$NON-NLS-2$ form = toolkit.createScrolledForm(parent); form.setData("novarrows", Boolean.TRUE); //$NON-NLS-1$ form.setText(ViewUtilities.escapeForLabel(getTitle())); form.setDelayedReflow(true); CheatSheetStopWatch .printLapTime( "Page.createInfoArea()", "Time in Page.createInfoArea() after createScrolledForm(): "); //$NON-NLS-1$ //$NON-NLS-2$ GridData gd = new GridData(GridData.FILL_BOTH); gd.widthHint = 10; form.setLayoutData(gd); CheatSheetStopWatch .printLapTime( "Page.createInfoArea()", "Time in Page.createInfoArea() after setLayoutData(): "); //$NON-NLS-1$ //$NON-NLS-2$ TableWrapLayout layout = new TableWrapLayout(); CheatSheetStopWatch .printLapTime( "Page.createInfoArea()", "Time in Page.createInfoArea() after new FormTableWrapLayout(): "); //$NON-NLS-1$ //$NON-NLS-2$ layout.numColumns = 2; // DG - added changes to make the check icon use less space // and to compensate for the fix in section layout // computation that makes it shorter for 3 pixels. layout.leftMargin = 0; layout.horizontalSpacing = 0; layout.verticalSpacing = 3; form.getBody().setLayout(layout); CheatSheetStopWatch .printLapTime( "Page.createInfoArea()", "Time in Page.createInfoArea() end of method: "); //$NON-NLS-1$ //$NON-NLS-2$ } public void dispose() { if (form != null) { form.dispose(); } if (toolkit != null) { toolkit.dispose(); } form = null; toolkit = null; } protected void init(Display display) { toolkit = new FormToolkit(display); backgroundColor = toolkit.getColors().getBackground(); } protected abstract String getTitle(); public abstract void initialized(); }
LAKE WATER QUALITY MONITORING TOOLS Abstract. Lakes as ecosystems provide many goods and services. To benefit from them in long term we must assure sustainable management. SIMILE (informative System for the Integrated Monitoring of Insubric Lakes and their Ecosystems) project is focused on developing efficient monitoring of lake water quality since it gives the critical input for adequate management. The lakes of interest for SIMILE are the Insubric lakes Como, Lugano, and Maggiore. The paper is focused on describing which tools are used in the SIMILE project to exploit different sources of lake water quality data: in-situ high-frequency monitoring (HFM) through sensors, satellite observations, and data collected by citizens. Even though the paper is focused on the SIMILE project, and thus on tools and procedures for the Insubric lakes, it can serve as an example for other lakes too, especially because the tools developed in the project, such as a collaborative platform for sharing satellite-derived water quality parameters, and mobile application and web administrator interface for citizen science, are free and open-source, they can be easily adapted if needed. Moreover, the procedures for the processing of data coming from different sources are based on free (and often also open source) software and are well documented. The tools and procedures described in this paper might be a foundation for similar practice for lakes worldwide, and thus a step forward the 6th Sustainable Development Goal (SDG) of the United Nations (Ensure availability and sustainable management of water and sanitation for all).
from telegram.ext import ConversationHandler from telegram.ext import MessageHandler from telegram.ext import Filters from telegram.ext import CallbackQueryHandler from Model.share import Share import Controllers.global_states as states from Utils.logging import get_logger as log import pandas as pd import datetime GETSUMMARY = range(1) class DividendSummary: def __init__(self, dispatcher): self.__dp = dispatcher self.__handler() def __handler(self): ds_handler = ConversationHandler( entry_points=[CallbackQueryHandler( self.get_ticker, pattern='^' + str(states.DIVIDENDINFO) + '$')], states={ GETSUMMARY: [ MessageHandler(Filters.text, self.get_dividend_summary) ], }, fallbacks=[] ) self.__dp.add_handler(ds_handler) @staticmethod def get_ticker(update, context): user = update.effective_user log().info("User %s pressed the dividend summary button.", user.first_name) query = update.callback_query query.answer() query.edit_message_text( text="Enter ticker symbol (e.g D05)") return GETSUMMARY @staticmethod def get_dividend_summary(update, context): ticker = update.message.text user = update.effective_user log().info("User %s entered ticker value %s.", user.first_name, ticker) years = 5 share = Share(ticker) if not share.is_valid: update.message.reply_text("Invalid ticker. Please use /start to go back to the main menu") log().info("User %s entered an invalid ticker value %s.", user.first_name, ticker) return ConversationHandler.END a = share.get_dividend_summary(datetime.datetime.now().year, datetime.datetime.now().year - years) s = '<b>' + share.name + '</b>\n\n' for item in a: s += '<b>' + str(item.year) + ' (' + str(item.total) + ')</b>' + '\n' i = 1 for pay_date, pay_amount in zip(item.pay_date, item.amount): if pay_date == '-': continue s += pd.to_datetime(pay_date).strftime('%d %B') + ': ' + str(pay_amount).replace('SGD', 'SGD ') +'\n' i += 1 s += '\n' update.message.reply_text(s, parse_mode='HTML') return ConversationHandler.END
<reponame>map7000/ignite /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.ignite.configuration; import java.io.Serializable; import org.apache.ignite.internal.util.typedef.internal.A; /** * This class allows defining system data region configuration with various parameters for Apache Ignite * page memory (see {@link DataStorageConfiguration}. * This class is similiar to {@link DataRegionConfiguration}, but with restricted set of properties. */ public class SystemDataRegionConfiguration implements Serializable { /** Serial version uid. */ private static final long serialVersionUID = 0L; /** Default initial size in bytes of a memory chunk for the system cache (40 MB). */ public static final long DFLT_SYS_REG_INIT_SIZE = 40L * 1024 * 1024; /** Default max size in bytes of a memory chunk for the system cache (100 MB). */ public static final long DFLT_SYS_REG_MAX_SIZE = 100L * 1024 * 1024; /** Initial size in bytes of a memory chunk reserved for system cache. */ private long initSize = DFLT_SYS_REG_INIT_SIZE; /** Maximum size in bytes of a memory chunk reserved for system cache. */ private long maxSize = DFLT_SYS_REG_MAX_SIZE; /** * Initial size of a data region reserved for system cache. * * @return Size in bytes. */ public long getInitialSize() { return initSize; } /** * Sets initial size of a data region reserved for system cache. * * Default value is {@link #DFLT_SYS_REG_INIT_SIZE} * * @param initSize Size in bytes. * @return {@code this} for chaining. */ public SystemDataRegionConfiguration setInitialSize(long initSize) { A.ensure(initSize > 0, "System region initial size should be greater than zero."); this.initSize = initSize; return this; } /** * Maximum data region size in bytes reserved for system cache. * * @return Size in bytes. */ public long getMaxSize() { return maxSize; } /** * Sets maximum data region size in bytes reserved for system cache. The total size should not be less than 10 MB * due to internal data structures overhead. * * Default value is {@link #DFLT_SYS_REG_MAX_SIZE}. * * @param maxSize Maximum size in bytes for system cache data region. * @return {@code this} for chaining. */ public SystemDataRegionConfiguration setMaxSize(long maxSize) { A.ensure(maxSize > 0, "System region max size should be greater than zero."); this.maxSize = maxSize; return this; } }
package com.jarntang.genertor.ui; import com.jarntang.genertor.DataStorage.Configuration; import com.jarntang.genertor.core.GenerateService; import com.jarntang.genertor.core.model.CodeInfo; import com.jarntang.genertor.util.FileUtils; import java.nio.file.Paths; import java.util.List; import java.util.Set; /** * select table model. * * @author qinmu * @since 2017/07/20 16:51 */ public class SelectTableModel { Set<CodeInfo> genCode(Configuration dbConfig, Set<String> selectTableNames) { GenerateService service = new GenerateService(); return service.generate(dbConfig, selectTableNames); } boolean exist(String file) { return Paths.get(file).toFile().exists(); } void writeToFile(CodeInfo code) { FileUtils.write(code.getFileName(), code.getJavaCode()); } }
Panitumumab Use in Metastatic Colorectal Cancer and Patterns of KRAS Testing: Results from a Europe-Wide Physician Survey and Medical Records Review Background From 20082013, the European indication for panitumumab required that patients tumor KRAS exon 2 mutation status was known prior to starting treatment. To evaluate physician awareness of panitumumab prescribing information and how physicians prescribe panitumumab in patients with metastatic colorectal cancer (mCRC), two European multi-country, cross-sectional, observational studies were initiated in 2012: a physician survey and a medical records review. The first two out of three planned rounds for each study are reported. Methods The primary objective in the physician survey was to estimate the prevalence of KRAS testing, and in the medical records review, it was to evaluate the effect of test results on patterns of panitumumab use. The medical records review study also included a pathologists survey. Results In the physician survey, nearly all oncologists (299/301) were aware of the correct panitumumab indication and the need to test patients tumor KRAS status before treatment with panitumumab. Nearly all oncologists (283/301) had in the past 6 months of clinical practice administered panitumumab correctly to mCRC patients with wild-type KRAS status. In the medical records review, 97.5% of participating oncologists (77/79) conducted a KRAS test for all of their patients prior to prescribing panitumumab. Four patients (1.3%) did not have tumor KRAS mutation status tested prior to starting panitumumab treatment. Approximately one-quarter of patients (85/306) were treated with panitumumab and concurrent oxaliplatin-containing chemotherapy; of these, 83/85 had confirmed wild-type KRAS status prior to starting panitumumab treatment. All 56 referred laboratories that participated used a Conformit Europenne-marked or otherwise validated KRAS detection method, and nearly all (55/56) participated in a quality assurance scheme. Conclusions There was a high level of knowledge amongst oncologists around panitumumab prescribing information and the need to test and confirm patients tumors as being wild-type KRAS prior to treatment with panitumumab, with or without concurrent oxaliplatin-containing therapy. Introduction Anti-epidermal growth factor receptor (EGFR) monoclonal antibodies (mAbs), such as panitumumab (Vectibix 1, a recombinant, fully human IgG2 mAb) and cetuximab (Erbitux 1, a recombinant, chimeric mouse/human IgG1 mAb), bind with high affinity and specificity to the EGFR, and have been shown to be effective across all lines of treatment in metastatic colorectal cancer (mCRC). Reports of improved efficacy with panitumumab and cetuximab in patients with wild-type versus mutant or unknown KRAS exon 2 status led to the requirement for physicians to determine a patient's tumor KRAS mutation status prior to starting treatment with EGFR inhibitors. Physicians can now determine the most appropriate treatment option for individual patients with mCRC, based upon the molecular profile of their tumor. Panitumumab was first approved in Europe in December 2007 as monotherapy to treat patients with wild-type KRAS exon 2 mCRC who had failed on prior fluoropyrimidine-, oxaliplatin-, and irinotecan-containing chemotherapy regimens, based upon phase III clinical data. Educational materials for panitumumab have been distributed to physicians since 2009, making them aware of the appropriate prescribing information and the need for KRAS mutation status to be determined by an experienced laboratory prior to prescribing panitumumab. In November 2011, data from two additional phase III studies led to the European panitumumab license being expanded to include use in patients with wild-type KRAS exon 2 mCRC in the first-line setting combined with FOLFOX, and the second-line setting combined with FOLFIRI. Within the panitumumab licensed indication, concurrent treatment with oxaliplatin-containing chemotherapy in patients with mutant or unknown KRAS mCRC status was contraindicated, due to detrimental effects on progression free survival and overall survival. Previous physician surveys have found that in 2010, when guidelines first recommended testing for KRAS status, the adoption of KRAS testing prior to treating patients with EGFR inhibitors varied widely. In 2010, 73% (326/448) of participating physicians in Europe reported undertaking appropriate KRAS testing when mCRC was diagnosed, compared with 63% (160/256) in Latin America and 20% (28/139) in Asia. However, there was a rapid and widespread adoption of KRAS testing prior to treating patients with EGFR inhibitors (3% in 2008; 47% in 2009; 69% in 2010), with results available quickly (within 15 days) for more than 80% of patients. In the US, a survey carried out in 2010 reported that of 1,242 physicians responding, only one-fifth of those who had treated mCRC had ordered or recommended KRAS testing. In contrast in another study, a more targeted identification of oncologists treating mCRC found that in 2010 all oncologists (34/34) tested tumor KRAS status. Serono, F. Hoffmann-La Roche, Bayer and Sanofi. LM has acted in an advisory role and speaker's bureau for Amgen Ltd., Merck Serono, Sanofi, F. Hoffman-La Roche, Baxter and Fresenius. JTo has acted in an advisory role and in speakers' bureaus for Amgen Ltd., Merck Serono, F. Hoffmann-La Roche and Bayer. ER has acted in an advisory role for AstraZeneca and Glaxo Wellcome, received a grant as a speaker for AstraZeneca, and has received research funding from F. Hoffmann-La Roche and Amgen Ltd. PF has participated in advisory boards for Amgen and Pfizer and has received honoraria as a speaker for Amgen Ltd., Merck Serono, Astra Zeneca, F. Hoffmann-La Roche and Pfizer. GdM has no relevant disclosures. PG-A has acted in an advisory role and in speakers' bureaus for Amgen Ltd., Merck Serono, F. Hoffmann-La Roche, Bayer and Sanofi, and has also received research funding from F. Hoffmann-La Roche and Bayer. GA has acted as a speaker for Amgen Ltd., Merck Serono, F. Hoffmann-La Roche, Sanofi, and Lilly. AT is a compensated employee of Amgen Ltd. as an Observational Research Medical Director and a stockholder in Amgen Ltd. GK is a compensated employee of Amgen Ltd. as an Observational Research Senior Manager and a stockholder in Amgen Ltd. GD is a compensated employee of Amgen Ltd. as a Biostatistics Senior Manager and a stockholder in Amgen Ltd. J-HT is a compensated employee of Amgen Ltd. as the Medical Director of Switzerland and a stockholder in Amgen Ltd. JHvK has participated in advisory boards for Amgen Ltd., Merck Serono, GlaxoSmithKline, and Sakura, and has received honoraria and research grants from these companies. This does not alter the authors' adherence to PLOS ONE policies on sharing data and materials. Medical records review studies carried out in 2010 reported that over 94% of patients were being tested for tumor KRAS status prior to being treated with EGFR-targeted therapies. In 93 sites from France, 94% of 1,044 patients being treated with cetuximab for CRC had been tested for tumor KRAS status, with wild-type KRAS confirmed in 95% of tested patients. In the US, there was rapid uptake of KRAS tumor testing by 2010 in one study, with 97% of 1,188 patients with mCRC being tested in 2010 compared with 7% of patients being tested in 2006. In order to evaluate physician awareness of the prescribing information for panitumumab and how physicians prescribe panitumumab in Europe, two studies were initiated in 2012: a physician survey evaluating oncologists' knowledge of the licensed indication for panitumumab, and a medical records review of patients with mCRC treated with panitumumab to evaluate how oncologists prescribe panitumumab. The first two rounds focused upon KRAS exon 2 status and are reported here. In July 2013, based upon improved outcomes in patients with wild-type versus mutant or unknown tumor RAS status, the European license for panitumumab was refined to target panitumumab treatment to patients with wild-type RAS mCRC. The ongoing third and final rounds of each study are focusing on tumor RAS (KRAS exons 2/ 3/4 and NRAS exons 2/3/4) testing, and will be reported separately in a future publication. Both studies will help to understand the level of acceptance of tumor KRAS/RAS testing by clinicians during their decision processes around treating with panitumumab. Study participants A physician survey and a medical records review were designed in Europe: both were multicountry, cross-sectional, observational studies with practicing oncologists who had prescribed panitumumab to mCRC patients in the previous 6 months. Rounds 1 and 2 (evaluating KRAS testing) were conducted between September 2012 and December 2013. Round 3 (evaluating RAS testing) is currently being conducted for both studies in 2014 and 2015. In Round 1, physicians in five countries (France, Germany, Italy, Spain, and the Czech Republic) were invited to participate. Four additional countries (Belgium, Denmark, The Netherlands, and Sweden) were included in Round 2 to increase representation of countries in Europe. In both rounds of each study, physicians were screened by telephone using standardized questionnaires to determine eligibility. The sampling list used in Round 1 was based on a healthcare industry database provider (Cegedim) medical marketing database and included physician contact details that were not filtered by specialty. Physicians were randomly selected for inclusion in the study from this list. The inclusion of physicians who were not oncologists in the study population partly explains the low response rate observed in Round 1 of the study. In Round 2 of the medical chart review the sampling list used included the medical marketing database filtered by specialty in addition to lists of colorectal cancer physicians. This approach allowed for a more targeted sampling of oncologists and led to a higher physician response rate in Round 2 of the chart review than observed in Round 1. In order to obtain data on pathology testing, participating oncologists in the medical records review study were asked permission for the investigator to approach the pathology laboratories which carried out KRAS mutation tests, in order to send them a pathology survey to complete. Study protocols and informed consent forms (ICF) were reviewed and approved by the local Institutional Review Board or Ethical Review Board in each country before the studies began, as required. As agreed with the ethical committees, in France and The Netherlands signed ICFs were not required, only verbal ICF (recorded in the patient's file). ICFs were required in Germany (reviewed and approved by the Ethik-Kommission der Bayerischen Landesrztekammer), Italy (reviewed and approved by the EC Azienda AOU S. Maria della Misericordia di Udine), Spain (reviewed and approved by the Comite Etico de Investigacion Clinica H.G.U. Gregorio Maranon), Czech Republic (reviewed and approved by the Eticka Komise Masarykova Onkologickeho Ustavu, Brno), Belgium (reviewed and approved by the Medical Ethics Committee des Cliniques Saint-Joseph, Liege) and Sweden (reviewed and approved by the Regional Ethic Committee Board in Sweden-Karolina Institutet/ Solna). Ethics Committee approval was not required in Denmark, but a signed ICF was required in all Danish sites. Inclusion criteria for participating physicians Physician survey. Practicing oncology specialists were eligible if they had treated at least five (Round 1) or three (Round 2) new or continuing patients with mCRC in the last 3 months and prescribed panitumumab in the previous 6 months. Medical records review. Practicing oncologists who had treated at least five (Round 1) or three (Round 2) new or continuing patients with mCRC in the last 3 months, and had prescribed panitumumab to treat new or continuing patients with mCRC in the past 6 months were eligible. Only one oncologist per medical center could participate for each round of the study. Exclusion criteria for participating physicians In Round 2 of each study, physicians were excluded if they had already taken part in Round 1. Physicians were excluded from the physician survey if they had taken part in the medical record review (Round 1 or 2). Physicians were excluded from the medical record review if they had taken part in the physicians survey (Round 1 only). Note that in Round 2 of the medical records review, a more targeted sampling of oncologists was introduced with physicians from specialties that do not treat mCRC being excluded. In addition, in both studies, the number of new or continuing patients with mCRC requiring treatment in the last 3 months was reduced from at least five in Round 1, to at least three in Round 2. These changes were introduced in order to improve physician response rates. Inclusion criteria for patients In the medical records review, eligible patients must have received panitumumab (outside of a clinical trial setting) for the treatment of mCRC during the 6-month period prior to the time when medical records were obtained, and have provided written consent to allow access to their medical records (if local laws required it). Informed consent was obtained from a legally acceptable representative of deceased patients, where necessary, to allow access to their medical records for the purpose of this study. Study objectives Physician survey. The primary objective is to assess oncologists' knowledge of the appropriate licensed indication for panitumumab in mCRC patients regarding tumor KRAS status in selected European countries. Specific primary objective measures are to evaluate oncologists' knowledge: of the licensed indication for panitumumab, which is for the treatment of patients with wild-type KRAS mCRC in first line combined with FOLFOX, in second line combined with FOLFIRI in patients who have received first-line fluoropyrimidine-based chemotherapy (excluding irinotecan), and as monotherapy after failure of fluoropyrimidine-, oxaliplatin-, and irinotecan-containing chemotherapy regimens; that testing tumor KRAS mutation status should be performed prior to starting treatment with panitumumab; that panitumumab is not indicated for mCRC patients with mutant or unknown KRAS tumor status; that panitumumab should not be administered in combination with oxaliplatin-containing chemotherapy in mCRC patients with mutant or unknown KRAS tumor status. An additional objective measure is to characterize the results of the survey in each round to evaluate whether there are any differences between rounds. Medical records review. The primary objective is to estimate the prevalence of KRAS testing and the impact of KRAS test results on patterns of panitumumab use in patients with mCRC treated with panitumumab in selected European countries, following changes in the licensed indication regarding the risk of panitumumab use in mCRC patients with mutant KRAS tumors. The primary objective measures include: the estimated proportion of patients with mCRC tested for KRAS status prior to treatment with panitumumab; the proportion of tested patients treated with panitumumab who had mutant, wild-type, or unknown tumor KRAS status; the estimated proportion of patients with mCRC tested for KRAS status prior to treatment with panitumumab who were treated concurrently with oxaliplatin-containing chemotherapy; the proportion of tested patients treated with panitumumab concurrently with oxaliplatin-containing chemotherapy who had mutant, wild-type, or unknown tumor KRAS status. Secondary objective measures include the estimated proportion of: oncologists who agree to participate in the study; oncologists who conduct a KRAS test prior to prescribing panitumumab (in those patients with mCRC who had been treated with panitumumab); laboratories that tested mCRC KRAS status for those patients who were treated with panitumumab who i) participate in the European Society of Pathology (ESP) Quality Assurance (QA) Scheme, or are certified by an ESP-approved accreditation body, and ii) use a Conformit Europenne (CE)-marked or otherwise validated KRAS detection method. An additional objective measure is to characterize the results of each round of the medical records review, and to evaluate whether there are any differences between rounds. Data collection Physician survey. In each round of survey, telephone interviews with eligible participating oncologists were conducted by trained study staff using a standardized questionnaire and following consistent procedures and data collection. The questionnaire was carefully translated to ensure that the content and the way of asking questions was consistent across countries. Two pilot interviews were conducted in each country in Round 1 to ensure that all questions were well targeted and correctly understood; questions were reviewed and modified as needed, depending on the outcome of the pilot interviews. Medical records review. Medical information relating to panitumumab (including but not limited to 3 months before and after the first dose of panitumumab) and tumor KRAS testing was abstracted and anonymized at the site from medical records for transfer into standardized electronic case report forms. Abstracted and anonymized data were checked by trained data extractors prior to being included in the data analysis. Two pilot abstractions were conducted in each country prior to Round 1, to ensure all questions were well targeted and correctly understood, with modifications made as required. Statistical analysis In both studies, no formal hypothesis testing was conducted and the data analysis was descriptive in nature. For the categorical study endpoints described above, the count and proportion (%) in each category, based on the appropriate denominator, were calculated. The 95% confidence intervals for the proportions are based on a normal approximation to the binomial distribution. Results Physician response rate and baseline characteristics Physician survey. There were low responses in the first two rounds of the physician survey, with 10.8% (441/4,075) of physicians responding to the screening questionnaire ( Fig 1A). Medical records review. In Round 1, low responses to the screening questionnaire (8.6%; 105/1,218) were observed ( Fig 1B). However, in Round 2 response rates increased (60.9%; 56/ 92) as a result of changes in methodology and inclusion criteria outlined in the Methods section, with all 56 oncologists responding to the screening questionnaire being eligible (40 were not eligible in Round 1). Three hundred and six patient records from the 79 participating oncologists in both rounds of the medical records review were evaluated. Two-thirds of patients were male (66.7%; 204/ 306), and approximately one-quarter (23.9%; 73/306) were 75 years of age or older (Table 2). Just over one-quarter were receiving concurrent panitumumab and oxaliplatin-containing therapy (27.8%; 85/306) ( Table 2). Physician's understanding of who, and how, to treat with panitumumab Physician survey results: Awareness of the licensed indication and testing for KRAS status before starting treatment with panitumumab. Nearly all oncologists were aware of the need to test patients with mCRC for KRAS status before treatment with panitumumab (99.3%; 299/301) ( Table 3). Of the two remaining oncologists, one did not consider KRAS testing to be appropriate, and the other provided no response. Nearly all oncologists (99.0%; 298/301) were aware of the correct indication for panitumumab for treatment of mCRC patients with wildtype KRAS tumors; two oncologists responded for the treatment of patients with mutant mCRC KRAS tumors, and one gave an invalid multiple response. Almost all (97.7%; 294/301) oncologists were aware of all their patients' tumor KRAS status prior to treatment with panitumumab (Table 3). Six oncologists were unaware of their patients' tumor KRAS mutation status prior to treatment with panitumumab, and the other gave a missing response. Correct administration of panitumumab: Nearly all oncologists (94.0%; 283/301) had administered panitumumab correctly to all their mCRC patients in the past 6 months of clinical practice (those with known wild-type KRAS status prior to first dose of panitumumab) ( Table 3). Of the responses from the remaining 18 oncologists, 15 (5.0%) had administered panitumumab to at least one patient with mutant or unknown KRAS status in the past 6 months of clinical practice, two (0.7%) were unsure, and one (0.3%) gave a missing response. The most frequent influencing factors cited for treating patients with mutant KRAS status were the patient's medical status (n = 8) and other (n = 6: not concerned with KRAS mutation type It should be noted that multiple reasons could be given. Of the 301 participating oncologists, 164 (54.5%) had administered panitumumab concurrently with oxaliplatin-containing therapy to at least one mCRC patient in the past 6 months of routine clinical practice (Table 3). Of these, 10 (6.1%) oncologists had administered panitumumab simultaneously with oxaliplatin-containing chemotherapy to mCRC patients with KRAS status mutant or unknown, and one oncologist was unsure (Table 3). There was no indication from the free-text responses that these oncologists were unaware of the contraindication of administering panitumumab simultaneously with oxaliplatin-containing chemotherapy to mCRC patients with tumor KRAS status unknown. Differences in survey responses between rounds: There were no noticeable differences in the results obtained for the physician survey between Rounds 1 and 2. Three (1.0%) of the 302 patients tested for KRAS tumor status prior to their first dose of panitumumab had mutant (n = 2) or unknown (n = 1) KRAS status (none were receiving concurrent oxaliplatin-containing therapy (Table 4). How oncologists treat patients with panitumumab based upon KRAS testing Testing patients' tumors for KRAS status prior to treatment with panitumumab and concurrent oxaliplatin-containing chemotherapy: Approximately one quarter of patients (27.8%; 85/ 306) were treated with panitumumab and concurrent oxaliplatin-containing chemotherapy, with nearly all of these patients (97.6%; 83/85) having a confirmed wild-type KRAS result prior to starting treatment (Table 4). Differences in medical record review responses between rounds: There were no noticeable differences in the results obtained for the medical records review study between Rounds 1 and 2. One oncologist responded that KRAS testing was not appropriate (Round 1), and one oncologist did not respond (Round 2). Discussion In the physician survey, amongst participating oncologists, nearly all those surveyed in 2012 and 2013 (99.3%; 299/301) were aware of the need to test tumor KRAS status before administration of panitumumab to patients with mCRC. Nearly all oncologists (94.0%; 283/301) had administered panitumumab correctly to all of their mCRC patients with wild-type KRAS status, according to the label, in the past 6 months of clinical practice. In the medical records review, nearly all oncologists (97.5%) conducted a KRAS test for all of their patients prior to prescribing panitumumab. Importantly, tumor KRAS status was known in nearly all (98.7%) patients prior to prescribing panitumumab (with or without oxaliplatin-containing therapy), with tumor wild-type KRAS confirmed in 97.7% of patients. All corresponding laboratories that responded to the pathologist survey used validated KRAS testing methods, and regularly checked their testing methods versus QA schemes in place. Fifteen of the 301 oncologists in the physician survey said that in the last 6 months of clinical practice they had administered at least once panitumumab to mCRC patients when the KRAS result was mutant or unknown. This proportion (5%) is higher in the survey than in the chart review study in which 1% of the patients had mutant or unknown KRAS results at the initiation of panitumumab treatment. The physician survey records the number of physicians who had administered panitumumab outside the label indication once or more in the last 6 months and therefore, did not capture the number patients treated according to the label as the chart review did. Oncologists quoted a number of reasons for prescribing panitumumab (with or without concurrent oxaliplatin-containing therapy) to patients with mutant or unknown KRAS status, with the most frequent influencing factors being the patients' medical condition, that they were unconcerned by KRAS mutation status, the availability of tumor tissue, and the time taken for KRAS test results to be received. It appears that on rare occasions physicians are using their clinical judgment and they do not adhere with the guidelines despite that they seem to have a good knowledge of the label indication. Characteristics of patients such as co-morbidity is a factor that has been shown in the past to influence physicians implementation of clinical guidelines. Low response rates are not uncommon for physician telephone surveys. A physician survey carried out in 12 countries assessing their knowledge and application of COPD showed that contacting physicians by telephone had low response rate (USA 10%, Italy 21%). A telephone survey amongst neurologists in 12 European countries to assess awareness of clinical guidelines had a response rate of 27.2%. Low response rates also occur in chart review studies, with 10% of invited physicians participating in a US-based community chart review study, and 34% of invited urologists participating in a retrospective on-line chart review. The sampling list used for the physicians' survey and Round 1 of chart review was based on a medical marketing database and included physician contact details that were not filtered by specialty. The inclusion of physicians who were not oncologists in the initial study population may give an underestimate of the true response rate observed in the study. For Round 2 of the chart review study a more targeted method of sampling was used where the medical marketing database was filtered by specialty. With the different sampling methods used and the similarities in baseline characteristics of physicians between rounds, the results are considered to be representative of oncologist prescribing practice in Europe and any perceived selection bias resulting from the low response rate is unlikely to be impacting the study results. Responding and non-responding physicians have been found to have similar demographic characteristics, perhaps due to the high level of homogeneity in the physician population (comparable education, socio-economic status, etc.) , respectively) than screened oncologists who were not eligible for the study. Approximately three quarters of physicians could recall receiving educational materials on KRAS testing and this result was encouraging. Overall, we consider that the participating oncologists were likely to be representative of those treating mCRC patients in the EU. Within the EU, individual countries are likely to have their own strategies for improving the care of patients with mCRC. In general there should be equal access to treatments and a need to develop platforms that enable patients to receive the most appropriate treatment (e.g. molecular genetics and testing). Within individual countries, the proportion of patients treated in each type of facility (institution / hospital / private practice) will differ, and the use of KRAS testing may also vary between facility types. In the physician survey, we have shown that by 2012, the percentage of participating physicians adopting tumor KRAS testing was nearly 100% in Europe. Previous physician surveys in 2010 following published guidance recommending the adoption of KRAS testing prior to EGFR-targeted treatment found that the range of adoption varied widely (20-100%) across countries. In Europe in 2010, physicians used clinical judgment when deciding whether or not to test mCRC KRAS status prior to treatment with EGFR-targeted therapies, with 73% of participating physicians testing mCRC KRAS status prior to prescribing EGFR-targeted therapies. Of those specialists who did not test KRAS status, reasons cited were that the tests were not considered relevant for the patients (47%) or the specialist was unfamiliar with the test (40%). In Round 3 of the physician survey, more information regarding influencing factors will be collected to gain as much insight as possible into why, on rare occasions, physicians might prescribe panitumumab to patients with mutant or unknown RAS tumor status. The data we report in our medical records review are supported by previous studies, which showed that, in 2010, physicians were beginning to adopt KRAS testing prior to EGFR-targeted treatment following published guidance. Of those specialists in France who did not test KRAS status, reasons for not testing were that the patient had received prior anti-EGFR-treatment (63% of patients) or there was an absence of tumor/technical issues (27% of patients). Interestingly, in the US in 2010, of those patients with mutant KRAS tumor status, only 86% were not treated with EGFR-targeted therapies, suggesting that 14% received anti-EGFR-treatment. In comparison, by 2012 in our medical records review, 1% (3/302) of patients tested for KRAS tumor status prior to their first dose of panitumumab had mutant or unknown KRAS status (none were receiving concurrent oxaliplatin-containing therapy). We have shown that by 2012 in Europe, there was a high level of knowledge amongst oncologists around the need to test and confirm patients' mCRC tumors as being wild-type for KRAS prior to treatment with panitumumab, with or without concurrent oxaliplatin-containing therapy. Nearly all oncologists surveyed followed the licensed indication for panitumumab, but a minority still used their clinical judgment when deciding whether to treat patients with mutant or unknown KRAS mCRC status. While their decisions conflict with current prescribing information, discussions between individual physicians and their patients around the risks and benefits (e.g. additional biopsy, denial of treatment) may contribute to these decisions. Both studies report very good compliance with the licensed indication for panitumumab in terms of KRAS testing at the time of Rounds 1 and 2 of the studies. There was also a very good level of knowledge amongst oncologists around the need to test and confirm wild-type KRAS tumor status prior to treatment with panitumumab, with or without concurrent oxaliplatincontaining therapy. Nearly all patients treated with panitumumab (with or without concurrent oxaliplatin-containing therapy) had wild-type KRAS tumor status confirmed prior to first dose. It is important that tests for predictive molecular markers such as KRAS are carried out using validated tests in accredited laboratories that have quality controls in place. All participating laboratories used a CE-marked or otherwise validated KRAS detection method, and nearly all participated in a QA scheme. In Round 3 of the physician survey and medical records review, which is evaluating knowledge of the need to test for an expanded number of RAS mutations prior to treating with panitumumab, the physician questionnaires will capture additional free-text details to describe the oncologists' rationale that led to patients with mutant or unknown tumor RAS status receiving panitumumab. Distribution of the educational materials continues. Data from Round 3 for both studies evaluating RAS testing are awaited with interest.
Indigenous device for in circuit delivery of bronchodilator drugs through A 44-year-old, 70 kg, female, mother of two, with dysfunctional uterine bleeding was posted for endometrial ablation. The patient was apparently fine prior to 10 years, when she noticed increased blinking of eyes and some facial movements, which gradually spread and involved her whole body since the last three to four years. The movements were more in the extremities and patient could not sit still in one place. The movements were less during sleep. She would do most of her household work. This patient with normal vitals and a normal cardiorespiratory system had apparently normal higher functions. cases per million worldwide is a fatal autosomal dominant disorder characterised by progressive motor, emotional and cognitive dysfunction caused by mutation in the Huntington's gene. The onset is typically between 35 and 45 years and the duration averages 17 years from the time of diagnosis to death. The clinical diagnosis can be readily made in cases with positive family history of an insidious onset of chorea, dementia and emotional symptoms. We share our experience of managing such a rare case in our day-to-day practice. A 44-year-old, 70 kg, female, mother of two, with dysfunctional uterine bleeding was posted for endometrial ablation. The patient was apparently fine prior to 10 years, when she noticed increased blinking of eyes and some facial movements, which gradually spread and involved her whole body since the last three to four years. The movements were more in the extremities and patient could not sit still in one place. The movements were less during sleep. She would do most of her household work. This patient with normal vitals and a normal cardiorespiratory system had apparently normal higher functions. As the procedure was restricted to the uterus we decided to conduct neuraxial blockade. The patient was prepared for the procedure after explaining the details. Oral diazepam 5 mg and IV ondensetron were administered 45 minutes prior. Continuous arm movements made securing of the IV line a difficult task; it was then doubly fixed and fluids infused. The monitors were firmly attached. Her continuous body movements made it difficult for us to give her the required position for spinal anaesthesia. She was made to sit at the edge of the operating table with her legs hanging down and two OT attendants holding her firmly to make lumbar puncture possible. We could get dural puncture at the very first instant, with a 25 gauge needle. 2.8 ml of heavy bupivacaine was then injected to achieve analgesia up to the T8 level. The procedure lasted 50 minutes. Oxygen was administered and no sedative or hypnotic was given. Vitals were stable throughout and no vasopressors were used. She continued to have movements of both her arms and head throughout the procedure, but not of the lower extremities. In the recovery room, she gradually regained the sensations in the anaesthetised parts and within three-and-a-half hours the preoperative movements appeared in the lower limbs. She had an uneventful hospital stay till her discharge on the fourth postoperative day. There are few case reports published describing the anaesthetic management of patients with Huntington's chorea. Major concerns in management are potential difficult airway, sleep apnoea, risk of aspiration and altered reactions to various drugs. For general anaesthesia, propofol, short-acting neuromuscular agents, nitrous oxide, sevoflurane combined with an opiod and droperidol are safe. Although reported experience with regional analgesia is sparse, spinal anaesthesia has been successfully administered. Reviewed literature showed a higher possibility of complications with general anaesthesia; hence we opted for a neuraxial blockade. The movements of lower limbs slowly reappeared once the effect of the drug wore off. This could be explained, as the pathology in HD lies in the brain and all the pathways are blocked when the neuraxial block is achieved. Sir, Nebulized bronchodilator drugs are commonly used in Letters to Editor mechanically ventilated patients but are expensive, provide a possible source of contamination and require adjustments in minute ventilation during delivery. In contrast drugs administration by MDI is easier, faster and provides cost-effective drug delivery. But the direct delivery of the drug into the circuit with MDI is difficult and may be inefficient. Syringe actuated MDI have been described in past but they may be associated with loss of drug because of impaction on the syringe and catheter walls and mucosal injury due to impact of propellant on the tracheal mucosa. We describe a simple, indigenous, cheap device which can be used to deliver bronchodilator drugs to the tracheobronchial tree in intubated patients in circuit without leaks . The nozzle of MDI is removed, smoothened and drilled into a standard right angle connector and fixed with a screw. This assembly is then sterilized before use. The distal end of this angle connector is attached to corrugated catheter mount for flexibility and ease of use. The patient end can be connected to the ETT when required. This device is easy to use and saves times so, can be handy in emergency situations. We are keeping this device on our emergency trolley and can deliver the bronchodilator drugs to the patients in few seconds with simple sequence pick -attach and deliver. This device has been successfully used by us -on many occasions to save patients life intraoperatively and in intubated ICU patients. Boneless occiput and awake fibreoptic intubation in lateral position DOI: 10.4103/0019-5049.65355 Sir, Tracheal intubation with a patient in a lateral position is not a routine procedure. The use of a laryngeal mask airway (LMA) has been suggested for difficult airway situations with a patient in a lateral position. Tracheal intubation using fibreoptic bronchoscope remains an alternative. However, awake fibreoptic intubation with a patient placed lateral has never been described. Nathanson and colleagues suggested such a concept in a manikin. An 18-year-old male with operated 'suboccipital intra-diploic subarachnoid cyst' was scheduled for ventriculoperitoneal shunt (VP) surgery. He underwent two different surgeries under general anaesthesia (GA), 10 days prior. In the first procedure, craniotomy and de-roofing of the suboccipital cyst was carried out. Four days later, the patient developed intra-diploic pseudomeningocoele with the sub-galeal collection of CSF for which a sub-galeo-peritoneal shunt was inserted. In both the occasions, the airway was secured
Height extrapolation of fire resistant nonloadbearing steel framed walls A review of height extrapolation methods used in the past, by BRANZ, has shown that complex techniques based on temperature rises inducing deflections, curvature and detachment of studs from channels can be reduced to a simple empirical formula. Given that a wall system comprising a certain stud and lining configuration has to be proven by a fire resistance test, a premise that the same or closely similar thermal and structural conditions will be reproduced within the wall is the basis of the proposed method. Four key features (of height, stud depth, lining and temperature difference across the studs) affecting the general performance of a wall were examined to determine some key dependencies and isolate irrelevant parameters from further consideration. This approach was possible by taking a macroscopic view of a system as a whole, and by assuming for all height and stud depth combinations of a given system that the behaviour is similar and predictable to a high degree. Copyright © 2002 John Wiley & Sons, Ltd.
<gh_stars>0 package util import ( // nolint:gosec "crypto/sha1" "crypto/sha256" "encoding/json" "fmt" "net/http" "regexp" "strings" "sync/atomic" "time" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/credentials" "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/service/s3/s3manager" retailcrm "github.com/retailcrm/api-client-go/v2" v1 "github.com/retailcrm/mg-transport-api-client-go/v1" "github.com/retailcrm/mg-transport-core/v2/core/config" "github.com/retailcrm/mg-transport-core/v2/core/logger" "github.com/retailcrm/mg-transport-core/v2/core/util/errorutil" ) var ( markdownSymbols = []string{"*", "_", "`", "["} slashRegex = regexp.MustCompile(`/+$`) ) var DefaultScopes = []string{ "integration_read", "integration_write", } var defaultCurrencies = map[string]string{ "rub": "₽", "uah": "₴", "byn": "Br", "kzt": "₸", "usd": "$", "eur": "€", "prb": "PRB", "mdl": "L", "kgs": "с", "pln": "zł", "azn": "₼", "amd": "֏", "thb": "฿", "aed": "AED", "nok": "kr", "cad": "C$", "czk": "Kč", "sek": "kr", "dkk": "kr", "ron": "lei", "uzs": "So'm", "aud": "$", "chf": "₣", "inr": "₹", "bgn": "лв", "ngn": "₦", "huf": "ƒ", "ils": "₪", "try": "₺", "stn": "₡", "ars": "$", "bob": "Bs", "ves": "Bs", "gtq": "Q", "hnl": "L", "dop": "RD$", "cop": "COL$", "crc": "₡", "cup": "$MN", "nio": "C$", "pab": "B/", "pyg": "₲", "pen": "S/", "svc": "₡", "uyu": "$U", "clp": "Ch$", "gel": "₾", "gbp": "£", } // Utils service object. type Utils struct { Logger logger.Logger slashRegex *regexp.Regexp AWS config.AWS TokenCounter uint32 IsDebug bool } // NewUtils will create new Utils instance. func NewUtils(awsConfig config.AWS, logger logger.Logger, debug bool) *Utils { return &Utils{ IsDebug: debug, AWS: awsConfig, Logger: logger, TokenCounter: 0, slashRegex: slashRegex, } } // ResetUtils resets the utils inner state. func (u *Utils) ResetUtils(awsConfig config.AWS, debug bool, tokenCounter uint32) { u.TokenCounter = tokenCounter u.AWS = awsConfig u.IsDebug = debug u.slashRegex = slashRegex } // GenerateToken will generate long pseudo-random string. func (u *Utils) GenerateToken() string { c := atomic.AddUint32(&u.TokenCounter, 1) return fmt.Sprintf("%x", sha256.Sum256([]byte(fmt.Sprintf("%d%d", time.Now().UnixNano(), c)))) } // GetAPIClient will initialize RetailCRM api client from url and key. func (u *Utils) GetAPIClient(url, key string, scopes []string) (*retailcrm.Client, int, error) { client := retailcrm.New(url, key). WithLogger(retailcrm.DebugLoggerAdapter(u.Logger)) client.Debug = u.IsDebug cr, status, err := client.APICredentials() if err != nil { return nil, status, err } if res := u.checkScopes(cr.Scopes, scopes); len(res) != 0 { u.Logger.Error(url, status, res) return nil, http.StatusBadRequest, errorutil.NewInsufficientScopesErr(res) } return client, 0, nil } func (u *Utils) checkScopes(scopes []string, scopesRequired []string) []string { rs := make([]string, len(scopesRequired)) copy(rs, scopesRequired) for _, vs := range scopes { for kn, vn := range rs { if vn == vs { if len(rs) == 1 { rs = rs[:0] break } rs = append(rs[:kn], rs[kn+1:]...) } } } return rs } // UploadUserAvatar will upload avatar for user. func (u *Utils) UploadUserAvatar(url string) (picURLs3 string, err error) { s3Config := &aws.Config{ Credentials: credentials.NewStaticCredentials( u.AWS.AccessKeyID, u.AWS.SecretAccessKey, ""), Region: aws.String(u.AWS.Region), } s := session.Must(session.NewSession(s3Config)) uploader := s3manager.NewUploader(s) // nolint:gosec resp, err := http.Get(url) if err != nil { return } defer resp.Body.Close() if resp.StatusCode >= http.StatusBadRequest { return "", fmt.Errorf("get: %v code: %v", url, resp.StatusCode) } result, err := uploader.Upload(&s3manager.UploadInput{ Bucket: aws.String(u.AWS.Bucket), Key: aws.String(fmt.Sprintf("%v/%v.jpg", u.AWS.FolderName, u.GenerateToken())), Body: resp.Body, ContentType: aws.String(u.AWS.ContentType), ACL: aws.String("public-read"), }) if err != nil { return } picURLs3 = result.Location return } // RemoveTrailingSlash will remove slash at the end of any string. func (u *Utils) RemoveTrailingSlash(crmURL string) string { return u.slashRegex.ReplaceAllString(crmURL, ``) } // GetMGItemData will upload file to MG by URL and return information about attachable item. func GetMGItemData(client *v1.MgClient, url string, caption string) (v1.Item, int, error) { item := v1.Item{} data, st, err := client.UploadFileByURL( v1.UploadFileByUrlRequest{ Url: url, }, ) if err != nil { return item, st, err } item.ID = data.ID item.Caption = caption return item, st, err } // GetEntitySHA1 will serialize any value to JSON and return SHA1 hash of this JSON. func GetEntitySHA1(v interface{}) (hash string, err error) { res, _ := json.Marshal(v) // nolint:gosec h := sha1.New() _, err = h.Write(res) hash = fmt.Sprintf("%x", h.Sum(nil)) return } // ReplaceMarkdownSymbols will remove markdown symbols from text. func ReplaceMarkdownSymbols(s string) string { for _, v := range markdownSymbols { s = strings.ReplaceAll(s, v, "\\"+v) } return s } // DefaultCurrencies will return default currencies list for all bots. func DefaultCurrencies() map[string]string { return defaultCurrencies } // GetCurrencySymbol returns currency symbol by it's ISO 4127 code. // It returns provided currency code in uppercase if currency symbol cannot be found. func GetCurrencySymbol(code string) string { if i, ok := DefaultCurrencies()[strings.ToLower(code)]; ok { return i } return strings.ToUpper(code) } func FormatCurrencyValue(value float32) string { return fmt.Sprintf("%.2f", value) }
The invention relates to a tennis practice backboard, panels for use in fenced-in tennis court. In constructing a tennis practice backboard, it is desirable to provide a hitting surface that allows the ball to return to approximately the same spot at just about the same height every time, encouraging longer and better rallies. It is also desirable to provide such a system that can be used by a player standing a significant distance away from the practice backboard (e.g., up to 39 feet away) so that the ability to return a ball hit against the rebound surface is not merely dependent upon quick reflexes, but more closely simulates actual play conditions. It is also desirable to have such a system that may be constructed at the site of the tennis court, and releasably mounted to the fencing for the tennis court, avoiding the use of special mounting systems and anchoring systems, and facilitating replacement of any damaged component part. Such a system must also be able to withstand humidity, wind, rain, cold, heat, and other weather conditions without being adversely effected. According to the present invention, a tennis practice backboard (and panel associated therewith and method for constructing the same) is provided that satisfies all of the above-enumerated conditions. The system is formed by a plurality of rebound panels, each having a rebound surface curved about first and second perpendicular axes, and means for attaching the panels together in abutting relationship to provide a concave tennis rebound backboard. Means are provided for mounting the tennis rebound backboard so that the top thereof is tilted backwardly with respect to the bottom thereof so that the backboard is tilted an angle .alpha. from vertical. The concave rebound surface when mounted in this manner allows the ball to return to approximately the same spot and at just about the same height every time it is impacted thereagainst, and allows the player to stand up to 39 feet (the distance from the base line to the net on a conventional tennis court) away when using the system. The panels utilized in the tennis practice backboard each have a rebound surface that is concave, and consist essentially of an integral structure of self-skinning structural polyurethane foam having a density of about 4 to 80 pounds per cubic foot (preferably about 40 pounds per cubic foot), a skin density at the rebound surface of about 20 to 80 pounds per cubic foot (preferably about 56 pounds per cubic foot) and a skin hardness of about 35 to 90 (preferably about 80) on the Shore D scale and 50 to 95 on the Shore A scale. Formed in such a way, the panels are easy to construct into a practice backboard, yet are tough, strong, and durable. They are not adversely affected by temperatures from -20.degree. F. to 200.degree. F., nor are they adversely affected by wind, rain, or other weather conditions. An integral circumferential lip extends away from the concave surface around the entire circumference of each panel, and a plurality of openings are formed in the circumferential lip for receipt of fasteners for attaching the panels together in abutting relationship, and attaching them to the means for mounting them in an upright position. The concave rebound surface is preferably quadrate, and each panel may have a thickness of about 3", with the concave rebound surface itself having a thickness of about 1/2". The panels may be readily shipped, with mounting hardware, to a fenced-in tennis court for erection on site. At the tennis court the panels are attached together in abutting relationship with removable fasteners to provide a concave tennis backboard and the backboard is releasably mounted to the tennis court fence so that it is upright. Mounting may be accomplished utilizing a plurality of horizontally extending members, a plurality of brackets attached to each of the horizontally extending members and extending outwardly therefrom, means for attaching each of the brackets to a panel (such as bolts and nuts) and means for attaching each of the horizontally extending members to the fence posts for the tennis court fence (such as U-bolts or cables). The tennis practice backboard may thus readily be constructed on site without any special mounting or anchoring structures, may be disassembled if desired, and may have the component parts thereof readily replaced if damaged. It is the primary object of the present invention to provide a simple, efficient, durable and easily constructed tennis practice backboard. This and other objects of the invention will become clear from an inspection of the detailed description of the invention and from the appended claims.
The structures and thermodynamic stability of copper(II) chloride surfaces. Using density functional theory calculations of periodic slabs, within the generalised gradient approximation, this study provides optimised structures for all plausible terminations of copper(II) chloride surfaces along the three low-index orientations. The ab initio atomistic thermodynamic approach serves to construct a thermodynamic stability diagram for CuCl2 configurations as a function of the chemical potential of chlorine (Cl(T,P)). We observe a shift in thermodynamic stability ordering at around Cl(T,P) = -1.0 eV between a copper-chlorine terminated surface (i.e., CuCl) and a chlorine-covered surface (i.e., Cl). This conclusion accords with experimental observations that report CuCl-bulk like structures, acting as a prerequisite for the formation of CuCl2-bulk like arrangements in the course of copper chlorination. Profound stabilities and optimised structures of CuCl and Cl configurations are discussed within the context of the functionality of CuCl2 as the chief chlorination and condensation catalyst of aromatic pollutants under conditions relevant to their formation in thermal systems, i.e. 400-1000 K, a total operating pressure of 1.0 atm and PCl2 = 10(-6)-10(-4) atm (1.0-100.0 ppm).
Three dimensional design, simulation and optimization of a novel, universal diabetic foot offloading orthosis Leg amputation is a major consequence of aggregated foot ulceration in diabetic patients. A common sense based treatment approach for diabetic foot ulceration is foot offloading where the patient is required to wear a foot offloading orthosis during the entire treatment course. Removable walker is an excellent foot offloading modality compared to the golden standard solution - total contact cast and felt padding. Commercially available foot offloaders are generally customized with huge cost and less patient compliance. This work suggests an optimized 3D model of a new type light weight removable foot offloading orthosis for diabetic patients. The device has simple adjustable features which make this suitable for wide range of patients with weight of 35 to 74 kg and height of 137 to 180 cm. Foot plate of this orthosis is unisexual, with a size adjustability of (US size) 6 to 10. Materials like Aluminum alloy 6061-T6, Acrylonitrile Butadiene Styrene (ABS) and Polyurethane acted as the key player in reducing weight of the device to 0.804 kg. Static analysis of this device indicated that maximum stress developed in this device under a load of 1000 N is only 37.8 MPa, with a small deflection of 0.150 cm and factor of safety of 3.28, keeping the safety limits, whereas dynamic analysis results assures the load bearing capacity of this device. Thus, the proposed device can be safely used as an orthosis for offloading diabetic ulcerated foot. Introduction Diabetes mellitus (DM) is a chronic disease which is associated with the abnormalities in blood glucose level of body. It has been estimated that, by 2030, the number of diabetic patients may shoot up to 366 million. India, one of the major developing countries, is considered as the diabetic capital of World. DM is well renowned for its short term and long term complications. Diabetic foot ulceration (DFU) is one among the major complication of long term DM for both type 1 and 2. The life time risk of a diabetic foot ulceration development in a patient is 15 -25% and also the frequency of ulcer occurrence is more in elder patients. DFU is one of major reason for non traumatic lower leg amputation and it was found that 40% -70% of non traumatic lower leg amputation cases in hospitals are due to DFU. About 40% of diabetic lower leg amputation can be avoided by giving special foot wound care. Delay in wound healing is one among the main issues related with diabetes mellitus and continuous mechanical stresses on the wound can seriously affect the healing process and period. So, the ideal treatment strategy is foot ulcer offloading (rebalancing the weight exerted on the wound site to non wounded area, in a weight bearing condition) by means of an external set up. The different offloading modalities includes complete bed rest, wheel chair, total contact cast (TCC), felted foams, insoles, healing shoe and removable cast/walker. Among these methods, even though TCC is considered to be the bench mark solution with a better wound healing rate than other modalities like half shoes, insoles, irremovable TCC and other removable walkers, it is less preferred by patients and podiatrists because it is irremovable, difficulty to monitor wound and needs experienced hands for patient application. An online survey of offloading practices for diabetes related plantar neuropathic ulcers reported that the widely preferred foot offloading modality is felt padding followed by removable walker/cast. The considerable option left for the ulcer treatment is using removable walker because felt padding can cause secondary foot ulcers even though it is effective in healing foot ulcer. Prefabricated walking brace or removable walker (examples like DH-Pressure Relief Walker, Aircast Pneumatic Walker-available in market), was found to be good in pressure reduction but they are expensive and less compliant, most of them were custom made. In India, a low income country, different low cost (<$1) offloading modalities have been developed, for instance, Mandakini, Samadhaan system, and Bohler iron cast, which uses only cheap materials. But, the clinical effectiveness of these devices in randomized trials was not reported. So, in India, there exists a need of a foot offloading orthosis which should be featured as removable, light weight, low cost, durability, easily fabricable, of universal design and user friendly. This article presents an optimized 3D model of a novel universal foot offloading orthosis design, using finite element analysis (FEA) technique and material selection database in the 3D modeling, parametric and featuring software -SOLIDWORKS 2013. Selection of appropriate materials is a crucial step considered in the design and simulation of the foot offloading orthosis because of its direct effects on reducing the overall weight of the device, inducing strength and durability and also, in reducing the overall fabrication cost. Different materials like High Density Polyethylene (HDPE), Acrylonitrile Butadiene Styrene (ABS) and Aluminum alloy T6-6061 have been used successfully in the optimization including weight reduction process and Factor of Safety (FOS) analysis. Key factors like material availability, easiness in fabrication, material and production cost were taken into account while designing the orthosis. The proposed design consists of certain adjustable features which makes the design as an off-the-shelf design for wide range of patients, both men and women, ranging from height of 135 to 170 cm, weighing up to 75 kg. Unisexual foot plate accommodates a wide variety of patients with US foot size ranging from 6 to 10. In the following sections, methodology involved and results obtained are described in brief. Description of proposed foot offloading orthosis design The proposed design is universal and unisexual in nature, which is an assembly of several parts like two height adjusting Aluminum alloy T6-6061 bars, two knee bars, two calf bands, rigid ankle joint and an adjustable foot plate. One of the significant advantage of this design is that the overall height of the device including the height required for foot offloading can be easily adjusted by sliding and fixing the adjustable bar and knee bar, using Metric 8 size screw and bolts. People with less lower leg height (below or equal to 28 cm) needs only the adjustable bars and one calf band and does not require knee bars. So, the weight of the device can be adjusted easily for patients with light and medium/heavy weight. Moreover, the size of the footplate can be increased or decreased easily with a simple adjusting mechanism, which does not affect the patient comfort and aesthetics of the foot plate. The length of the foot plate can be increased from 23 cm to 27 cm; so that women and men of different foot size (US size-men (6 to 10) and women (7 to 10)) can use the device. The two calf bands consist of sliding slots, which makes the bands suitable for patients with different calf circumferences. These slots also will be helpful in attaching the bands with those two sidebars. The overall weight of device, excluding fasteners and inner lining is 0.80 kg. Three dimensional modeling of the featured design In this section, the design strategies involved in three dimensional modeling of all the parts of the proposed foot offloading orthosis will be discussed in brief. For designing those parts, anthropometric measurements have taken from 39 volunteers, including seventeen male and twenty two female of age ranging from 46 ± 28 and 42 ± 23 respectively. Oral consent was taken before the data collection. Table 1 shows the summary of anthropometric data collected. Standard methods have been followed in the anthropometric data collection step. A 3D modeling, parametric and feature based software-SOLIDWORKS 2013 has been used in this work for modeling and finite element analysis. Figure 1 shows the block diagram of the major steps involved in the proposed work. For this modeling process, lengths of lower leg height of the volunteers have been taken using a measuring tape. Minimum and maximum lower leg height was found out as 27.5 and 44 cm respectively. So, a 3D model of adjustable bar with initial dimensions-length width thickness as 29 cm 3 cm 1 cm -was created using SOLIDWORKS 2013. The dimensions (width and thickness) have been optimized later based on maximum stress developed, maximum deflection occurred, factor of safety and weight of the part, using static finite element analysis. On the extruded model, a sliding adjustable feature was made in such a way that the position of calf bands and height of the device can be changed based on a Metric size 8 (M8) screw location. 3D modeling of knee bar. Similar to the modeling of adjustable bar, the knee bar has been developed by considering the minimum and maximum value of lower leg height of the subjects. The initial dimensions considered were length width thickness as 22 3 1 cm. After the optimization of the dimensions-width and thickness, final dimensions have been fixed. A long, centered slot had been made on the extruded model for the adjustable sliding mechanism. 3D modeling of calf bands. Calf bands are designed using the anthropometric data collected (minimum and maximum value of circumference -below knee region, mid -calf region and lower calf regions. Two adjustable slots for each band were made in such a way that the radius and circumference of the band can be positioned according to the calf circumference of the patients. As the starting dimension, a thickness of 0.50 cm was considered for both the bands. Later it was replaced with the dimension optimization results. 3D modeling of adjustable foot plate and rigid joint. Footwear size differs from patient to patient, so it is necessary to design an adjustable foot plate for accommodating a wide range of patients. A simple sliding mechanism is used in adjusting the length of the foot plate. The sliding mechanism is designed in such a way that the overall length of the device can be adjusted from 23.5 to 27.8 cm. For limiting the motion of ankle, a rigid joint was designed to attach the assembly of calf bands and bars to the foot plate. Thickness of the foot plate was varied from 5 to 3 cm for dimension optimization. Material selection The crucial step involved in the designing process of foot offloading orthosis is the material selection. It can control various factors like strength bearing capability of the device, weight of the device, fabrication cost and durability. There are different materials including metals, polymers, and polymercomposite materials are being widely using in various biomedical applications. For developing a light weight orthotic device, one of the commonly used materials is Aluminum alloy 6061-T6. It is an easily machinable and weldable material with good finishing characteristics and high yield strength of 275MPa and density of 2700 kg m 3 ; used in manufacturing many consumer durable products like cycle frame, rivets, aircraft body parts, camera lenses, brake components and so on. Thus, for a light weight foot offloading orthosis, it is appropriate to consider this material for parts like knee bars, adjustable bars and the rigid joint parts. Since, foot is not allowed to touch the ground, it is mandatory to use materials with high yield strength, so Aluminum alloy 6061-T6 can be considered for developing the light weight orthosis. Calf bands are the significant parts of the proposed design, where most of the load or weight of the person is going to apply. A thorough material screening was conducted based on factors like biocompatibility, part dimensions, tensile strength, maximum load applied, medical application, chemical resistance, fabrication process and cost involved and based on the screening results, two polymers were selected, namely High Density Polyethylene grade (HDPE) and Acrylonitrile Butadiene Styrene (ABS) of yield strengths 25 MPa and 30 MPa respectively. Density of ABS (1020 kg m 3 )is higher than HDPE (955 kg m 3 ). Optimization of dimensions and finalization of ideal material for calf bands of the proposed design was done using the results of Finite element analysis. For adjustable foot plate and inserting plug, 2 materials ABS and Polyurethane (PU) were compared and optimized the dimensions of foot plate. Finite element analysis (FEA) and optimization of the different parts of model Finite element analysis is an integrated, numerical analysis tool which is helpful in finding out the behavior of a complex system or structure in accordance with the applied load. SolidWorks Premium 2013 package has been used here for FE static and dynamic analysis studies. In the static analysis process, for a gradually increasing load with uniform distribution and unidirectional, various factors like von Mises stress, maximum deflection or displacement occurred, strain developed on the system, and factor of safety can be studied. Software assumes that all the materials used in the model obey Hooks law and it does not allow changing the boundary conditions after the meshing process. Initial and damping forces will be eliminated during the simulation process due to very less accelerations and velocities. where is the von Mises stress resulted and, and are the principal stress induced in x, y and z directions when a body is applied with an external load., and are the corresponding shear stress values generated. A displacement or deflection will occur after the development of resulted stress and in this work, resultant deflection had been observed. Factor of safety study is another design criterion, which is obtained by considering the yield strength of the material and von Mises stress. Based on the analysis results -stress developed, maximum deflection, factor of safety and weight, geometric dimensions of the parts like calf bands, adjustable bars and knee bars have been optimized. The minimum allowable factor of safety considered, with an applied load of 1000 N, to be as 3 for calf bands and 4 for both metal uprights. For optimizing geometric parameters, dimensions like width and thickness have been controlled, keeping length (for adjustable and knee bars) and radius (for calf bands) as constant. After dimension optimization, dynamic analysis study of the models had been conducted using SolidWorks package. For this real time analysis, a muscloskeletal modeling biomechanical software, OpenSim has been used to obtain the dynamic data. An OpenSim gait model 2354 with a weight of 74 kg has been simulated with normal walking speed, for 10 minute. Displacement data of leg shank was exported into the SolidWorks simulation and von Mises stress developed were noticed. Production cost analysis Many factors such as availability of material with necessary mechanical and physical properties and production cost are needed to be considered before manufacturing any product. So, an overall expenditure involved in developing the proposed device was tabulated after dimension optimization and market study. Results and discussion Three dimensional modelling is the preliminary work to be done after the conceptual understanding of device. Figure 2 shows the entire assembled model of proposed model, marked with various device parts. Simulation analysis, using appropriate materials, is a significant step in structural designing process where the design engineers can easily analysis the structural part fault. After modelling, static analysis study of the parts was conducted by applying a uniform force and observed the maximum von Mises stress, resultant deflection, factor of safety and weight of the part. For all parts, a compressive load of 1000 N was applied, keeping zero loading condition at the lower side of parts. It was observed that with the initial dimension conditions, the parts can withstand the load applied to it. So, dimension optimization was carried out to obtain ideal geometric parameters for parts, until the factor of safety reached below 3. For both calf bands, ABS and HDPE materials have been used in the optimization process and found that ABS bands are comparatively better than HDPE, with lesser deflection and von Mises stress. Since ABS material is denser than HDPE, weight of ABS band is slightly higher. Table 2 shows the dimension optimization strategy adopted for calf bands. The optimized geometric parameter -thickness, for calf band 1 and 2 was 0.40 cm because it was observed that for values less than 0.40 cm, factor of safety resulted was less than 3. From Table 2, it was well understood that the von Mises stress and deflection of ABS bands, with 0.40 cm thickness, are lesser than HDPE. So, material chosen for calf bands 1 and 2 was ABS, even though ABS bands are heavier and rigid than HDPE bands. For adjustable and knee bar, width and thickness was controlled to optimize the dimensions, keeping the part length fixed. Optimization of bar dimensions is shown in Table 3. The finalized dimensions of knee bar are 2220.30 cm where these dimensions satisfy the factor of safety needed. Similarly, for adjustable bar, with a length of 30 cm, width and thickness was optimized as 2 and 0.30 cm respectively. After finalizing the dimensions, optimized parts including knee bar, adjustable bar, calf bands and rigid joint have been assembled and applied 1000 N load compressive load to the top portion. In simulation analysis, it was assumed that the foot offloading orthosis is bearing the entire load of 1000 N. The maximum stress acquired in this worst condition is 37.75 MPa with a minimum deflection of 0.15 cm and factor of safety of 3.28. Models -calf band 1 and knee bar, calf band2 and adjustable bars were assembled after dimension optimization and dynamic analysis of the assemblies were implemented. Maximum stress developed in assembly 1 was 194.1 MPa and assembly 2 was 97.8 MPa. Figure 4 shows the analysis results of both assemblies. Another important part of this proposed design is the adjustable foot plate through which the force exerted by the patient is distributed. So, static analysis of foot plate with compressive load of 1000 N had been studied and compared the efficiency of ABS and PU as a foot plate. Table 4 shows the optimization of foot plate. Since the foot plate need to be light weight and flexible, Polyurethane material has been finalized as the base material. Thickness was finalized to be 4 cm so the weight of the foot plate was below 0.50kg. From a manufacturer point of view, to approve any mechanical design, it is necessary that the von Mises stress developed in a system during a worst case situation should be less than the yield strength of the materials used. The proposed work produced satisfactory analysis results for all parts in the 1000 N load environment. This situation can be considered as a worst case because in this case it is assumed that entire weight of a 100 kg person is applying on one leg. Also, the dynamic analysis results assure the capability of this device to withstand the load applied by a 74kg person. Weight of the entire device excluding all silicon linings, screws and velcro bands is 0.80 kg, which was controlled by the dimension optimization process. Factor of safety and weight are the parameters which depends upon each other, i.e. if weight is more, factor of safety will also be more. But it can result in the wastage of material and so optimization of dimension should be done in order to ensure proper weight and good factor of safety. The design engineer should consider the current market state by studying the material availability and its production cost. Table 5, 6, 7 shows the overall expense of production cost including the material and fabrication cost for different parts of the orthosis. For the estimation purpose, rapid prototyping method was chosen for the fabrication of calf bands. The overall production cost including VAT tax was found to be Rs. 15150/-. For mass production, the cost will be reduced further more. This work proposes a novel universal, unisexual design of diabetic foot offloading orthosis with optimized dimensions, minimum weight and satisfactory factor of safety. Conclusion As there is rise in the prevalence rate of foot ulceration in diabetic patients globally, it is wise to develop a patient compliant foot offloading orthosis. The proposed design can be considered as universally designed foot offloading orthosis with less weight (< 1kg) and several adjustable features. It can be used for patients with weight less than 74kg and height in between 137 to 180 cm. The designed foot plate can be adjusted for patients of US foot size -male between 7 and 10 and female 6 to 10. Simple mechanisms are used in this design for height, calf circumference and foot size adjustments. So, this design can replace the commercially available customized foot offloading orthosis. Materials selected after simulation analysis reduced the weight of the device considerably. Before fixing the materials, a thorough analysis study was conducted and it was found out that ABS material is comparatively better than HDPE for fabricating calf bands. For the foot section, main material used was ABS, which can withstand the maximum load excreted on the device with minimum deflection. The assembled model including calf bands, knee and adjustable bars, rigid joint results a factor of safety of 3.28 which crosses the minimum safety limit requirement. To develop this device, different fabrication techniques like extrusion and machining for aluminium bars and rapid prototyping or injection modelling for calf bands and foot plate can be considered. Cost of fabrication for a single prototype will be more comparing to mass production. Strength of material testing including tensile test, hardness test and fatigue test can be used in future to validate the developed device.
<gh_stars>10-100 /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "signtool.h" #include <prmem.h> #include <prio.h> #include <prenv.h> static int javascript_fn(char *relpath, char *basedir, char *reldir, char *filename, void *arg); static int extract_js (char *filename); static int copyinto (char *from, char *to); static PRStatus ensureExists (char *base, char *path); static int make_dirs(char *path, PRInt32 file_perms); static char *jartree = NULL; static int idOrdinal; static PRBool dumpParse = PR_FALSE; static char *event_handlers[] = { "onAbort", "onBlur", "onChange", "onClick", "onDblClick", "onDragDrop", "onError", "onFocus", "onKeyDown", "onKeyPress", "onKeyUp", "onLoad", "onMouseDown", "onMouseMove", "onMouseOut", "onMouseOver", "onMouseUp", "onMove", "onReset", "onResize", "onSelect", "onSubmit", "onUnload" }; static int num_handlers = 23; /* * I n l i n e J a v a S c r i p t * * Javascript signing. Instead of passing an archive to signtool, * a directory containing html files is given. Archives are created * from the archive= and src= tag attributes inside the html, * as appropriate. Then the archives are signed. * */ int InlineJavaScript(char *dir, PRBool recurse) { jartree = dir; if (verbosity >= 0) { PR_fprintf(outputFD, "\nGenerating inline signatures from HTML files in: %s\n", dir); } if (PR_GetEnv("SIGNTOOL_DUMP_PARSE")) { dumpParse = PR_TRUE; } return foreach(dir, "", javascript_fn, recurse, PR_FALSE /*include dirs*/, (void * )NULL); } /************************************************************************ * * j a v a s c r i p t _ f n */ static int javascript_fn (char *relpath, char *basedir, char *reldir, char *filename, void *arg) { char fullname [FNSIZE]; /* only process inline scripts from .htm, .html, and .shtml*/ if (!(PL_strcaserstr(filename, ".htm") == filename + strlen(filename) - 4) && !(PL_strcaserstr(filename, ".html") == filename + strlen(filename) - 5) && !(PL_strcaserstr(filename, ".shtml") == filename + strlen(filename) -6)) { return 0; } /* don't process scripts that signtool has already extracted (those that are inside .arc directories) */ if (PL_strcaserstr(filename, ".arc") == filename + strlen(filename) - 4) return 0; if (verbosity >= 0) { PR_fprintf(outputFD, "Processing HTML file: %s\n", relpath); } /* reset firstArchive at top of each HTML file */ /* skip directories that contain extracted scripts */ if (PL_strcaserstr(reldir, ".arc") == reldir + strlen(reldir) - 4) return 0; sprintf (fullname, "%s/%s", basedir, relpath); return extract_js (fullname); } /*=========================================================================== = = D A T A S T R U C T U R E S = */ typedef enum { TEXT_HTML_STATE = 0, SCRIPT_HTML_STATE } HTML_STATE ; typedef enum { /* we start in the start state */ START_STATE, /* We are looking for or reading in an attribute */ GET_ATT_STATE, /* We're burning ws before finding an attribute */ PRE_ATT_WS_STATE, /* We're burning ws after an attribute. Looking for an '='. */ POST_ATT_WS_STATE, /* We're burning ws after an '=', waiting for a value */ PRE_VAL_WS_STATE, /* We're reading in a value */ GET_VALUE_STATE, /* We're reading in a value that's inside quotes */ GET_QUOTED_VAL_STATE, /* We've encountered the closing '>' */ DONE_STATE, /* Error state */ ERR_STATE } TAG_STATE ; typedef struct AVPair_Str { char *attribute; char *value; unsigned int valueLine; /* the line that the value ends on */ struct AVPair_Str *next; } AVPair; typedef enum { APPLET_TAG, SCRIPT_TAG, LINK_TAG, STYLE_TAG, COMMENT_TAG, OTHER_TAG } TAG_TYPE ; typedef struct { TAG_TYPE type; AVPair * attList; AVPair * attListTail; char *text; } TagItem; typedef enum { TAG_ITEM, TEXT_ITEM } ITEM_TYPE ; typedef struct HTMLItem_Str { unsigned int startLine; unsigned int endLine; ITEM_TYPE type; union { TagItem *tag; char *text; } item; struct HTMLItem_Str *next; } HTMLItem; typedef struct { PRFileDesc *fd; PRInt32 curIndex; PRBool IsEOF; #define FILE_BUFFER_BUFSIZE 512 char buf[FILE_BUFFER_BUFSIZE]; PRInt32 startOffset; PRInt32 maxIndex; unsigned int lineNum; } FileBuffer; /*=========================================================================== = = F U N C T I O N S = */ static HTMLItem*CreateTextItem(char *text, unsigned int startline, unsigned int endline); static HTMLItem*CreateTagItem(TagItem*ti, unsigned int startline, unsigned int endline); static TagItem*ProcessTag(FileBuffer*fb, char **errStr); static void DestroyHTMLItem(HTMLItem *item); static void DestroyTagItem(TagItem*ti); static TAG_TYPE GetTagType(char *att); static FileBuffer*FB_Create(PRFileDesc*fd); static int FB_GetChar(FileBuffer *fb); static PRInt32 FB_GetPointer(FileBuffer *fb); static PRInt32 FB_GetRange(FileBuffer *fb, PRInt32 start, PRInt32 end, char **buf); static unsigned int FB_GetLineNum(FileBuffer *fb); static void FB_Destroy(FileBuffer *fb); static void PrintTagItem(PRFileDesc *fd, TagItem *ti); static void PrintHTMLStream(PRFileDesc *fd, HTMLItem *head); /************************************************************************ * * C r e a t e T e x t I t e m */ static HTMLItem* CreateTextItem(char *text, unsigned int startline, unsigned int endline) { HTMLItem * item; item = PR_Malloc(sizeof(HTMLItem)); if (!item) { return NULL; } item->type = TEXT_ITEM; item->item.text = text; item->next = NULL; item->startLine = startline; item->endLine = endline; return item; } /************************************************************************ * * C r e a t e T a g I t e m */ static HTMLItem* CreateTagItem(TagItem*ti, unsigned int startline, unsigned int endline) { HTMLItem * item; item = PR_Malloc(sizeof(HTMLItem)); if (!item) { return NULL; } item->type = TAG_ITEM; item->item.tag = ti; item->next = NULL; item->startLine = startline; item->endLine = endline; return item; } static PRBool isAttChar(int c) { return (isalnum(c) || c == '/' || c == '-'); } /************************************************************************ * * P r o c e s s T a g */ static TagItem* ProcessTag(FileBuffer*fb, char **errStr) { TAG_STATE state; PRInt32 startText, startID, curPos; PRBool firstAtt; int curchar; TagItem * ti = NULL; AVPair * curPair = NULL; char quotechar = '\0'; unsigned int linenum; unsigned int startline; state = START_STATE; startID = FB_GetPointer(fb); startText = startID; firstAtt = PR_TRUE; ti = (TagItem * ) PR_Malloc(sizeof(TagItem)); if (!ti) out_of_memory(); ti->type = OTHER_TAG; ti->attList = NULL; ti->attListTail = NULL; ti->text = NULL; startline = FB_GetLineNum(fb); while (state != DONE_STATE && state != ERR_STATE) { linenum = FB_GetLineNum(fb); curchar = FB_GetChar(fb); if (curchar == EOF) { *errStr = PR_smprintf( "line %d: Unexpected end-of-file while parsing tag starting at line %d.\n", linenum, startline); state = ERR_STATE; continue; } switch (state) { case START_STATE: if (curchar == '!') { /* * SGML tag or comment * Here's the general rule for SGML tags. Everything from * <! to > is the tag. Inside the tag, comments are * delimited with --. So we are looking for the first '>' * that is not commented out, that is, not inside a pair * of --: <!DOCTYPE --this is a comment >(psyche!) --> */ PRBool inComment = PR_FALSE; short hyphenCount = 0; /* number of consecutive hyphens */ while (1) { linenum = FB_GetLineNum(fb); curchar = FB_GetChar(fb); if (curchar == EOF) { /* Uh oh, EOF inside comment */ *errStr = PR_smprintf( "line %d: Unexpected end-of-file inside comment starting at line %d.\n", linenum, startline); state = ERR_STATE; break; } if (curchar == '-') { if (hyphenCount == 1) { /* This is a comment delimiter */ inComment = !inComment; hyphenCount = 0; } else { /* beginning of a comment delimiter? */ hyphenCount = 1; } } else if (curchar == '>') { if (!inComment) { /* This is the end of the tag */ state = DONE_STATE; break; } else { /* The > is inside a comment, so it's not * really the end of the tag */ hyphenCount = 0; } } else { hyphenCount = 0; } } ti->type = COMMENT_TAG; break; } /* fall through */ case GET_ATT_STATE: if (isspace(curchar) || curchar == '=' || curchar == '>') { /* end of the current attribute */ curPos = FB_GetPointer(fb) - 2; if (curPos >= startID) { /* We have an attribute */ curPair = (AVPair * )PR_Malloc(sizeof(AVPair)); if (!curPair) out_of_memory(); curPair->value = NULL; curPair->next = NULL; FB_GetRange(fb, startID, curPos, &curPair->attribute); /* Stick this attribute on the list */ if (ti->attListTail) { ti->attListTail->next = curPair; ti->attListTail = curPair; } else { ti->attList = ti->attListTail = curPair; } /* If this is the first attribute, find the type of tag * based on it. Also, start saving the text of the tag. */ if (firstAtt) { ti->type = GetTagType(curPair->attribute); startText = FB_GetPointer(fb) -1; firstAtt = PR_FALSE; } } else { if (curchar == '=') { /* If we don't have any attribute but we do have an * equal sign, that's an error */ *errStr = PR_smprintf("line %d: Malformed tag starting at line %d.\n", linenum, startline); state = ERR_STATE; break; } } /* Compute next state */ if (curchar == '=') { startID = FB_GetPointer(fb); state = PRE_VAL_WS_STATE; } else if (curchar == '>') { state = DONE_STATE; } else if (curPair) { state = POST_ATT_WS_STATE; } else { state = PRE_ATT_WS_STATE; } } else if (isAttChar(curchar)) { /* Just another char in the attribute. Do nothing */ state = GET_ATT_STATE; } else { /* bogus char */ *errStr = PR_smprintf("line %d: Bogus chararacter '%c' in tag.\n", linenum, curchar); state = ERR_STATE; break; } break; case PRE_ATT_WS_STATE: if (curchar == '>') { state = DONE_STATE; } else if (isspace(curchar)) { /* more whitespace, do nothing */ } else if (isAttChar(curchar)) { /* starting another attribute */ startID = FB_GetPointer(fb) - 1; state = GET_ATT_STATE; } else { /* bogus char */ *errStr = PR_smprintf("line %d: Bogus character '%c' in tag.\n", linenum, curchar); state = ERR_STATE; break; } break; case POST_ATT_WS_STATE: if (curchar == '>') { state = DONE_STATE; } else if (isspace(curchar)) { /* more whitespace, do nothing */ } else if (isAttChar(curchar)) { /* starting another attribute */ startID = FB_GetPointer(fb) - 1; state = GET_ATT_STATE; } else if (curchar == '=') { /* there was whitespace between the attribute and its equal * sign, which means there's a value coming up */ state = PRE_VAL_WS_STATE; } else { /* bogus char */ *errStr = PR_smprintf("line %d: Bogus character '%c' in tag.\n", linenum, curchar); state = ERR_STATE; break; } break; case PRE_VAL_WS_STATE: if (curchar == '>') { /* premature end-of-tag (sounds like a personal problem). */ *errStr = PR_smprintf( "line %d: End of tag while waiting for value.\n", linenum); state = ERR_STATE; break; } else if (isspace(curchar)) { /* more whitespace, do nothing */ break; } else { /* this must be some sort of value. Fall through * to GET_VALUE_STATE */ startID = FB_GetPointer(fb) - 1; state = GET_VALUE_STATE; } /* Fall through if we didn't break on '>' or whitespace */ case GET_VALUE_STATE: if (isspace(curchar) || curchar == '>') { /* end of value */ curPos = FB_GetPointer(fb) - 2; if (curPos >= startID) { /* Grab the value */ FB_GetRange(fb, startID, curPos, &curPair->value); curPair->valueLine = linenum; } else { /* empty value, leave as NULL */ } if (isspace(curchar)) { state = PRE_ATT_WS_STATE; } else { state = DONE_STATE; } } else if (curchar == '\"' || curchar == '\'') { /* quoted value. Start recording the value inside the quote*/ startID = FB_GetPointer(fb); state = GET_QUOTED_VAL_STATE; PORT_Assert(quotechar == '\0'); quotechar = curchar; /* look for matching quote type */ } else { /* just more value */ } break; case GET_QUOTED_VAL_STATE: PORT_Assert(quotechar != '\0'); if (curchar == quotechar) { /* end of quoted value */ curPos = FB_GetPointer(fb) - 2; if (curPos >= startID) { /* Grab the value */ FB_GetRange(fb, startID, curPos, &curPair->value); curPair->valueLine = linenum; } else { /* empty value, leave it as NULL */ } state = GET_ATT_STATE; quotechar = '\0'; startID = FB_GetPointer(fb); } else { /* more quoted value, continue */ } break; case DONE_STATE: case ERR_STATE: default: ; /* should never get here */ } } if (state == DONE_STATE) { /* Get the text of the tag */ curPos = FB_GetPointer(fb) - 1; FB_GetRange(fb, startText, curPos, &ti->text); /* Return the tag */ return ti; } /* Uh oh, an error. Kill the tag item*/ DestroyTagItem(ti); return NULL; } /************************************************************************ * * D e s t r o y H T M L I t e m */ static void DestroyHTMLItem(HTMLItem *item) { if (item->type == TAG_ITEM) { DestroyTagItem(item->item.tag); } else { if (item->item.text) { PR_Free(item->item.text); } } } /************************************************************************ * * D e s t r o y T a g I t e m */ static void DestroyTagItem(TagItem*ti) { AVPair * temp; if (ti->text) { PR_Free(ti->text); ti->text = NULL; } while (ti->attList) { temp = ti->attList; ti->attList = ti->attList->next; if (temp->attribute) { PR_Free(temp->attribute); temp->attribute = NULL; } if (temp->value) { PR_Free(temp->value); temp->value = NULL; } PR_Free(temp); } PR_Free(ti); } /************************************************************************ * * G e t T a g T y p e */ static TAG_TYPE GetTagType(char *att) { if (!PORT_Strcasecmp(att, "APPLET")) { return APPLET_TAG; } if (!PORT_Strcasecmp(att, "SCRIPT")) { return SCRIPT_TAG; } if (!PORT_Strcasecmp(att, "LINK")) { return LINK_TAG; } if (!PORT_Strcasecmp(att, "STYLE")) { return STYLE_TAG; } return OTHER_TAG; } /************************************************************************ * * F B _ C r e a t e */ static FileBuffer* FB_Create(PRFileDesc*fd) { FileBuffer * fb; PRInt32 amountRead; PRInt32 storedOffset; fb = (FileBuffer * ) PR_Malloc(sizeof(FileBuffer)); fb->fd = fd; storedOffset = PR_Seek(fd, 0, PR_SEEK_CUR); PR_Seek(fd, 0, PR_SEEK_SET); fb->startOffset = 0; amountRead = PR_Read(fd, fb->buf, FILE_BUFFER_BUFSIZE); if (amountRead == -1) goto loser; fb->maxIndex = amountRead - 1; fb->curIndex = 0; fb->IsEOF = (fb->curIndex > fb->maxIndex) ? PR_TRUE : PR_FALSE; fb->lineNum = 1; PR_Seek(fd, storedOffset, PR_SEEK_SET); return fb; loser: PR_Seek(fd, storedOffset, PR_SEEK_SET); PR_Free(fb); return NULL; } /************************************************************************ * * F B _ G e t C h a r */ static int FB_GetChar(FileBuffer *fb) { PRInt32 storedOffset; PRInt32 amountRead; int retval = -1; if (fb->IsEOF) { return EOF; } storedOffset = PR_Seek(fb->fd, 0, PR_SEEK_CUR); retval = (unsigned char) fb->buf[fb->curIndex++]; if (retval == '\n') fb->lineNum++; if (fb->curIndex > fb->maxIndex) { /* We're at the end of the buffer. Try to get some new data from the * file */ fb->startOffset += fb->maxIndex + 1; PR_Seek(fb->fd, fb->startOffset, PR_SEEK_SET); amountRead = PR_Read(fb->fd, fb->buf, FILE_BUFFER_BUFSIZE); if (amountRead == -1) goto loser; fb->maxIndex = amountRead - 1; fb->curIndex = 0; } fb->IsEOF = (fb->curIndex > fb->maxIndex) ? PR_TRUE : PR_FALSE; loser: PR_Seek(fb->fd, storedOffset, PR_SEEK_SET); return retval; } /************************************************************************ * * F B _ G e t L i n e N u m * */ static unsigned int FB_GetLineNum(FileBuffer *fb) { return fb->lineNum; } /************************************************************************ * * F B _ G e t P o i n t e r * */ static PRInt32 FB_GetPointer(FileBuffer *fb) { return fb->startOffset + fb->curIndex; } /************************************************************************ * * F B _ G e t R a n g e * */ static PRInt32 FB_GetRange(FileBuffer *fb, PRInt32 start, PRInt32 end, char **buf) { PRInt32 amountRead; PRInt32 storedOffset; *buf = PR_Malloc(end - start + 2); if (*buf == NULL) { return 0; } storedOffset = PR_Seek(fb->fd, 0, PR_SEEK_CUR); PR_Seek(fb->fd, start, PR_SEEK_SET); amountRead = PR_Read(fb->fd, *buf, end - start + 1); PR_Seek(fb->fd, storedOffset, PR_SEEK_SET); if (amountRead == -1) { PR_Free(*buf); *buf = NULL; return 0; } (*buf)[end-start+1] = '\0'; return amountRead; } /************************************************************************ * * F B _ D e s t r o y * */ static void FB_Destroy(FileBuffer *fb) { if (fb) { PR_Free(fb); } } /************************************************************************ * * P r i n t T a g I t e m * */ static void PrintTagItem(PRFileDesc *fd, TagItem *ti) { AVPair * pair; PR_fprintf(fd, "TAG:\n----\nType: "); switch (ti->type) { case APPLET_TAG: PR_fprintf(fd, "applet\n"); break; case SCRIPT_TAG: PR_fprintf(fd, "script\n"); break; case LINK_TAG: PR_fprintf(fd, "link\n"); break; case STYLE_TAG: PR_fprintf(fd, "style\n"); break; case COMMENT_TAG: PR_fprintf(fd, "comment\n"); break; case OTHER_TAG: default: PR_fprintf(fd, "other\n"); break; } PR_fprintf(fd, "Attributes:\n"); for (pair = ti->attList; pair; pair = pair->next) { PR_fprintf(fd, "\t%s=%s\n", pair->attribute, pair->value ? pair->value : ""); } PR_fprintf(fd, "Text:%s\n", ti->text ? ti->text : ""); PR_fprintf(fd, "---End of tag---\n"); } /************************************************************************ * * P r i n t H T M L S t r e a m * */ static void PrintHTMLStream(PRFileDesc *fd, HTMLItem *head) { while (head) { if (head->type == TAG_ITEM) { PrintTagItem(fd, head->item.tag); } else { PR_fprintf(fd, "\nTEXT:\n-----\n%s\n-----\n\n", head->item.text); } head = head->next; } } /************************************************************************ * * S a v e I n l i n e S c r i p t * */ static int SaveInlineScript(char *text, char *id, char *basedir, char *archiveDir) { char *filename = NULL; PRFileDesc * fd = NULL; int retval = -1; PRInt32 writeLen; char *ilDir = NULL; if (!text || !id || !archiveDir) { return - 1; } if (dumpParse) { PR_fprintf(outputFD, "SaveInlineScript: text=%s, id=%s, \n" "basedir=%s, archiveDir=%s\n", text, id, basedir, archiveDir); } /* Make sure the archive directory is around */ if (ensureExists(basedir, archiveDir) != PR_SUCCESS) { PR_fprintf(errorFD, "ERROR: Unable to create archive directory %s.\n", archiveDir); errorCount++; return - 1; } /* Make sure the inline script directory is around */ ilDir = PR_smprintf("%s/inlineScripts", archiveDir); scriptdir = "inlineScripts"; if (ensureExists(basedir, ilDir) != PR_SUCCESS) { PR_fprintf(errorFD, "ERROR: Unable to create directory %s.\n", ilDir); errorCount++; return - 1; } filename = PR_smprintf("%s/%s/%s", basedir, ilDir, id); /* If the file already exists, give a warning, then blow it away */ if (PR_Access(filename, PR_ACCESS_EXISTS) == PR_SUCCESS) { PR_fprintf(errorFD, "warning: file \"%s\" already exists--will overwrite.\n", filename); warningCount++; if (rm_dash_r(filename)) { PR_fprintf(errorFD, "ERROR: Unable to delete %s.\n", filename); errorCount++; goto finish; } } /* Write text into file with name id */ fd = PR_Open(filename, PR_WRONLY | PR_CREATE_FILE | PR_TRUNCATE, 0777); if (!fd) { PR_fprintf(errorFD, "ERROR: Unable to create file \"%s\".\n", filename); errorCount++; goto finish; } writeLen = strlen(text); if ( PR_Write(fd, text, writeLen) != writeLen) { PR_fprintf(errorFD, "ERROR: Unable to write to file \"%s\".\n", filename); errorCount++; goto finish; } retval = 0; finish: if (filename) { PR_smprintf_free(filename); } if (ilDir) { PR_smprintf_free(ilDir); } if (fd) { PR_Close(fd); } return retval; } /************************************************************************ * * S a v e U n n a m a b l e S c r i p t * */ static int SaveUnnamableScript(char *text, char *basedir, char *archiveDir, char *HTMLfilename) { char *id = NULL; char *ext = NULL; char *start = NULL; int retval = -1; if (!text || !archiveDir || !HTMLfilename) { return - 1; } if (dumpParse) { PR_fprintf(outputFD, "SaveUnnamableScript: text=%s, basedir=%s,\n" "archiveDir=%s, filename=%s\n", text, basedir, archiveDir, HTMLfilename); } /* Construct the filename */ ext = PL_strrchr(HTMLfilename, '.'); if (ext) { *ext = '\0'; } for (start = HTMLfilename; strpbrk(start, "/\\"); start = strpbrk(start, "/\\") + 1) /* do nothing */; if (*start == '\0') start = HTMLfilename; id = PR_smprintf("_%s%d", start, idOrdinal++); if (ext) { *ext = '.'; } /* Now call SaveInlineScript to do the work */ retval = SaveInlineScript(text, id, basedir, archiveDir); PR_Free(id); return retval; } /************************************************************************ * * S a v e S o u r c e * */ static int SaveSource(char *src, char *codebase, char *basedir, char *archiveDir) { char *from = NULL, *to = NULL; int retval = -1; char *arcDir = NULL; if (!src || !archiveDir) { return - 1; } if (dumpParse) { PR_fprintf(outputFD, "SaveSource: src=%s, codebase=%s, basedir=%s,\n" "archiveDir=%s\n", src, codebase, basedir, archiveDir); } if (codebase) { arcDir = PR_smprintf("%s/%s/%s/", basedir, codebase, archiveDir); } else { arcDir = PR_smprintf("%s/%s/", basedir, archiveDir); } if (codebase) { from = PR_smprintf("%s/%s/%s", basedir, codebase, src); to = PR_smprintf("%s%s", arcDir, src); } else { from = PR_smprintf("%s/%s", basedir, src); to = PR_smprintf("%s%s", arcDir, src); } if (make_dirs(to, 0777)) { PR_fprintf(errorFD, "ERROR: Unable to create archive directory %s.\n", archiveDir); errorCount++; goto finish; } retval = copyinto(from, to); finish: if (from) PR_Free(from); if (to) PR_Free(to); if (arcDir) PR_Free(arcDir); return retval; } /************************************************************************ * * T a g T y p e T o S t r i n g * */ char * TagTypeToString(TAG_TYPE type) { switch (type) { case APPLET_TAG: return "APPLET"; case SCRIPT_TAG: return "SCRIPT"; case LINK_TAG: return "LINK"; case STYLE_TAG: return "STYLE"; default: break; } return "unknown"; } /************************************************************************ * * e x t r a c t _ j s * */ static int extract_js(char *filename) { PRFileDesc * fd = NULL; FileBuffer * fb = NULL; HTMLItem * head = NULL; HTMLItem * tail = NULL; HTMLItem * curitem = NULL; HTMLItem * styleList = NULL; HTMLItem * styleListTail = NULL; HTMLItem * entityList = NULL; HTMLItem * entityListTail = NULL; TagItem * tagp = NULL; char *text = NULL; char *tagerr = NULL; char *archiveDir = NULL; char *firstArchiveDir = NULL; char *basedir = NULL; PRInt32 textStart; PRInt32 curOffset; HTML_STATE state; int curchar; int retval = -1; unsigned int linenum, startLine; /* Initialize the implicit ID counter for each file */ idOrdinal = 0; /* * First, parse the HTML into a stream of tags and text. */ fd = PR_Open(filename, PR_RDONLY, 0); if (!fd) { PR_fprintf(errorFD, "Unable to open %s for reading.\n", filename); errorCount++; return - 1; } /* Construct base directory of filename. */ { char *cp; basedir = PL_strdup(filename); /* Remove trailing slashes */ while ( (cp = PL_strprbrk(basedir, "/\\")) == (basedir + strlen(basedir) - 1)) { *cp = '\0'; } /* Now remove everything from the last slash (which will be followed * by a filename) to the end */ cp = PL_strprbrk(basedir, "/\\"); if (cp) { *cp = '\0'; } } state = TEXT_HTML_STATE; fb = FB_Create(fd); textStart = 0; startLine = 0; while (linenum = FB_GetLineNum(fb), (curchar = FB_GetChar(fb)) != EOF) { switch (state) { case TEXT_HTML_STATE: if (curchar == '<') { /* * Found a tag */ /* Save the text so far to a new text item */ curOffset = FB_GetPointer(fb) - 2; if (curOffset >= textStart) { if (FB_GetRange(fb, textStart, curOffset, &text) != curOffset - textStart + 1) { PR_fprintf(errorFD, "Unable to read from %s.\n", filename); errorCount++; goto loser; } /* little fudge here. If the first character on a line * is '<', meaning a new tag, the preceding text item * actually ends on the previous line. In this case * we will be saying that the text segment ends on the * next line. I don't think this matters for text items. */ curitem = CreateTextItem(text, startLine, linenum); text = NULL; if (tail == NULL) { head = tail = curitem; } else { tail->next = curitem; tail = curitem; } } /* Process the tag */ tagp = ProcessTag(fb, &tagerr); if (!tagp) { if (tagerr) { PR_fprintf(errorFD, "Error in file %s: %s\n", filename, tagerr); errorCount++; } else { PR_fprintf(errorFD, "Error in file %s, in tag starting at line %d\n", filename, linenum); errorCount++; } goto loser; } /* Add the tag to the list */ curitem = CreateTagItem(tagp, linenum, FB_GetLineNum(fb)); if (tail == NULL) { head = tail = curitem; } else { tail->next = curitem; tail = curitem; } /* What's the next state */ if (tagp->type == SCRIPT_TAG) { state = SCRIPT_HTML_STATE; } /* Start recording text from the new offset */ textStart = FB_GetPointer(fb); startLine = FB_GetLineNum(fb); } else { /* regular character. Next! */ } break; case SCRIPT_HTML_STATE: if (curchar == '<') { char *cp; /* * If this is a </script> tag, then we're at the end of the * script. Otherwise, ignore */ curOffset = FB_GetPointer(fb) - 1; cp = NULL; if (FB_GetRange(fb, curOffset, curOffset + 8, &cp) != 9) { if (cp) { PR_Free(cp); cp = NULL; } } else { /* compare the strings */ if ( !PORT_Strncasecmp(cp, "</script>", 9) ) { /* This is the end of the script. Record the text. */ curOffset--; if (curOffset >= textStart) { if (FB_GetRange(fb, textStart, curOffset, &text) != curOffset - textStart + 1) { PR_fprintf(errorFD, "Unable to read from %s.\n", filename); errorCount++; goto loser; } curitem = CreateTextItem(text, startLine, linenum); text = NULL; if (tail == NULL) { head = tail = curitem; } else { tail->next = curitem; tail = curitem; } } /* Now parse the /script tag and put it on the list */ tagp = ProcessTag(fb, &tagerr); if (!tagp) { if (tagerr) { PR_fprintf(errorFD, "Error in file %s: %s\n", filename, tagerr); } else { PR_fprintf(errorFD, "Error in file %s, in tag starting at" " line %d\n", filename, linenum); } errorCount++; goto loser; } curitem = CreateTagItem(tagp, linenum, FB_GetLineNum(fb)); if (tail == NULL) { head = tail = curitem; } else { tail->next = curitem; tail = curitem; } /* go back to text state */ state = TEXT_HTML_STATE; textStart = FB_GetPointer(fb); startLine = FB_GetLineNum(fb); } } } break; } } /* End of the file. Wrap up any remaining text */ if (state == SCRIPT_HTML_STATE) { if (tail && tail->type == TAG_ITEM) { PR_fprintf(errorFD, "ERROR: <SCRIPT> tag at %s:%d is not followed " "by a </SCRIPT> tag.\n", filename, tail->startLine); } else { PR_fprintf(errorFD, "ERROR: <SCRIPT> tag in file %s is not followed" " by a </SCRIPT tag.\n", filename); } errorCount++; goto loser; } curOffset = FB_GetPointer(fb) - 1; if (curOffset >= textStart) { text = NULL; if ( FB_GetRange(fb, textStart, curOffset, &text) != curOffset - textStart + 1) { PR_fprintf(errorFD, "Unable to read from %s.\n", filename); errorCount++; goto loser; } curitem = CreateTextItem(text, startLine, linenum); text = NULL; if (tail == NULL) { head = tail = curitem; } else { tail->next = curitem; tail = curitem; } } if (dumpParse) { PrintHTMLStream(outputFD, head); } /* * Now we have a stream of tags and text. Go through and deal with each. */ for (curitem = head; curitem; curitem = curitem->next) { TagItem * tagp = NULL; AVPair * pairp = NULL; char *src = NULL, *id = NULL, *codebase = NULL; PRBool hasEventHandler = PR_FALSE; int i; /* Reset archive directory for each tag */ if (archiveDir) { PR_Free(archiveDir); archiveDir = NULL; } /* We only analyze tags */ if (curitem->type != TAG_ITEM) { continue; } tagp = curitem->item.tag; /* go through the attributes to get information */ for (pairp = tagp->attList; pairp; pairp = pairp->next) { /* ARCHIVE= */ if ( !PL_strcasecmp(pairp->attribute, "archive")) { if (archiveDir) { /* Duplicate attribute. Print warning */ PR_fprintf(errorFD, "warning: \"%s\" attribute overwrites previous attribute" " in tag starting at %s:%d.\n", pairp->attribute, filename, curitem->startLine); warningCount++; PR_Free(archiveDir); } archiveDir = PL_strdup(pairp->value); /* Substiture ".arc" for ".jar" */ if ( (PL_strlen(archiveDir) < 4) || PL_strcasecmp((archiveDir + strlen(archiveDir) -4), ".jar")) { PR_fprintf(errorFD, "warning: ARCHIVE attribute should end in \".jar\" in tag" " starting on %s:%d.\n", filename, curitem->startLine); warningCount++; PR_Free(archiveDir); archiveDir = PR_smprintf("%s.arc", archiveDir); } else { PL_strcpy(archiveDir + strlen(archiveDir) -4, ".arc"); } /* Record the first archive. This will be used later if * the archive is not specified */ if (firstArchiveDir == NULL) { firstArchiveDir = PL_strdup(archiveDir); } } /* CODEBASE= */ else if ( !PL_strcasecmp(pairp->attribute, "codebase")) { if (codebase) { /* Duplicate attribute. Print warning */ PR_fprintf(errorFD, "warning: \"%s\" attribute overwrites previous attribute" " in tag staring at %s:%d.\n", pairp->attribute, filename, curitem->startLine); warningCount++; } codebase = pairp->value; } /* SRC= and HREF= */ else if ( !PORT_Strcasecmp(pairp->attribute, "src") || !PORT_Strcasecmp(pairp->attribute, "href") ) { if (src) { /* Duplicate attribute. Print warning */ PR_fprintf(errorFD, "warning: \"%s\" attribute overwrites previous attribute" " in tag staring at %s:%d.\n", pairp->attribute, filename, curitem->startLine); warningCount++; } src = pairp->value; } /* CODE= */ else if (!PORT_Strcasecmp(pairp->attribute, "code") ) { /*!!!XXX Change PORT to PL all over this code !!! */ if (src) { /* Duplicate attribute. Print warning */ PR_fprintf(errorFD, "warning: \"%s\" attribute overwrites previous attribute" " ,in tag staring at %s:%d.\n", pairp->attribute, filename, curitem->startLine); warningCount++; } src = pairp->value; /* Append a .class if one is not already present */ if ( (PL_strlen(src) < 6) || PL_strcasecmp( (src + PL_strlen(src) - 6), ".class") ) { src = PR_smprintf("%s.class", src); /* Put this string back into the data structure so it * will be deallocated properly */ PR_Free(pairp->value); pairp->value = src; } } /* ID= */ else if (!PL_strcasecmp(pairp->attribute, "id") ) { if (id) { /* Duplicate attribute. Print warning */ PR_fprintf(errorFD, "warning: \"%s\" attribute overwrites previous attribute" " in tag staring at %s:%d.\n", pairp->attribute, filename, curitem->startLine); warningCount++; } id = pairp->value; } /* STYLE= */ /* style= attributes, along with JS entities, are stored into * files with dynamically generated names. The filenames are * based on the order in which the text is found in the file. * All JS entities on all lines up to and including the line * containing the end of the tag that has this style= attribute * will be processed before this style=attribute. So we need * to record the line that this _tag_ (not the attribute) ends on. */ else if (!PL_strcasecmp(pairp->attribute, "style") && pairp->value) { HTMLItem * styleItem; /* Put this item on the style list */ styleItem = CreateTextItem(PL_strdup(pairp->value), curitem->startLine, curitem->endLine); if (styleListTail == NULL) { styleList = styleListTail = styleItem; } else { styleListTail->next = styleItem; styleListTail = styleItem; } } /* Event handlers */ else { for (i = 0; i < num_handlers; i++) { if (!PL_strcasecmp(event_handlers[i], pairp->attribute)) { hasEventHandler = PR_TRUE; break; } } } /* JS Entity */ { char *entityStart, *entityEnd; HTMLItem * entityItem; /* go through each JavaScript entity ( &{...}; ) and store it * in the entityList. The important thing is to record what * line number it's on, so we can get it in the right order * in relation to style= attributes. * Apparently, these can't flow across lines, so the start and * end line will be the same. That helps matters. */ entityEnd = pairp->value; while ( entityEnd && (entityStart = PL_strstr(entityEnd, "&{")) /*}*/ != NULL) { entityStart += 2; /* point at beginning of actual entity */ entityEnd = PL_strchr(entityStart, '}'); if (entityEnd) { /* Put this item on the entity list */ *entityEnd = '\0'; entityItem = CreateTextItem(PL_strdup(entityStart), pairp->valueLine, pairp->valueLine); *entityEnd = /* { */ '}'; if (entityListTail) { entityListTail->next = entityItem; entityListTail = entityItem; } else { entityList = entityListTail = entityItem; } } } } } /* If no archive was supplied, we use the first one of the file */ if (!archiveDir && firstArchiveDir) { archiveDir = PL_strdup(firstArchiveDir); } /* If we have an event handler, we need to archive this tag */ if (hasEventHandler) { if (!id) { PR_fprintf(errorFD, "warning: tag starting at %s:%d has event handler but" " no ID attribute. The tag will not be signed.\n", filename, curitem->startLine); warningCount++; } else if (!archiveDir) { PR_fprintf(errorFD, "warning: tag starting at %s:%d has event handler but" " no ARCHIVE attribute. The tag will not be signed.\n", filename, curitem->startLine); warningCount++; } else { if (SaveInlineScript(tagp->text, id, basedir, archiveDir)) { goto loser; } } } switch (tagp->type) { case APPLET_TAG: if (!src) { PR_fprintf(errorFD, "error: APPLET tag starting on %s:%d has no CODE " "attribute.\n", filename, curitem->startLine); errorCount++; goto loser; } else if (!archiveDir) { PR_fprintf(errorFD, "error: APPLET tag starting on %s:%d has no ARCHIVE " "attribute.\n", filename, curitem->startLine); errorCount++; goto loser; } else { if (SaveSource(src, codebase, basedir, archiveDir)) { goto loser; } } break; case SCRIPT_TAG: case LINK_TAG: case STYLE_TAG: if (!archiveDir) { PR_fprintf(errorFD, "error: %s tag starting on %s:%d has no ARCHIVE " "attribute.\n", TagTypeToString(tagp->type), filename, curitem->startLine); errorCount++; goto loser; } else if (src) { if (SaveSource(src, codebase, basedir, archiveDir)) { goto loser; } } else if (id) { /* Save the next text item */ if (!curitem->next || (curitem->next->type != TEXT_ITEM)) { PR_fprintf(errorFD, "warning: %s tag starting on %s:%d is not followed" " by script text.\n", TagTypeToString(tagp->type), filename, curitem->startLine); warningCount++; /* just create empty file */ if (SaveInlineScript("", id, basedir, archiveDir)) { goto loser; } } else { curitem = curitem->next; if (SaveInlineScript(curitem->item.text, id, basedir, archiveDir)) { goto loser; } } } else { /* No src or id tag--warning */ PR_fprintf(errorFD, "warning: %s tag starting on %s:%d has no SRC or" " ID attributes. Will not sign.\n", TagTypeToString(tagp->type), filename, curitem->startLine); warningCount++; } break; default: /* do nothing for other tags */ break; } } /* Now deal with all the unnamable scripts */ if (firstArchiveDir) { HTMLItem * style, *entity; /* Go through the lists of JS entities and style attributes. Do them * in chronological order within a list. Pick the list with the lower * endLine. In case of a tie, entities come first. */ style = styleList; entity = entityList; while (style || entity) { if (!entity || (style && (style->endLine < entity->endLine))) { /* Process style */ SaveUnnamableScript(style->item.text, basedir, firstArchiveDir, filename); style = style->next; } else { /* Process entity */ SaveUnnamableScript(entity->item.text, basedir, firstArchiveDir, filename); entity = entity->next; } } } retval = 0; loser: /* Blow away the stream */ while (head) { curitem = head; head = head->next; DestroyHTMLItem(curitem); } while (styleList) { curitem = styleList; styleList = styleList->next; DestroyHTMLItem(curitem); } while (entityList) { curitem = entityList; entityList = entityList->next; DestroyHTMLItem(curitem); } if (text) { PR_Free(text); text = NULL; } if (fb) { FB_Destroy(fb); fb = NULL; } if (fd) { PR_Close(fd); } if (tagerr) { PR_smprintf_free(tagerr); tagerr = NULL; } if (archiveDir) { PR_Free(archiveDir); archiveDir = NULL; } if (firstArchiveDir) { PR_Free(firstArchiveDir); firstArchiveDir = NULL; } return retval; } /********************************************************************** * * e n s u r e E x i s t s * * Check for existence of indicated directory. If it doesn't exist, * it will be created. * Returns PR_SUCCESS if the directory is present, PR_FAILURE otherwise. */ static PRStatus ensureExists (char *base, char *path) { char fn [FNSIZE]; PRDir * dir; sprintf (fn, "%s/%s", base, path); /*PR_fprintf(outputFD, "Trying to open directory %s.\n", fn);*/ if ( (dir = PR_OpenDir(fn)) ) { PR_CloseDir(dir); return PR_SUCCESS; } return PR_MkDir(fn, 0777); } /*************************************************************************** * * m a k e _ d i r s * * Ensure that the directory portion of the path exists. This may require * making the directory, and its parent, and its parent's parent, etc. */ static int make_dirs(char *path, int file_perms) { char *Path; char *start; char *sep; int ret = 0; PRFileInfo info; if (!path) { return 0; } Path = PL_strdup(path); start = strpbrk(Path, "/\\"); if (!start) { return 0; } start++; /* start right after first slash */ /* Each time through the loop add one more directory. */ while ( (sep = strpbrk(start, "/\\")) ) { *sep = '\0'; if ( PR_GetFileInfo(Path, &info) != PR_SUCCESS) { /* No such dir, we have to create it */ if ( PR_MkDir(Path, file_perms) != PR_SUCCESS) { PR_fprintf(errorFD, "ERROR: Unable to create directory %s.\n", Path); errorCount++; ret = -1; goto loser; } } else { /* something exists by this name, make sure it's a directory */ if ( info.type != PR_FILE_DIRECTORY ) { PR_fprintf(errorFD, "ERROR: Unable to create directory %s.\n", Path); errorCount++; ret = -1; goto loser; } } start = sep + 1; /* start after the next slash */ *sep = '/'; } loser: PR_Free(Path); return ret; } /* * c o p y i n t o * * Function to copy file "from" to path "to". * */ static int copyinto (char *from, char *to) { PRInt32 num; char buf [BUFSIZ]; PRFileDesc * infp = NULL, *outfp = NULL; int retval = -1; if ((infp = PR_Open(from, PR_RDONLY, 0777)) == NULL) { PR_fprintf(errorFD, "ERROR: Unable to open \"%s\" for reading.\n", from); errorCount++; goto finish; } /* If to already exists, print a warning before deleting it */ if (PR_Access(to, PR_ACCESS_EXISTS) == PR_SUCCESS) { PR_fprintf(errorFD, "warning: %s already exists--will overwrite\n", to); warningCount++; if (rm_dash_r(to)) { PR_fprintf(errorFD, "ERROR: Unable to remove %s.\n", to); errorCount++; goto finish; } } if ((outfp = PR_Open(to, PR_WRONLY | PR_CREATE_FILE | PR_TRUNCATE, 0777)) == NULL) { char *errBuf = NULL; errBuf = PR_Malloc(PR_GetErrorTextLength() + 1); PR_fprintf(errorFD, "ERROR: Unable to open \"%s\" for writing.\n", to); if (PR_GetErrorText(errBuf)) { PR_fprintf(errorFD, "Cause: %s\n", errBuf); } if (errBuf) { PR_Free(errBuf); } errorCount++; goto finish; } while ( (num = PR_Read(infp, buf, BUFSIZ)) > 0) { if (PR_Write(outfp, buf, num) != num) { PR_fprintf(errorFD, "ERROR: Error writing to %s.\n", to); errorCount++; goto finish; } } retval = 0; finish: if (infp) PR_Close(infp); if (outfp) PR_Close(outfp); return retval; }
/****************************************************************************** * SOFA, Simulation Open-Framework Architecture * * (c) 2006 INRIA, USTL, UJF, CNRS, MGH * * * * This program is free software; you can redistribute it and/or modify it * * under the terms of the GNU Lesser General Public License as published by * * the Free Software Foundation; either version 2.1 of the License, or (at * * your option) any later version. * * * * This program is distributed in the hope that it will be useful, but WITHOUT * * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License * * for more details. * * * * You should have received a copy of the GNU Lesser General Public License * * along with this program. If not, see <http://www.gnu.org/licenses/>. * ******************************************************************************* * Authors: The SOFA Team and external contributors (see Authors.txt) * * * * Contact information: [email protected] * ******************************************************************************/ #ifndef SOFA_COMPONENT_BEHAVIORMODEL_EULERIANFLUID_GRID2D_H #define SOFA_COMPONENT_BEHAVIORMODEL_EULERIANFLUID_GRID2D_H #include "config.h" #include <sofa/type/Vec.h> #include <sofa/type/Mat.h> #include <sofa/helper/rmath.h> #include <sofa/helper/logging/Messaging.h> #include <iostream> namespace sofa { namespace component { namespace behaviormodel { namespace eulerianfluid { #ifndef NDEBUG #define DEBUGGRID #endif class SOFA_EULERIAN_FLUID_API Grid2D { public: typedef float real; typedef sofa::type::Vec<2,real> vec2; struct Cell { vec2 u; ///< velocity (unit = cell width) int type; ///< First particle (or 0 for non-fluid cell) int dummy; ///< Align the structure to 16 bytes void clear() { u.clear(); type = 0; } }; int nx,ny,ncell; enum { PART_EMPTY=0, PART_WALL=-1, PART_FULL=1 }; Cell* fdata; real* pressure; real* levelset; //char* distance; real t; real tend; real max_pressure; Cell bcell; static const unsigned long* obstacles; Grid2D(); ~Grid2D(); void clear(int _nx,int _ny); template<class T> static inline T lerp(T a, T b, real f) { return a+(b-a)*f; } int clamp_x(int x) { return (x<0)?0:(x>=nx)?nx-1:x; } int clamp_y(int y) { return (y<0)?0:(y>=ny)?ny-1:y; } int clamp_in_x(int x) { return (x<1)?1:(x>=nx-1)?nx-2:x; } int clamp_in_y(int y) { return (y<1)?1:(y>=ny-1)?ny-2:y; } int index(int x, int y) const { return x + y*nx; } int index(const vec2& p) const { return index(sofa::helper::rnear(p[0]), sofa::helper::rnear(p[1])); } Cell* get(int x, int y, Cell* base) const { return base+index(x,y); } const Cell* get(int x, int y, const Cell* base) const { return base+index(x,y); } Cell* get(int x, int y) { #ifdef DEBUGGRID if (((unsigned)x>=(unsigned)nx) || ((unsigned)y>=(unsigned)ny)) { msg_info("Grid2D")<<"INVALID CELL "<<x<<','<<y ; return &bcell; } #endif return get(x,y,fdata); } const Cell* get(int x, int y) const { #ifdef DEBUGGRID if (((unsigned)x>=(unsigned)nx) || ((unsigned)y>=(unsigned)ny)) { msg_info("Grid2D")<<"INVALID CELL "<<x<<','<<y ; return &bcell; } #endif return get(x,y,fdata); } Cell* get(const vec2& p) { return get(sofa::helper::rnear(p[0]),sofa::helper::rnear(p[1])); } const Cell* get(const vec2& p) const { return get(sofa::helper::rnear(p[0]),sofa::helper::rnear(p[1])); } template<int C> real interp(const Cell* base, real fx, real fy) const { return lerp( lerp(get(0,0,base)->u[C],get(1,0,base)->u[C],fx), lerp(get(0,1,base)->u[C],get(1,1,base)->u[C],fx), fy ); } template<int C> real interp(vec2 p) const { p[C] += 0.5; int ix = sofa::helper::rfloor(p[0]); int iy = sofa::helper::rfloor(p[1]); const Cell* base = get(ix,iy); return interp<C>(base, p[0]-ix, p[1]-iy); } vec2 interp(vec2 p) const { return vec2( interp<0>(p), interp<1>(p) ); } template<int C> void impulse(Cell* base, real fx, real fy, real i) { get(0,0,base)->u[C] += i*(1-fx)*(1-fy); get(1,0,base)->u[C] += i*( fx)*(1-fy); get(0,1,base)->u[C] += i*(1-fx)*( fy); get(1,1,base)->u[C] += i*( fx)*( fy); } template<int C> void impulse(vec2 p, real i) { p[C] += 0.5; int ix = sofa::helper::rfloor(p[0]); int iy = sofa::helper::rfloor(p[1]); Cell* base = get(ix,iy); impulse<C>(base, p[0]-ix, p[1]-iy, i); } void impulse(const vec2& p, const vec2& i) { impulse<0>(p,i[0]); impulse<1>(p,i[1]); } real* getpressure(int x, int y) { return pressure + index(x,y); } real getpressure(vec2 p) { int ix = sofa::helper::rfloor(p[0]); int iy = sofa::helper::rfloor(p[1]); real fx = p[0]-ix; real fy = p[1]-iy; real* base = getpressure(ix,iy); return lerp( lerp(base[index(0,0)],base[index(1,0)],fx), lerp(base[index(0,1)],base[index(1,1)],fx), fy ); } real* getlevelset(int x, int y) { return levelset + index(x,y); } real getlevelset(vec2 p) { int ix = sofa::helper::rfloor(p[0]); int iy = sofa::helper::rfloor(p[1]); real fx = p[0]-ix; real fy = p[1]-iy; real* base = getlevelset(ix,iy); return lerp( lerp(base[index(0,0)],base[index(1,0)],fx), lerp(base[index(0,1)],base[index(1,1)],fx), fy ); } void seed(real height); void seed(real height, vec2 normal); void seed(vec2 p0, vec2 p1, vec2 velocity=vec2(0,0)); void step(Grid2D* prev, Grid2D* temp, real dt=0.04, real diff=0.00001); void step_init(const Grid2D* prev, Grid2D* temp, real dt, real diff); //void step_particles(Grid2D* prev, Grid2D* temp, real dt, real diff); void step_levelset(Grid2D* prev, Grid2D* temp, real dt, real diff); void step_forces(const Grid2D* prev, Grid2D* temp, real dt, real diff, real scale=1.0); void step_surface(const Grid2D* prev, Grid2D* temp, real dt, real diff); void step_advect(const Grid2D* prev, Grid2D* temp, real dt, real diff); void step_diffuse(const Grid2D* prev, Grid2D* temp, real dt, real diff); void step_project(const Grid2D* prev, Grid2D* temp, real dt, real diff); void step_color(const Grid2D* prev, Grid2D* temp, real dt, real diff); // internal helper function // template<int C> inline real find_velocity(int x, int y, int ind, int ind2, const Grid2D* prev, const Grid2D* temp); // Fast Marching Method Levelset Update enum Status { FMM_FRONT0 = 0, FMM_FAR = -1, FMM_KNOWN = -2, FMM_BORDER = -3 }; int* fmm_status; int* fmm_heap; int fmm_heap_size; int fmm_pop(); void fmm_push(int index); void fmm_swap(int entry1, int entry2); }; } // namespace eulerianfluid } // namespace behaviormodel } // namespace component } // namespace sofa #endif
Hundreds of Coventry City fans marched to the Ricoh Arena today ahead of their League One match at home, in protest against the the club’s hedge fund owners Sisu . Organisers have said that around 2,500 Coventry City and Rochdale fans marched from Holbrooks Park to the stadium. Some fans chose to boycott the match against Rochdale, with many who joined in on the march continuing their protest around the feet of Jimmy Hill&apos;s statue well after kick-off. Fans met near the Unicorn Social Club in Holbrooks at 2pm. Here the protest began with fans chanting "Let down by the football league" and "We want Sisu out". The group were then escorted by police through the streets of Coventry, lead by a marching band and carrying banners and their team&apos;s flags. Echos of "I&apos;m city till I die" and "You are my city" travelled around Holbrooks as the crowd took over the streets, stopping traffic in its path. During the protest, father and son, John and Andrew McQuillan, told the Telegraph that they joined the march because they felt the fans were being let down by the owners. John, who has watched the team play for over thirty years, said: "Fans just go in and don&apos;t expect anything anymore." City fan of some 40 years, Stuart Brown added: “Today’s march is all about family. We’re doing a pick up from the Cherry Tree for anyone with mobility problems and it is just to walk for a mile in a family environment. “I think most people are pleased that these things are happening. Jan Mokrzycki, a member of the Sky Blue Trust , told the Telegraph that he was happy with the number of supporters that turned up to today&apos;s march. He said: "We stopped all the traffic, but everyone was in good humour about it. "I think, basically, it shows that there&apos;s still a massive amount of passion around the football club. "At the end of the day, the football club is in the hearts of the supporters." When asked what was next for Fighting The Jimmy Hill Way he said: "Watch this space". Organisers also wanted to assure fans that boycotting or attending the match was a personal decision which would be respected by all. Last week, t housands of plastic pigs were thrown onto the pitch ahead of CCFC’s League One clash with Charlton Athletic at The Valley in protest against the club&apos;s owners.
from collections import defaultdict N = int(input()) mem = defaultdict() mem["AC"] = 0 mem["WA"] = 0 mem["TLE"] = 0 mem["RE"] = 0 for i in range(N): inp = input() mem[inp] += 1 print("AC x " + str(mem["AC"])) print("WA x " + str(mem["WA"])) print("TLE x " + str(mem["TLE"])) print("RE x " + str(mem["RE"]))
import { apiUrl } from "./env"; export const fetcher = (resource: string) => fetch(apiUrl(resource)).then(res => res.json());
AND SPEAKING OF DATATREASURY . . . I discovered this article in The Green Sheet, which does a nice job summarizing the actions of DataTreasury and their enforcement of US patents 5,910,988 and 6,032,137 against the entire banking industry pursuant to Check 21. For those that may not be familiar with it, The Check Clearing for the 21st Century Act ("Check 21") was passed by Congress and became effective on October 28, 2004. Check 21 is intended to foster innovation in the payments system and to enhance its efficiency by reducing some of the legal impediments to check truncation. The law facilitates check truncation by creating a new negotiable instrument called a substitute check, which permits banks to truncate original checks, to process check information electronically, and to deliver substitute checks to banks that want to continue receiving paper checks. A substitute check is the legal equivalent of the original check and includes all the information contained on the original check. The law does not require banks to accept checks in electronic form nor does it require banks to use the new authority granted by the Act to create substitute checks (more information can be found here). The problem here is that DataTreasury is claiming to have a patent on core features used in the Check 21 process. So now we have a law allowing banks to electronically process checks, but in order to do so, they have to go through DataTreasury's patent. Very valuable stuff. According to DataTreasury, each year Bank of America processes 9.4 billion checks; Citigroup processes 2.4 billion; Wachovia processes 4.5 billion; and Wells Fargo processes 3.7 billion checks. JPMorgan Chase processed 1.5 billion checks in 2003. So far, DataTreasury has been successful in its attempts to go after patent infringers. It has entered into licensing agreements with some companies, and at least one company, ACS, is permanently barred from ever using its technology. JPMorgan Chase, which opted to settle with DataTreasury in the infringement suit, is now a DataTreasury licensee. And DataTreasury has made it clear that they will be going after others. DataTreasury is currently preparing to take First Data and Ingenico to trial to resolve its claims against them; it has refiled its claims against Viewpointe Archive, a check-image archiving provider founded by JPMorgan Chase.
import java.util.Scanner; import java.util.ArrayList; public class even_picture { public static void main(String[] args) { // TODO Auto-generated method stub Scanner obj=new Scanner(System.in); int n=obj.nextInt(); ArrayList<String> list=new ArrayList<String>(); list.add("0 0"); list.add("0 1"); for(int i=1;i<=n;i++) { int s=i-1; list.add(i+" "+s); s+=1; list.add(i+" "+s); s+=1; list.add(i+" "+s); } n++; int s=n-1; list.add(n+" "+s); s++; list.add(n+" "+s); System.out.println(list.size()); while(list.size()!=0) System.out.println(list.remove(0)); } }
Q: What do you think of "Planning Poker"? Planning Poker Summary, in case you don't want to read the wiki article: Get a list of tasks you want to do for the upcoming iteration For each task: 2.1 Discuss with the group what it entails 2.2 Everyone writes down / selects an estimation of how much effort is required for the task 2.3 Everyone reveals their estimation 2.4 The highest and lowest outliers explain their reasoning 2.5 Repeat until a consensus is reached Usually something similar to numbers from the Fibonacci sequence like 0, ½, 1, 2, 3, 5, 8, 13, 20, 40, 100 are the allowed values, so you don't get long arguments over close values like 23 vs 27. Further, the numbers represent a unit-less value of effort, whose value is determined by a baseline task that everyone agrees equals about a 1, and all else is relative to that. Ultimately, the goal is to get a good feel for a given team's "velocity", which is the number of these points that can be completed in a given iteration. With that, it's possible to make reasonably accurate estimates of how long any given feature will take. We did this at iteration planning meetings at one company I worked at, and I thought it was one of the few good things about that particular company. So, what I'm wondering is, has anyone used this? Do you think it's a useful tool for estimation? Does it work in all situations, or does it lend itself to certain teams, projects, etc? A: We use it in our company for the project I'm involved in. Some notes about planning poker are expressed in my recent blog post, and here's a bigger list of why it's cool: It makes everyone agree. People are not forced to accept any result; instead they're forced to make their own estimate! The time to defend their own estimates is also allocated, if it's necessary. It keeps everyone busy. You can't slack during the meeting, while trying to show that you're so involved. Also, necessity of moving your hands constitutes a good physical exercise to keep you off of sleeping. However, a downside of this is that sometimes you do need to do something else (for example, take some notes and write down the details of the agreement you've just reached). It keeps meetings faster. There's no need for a constant involvement of a meeting leader to keep everything on pace. The game with clear rules is way better for that. Yes, you need to make some extra moves to put cards on, reveal them, et cetera, but these pay their way. A lot of people just like to play cards, especially poker :-) This increases motivation. A company that sells decks of such cards accompanied their site with an article about Planning Poker, which is also worth reading. A: We use it extensively. I find it has several advantages over traditional methods: The team takes more ownership of estimates Often programmer archetypes favor introverts - this method encourages them to contribute where they might otherwise defer to more extroverted personalities When a feature has a wide distribution of estimates it is a good indicator of risk Just by doing the estimate you learn more about the tasks Nothing beats putting people in a room communicating effectivly A: I agree with Pavel's points. There's also one other thing that is valuable. It levels the playing field for discussion. Often quiet people are drowned out by more verbal people in a group discussion. Planning poker gives everybody a chance to make their decision before the active discussion begin. And if it the quiet person who provides the "outlier" opinion, they have the full stage on which to present their case. Therefore the technique is empowers the quieter contributors, and ensures full team participation.
Design of Circularly Polarized Patch Antenna on Conical Structure Circular polarization of slotted patch on conical surface is presented the circular polarisation is obtained by simulating the two symmetrical circular slot on patch antenna in planar and conical structure. In this paper, the variation of return loss (S11), axial ratio (AR) and beam width of the radiation of the circular polarization of planar patch is compared with patch embedded in conical surface. A 3 dB axial ratio bandwidth around 13 MHz and a −10 dB return loss bandwidth around 27 MHz are obtained with a high gain of 8.97dBic in the patch on conical structure and a 3 dB axial ratio beam width of 99 degree and 59 degree in XZ and YZ plane ($\mathbf{phi} = 0$ degree and $\mathbf{phi} = 90$ degree) respectively.
/** * This method is fired when enough data is in the Buffer to complete a command. If the * command does not match the signature of the buffered data then an exception is thrown * and the socket should be closed as the command/response queues are no longer in sync. * * @param command - The command to process from the response buffer. */ private void processCommand(MemcacheCommand command) { if (command == null) { log.warn("processCommand", "noCommandFound"); return; } LineParser parser = command.getLineParser(); MemcacheCommandResponse response = parser.getResponse(); log.trace("processCommand", "redisCommandSuccess", new String[]{"command"}, command.getCommand()); command.setResponse(response); }
Tracking systems (also known as navigation systems) assist surgeons during surgeries that require the precise locating of instruments such as surgical instruments. Such surgeries include neurosurgery, spine, and orthopedic surgery. In one implementation, the tracking system tracks a position and orientation of the surgical instrument during the surgical procedure and often displays the position and/or orientation of the instrument on a monitor in conjunction with a preoperative image or an intraoperative image of the patient (preoperative images are typically prepared by MRI or CT scans, while intraoperative images may be prepared using a fluoroscope, low level x-ray or any similar device). It has also been proposed that the surgical instrument be used free hand without the aid of a cutting jig, guide arm or other constraining mechanism to establish the location to which the cutting implement at the end of the instrument is applied. See, for example, U.S. Pat. No. 6,757,582 to Brisson et al. In one implementation, the tracking system typically employs a camera that detects a tracking device located on the surgical instrument. The tracking device has a plurality of optical markers such as light emitting diodes (LEDs) to determine the position and orientation of the surgical instrument. The position of the surgical instrument usually correlates to the coordinates of a working end of the instrument in three-dimensional space, the x, y, z or Cartesian coordinates, relative to the camera. The orientation of the surgical instrument means the pitch, roll, and yaw of the instrument. When both the position and the orientation of the surgical instrument are defined, the relative position of that instrument is known to the tracking system. One type of surgical instrument is known as a “pencil-style” hand-held surgical instrument. The pencil-style hand-held surgical instrument is held by the hand of the user to perform a medical/surgical task on the tissue of the patient such as shape or remove tissue such as bone from a femur. The pencil-style handheld surgical instrument makes use of a telescoping nose for a depth degree of freedom. The pencil-style hand-held surgical instrument also makes use of two additional degrees of freedom which are provided via a pivoting gimbal mechanism. In one implementation, the instrument includes a portion having a threaded nose tube that translates linearly. A motor telescopes the nose tube using an elongated rotor with a long internal thread directly engaging the nose tube. The nose tube has an external thread on a proximal end, which directly interfaces with the rotor of the motor. As the rotor spins in one direction, the nose tube pulls in (due to the nose tube being keyed) and spinning in the opposite direction results in the nose tube pushing out. An example of such a pencil-style hand-held surgical instrument is disclosed in pending patent application U.S. Patent Application Publication No. 2013/0060278, filed Aug. 31, 2012, the entire disclosure of which is hereby expressly incorporated by reference. Although the above has worked well, it is desirable to improve hand-held surgical instruments.
""" blockchain command line interface """ from http_handler import app # handler = HttpHandler() if __name__ == '__main__': from argparse import ArgumentParser parser = ArgumentParser() parser.add_argument('-p', '--port', default=5000, type=int, help='port to listen on') args = parser.parse_args() port = args.port app.run(host='127.0.0.1', port=port)
package me.computoMovil.smartAlarm.views; import android.animation.ValueAnimator; import android.content.Context; import android.graphics.Canvas; import android.graphics.Paint; import android.graphics.Path; import android.graphics.RectF; import android.util.AttributeSet; import android.view.View; import android.view.animation.LinearInterpolator; import com.afollestad.aesthetic.Aesthetic; import androidx.annotation.Nullable; import io.reactivex.disposables.Disposable; import io.reactivex.functions.Consumer; import me.computoMovil.smartAlarm.interfaces.Subscribblable; import me.computoMovil.androidutils.DimenUtils; public class ProgressTextView extends View implements Subscribblable { private Paint linePaint, circlePaint, referenceCirclePaint, backgroundPaint, textPaint; private long progress, maxProgress, referenceProgress; private String text; private int padding; private Disposable colorAccentSubscription; private Disposable textColorPrimarySubscription; private Disposable textColorSecondarySubscription; public ProgressTextView(Context context) { this(context, null); } public ProgressTextView(Context context, @Nullable AttributeSet attrs) { this(context, attrs, 0); } public ProgressTextView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); padding = DimenUtils.dpToPx(4); linePaint = new Paint(); linePaint.setAntiAlias(true); linePaint.setStyle(Paint.Style.STROKE); linePaint.setStrokeWidth(padding); circlePaint = new Paint(); circlePaint.setAntiAlias(true); referenceCirclePaint = new Paint(); referenceCirclePaint.setAntiAlias(true); backgroundPaint = new Paint(); backgroundPaint.setAntiAlias(true); backgroundPaint.setStyle(Paint.Style.STROKE); backgroundPaint.setStrokeWidth(padding); textPaint = new Paint(); textPaint.setAntiAlias(true); textPaint.setTextAlign(Paint.Align.CENTER); textPaint.setTextSize(DimenUtils.spToPx(34)); textPaint.setFakeBoldText(true); subscribe(); } @Override public void subscribe() { colorAccentSubscription = Aesthetic.Companion.get() .colorAccent() .subscribe(new Consumer<Integer>() { @Override public void accept(Integer integer) throws Exception { linePaint.setColor(integer); circlePaint.setColor(integer); invalidate(); } }); textColorPrimarySubscription = Aesthetic.Companion.get() .textColorPrimary() .subscribe(new Consumer<Integer>() { @Override public void accept(Integer integer) throws Exception { textPaint.setColor(integer); referenceCirclePaint.setColor(integer); invalidate(); } }); textColorSecondarySubscription = Aesthetic.Companion.get() .textColorSecondary() .subscribe(new Consumer<Integer>() { @Override public void accept(Integer integer) throws Exception { backgroundPaint.setColor(integer); backgroundPaint.setAlpha(50); invalidate(); } }); } @Override public void unsubscribe() { colorAccentSubscription.dispose(); textColorPrimarySubscription.dispose(); textColorSecondarySubscription.dispose(); } public void setText(String text) { this.text = text; invalidate(); } public void setProgress(long progress) { setProgress(progress, false); } public void setProgress(long progress, boolean animate) { if (animate) { ValueAnimator animator = ValueAnimator.ofFloat(this.progress, progress); animator.setInterpolator(new LinearInterpolator()); animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() { @Override public void onAnimationUpdate(ValueAnimator valueAnimator) { ProgressTextView.this.progress = (long) (float) valueAnimator.getAnimatedValue(); invalidate(); } }); animator.start(); } else { this.progress = progress; invalidate(); } } public void setMaxProgress(long maxProgress) { setMaxProgress(maxProgress, false); } public void setMaxProgress(long maxProgress, boolean animate) { if (animate) { ValueAnimator animator = ValueAnimator.ofFloat(this.maxProgress, maxProgress); animator.setInterpolator(new LinearInterpolator()); animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() { @Override public void onAnimationUpdate(ValueAnimator valueAnimator) { ProgressTextView.this.maxProgress = (long) (float) valueAnimator.getAnimatedValue(); invalidate(); } }); animator.start(); } else { this.maxProgress = maxProgress; invalidate(); } } public void setReferenceProgress(long referenceProgress) { this.referenceProgress = referenceProgress; invalidate(); } @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { super.onMeasure(widthMeasureSpec, heightMeasureSpec); int size = getMeasuredWidth(); setMeasuredDimension(size, size); } @Override protected void onDraw(Canvas canvas) { int size = Math.min(canvas.getWidth(), canvas.getHeight()); int sidePadding = padding * 3; canvas.drawCircle(size / 2, size / 2, (size / 2) - sidePadding, progress > maxProgress && maxProgress > 0 ? linePaint : backgroundPaint); if (maxProgress > 0) { float angle = (360f * progress / maxProgress); float referenceAngle = (360f * referenceProgress / maxProgress); Path path = new Path(); path.arcTo(new RectF(sidePadding, sidePadding, size - sidePadding, size - sidePadding), -90, angle, true); canvas.drawPath(path, linePaint); canvas.drawCircle((size / 2) + ((float) Math.cos((angle - 90) * Math.PI / 180) * ((size / 2) - sidePadding)), (size / 2) + ((float) Math.sin((angle - 90) * Math.PI / 180) * ((size / 2) - sidePadding)), 2 * padding, circlePaint); if (referenceProgress != 0) canvas.drawCircle((size / 2) + ((float) Math.cos((referenceAngle - 90) * Math.PI / 180) * ((size / 2) - sidePadding)), (size / 2) + ((float) Math.sin((referenceAngle - 90) * Math.PI / 180) * ((size / 2) - sidePadding)), 2 * padding, referenceCirclePaint); } if (text != null) canvas.drawText(text, size / 2, (size / 2) - ((textPaint.descent() + textPaint.ascent()) / 2), textPaint); } }
The Case for Safe and Affordable Energy: The Community Fight against the William Zimmer Nuclear Power Plant, 19691985 In 1971, David Fankhauser and his wife, Jill, left Johns Hopkins University, graduate degrees in hand, and headed for New Richmond, Ohio. Soon to be parents, the couple rented land near the Ohio River, to farm and garden organically and live as self-reliantly and healthfully as possible. Hired soon after by the University of CincinnatiClermont, Fankhauser worked as a biology professor there while he and his wife raised their family in the river plain. Today, it is a beautiful, sleepy stretch of land, which the Fankhausers now own, crowded with heavy, old trees, homegrown crops and grazing livestock. Yet the serenity of that place was once deeply threatened. As much as the Fankhausers wanted to distance their family from synthetic chemicals and consumer excess, almost immediately after arriving in Cincinnati they found out that Cincinnati Gas & Electric Company (CG&E), along with two other regional utilities, Dayton Power & Light (DP&L) and Columbus and Southern Ohio Electric Company (C&SOE), had plans to construct a nuclear power plant near Moscow, Ohiojust upriver and upwind.1 Trained as a geneticist who used radiation in the laboratory to induce mutations in bacteria, Fankhauser was already critical of nuclear energy, yet after talking with his neighbors he quickly realized few others in Cincinnati understood its risks. Each morning, he read the latest edition of the Cincinnati Enquirer; that it often contained op-eds praising the future William H. Zimmer Nuclear Power Plant deeply worried him. People merely assumed Zimmer would make its nearby communities wealthy. After being involved in funding nuclear technology research since the 1950s, CG&E announced plans for its own nuclear station in September 1969, marketing it as an economic stimulus for the area and a Dr. David Fankhauser
Ethnicity and Electoral Politics main actors in the bargaining model: the minority, the majority, and the lobby. For Jenne, the lobby actor plays a significant role in influencing the intensity of minority demands and the response of the majority group. In fact, Jenne theorizes minority radicalization is driven by signals of behavioral intent from both the majority and/or lobby actor. In practical terms, her model paradoxically predicts if minority members are confident of external support, their leaders will radicalize for concessions despite the majoritys attempts to appease them (p. 53). This is a strong departure from literature that suggests minority radicalization is mainly a function of the majoritys inability to commit to minority protection. The next four chapters are dedicated to presenting her case studies, and how they fit into the theoretical model. In doing so, however, it becomes apparent that the model is more applicable to territorial concentrated minorities and perhaps, specific to the context of postcommunist Eastern Europe. In respect to the latter point, due to the historical rooting of ethnic identification in the region, it will be far-fetched to ascertain universal applicability of her theory without further testing. The final chapter presents potential policy recommendations to alleviate the paradox of minority empowerment. This unfortunately is not a major strength of the book. For instance, one of her major suggestions is that thirdparty mediators in ethnic conflicts should not have ties to either party of the dispute; or forceful interventions should only be carried out by major powers due to potent inducements and threats at their disposal. Both suggestions are the basis of any effective mediation and are well-known principles in international policy studies and diplomatic practices. Notwithstanding this lapse, Ethnic Bargaining is a well-written book for professional scholars and graduate students interested in ethnic relations in Eastern Europe. The theoretical argument is a novel one, perhaps signifying a broader movement towards a new discourse in ethnic minority empowerment.
Effect of Sintering Process and Starch Amount on the Porosity and Permeability of Al2O3-ZrO2 High Porous Oil Filters - Alumina-Zirconia is prepared for oil filter. Oil filters are used to separate oil derivatives from each other using separation principles depending on the size of the holes. These filters work on the principle of separation depending on the density and viscosity of liquid or on the difference in impurity crystals size. This work involves preparation of filters from Alumina-Zirconia powder materials by a hybrid freeze casting and space-holder method. These filters have excellent properties such as stability at high temperature, excellent corrosion resistance; withstand static stresses, and other unique thermal properties. Alumina-Zirconia powder is mixed with different amounts of (zero, 15, 25, and 35 vol. %) of starch powder. Powder mixture has been blending with water using an electric mixer to obtain homogeneous slurry. Solid: liquid ratio of slurry of 30:70 is poured in a cylindrical metal molds and freezed by liquid nitrogen chamber. The solidified material was heat treated at 300 °C for 60 min then sintered at 1550 °C, 1600 °C and 1700 °C under vacuum for 120 min. Hot samples were cooled inside furnace until room temperature. The sintered materials were examined to show the effect of starch adding and sintering process on the porous structure and permeability ratio of the fluid using Archimedes method and SEM image analyzed by J-image program. Best permeability and homogeneous porous structure are obtained at 1600 °C sintering temperature with 24 vol. % of starch powder.
/** * gpiochip_remove() - unregister a gpio_chip * @chip: the chip to unregister * * A gpio_chip with any GPIOs still requested may not be removed. */ void gpiochip_remove(struct gpio_chip *chip) { struct gpio_device *gdev = chip->gpiodev; struct gpio_desc *desc; unsigned long flags; unsigned i; bool requested = false; gpiochip_sysfs_unregister(gdev); gdev->chip = NULL; gpiochip_irqchip_remove(chip); acpi_gpiochip_remove(chip); gpiochip_remove_pin_ranges(chip); gpiochip_free_hogs(chip); of_gpiochip_remove(chip); gdev->data = NULL; spin_lock_irqsave(&gpio_lock, flags); for (i = 0; i < gdev->ngpio; i++) { desc = &gdev->descs[i]; if (test_bit(FLAG_REQUESTED, &desc->flags)) requested = true; } spin_unlock_irqrestore(&gpio_lock, flags); if (requested) dev_crit(&gdev->dev, "REMOVING GPIOCHIP WITH GPIOS STILL REQUESTED\n"); cdev_del(&gdev->chrdev); device_del(&gdev->dev); put_device(&gdev->dev); }
package impl import ( logging "github.com/ipfs/go-log/v2" "github.com/EpiK-Protocol/go-epik/api" "github.com/EpiK-Protocol/go-epik/node/impl/client" "github.com/EpiK-Protocol/go-epik/node/impl/common" "github.com/EpiK-Protocol/go-epik/node/impl/full" "github.com/EpiK-Protocol/go-epik/node/impl/market" "github.com/EpiK-Protocol/go-epik/node/impl/paych" ) var log = logging.Logger("node") type FullNodeAPI struct { common.CommonAPI full.ChainAPI client.API full.MpoolAPI market.MarketAPI paych.PaychAPI full.StateAPI full.MsigAPI full.WalletAPI full.SyncAPI } var _ api.FullNode = &FullNodeAPI{}
import java.util.*; import java.util.stream.LongStream; import java.util.stream.Stream; import static java.util.function.Function.identity; import static java.util.stream.Collectors.toList; public class ReHash { public static void main(String[] args) { Scanner s = new Scanner(System.in); System.out.println(findValue(s.nextLong())); } private static String findValue(long r) { Map<Long, Long> xy = findXY(findY(r), r); if (xy.isEmpty()) { return "NO"; } else { Long x = xy.keySet().stream().min(Long::compareTo).get(); return x + " " + xy.get(x); } } private static List<Long> findY(long r) { long diffBetweenSquares = 4 * (r - 1); long expectedModule = diffBetweenSquares % 2; return LongStream.rangeClosed(1, (long) Math.sqrt(diffBetweenSquares)) .parallel() .mapToObj(divisor -> checkAndReturnDivisors(divisor, diffBetweenSquares)) .flatMap(identity()) .filter(divisor -> divisor % 2 == expectedModule) .map(divisor -> diffBetweenSquares / divisor - divisor) .filter(ReHash::isEven) .map(val -> val / 2 - 1) .filter(ReHash::isEven) .filter(val -> val > 0) .map(val -> val / 2) .collect(toList()); } private static Stream<Long> checkAndReturnDivisors(final long divisor, final long number) { List<Long> divisors = new ArrayList<>(); if (number % divisor == 0) { divisors.add(divisor); if (number / divisor != divisor) { divisors.add(number / divisor); } } return divisors.stream(); } private static boolean isEven(long number) { return number % 2 == 0; } private static Map<Long, Long> findXY(List<Long> ys, long r) { Map<Long, Long> values = new TreeMap<>(); ys.forEach(y -> findAndCheckXs(1, 2 * y + 1, 1 - r).forEach(x -> values.put(x, y))); return values; } private static List<Long> findAndCheckXs(final long a, final long b, final long c) { return findXs(a, b, c).stream() .map(Math::round) .filter(x -> x > 0) .filter(x -> checkX(a, b, c, x)) .collect(toList()); } private static boolean checkX(final long a, final long b, final long c, final long x) { double value = Math.pow(x, 2) * a + 1. * b * x + 1. * c; return value == 0; } private static List<Double> findXs(final long a, final long b, final long c) { List<Double> xs = new ArrayList<>(); double D = 1. * b * b - 4. * a * c; if (D > 0) { xs.add((-b - Math.sqrt(D)) / (2 * a)); xs.add((-b + Math.sqrt(D)) / (2 * a)); } else if (D == 0) { xs.add(-b * 1. / (2 * a)); } return xs; } }
. Lipid peroxides are formed by autooxidation of polyunsaturated fatty acids found primarily in cell membranes. An increase level of lipid peroxides in the tissue therefore reflects membrane damage. We reported that water immersion restraint rats caused significant increase of gastric mucosal lipid peroxide which reflected on gastric mucosal injury. The gastric mucosal injury is also known as the post-operative complication due to physical stress. So we studied plasma lipid peroxide and its related substances in the operation of esophageal cancer. Lipid peroxide levels increased significantly in pre- and post-operation but temporal decrease was found during the operation. Vitamin E is thought to be an important structural component of biologic membranes and is believed to act as a free radical scavenger in lipid peroxidation. Vitamin E also increased in the patients of esophageal cancer and decreased significantly during the operation. Superoxide dismutase changed frequently during the operation but there was no deficit tendency in its changes. Catalase levels also changes frequently and showed temporal but statistical elevation after the operation. These results indicated that lipid peroxidation may contribute to the development of organic damage in the operation of esophageal cancer.
Bay Path said in a news release Tuesday that it will use the money to research and engage with employers and to build up its The American Women’s College program to enroll more adult women. The courses offer cybersecurity and information technology studies. The American Women’s College offers online courses and the option of taking some classes in person at Bay Path on Saturdays, according to its website. According to the release, the project will use evidence-based strategies, adaptive learning technology and predictive analytics built into the Social Online Universal Learning (SOUL) model that is the foundation of The American Women’s College online accelerated baccalaureate degree programs. Partners include the Bay Path University Cybersecurity Academic Advisory Council, Economic Development Council of Western Massachusetts, MassHire Hampden County Workforce Board, MassHire Franklin Hampshire Workforce Board, Massachusetts Technology Leadership Council, Pass the Torch for Women, PSI Services, Jeannette Rankin Women’s Scholarship Fund, Springfield Technical Community College, University of Massachusetts Donahue Institute and the Center for Educational Policy at the College of Education at University of Massachusetts Amherst. Bay Path University said it was selected from hundreds of applicants in the “innovative solutions in education-to-employment” competition Strada Education Network announced in 2018. The competition focused on investment in working adults required to get more skilled as the labor market shifts and “disconnected youth” 18 to 24 who are neither working nor in school. Gov. Charlie Baker got a preview of the paid internship program, directed by Delcie Bean of Paragus IT.
/** * Builder for simple database server provider metadata. */ public class SimpleDatabaseServerProviderMetadataBuilder extends AbstractResourceProviderMetadataBuilder<SimpleDatabaseServerProviderMetadataBuilder, SimpleDatabaseServerProviderMetadata> { /** * The set of supported database types. */ private Set<DatabaseType> supportedDatabaseTypes; /** * Sets the set of supported database types. * * @param supportedDatabaseTypes the set of supported database types */ public SimpleDatabaseServerProviderMetadataBuilder supportedDatabaseTypes(Set<DatabaseType> supportedDatabaseTypes) { this.supportedDatabaseTypes = supportedDatabaseTypes; return this; } @Override protected SimpleDatabaseServerProviderMetadataBuilder getThis() { return this; } @Override protected SimpleDatabaseServerProviderMetadata build(String id, String name, String description, Class<? extends ResourceProvider<?, ?>> providerClass, List<ConfigurationProperty> providerConfigurationProperties, List<ConfigurationProperty> resourceTemplateConfigurationProperties, List<DisplayProperty> resourceDisplayProperties) { return new SimpleDatabaseServerProviderMetadata(id, name, description, providerClass, providerConfigurationProperties, resourceTemplateConfigurationProperties, resourceDisplayProperties, supportedDatabaseTypes); } }
Pathological Gamblers in the Workplace Abstract Commercial gaming is a thriving and popular industry. Increasingly, emerging technologies like the Internet provide unlimited access to gambling at work. This article provides an overview of pathological gambling and its associated adverse financial, legal, and psychosocial consequences with implications for the workplace. It also offers recommendations for safeguarding company resources, limiting liability and preventing potential abuses, identifying potential pathological gamblers, and devising effective intervention strategies and referral networks to assist employees with gambling problems.
Mechanism of inhibition of human leucocyte elastase by beta-lactams. 2. Stability, reactivation kinetics, and products of beta-lactam-derived E-I complexes. The monocyclic beta-lactams reported by Knight et al. as inhibitors of human leucocyte elastase (HLE) produce stable HLE-inhibitor complexes that slowly reactivate with half-lives ranging from less than 1 to 15 h at 37 degrees C. The complexes produced between PPE and two C-3 dimethyl-substituted beta-lactams are less stable than those produced between HLE and analogous C-3 diethyl-substituted lactams. The stability of the HLE-I complexes is governed primarily by the structure of the substituted urea portion of the inhibitors and not by the identity or presence of a leaving group at C-4 of the lactam ring. In some cases substitutions on the urea portion of the inhibitors yielded complexes that displayed biphasic reactivation kinetics. This suggests the presence of at least two different complexes. The stereochemistry of the leaving group at C-4 has a small effect on the stability of the final complex (1.3-2-fold); therefore, the identity of the final complex is dependent upon the initial stereochemistry at that position. The stability of the complexes was relatively insensitive to hydroxylamine, which suggests that the acyl-enzymes are protected from nucleophilic "rescue". The rate of reactivation of the complex derived from L-680,833,-4-[(1-(((1-(4- methylphenyl)butyl)amino)carbonyl)-3,3-diethyl-2-oxo-4-azetidinyl)ben zeneacetic acid, was pH independent, while the L-684,481, (R)-(1-(((1-(4-methylphenyl)butyl)amino)carbonyl)-3,3-diethyl-2-azeti din one generated complex displayed a pH-dependent reactivation rate. In the latter case, the increase in reactivation rate with pH displayed a pKa of 7.2. This is consistent with the requirement for base catalysis by the active site histidine to regenerate enzymatic activity. Reactivation of the L-680,833-derived complex produced different products as a function of pH, suggesting two different pH-dependent routes of reactivation. At low pH a route that produced primarily the substituted urea is favored, while at higher pH production of two six-membered ring diastereomers competes with urea generation. Thus, the apparent pH independence of the return of activity is the result of two offsetting pathways. Other compounds such as L-670,258, (S)-4-benzoic acid, reactivate by these two routes as well as by aminolysis by the other urea nitrogen to produce an additional regioisomer. The temperature dependence of the reactivation of the complexes derived from L-684,481 and L-680,833 suggests different mechanisms.(ABSTRACT TRUNCATED AT 400 WORDS)
Perfect for Friday the 13th. The "Haunted Windchimes" is the Carson Valley Arts Council's last concert of the 2017-2018 season on April 13. The group's sound is very traditional folk and blues and the features their original songs that have a vintage quality, as if they might have been written yesterday or 75 years ago. Don't miss this lively night of music at the CVIC Hall on Esmeralda Ave. in Minden. Doors open at 6 p.m. and the show starts at 7 p.m. Advance tickets are $22 and $26 at door, under age 18 free. To purchase tickets: Call 782-8207, online at http://www.cvartscouncil.com or pick them up at the CVAC office, Carson Valley Arts Council, 1572 Hwy 395, Suite A, Minden or the Douglas County Community Center, 1329 Waterloo Lane, Gardnerville. Come enjoy ice cream sundaes, banana splits and root beer floats all day on April 14 at the Douglas County Community & Senior Center in Gardnerville. Join or renew your YAH membership and attend this fabulous, free ice cream social. YAH members, will be taking memberships and renewals and the $5 fee to join will pay for itself that very day. Doors open at 11 a.m., bingo starts at 1 p.m. two free bingo cards with admission (addition cards available at $1 each). A new event presented on April 28, is hosted by the Friends of Genoa, to benefit the local volunteer fire department, Station No. 3. It's time to get ready for the community's annual event that supports the worthwhile cause of providing and delivering meals to our local homebound seniors. Forms are available to become a sponsor or donate to the event presented by Douglas County Senior Services. Stop by or call the Community & Senior Center in Gardnerville for information about how to become involved. Big Mama's car show is on May 12 at in Lampe Park, Gardnerville and features vintage cars, DJ music, food vendors and raffles for great prizes. Contact Georgianna Drees-Wasmer at 782-5500, Ext. 3. for information. A new event presented on April 28, is hosted by the Friends of Genoa, to benefit the local volunteer fire department, Station No. 3. It is sponsored by David Walley's 1862 Resort and Spa and begins at 10 a.m. and goes until 10 p.m. Daylong activities are free and include music by the Sierra Sweethearts, Jon & Betsy Elliott, Tong Argnto, Chris Bayer, Richar Elloyan & Steve Wasde, Larry Maurice and Gary Allegretto. Fun for children and the whole family features, Native American presentations, historic reenactments, including Mark Twain, Charley Parkhurst, and celebrities from the VC Living Legends. Here is where you will get a taste of a real live Old West shoot-out with the Cowboy Fast Draw. Evening dinner and concert tickets are $60. They include a barbecue dinner at the Genoa Fire Station followed by a concert with the Saddle Cats Western Swing Band and Dave Stamey. Purchase your tickets with cash or check at the Pink House, 193 Genoa Lane, Genoa, open Tuesday-Sunday (phone 392-4279). Sorry, no credit cards accepted for this event.
<gh_stars>0 export enum ProductType { matWalls = 'wallsmat', matFloors = 'floorsmat', transparentWalls = 'wallstransparent', transparentFloors = 'floorstransparent' }
In vitro evaluation of a combination treatment involving anticancer agents and an aurora kinase B inhibitor. Aurora kinase B (AURKB) inhibitors are regarded as potential molecular-targeting drugs for cancer therapy. The present study evaluated the cytotoxic effect of a combination of AZD1152-hQPA, an AURKB inhibitor, and various anticancer agents on the HeLa human cervical cancer cell line, as well as its cisplatin-resistant equivalent HCP4 cell line. It was demonstrated that AZD1152-hQPA had an antagonistic effect on the cytotoxicity of cisplatin, etoposide and doxorubicin, but had a synergistic effect on that of all-trans-retinoic acid (ATRA), Am80 and TAC-101, when tested on HeLa cells. Cisplatin, etoposide and doxorubicin were shown to increase the cellular expression of AURKB, while ATRA, Am80 and TAC-101 downregulated its expression. These results suggested that AURKB expression is regulated by these anticancer agents at the transcriptional level, and that the level of expression of AURKB may influence the cytotoxic effect of AZD1152-hQPA. Therefore, when using anticancer agents, decreasing the expression of AURKB using a molecular-targeting drug may be an optimal therapeutic strategy.
Metal free decarboxylative aminoxylation of carboxylic acids using a biphasic solvent system. The smooth oxidative radical decarboxylation of carboxylic acids with TEMPO and other derivatives as radical scavengers is reported. The key to success was the use of a two-phase solvent system to avoid otherwise predominant side reactions such as the oxidation of TEMPO by persulfate and enabled the selective formation of synthetically useful alkoxyamines. The method does not require transition metals and was successfully used in a new synthetic approach for the antidepressant indatraline.
/* * Distortion.cpp * * Created on: 28 Oct 2015 * Author: hieu */ #include <sstream> #include "Distortion.h" #include "../PhraseBased/Hypothesis.h" #include "../PhraseBased/Manager.h" #include "../legacy/Range.h" #include "../legacy/Bitmap.h" using namespace std; namespace Moses2 { struct DistortionState_traditional: public FFState { Range range; int first_gap; DistortionState_traditional() : range() { // uninitialised } void Set(const Range& wr, int fg) { range = wr; first_gap = fg; } size_t hash() const { return range.GetEndPos(); } virtual bool operator==(const FFState& other) const { const DistortionState_traditional& o = static_cast<const DistortionState_traditional&>(other); return range.GetEndPos() == o.range.GetEndPos(); } virtual std::string ToString() const { stringstream sb; sb << first_gap << " " << range; return sb.str(); } }; /////////////////////////////////////////////////////////////////////// Distortion::Distortion(size_t startInd, const std::string &line) : StatefulFeatureFunction(startInd, line) { ReadParameters(); } Distortion::~Distortion() { // TODO Auto-generated destructor stub } FFState* Distortion::BlankState(MemPool &pool, const System &sys) const { return new (pool.Allocate<DistortionState_traditional>()) DistortionState_traditional(); } void Distortion::EmptyHypothesisState(FFState &state, const ManagerBase &mgr, const InputType &input, const Hypothesis &hypo) const { DistortionState_traditional &stateCast = static_cast<DistortionState_traditional&>(state); // fake previous translated phrase start and end size_t start = NOT_FOUND; size_t end = NOT_FOUND; /* if (input.m_frontSpanCoveredLength > 0) { // can happen with --continue-partial-translation start = 0; end = input.m_frontSpanCoveredLength -1; } */ stateCast.range = Range(start, end); stateCast.first_gap = NOT_FOUND; } void Distortion::EvaluateInIsolation(MemPool &pool, const System &system, const Phrase<Moses2::Word> &source, const TargetPhraseImpl &targetPhrase, Scores &scores, SCORE &estimatedScore) const { } void Distortion::EvaluateInIsolation(MemPool &pool, const System &system, const Phrase<SCFG::Word> &source, const TargetPhrase<SCFG::Word> &targetPhrase, Scores &scores, SCORE &estimatedScore) const { } void Distortion::EvaluateWhenApplied(const ManagerBase &mgr, const Hypothesis &hypo, const FFState &prevState, Scores &scores, FFState &state) const { const DistortionState_traditional &prev = static_cast<const DistortionState_traditional&>(prevState); SCORE distortionScore = CalculateDistortionScore(prev.range, hypo.GetInputPath().range, prev.first_gap); //cerr << "distortionScore=" << distortionScore << endl; scores.PlusEquals(mgr.system, *this, distortionScore); DistortionState_traditional &stateCast = static_cast<DistortionState_traditional&>(state); stateCast.Set(hypo.GetInputPath().range, hypo.GetBitmap().GetFirstGapPos()); //cerr << "hypo=" << hypo.Debug(mgr.system) << endl; } SCORE Distortion::CalculateDistortionScore(const Range &prev, const Range &curr, const int FirstGap) const { bool useEarlyDistortionCost = false; if (!useEarlyDistortionCost) { return -(SCORE) ComputeDistortionDistance(prev, curr); } else { /* Pay distortion score as soon as possible, from Moore and Quirk MT Summit 2007 Definitions: S : current source range S' : last translated source phrase range S'' : longest fully-translated initial segment */ int prefixEndPos = (int) FirstGap - 1; if ((int) FirstGap == -1) prefixEndPos = -1; // case1: S is adjacent to S'' => return 0 if ((int) curr.GetStartPos() == prefixEndPos + 1) { //IFVERBOSE(4) std::cerr<< "MQ07disto:case1" << std::endl; return 0; } // case2: S is to the left of S' => return 2(length(S)) if ((int) curr.GetEndPos() < (int) prev.GetEndPos()) { //IFVERBOSE(4) std::cerr<< "MQ07disto:case2" << std::endl; return (float) -2 * (int) curr.GetNumWordsCovered(); } // case3: S' is a subsequence of S'' => return 2(nbWordBetween(S,S'')+length(S)) if ((int) prev.GetEndPos() <= prefixEndPos) { //IFVERBOSE(4) std::cerr<< "MQ07disto:case3" << std::endl; int z = (int) curr.GetStartPos() - prefixEndPos - 1; return (float) -2 * (z + (int) curr.GetNumWordsCovered()); } // case4: otherwise => return 2(nbWordBetween(S,S')+length(S)) //IFVERBOSE(4) std::cerr<< "MQ07disto:case4" << std::endl; return (float) -2 * ((int) curr.GetNumWordsBetween(prev) + (int) curr.GetNumWordsCovered()); } } int Distortion::ComputeDistortionDistance(const Range& prev, const Range& current) const { int dist = 0; if (prev.GetNumWordsCovered() == 0) { dist = current.GetStartPos(); } else { dist = (int) prev.GetEndPos() - (int) current.GetStartPos() + 1; } return abs(dist); } void Distortion::EvaluateWhenApplied(const SCFG::Manager &mgr, const SCFG::Hypothesis &hypo, int featureID, Scores &scores, FFState &state) const { UTIL_THROW2("Not implemented"); } }
Dr. Robert H. Hales, a Provo ophthalmologist and past president of the Utah Medical Association, died March 23, 1988, in Utah Valley Regional Medical Center of cancer. He was 57. Dr. Hales was affiliated with and president of many professional societies, including the medical association. He was also a fellow of the American College of Surgeons, and served as a clinical instructor at the University of Utah College of Medicine and the Brigham Young University College of Nursing.An active community leader, Dr. Hales was a lifetime member of the Cougar Club and a member of the Timpanogos Kiwanis Club. He had been a board member of the BYU Alumni Association and had recently received a Distinguished Alumni Award. Funeral will begin at 1 p.m. March 28 in the Provo Oak Hills 6th Ward chapel, 1900 N. 15th East. Friends may call at the chapel Sunday 7-9 p.m., and on Monday an hour before the service. Burial will be in Provo City Cemetery. The family suggests contributions be made in behalf of Dr. Hales to the U. Medical School.
Personality Characteristics of ADHD Adults Assessed With the Millon Clinical Multiaxial Inventory-II: Evidence of Four Distinct Subtypes This study compared the personality characteristics of 104 adults diagnosed with attention deficit hyperactivity disorder (ADHD). Personality features were assessed with the MCMI-II. Participants were divided into 4 groups based on the presence of persisting oppositional defiant disorder (ODD) or other comorbid diagnoses (ADHD only, ADHD-comorbid, ADHD-ODD, ADHD-ODD-comorbid). Significant differences between these groups were present for 9 of the 13 MCMI-II personality scales, resulting in 4 modal personality styles. ADHD-only adults evidenced mild histrionic traits, whereas the ADHD-comorbid group was more often avoidant and dependent in personality style. ADHD-ODD adults showed histrionic, narcissistic, aggressive-sadistic, and negativistic traits whereas the ADHD-ODD-comorbid group had a combination of avoidant, narcissistic, antisocial, aggressive-sadistic, negativistic, and self-defeating personality features. Implications for treatment are discussed.
def dset_logl(dset, det_pf): x, vp = resize_to_exp_limits_det(det_pf) exp_en = dset.all_en() likl = np.interp(exp_en, x, vp, left=0, right=0) logl = np.log(likl) return np.sum(logl)
Overnight parking restrictions will be in effect. Violators will be subject to a $50 fine. MANITOWOC - A snow emergency has been declared in Manitowoc, as a snowstorm is expected to leave up to 7 inches of snow in the area during the day Wednesday. As a result of the snow emergency, no parking will be allowed on city streets between 1 and 6 a.m. Thursday (Wednesday evening, overnight tonight). Vehicles parked in violation of the snow emergency are subject to a $50 fine. Manitowoc Recreation Department has cancelled its volleyball league and riflery programs scheduled for this evening. Manitowoc Public School District schools were to dismiss one hour early and all after-school activities were canceled. Two Rivers public-private schools were dismissing one hour early (1:30 p.m. for elementary; 1:45 p.m. for middle; and 2 p.m. for high school; and all after-school activities were canceled. Manitowoc Roncalli was closing early, at 1:35 p.m., and after-school activities were canceled. Mishicot public-private was closing early at 1:30 p.m. Wednesday and there was no pre-K or early childhood. Manitowoc Lutheran High School was closed Wednesday. Meals on Wheels, the Mishicot Senior Meal Site and the Manitowoc County home-delivered meal program were closed Wednesday. There was to be no afternoon 4K or early childhood in Mishicot. Lakeshore United Methodist Church activities for Wednesday were canceled. St. John's Lutheran Church in Maribel canceled Wednesday activities. St. John's Lutheran Church in Two Rivers canceled Wednesday evening services. St. Peter's Lutheran Church in Mishicot canceled Wednesday activities and there was to be no confirmation class or school board meeting. The National Weather Service has issued a winter weather advisory for the Manitowoc area, lasting until 9 p.m. Wednesday. In addition to the daytime snow, winds are expected to increase and produce gusts as high as 24 mph. Snow is likely, mainly before 10 p.m., with an overnight low of around 11 degrees. New snow of less than an inch is possible overnight, the NWS said. NWS's Thursday’s forecast calls for partly sunny skies with a high near 23 degrees. The next chance for snow comes Thursday night, when there is a chance of flurries prior to 11 p.m., then a chance of flurries with a slight chance of snow showers between 11 p.m. and midnight. Snow showers are also possible after midnight Thursday, with a 30 percent chance of precipitation. There’s also a slight chance of snow Friday morning through Saturday afternoon.
Chemotaxis in Bacillus subtilis: effects of attractants on the level of methylation of methyl-accepting chemotaxis proteins and the role of demethylation in the adaptation process. By performing in vivo methylation experiments and using highly resolving NaDodSO4-polyacrylamide gels, we have examined the effects of amino acid attractants on the methylation profile of Bacillus subtilis MCPs. Both increases and decreases have been found to occur in the level of methylation of these proteins. By using competition experiments and Conway diffusion cells, we have found that the demethylation event is correlated with the adaptation process. Gas chromatographic analysis indicates that methanol is evolved upon demethylation of these proteins. As more attractant receptors are titrated, corresponding increases in methanol evolution result. During this period of increased rate of methanol production, bacteria swim smoothly.
A study of information security awareness in Australian government organisations Purpose The purpose of this paper is to investigate the human-based information security (InfoSec) vulnerabilities in three Australian government organisations. Design/methodology/approach A Web-based survey was developed to test attitudes, knowledge and behaviour across eight policy-based focus areas. It was completed by 203 participants across the three organisations. This was complemented by interviews with senior management from these agencies. Findings Overall, management and employees had reasonable levels of InfoSec awareness. However, weaknesses were identified in the use of wireless technology, the reporting of security incidents and the use of social networking sites. These weaknesses were identified in the survey data of the employees and corroborated in the management interviews. Research limitations/implications As with all such surveys, responses to the questions on attitude and behaviour (but not knowledge) may have been influenced by the social desirability bias. Further research s...
<reponame>bitsmith1010/minimal-player-with-event-bus // this is expected in the build system, TODO: to remove function getMessage(): string { return 'test string'; } function printError(reason: any) { console.log('[!]', reason); } export { printError, getMessage };
Optimization of Distributed Integrated Multi-energy System Considering Industrial Process Based on Energy Hub As a typical scenario of distributed integrated multi-energy system (DIMS), industrial park contains complex production constraints and strong associations between industrial productions and energy demands. The industrial production process (IPP) consists of controllable subtasks and strict timing constraints. Taking IPP as a control variable of optimal scheduling, it is an available approach that models the IPP as material flow into an extension energy hub (EH) to achieve the optimization of industrial park. In this paper, considering the coupling between the production process and energy demands, a model of IPP is proposed by dividing the process into different adjustable steps, including continuous subtask, discrete subtask, and storage subtask. Then, a transport model of material flow is used to describe the IPP in an industrial park DIMS. Based on the concept of EH, a universal extension EH model is proposed considering the coupling among electricity, heat, cooling, and material. Furthermore, an optimal scheduling method for industrial park DIMS is proposed to improve the energy efficiency and operation economy. Finally, a case study of a typical battery factory is shown to illustrate the proposed method. The simulation results demonstrate that such a method reduces the operation cost and accurately reflects the operation state of the industrial factory.
/** * Copyright (c) 2002-2013 "Neo Technology," * Network Engine for Objects in Lund AB [http://neotechnology.com] * * This file is part of Neo4j. * * Neo4j is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ package org.neo4j.server.rest.web; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.PrintWriter; import java.util.Collection; import java.util.Collections; import java.util.Enumeration; import java.util.HashMap; import java.util.Locale; import java.util.Map; import javax.servlet.ServletOutputStream; import javax.servlet.http.Cookie; import org.mortbay.jetty.HttpFields; import org.mortbay.jetty.Response; public class InternalJettyServletResponse extends Response { private class Output extends ServletOutputStream { private ByteArrayOutputStream baos = new ByteArrayOutputStream(); @Override public void write( int c ) throws IOException { baos.write( c ); } public String toString() { try { baos.flush(); String result = baos.toString("UTF-8"); return result; } catch ( Exception e ) { throw new RuntimeException( e); } } } private final Map<String, Object> headers = new HashMap<String, Object>(); private final Output output = new Output(); private int status = -1; private String message = ""; public InternalJettyServletResponse() { super( null ); } public void addCookie( Cookie cookie ) { // TODO Auto-generated method stub } public String encodeURL( String url ) { // TODO Auto-generated method stub return null; } public void sendError( int sc ) throws IOException { sendError( sc, null ); } public void sendError( int code, String message ) throws IOException { setStatus( code, message ); } public void sendRedirect( String location ) throws IOException { setStatus( 304 ); addHeader( "location", location ); } public boolean containsHeader( String name ) { return headers.containsKey( name ); } public void setDateHeader( String name, long date ) { headers.put( name, date ); } public void addDateHeader( String name, long date ) { if ( headers.containsKey( name ) ) { headers.put( name, date ); } } public void addHeader( String name, String value ) { setHeader( name, value ); } public void setHeader( String name, String value ) { headers.put( name, value ); } public void setIntHeader( String name, int value ) { headers.put( name, value ); } public void addIntHeader( String name, int value ) { setIntHeader( name, value ); } @Override public String getHeader( String name ) { if ( headers.containsKey( name ) ) { Object value = headers.get( name ); if ( value instanceof String ) { return (String) value; } else if ( value instanceof Collection ) { return ( (Collection<?>) value ).iterator() .next() .toString(); } else { return value.toString(); } } return null; } public Map<String, Object> getHeaders() { return headers; } @Override public Enumeration<?> getHeaders( String name ) { if ( headers.containsKey( name ) ) { Object value = headers.get( name ); if ( value instanceof Collection ) { return Collections.enumeration( (Collection<?>) value ); } else { return Collections.enumeration( Collections.singleton( value ) ); } } return null; } public void setStatus( int sc, String sm ) { status = sc; message = sm; } public int getStatus() { return status; } public String getReason() { return message; } public ServletOutputStream getOutputStream() throws IOException { return output; } public boolean isWriting() { return false; } public PrintWriter getWriter() throws IOException { return new PrintWriter( output ); } public void setCharacterEncoding( String encoding ) { System.out.println("calling"); } public void setContentLength( int len ) { } public void setLongContentLength( long len ) { } public void setContentType( String contentType ) { } public void setBufferSize( int size ) { } public int getBufferSize() { return -1; } public void flushBuffer() throws IOException { } public String toString() { return null; } public HttpFields getHttpFields() { return null; } public long getContentCount() { return 1l; } public void complete() throws IOException { } public void setLocale( Locale locale ) { } public boolean isCommitted() { return false; } }
Test and analysis of an electro-optic dynamic diverging lens for three-dimensional optical memories. We present the experimental results of a two-dimensional electro-optic dynamic diverging lens for dynamic imaging. The device is based on a lanthanum-modified lead zirconate titanate ceramic wafer. It produces a smooth phase-modulation distribution, which almost eliminates the diffraction loss of interdigital electrodes and the interference among different diffraction orders that exist in most of these types of devices. The continual change of focal length in this device is achieved by an applied control voltage. A dynamic-imaging system is demonstrated. It can be used to address three-dimensional optical memories. The aberration of the device as compared with an ideal lens is also numerically evaluated. With minor modification to the applied voltage distribution on the device, its performance is comparable with that of an ideal lens.
// // User.h // siloTwitter // // Created by <NAME> on 2/26/15. // Copyright (c) 2015 <NAME>. All rights reserved. // #import <Foundation/Foundation.h> #import <CoreData/CoreData.h> @class Tweet; @interface User : NSManagedObject @property (nonatomic, retain) NSString * name; @property (nonatomic, retain) NSString * username; @property (nonatomic, retain) NSString * password; @property (nonatomic, retain) NSSet *tweets; @end @interface User (CoreDataGeneratedAccessors) - (void)addTweetsObject:(Tweet *)value; - (void)removeTweetsObject:(Tweet *)value; - (void)addTweets:(NSSet *)values; - (void)removeTweets:(NSSet *)values; @end
<reponame>soma-goodsduck/be-commons_spring-boot<filename>src/main/java/com/ducks/goodsduck/commons/model/entity/UserIdolGroup.java package com.ducks.goodsduck.commons.model.entity; import lombok.AccessLevel; import lombok.Getter; import lombok.NoArgsConstructor; import lombok.Setter; import javax.persistence.*; @Entity @Getter @Setter @NoArgsConstructor(access = AccessLevel.PROTECTED) public class UserIdolGroup { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Column(name = "user_idol_group_id") private Long id; @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "user_id") private User user; @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "idol_group_id") private IdolGroup idolGroup; public static UserIdolGroup createUserIdolGroup(IdolGroup idolGroup) { UserIdolGroup userIdolGroup = new UserIdolGroup(); userIdolGroup.setIdolGroup(idolGroup); return userIdolGroup; } }
#include<stdio.h> #include<stdlib.h> void sort(int *a,int n) { int l=0,r=n-1,t; while(l<r) { if(a[l]%2==1) { l++; } if(a[r]%2==0) { r--; } if(l<r) { t=a[l]; a[l]=a[r]; a[r]=t; } } } void print(int **a,int *b,int t) { for(int i=0;i<t;i++) { for(int j=0;j<b[i];j++) printf("%d ",a[i][j]); if(i<(t-1)) printf("\n"); } } int main() { int t; do { scanf("%d",&t); }while((t<1)||(t>500)); int **a=(int **)calloc(t,sizeof(int *)); //malloc对单,calloc对多 int *b=(int *)calloc(t,sizeof(int)); for(int i=0;i<t;i++) { do { scanf("%d",&b[i]); }while((b[i]<2)||(b[i]>2000)); a[i]=(int *)calloc(b[i],sizeof(int)); for(int j=0;j<b[i];j++) { scanf("%d",&a[i][j]); } sort(a[i],b[i]); } print(a,b,t); free(a); return 0; }
The Challenge of Workplace Health and Safety in Croatia In this manuscript, the authors examine the current state of workplace health and safety in Croatia during the recent recession and highlight efforts by international and regional organizations to assist the relatively young Croatian government with efforts to provide a safer work environment for Croatia's workers. Responsible managerial actions in the public, private and nonprofit sectors to address Croatian worker safety and health issues are provided. INTRODUCTION Occupational safety and health issues impact governments, labor and business organizations throughout the world affecting economies, profits and most importantly, the lives of residents. In addition, the recent world economic downturn labeled The Great Recession exposed structural problems in many countries. Croatia is an independent country that was established when Yugoslavia broke apart following the end of the Cold War. The country has made a formal application for membership in the European Union and is now a candidate for membership after signing the EU Accession Treaty in December 2011. Croatian citizens are awaiting ratification of their country's EU status from the current 27 EU countries, with a target date of July 2013 (CIA World Factbook, n.d.). Current economic problems in Croatia include a drop in Gross Domestic Product (GDP), decreased personal income, high unemployment and a weak governmental financial balance sheet. These problems have led to a weakened and unstable government and to problems both within the country and to a lesser extent with other nations. The effects of this financial crisis on occupational safety, occupational health and motor vehicle safety have yet to be fully explored. The purpose of this article is to provide a preliminary overview of this subject so that data collection and further analysis can be undertaken in a subsequent project. THE CROATIAN ECONOMY To understand the fragility and tumult of the Great Recession in Croatia, it is helpful to have a snapshot of this young country. Croatia is currently a country of 4,416,000 people (United Nations Data, 2009) and is considered part of Southern Europe(see Figure 1: Map of Croatia). The country achieved independence from Yugoslavia in 1991 and subsequently transitioned through four Prime Ministers from 1991 until 2000. In 2000, a parliamentary republic system was implemented and the Prime Ministers position became the official head-of-government. The longest serving Prime Minister from 2000 2012 was Ivo Sanader (December 23, 2003 July 6, 2009) and he is currently awaiting trial on corruption charges. His partys (Croatia Democratic Union, abbreviated HDZ) successor, JadrankaKosor, served as Prime Minister until December 23, 2011 when the Social Democratic Party (SDP) put in place ZoranMilanovi. The SDP has also controlled the Croatian Presidency since January 2010 when Ivo Josipovi was elected. In a span of 20 years, the Croatian government has been led by eight Prime
Sharing Antenatal Care: Client Satisfaction and Use of the Patientheld Record Two hundred women (148 shared care patients and 52 clinic patients) completed a questionnaire about care received during pregnancy and the use of a patientheld record. Women receiving shared care reported higher levels of satisfaction with their care than clinic patients (p<0.0001). Thirtysix percent of the women in shared care forgot to take their record to an appointment on at least 1 occasion. During the pregnancy, over half of the respondents in both groups made contact with the hospital for reasons other than for their regular visit. For both groups, convenience was the most frequently reported reason for choosing their model of care. Other important issues for shared care patients were that the service was more personal and more information was provided. Among clinic patients, safety and quality of care were identified as important. Problems involved with the patient holding the only complete pregnancy record are discussed.
<reponame>NovaSurfer/2d_sdl_engine // // Created by novasurfer on 4/23/20. // #include "game_main.h" #include "core/camera.h" //#include "core/glfw_base/window.h" #include "core/input_types.h" #include "core/log2.h" #include "core/rendering/renderqueue.h" #include "core/rendering/texture.h" #include "filesystem/resourceHolder.h" //#include "menu.h" #include <base/heap_alloc.h> #include <core/dbg/dbg_asserts.h> void Game::init(const sc2d::Window& window, const sc2d::WindowSize& window_size) { ///------------- INIT TEST SCENE / LEVEL sc::heap_alloc halloc; input = reinterpret_cast<sc2d::Input*>(halloc.allocate(sizeof(sc2d::Input), 8)); new (input)sc2d::Input(window); sc2d::Camera camera; camera.make_orthographic(window_size.width, window_size.height, sc2d::DEFAULT_Z_NEAR, sc2d::DEFAULT_Z_FAR); // REGULAR SPRITE const sc2d::Shader& sprite_shader = sc2d::ResourceHolder::get_shader("sprite_default"); const sc2d::Texture2d& logo_texture = sc2d::ResourceHolder::get_texture("logo"); sprite.init(sprite_shader); sprite.set_color(sc2d::Color::WHITE); sprite.set_texture(logo_texture); sprite.set_transfdata(math::vec2(0, 0), math::vec2(111, 148), 0, camera.get_proj()); // SPRITE_SHEEEEEEEEEEET const sc2d::Shader& sprite_sheet_shader = sc2d::ResourceHolder::get_shader("spritesheet"); const sc2d::TextureAtlas tex_atlas = sc2d::ResourceHolder::get_texture_atlas("tilemap"); tiled_map = sc2d::ResourceHolder::get_tiled_map("wasd"); tiled_map.init(sprite_sheet_shader, camera.get_proj()); tiled_map.set_sheet_texture(tex_atlas); const sc2d::Shader& font_shader = sc2d::ResourceHolder::get_shader("text_ft2"); font_shader.run(); font_shader.set_mat4("projection", camera.get_proj()); sc2d::Ft2Font128 fnt_04b_03; fnt_04b_03.init("data/fonts/04B_03__.TTF", 48); text_ft2.init(font_shader, fnt_04b_03); text_ft2.set_text("hello. I'm Max."); text_ft2.set_pos({100.f, 100.f}, 0); text_ft2.set_color(sc2d::Color::CYAN); const sc2d::Shader& batched_shader = sc2d::ResourceHolder::get_shader("sprite_batched"); sprite_batch.init(batched_shader, camera.get_proj()); render_queue.push(sprite); render_queue.push(text_ft2); DBG_WARN_ON_RENDER_ERR } void Game::draw() { tiled_map.draw_map(); render_queue.draw(); // sprite.draw(); // text_ft2.draw(); sprite_batch.draw({5, 5}, {100, 10}, {1.0, .0f, .0f, 1.0f}); sprite_batch.draw({100, 100}, {100, 100}, {1.0, .0f, 1.0f, 1.0f}); sprite_batch.draw({50, 65}, {10, 10}, {1.0, 1.0f, .0f, 1.0f}); sprite_batch.draw({500, 256}, {50, 50}, {0.0, 0.0f, .0f, 1.0f}); sprite_batch.flush(); // spritesheet->draw(sc2d::ResourceHolder::get_texture_atlas("tilemap"), math::vec2(0, 0), // math::size2d(16, 16), 0); } void Game::destroy() { // text_ft2.destroy(); // TODO: delete input } void Game::update(double dt) { if(input->get_key_down(Key::ESCAPE)) { log_info_cmd("ESCAPE PRESSED"); } }
Gastroplasty for morbid obesity: the internist's view. To evaluate the benefit of gastric surgery in terms of improvement in health risk factors, the loss of weight and its long-term maintenance, 28 non-diabetic morbidly obese subjects were followed during three to five years after vertical banded gastroplasty. Aside from a rapid and sustained loss of weight averaging nearly 75% reduction of weight excess, there occurred a concomitant improvement in glucose tolerance with 50% reduction in fasting insulinaemia and correction of hypertension. The improvement in cardiovascular risk factors also included the drop in plasma triglycerides associated with an increase in HDL-cholesterol, while uricaemia decreased to low normal levels. Gastric procedures are therefore an effective treatment of severe obesity and of its comorbid conditions, but they should be followed by careful medical and nutritional monitoring to prevent any possible digestive or nutritional complications.
#include <graphics/GraphicsState.h> using namespace pdfout; namespace kernel{ GraphicsState::GraphicsState(void) : mCTM(), mLineWidth(1.f), mLineCap(LineCapButt), mLineJoin(LineJoinMiter), mMiterLimit(10.f), //mDashPattern(), mRenderingIntent(RenderingIntentRelativeColorimetric), mFlatness(1.f), mStrokingColorSpace(ColorSpace::createDeviceGray()), mColorSpace(ColorSpace::createDeviceGray()), mStrokingColor(Color::createGray(ColorNameBlack)), mColor(Color::createGray(ColorNameBlack)), mColorRGB(Color::createGray(ColorNameBlack)), mColorCMYK(Color::createGray(ColorNameBlack)), mColorGray(Color::createGray(ColorNameBlack)), mTextState(), mExtGState(){ } GraphicsState *GraphicsState::clone(void) const{ return new GraphicsState(*this); } }
<reponame>sergeymakinen/go-quote package quote_test import ( "fmt" "github.com/sergeymakinen/go-quote/unix" "github.com/sergeymakinen/go-quote/windows" ) func ExampleQuoting_unix() { filename := `Long File With 'Single' & "Double" Quotes.txt` fmt.Println(unix.SingleQuote.MustQuote(filename)) // Echoing inside 'sh -c' requires a quoting to make it safe with an arbitrary string quoted := unix.SingleQuote.Quote(filename) fmt.Println([]string{ "sh", "-c", fmt.Sprintf("echo %s | callme", quoted), }) unquoted, _ := unix.SingleQuote.Unquote(quoted) fmt.Println(unquoted) // Output: // true // [sh -c echo 'Long File With '"'"'Single'"'"' & "Double" Quotes.txt' | callme] // Long File With 'Single' & "Double" Quotes.txt } func ExampleQuoting_windows() { // If you have to deal with a different from Argv command-line quoting // when starting processes on Windows, don't forget to manually create a command-line // via the CmdLine SysProcAttr attribute: // // cmd := exec.Command(name) // cmd.SysProcAttr = &windows.SysProcAttr{ // CmdLine: strings.Join(args, " "), // } filename := `Long File With 'Single' & "Double" Quotes.txt` fmt.Println(windows.Argv.MustQuote(filename)) // Using both Argv and Cmd quoting as callme.exe requires the Argv quoting // and its safe usage in cmd.exe requires the Cmd quoting quoted := windows.Argv.Quote(filename) fmt.Println([]string{ "cmd.exe", "/C", fmt.Sprintf("callme.exe %s", windows.Cmd.Quote(quoted)), }) unquoted, _ := windows.Cmd.Unquote(quoted) unquoted, _ = windows.Argv.Unquote(unquoted) fmt.Println(unquoted) // Output: // true // [cmd.exe /C callme.exe ^"Long^ File^ With^ ^'Single^'^ ^&^ \^"Double\^"^ Quotes.txt^"] // Long File With 'Single' & "Double" Quotes.txt }
Hypnotic Susceptibility and Autokinetic Movement Frequency It is possible that the individual differences in reporting autokinetic movement of a stationary source may be related to the hypnotic susceptibility of Ss as measured by the Harvard Group Scale for Hypnotic Susceptibility by Shor and Orne. Instructions from E that a source of illumination will be perceived as moving by S might be more effective in inducing perceived movement in those Ss who had scored high on the Harvard scale. Since these scores are directly related to susceptibility to hypnotic suggestion, it was predicted that there would be a positive correlation between autokinetic movement and scores on the scale. In the present study, on Day 1 the scale was administered to a large group of Ss. On Day 2, 20 female Ss who had scored high (8 to 1 2 ) and 20 female Ss who had scored low ( 0 to 4) volunteered to participate in an experiment on the autokinetic effect. Movement was assessed individually without a period of prior dark adaptation. Ss were told that they would be shown a spot of light for a series of 10 trials; each would last for 1 min., with an intertrial interval of 15 sec. Ss were requested to report perceived magnitude and direction of movement of the light. E was blind with respect to Ss' scores on the Harvard scale. There was a positive Pearsonian correlation between Ss' scores on the Harvard scale and the number of reported direction changes of the light source (I. =.45, p <.01). The mean number of changes in direction for high and low scores on the Harvard scale was 5.9 and 2.1, respectively (F = 57.53, d f = 1/36, f l <.0001). Thus, much of the variation in perception of autokinetic movement, in terms of number of reported changes in direction, could be accounted for by the differences in Ss' hypnotic susceptibility.
<filename>testFiles/withMultipleMethods.go package test import ( "fmt" "io" ) type S struct { FieldOne string io.Reader FieldThree int } func (s *S) MethodOne(a, b, c string) *int { num := 4 return &num } func (s *S) MethodTwo() { } func (s *S) methodThree() {} type Custom bool func (c Custom) doThing(n float64) *S { return &S{} } func (c Custom) SomethingElse() (b bool, e error, i interface{}) { return false, nil } func main() { fmt.Println("I'm running out of things to write in these.") }
The present invention relates to a structure and method for changing or controlling the thermal emissivity of the surface of a radiating object in situ, and thus, for changing or controlling the radiative heat transfer between the object and its environment in situ. More particularly, changing or controlling the degree of blackbody behavior of the object is accomplished by changing or controlling certain physical characteristics of a structure defining a plurality of cavities on the surface of the object. As described herein, this cavity structure may be integral to the radiating object or added to the surface of the object to form a new radiating surface. Heat transfer between an object and its environment is achieved by up to three main processes: conduction, convection, and radiation. While conduction occurs at solid/solid and solid/fluid interfaces, the principal means of transferring heat into or out of many systems is by a combination of convective media and radiation. Terrestrial system designs typically exploit both convective and radiative heat transfer, however, heat management in many space (i.e., extraterrestrial) systems relies essentially on radiation because of the lack of a convective medium. Convective heat transfer is provided by the natural or forced flow of a fluid over the surface of an object and can be controlled by changing parameters such as the fluid medium and/or its physical properties, flow rate, and surface roughness. In contrast, radiative heat transfer depends on the degree of blackbody behavior exhibited by the surface and the fourth power of surface temperature. Thermal energy radiated by a surface is expressed by the Stefan-Boltzmann equation: Qrad=A"sgr"xcex5(Tb4xe2x88x92Ta4)xe2x80x83xe2x80x83(1) where Qrad=thermal power radiated (W) A=area of radiating surface (m2) "sgr"=the Stefan-Boltzmann Constant (5.67xc3x9710xe2x88x928W/m2/K4) xcex5=thermal emissivity factor of radiating surface Tb=temperature of the radiating surface (K) Ta=ambient temperature (K) The thermal emissivity factor (xcex5) is the ratio of an object""s radiative emission efficiency to that of a perfect radiator, also called a blackbody. The thermal emissivity factor of most materials ranges between 0.05 and 0.95 and is relatively constant over a significant temperature range. Therefore, the radiative heat transfer capability of an object is typically a predetermined, monotonic function of its temperature raised to the fourth power. The following example illustrates the expected impact of changing the thermal emissivity, or degree of blackbody behavior, of an object that is transferring heat by free convection and radiation. In this example, the reference object is a horizontal cylinder 1 m long with a 10 cm outer diameter, rejecting heat to a 300K environment through free convection and radiation. A simplified equation for the laminar flow convective heat transfer coefficient, h, for the object is: h=1.32(xcex94T/Dc)0.25xe2x80x83xe2x80x83(2) (Holman, J. P., Heat Transfer, Sixth Edition, McGraw-Hill) where xcex94T=temperature difference between surface and ambient (K) Dc=diameter of cylinder (m) Heat transferred by convection (Qconv) is expressed by: Qconv=hA(Tbxe2x88x92Ta)xe2x80x83xe2x80x83(3) where A, Tb, and Ta are the same variables as in Equation 1. FIG. 1 shows the amount of heat rejected from the reference object by convection and radiation using Equations 1 and 3, respectively, over a xcex94T range of 1-1000 K, which covers a principal range of engineering interest. This figure shows the convection term (Qconv) to be approximately an order of magnitude larger than radiation (Qrad) from a surface with xcex5=0.1 for xcex94T up to about 100 K. Beyond this temperature, the T4 dependence of radiation increases more rapidly, making the two modes of heat transfer approximately equal when xcex94T approaches 1000 K. In contrast, radiation from a surface exhibiting ideal blackbody behavior (i.e., xcex5=1.0) is always greater than convection and is at least an order of magnitude larger when xcex94T is near or above 1000 K. More importantly, FIG. 1 illustrates the potential impact on the heat transfer capability of the reference object as the thermal emissivity of its surface changes, by changing the thermal emissivity factor from xcex5=1.0 to xcex5=0.1, and vice versa. Thus, the ability to change or control the degree of blackbody behavior of a radiating object, while it is in service (i.e., in situ), analogous to changing or controlling the convective term in a fluid system during operation by altering the flow rate of the fluid, would enable a remarkable improvement in the thermal design and control of many systems where radiative heat transfer is important. For example, the surface of an object or system with controllable thermal emissivity could be activated at some limiting temperature as a thermal safety valve. In this mode of operation, the surface would be triggered to switch to a higher thermal emissivity that, in turn, radiates more heat to prevent the temperature of the object or system increasing above safe limits. Similarly, switching thermal emissivity to a lower value could protect against a system operating at less than a desirable temperature limit. In addition, changing the thermal emissivity of an object will effectively change its thermal, or infrared (IR), signature. This is especially important in detection, recognition, and camouflage applications. For example, the ability to change or control the thermal emissivity of an object provides an opportunity for an object to match its thermal emission characteristics with those of other objects or structures in its vicinity, thereby enabling an IR camouflage effect. In current systems where radiative heat transfer is important, the surface material and/or surface preparation of a radiating object is carefully selected to obtain the desired fixed thermal emissivity and resulting radiative heat transfer characteristic. Typical surface preparations include a variety of coating, etching, and polishing techniques. Etching techniques are also being used to create fixed surface textures for spectroscopic applications. For example, Ion Optics Inc. (Waltham, Mass.) has developed tuned infrared sources using ion beam etching processes that create a random fixed surface texture consisting of sub-micron rods and cones (http://www.ion-optics.com). Such a surface texture has a high emissivity over a narrow band of wavelengths and low emissivity in other bands and is an attractive alternative to IR light-emitting diodes. Applying the emerging field of solid state microelectromechanical technology, tunable IR filters for IR spectral analysis are also being developed. An example of such a device is reported by Ohnstein, T. R., et al (xe2x80x9cTunable IR Filters With Integral Electromagnetic Actuators,xe2x80x9d Solid State Sensor and Actuator Workshop Proceedings, 1996, pp 196-199, Hilton Head, S.C.). Such tunable IR filters comprise arrays of waveguides whose transmittance can be varied by changing the spacing between them using linear actuators. The wavelength cutoff range from 8 xcexcm to 32 xcexcm achieved by Ohnstein et al with this technology is typical of its narrowband selectivity. Such IR spectral analysis devices, like the devices developed by Ion Optics, Inc., are purposely designed with surface microstructures having dimensions comparable to specific wavelengths in the electromagnetic spectrum to be effective at wavelengths that are discrete or in narrow bandwidths. Consequently, these devices are ineffective for applications which require the changing or controlling of broader ranges of wavelengths important in radiative heat transfer. Accordingly, there is a need for a capability to change or control broadband radiative heat transfer between an object and its environment while the object is in service. The present invention provides a structure and method for changing or controlling the thermal emissivity of the surface of an object in situ, and thus, changing or controlling the radiative heat transfer between the object and its environment in situ. Changing or controlling the degree of blackbody behavior of the object is accomplished by changing or controlling certain physical characteristics of a cavity structure on the surface of the object. The cavity structure, defining a plurality of cavities, may be formed by selectively removing material(s) from the surface, selectively adding a material(s) to the surface, or adding an engineered article(s) to the surface to form a new radiative surface. The physical characteristics of the cavity structure that are changed or controlled in accordance with the present invention include cavity area aspect ratio, cavity longitudinal axis orientation, and combinations thereof. Controlling the cavity area aspect ratio may be performed by controlling the size of the cavity surface area, the size of the cavity aperture area, or a combination thereof. As described herein, the cavity structure may contain a gas, liquid, or solid that further enhances radiative heat transfer control and/or improves other properties of the object, for example surface finish, while in service. The subject matter of the present invention is particularly disclosed and distinctly claimed in the concluding portion of this specification. However, both the organization and method of operation, together with further advantages and objects thereof, may best be understood by reference to the following description and examples taken in connection with accompanying drawings wherein like reference characters refer to like elements.
/** * @param directory * to unlock No-op if not locked. */ protected void unlockDirectory(File directory) { FileLock lock = locks.get(directory); if (lock != null) { locks.remove(directory); try { lock.release(); } catch (IOException e) { LogUtil.warn("Unable to unlock " + directory + ": " + e); } } }
Contingency Bases and the Problem of Sociocultural Context Abstract : United States (US) military presence during contingency operations can have a large impact on the host nation and other regional actors. Recent experience has shown that even on-base actions can have profoundly negative consequences for the success of US missions. One key to successful missions is to win and preserve the trust and confidence of the affected population. A thorough understanding of a host nation s customs, laws, and practices enables the commander to execute the mission with fewer obstacles, both locally and regionally. This Technical Note discusses the issue of how to approach setting up and operating contingency bases within different sociocultural contexts. The authors consider the range of impacts that a contingency base life cycle may have upon the nearby community economically, culturally, and socially. Detailed criteria are presented for consideration in the acquisition, construction, and operation of contingency bases, and the outline of a research program is proposed to address both documented and prospective negative sociocultural impacts.
. Azygos prolongation of the inferior vena cava is a congenital abnormality which is normally associated with a congenital cardiac lesion, abnormalities of the inferior caval system and, in some instances, abdominal heterotaxia. The authors report here a case which is exceptional in the sense that the azygos prolongation was isolated. Further radiological studies are essential in order to make the diagnosis following the discovery of a right-sided laterotracheal opacity on a plain chest film. Only five other cases were found in the literature.
``I trust that this book can help change the way you and your family think about vacations. And in doing so, it will change your life,'' Cali writes. His approach? Teach good family vacation planning skills. ``Most travel books don't explain how to plan one (a road trip),'' he said. The book is based on Cali's four ``vacation pillars'': planning ahead, involving the whole family, discovering something new, and expecting the unexpected. The guide includes the family's own ``Top 10 Road Trip Itineraries'' and tips that families can use to make their drive a good one. Even the book was a family project. Cali, his wife, Wendy, 16-year-old daughter Christie and 14-year-old son Josh wrote short essays describing their family adventures. Cali plans to donate every cent of the proceeds to the places that have helped his family create their vacation memories. Those includes the National Park Foundation, National Trust for Historic Preservation, Farm Aid and Habitat for Humanity. The idea for the book came from conversations with family and friends. Cali started to create sample itineraries for people who became interested in fun, family road trips. The demand became so great that he made time to write a book, although not always during normal waking hours. ``Sometimes at 4 o'clock on a Saturday morning,'' he said. Cali's childhood, unlike his children's, did not revolve around travel. But when his father gave 9-year-old Joe a book depicting places all over the world, young Cali was awestruck. ``It seemed kind of like this really distant dream. It was so hard for me to imagine going anywhere,'' he recalled. Now, traveling is Cali's life. The Cali family has traveled to 46 states and 20 foreign countries, and plans to see more. The walls of the Cali home are decorated with family photographs and collages depicting their journeys. The family has collected magnets from almost every place they have visited, proudly displayed in a frame on the kitchen wall. Cali is the executive vice president for direct marketing and finance at Grand Circle Travel. He sends out the company's catalogs and takes a trip once a year to make sure Grand Circle Travel cruises, safaris or vacations are perfect for their 200,000 customers. ``I can't believe I actually make a living doing this,'' he said. Before his travel days, Cali worked at New England Business Service in Groton for 12 years. He then turned his attention toward his real passion: seeing the world. Cali's favorite road trip took his family 22 days to complete. That vacation - which the Calis call The Great America West National Park Road Trip - included visits to Mount Rushmore, Yellowstone National Park, the Grand Canyon and the Four Corners, to name a few. Cali's work has taken him all over the world including the Galapagos Islands and Egypt, another one of his favorites. The family's next adventure, slated for next summer, will follow the trail of Lewis and Clark, taking a little over two weeks to drive from Minnesota to Oregon. His advice to first-time road trippers? “The Complete Guide to the Ultimate Family Road Trip'' by Joe Cali, ($18.95) published by Author House, is available at online booksellers and local bookstores or by special order.
/** * Chaos Crystal Mod class * * @author founderio * */ @Mod(modid = Constants.MOD_ID, name = Constants.MOD_NAME, version = Constants.MOD_VERSION, guiFactory = Constants.GUI_FACTORY_CLASS) public class ChaosCrystalMain { @Instance(Constants.MOD_ID) public static ChaosCrystalMain instance; @SidedProxy(clientSide = "founderio.chaoscrystal.ClientProxy", serverSide = "founderio.chaoscrystal.CommonProxy") public static CommonProxy proxy; public static SimpleNetworkWrapper network; public static ChaosRegistry chaosRegistry; public static final Random rand = new Random(); public static Item itemChaosCrystal; public static Item itemFocus; public static Item itemCrystalGlasses; public static Item itemManual; public static Item itemLifelessShard; public static Item itemShard; public static BlockShard blockShard; public static BlockBase blockBase; public static BlockApparatus blockReconstructor; public static BlockApparatus blockCreator; public static BlockApparatus blockSentry; public static BlockApparatus blockTicker; public static BlockLifeless blockLifeless; // public static BlockCrystalLight blockCrystalLight; // public static BiomeGenCrystal biomeCrystal; public static CreativeTabs creativeTab; public static GenCrystalSprouts genCrystalSprouts; @EventHandler public void preInit(FMLPreInitializationEvent event) { FMLCommonHandler.instance().bus().register(new Config()); Config.init(event.getSuggestedConfigurationFile()); creativeTab = new CreativeTabs(Constants.MOD_ID) { @Override @SideOnly(Side.CLIENT) public Item getTabIconItem() { return itemChaosCrystal; } }; itemChaosCrystal = new ItemChaosCrystal(); itemChaosCrystal.setUnlocalizedName(Constants.ID_ITEM_CHAOSCRYSTAL); itemChaosCrystal.setCreativeTab(creativeTab); itemFocus = new ItemFocus(); itemFocus.setUnlocalizedName(Constants.ID_ITEM_FOCUS); itemFocus.setCreativeTab(creativeTab); itemCrystalGlasses = new ItemCrystalGlasses(); itemCrystalGlasses.setUnlocalizedName(Constants.ID_ITEM_CRYSTALGLASSES); itemCrystalGlasses.setCreativeTab(creativeTab); itemManual = new ItemManual(); itemManual.setUnlocalizedName(Constants.ID_ITEM_MANUAL); itemManual.setCreativeTab(creativeTab); itemLifelessShard = new ItemLifelessShard(); itemLifelessShard.setUnlocalizedName(Constants.ID_ITEM_LIFELESS_SHARD); itemLifelessShard.setCreativeTab(creativeTab); blockShard = new BlockShard(); blockShard.setBlockName(Constants.ID_BLOCK_SHARD); blockShard.setCreativeTab(creativeTab); itemShard = new ItemShard(blockShard, Constants.METALIST_SHARD); itemShard.setUnlocalizedName(Constants.ID_BLOCK_SHARD); itemShard.setCreativeTab(creativeTab); blockBase = new BlockBase(); blockBase.setBlockName(Constants.ID_BLOCK_BASE); blockBase.setCreativeTab(creativeTab); blockLifeless = new BlockLifeless(); blockLifeless.setBlockName(Constants.ID_BLOCK_LIFELESS); blockLifeless.setCreativeTab(creativeTab); // blockCrystalLight = new BlockCrystalLight(); // blockCrystalLight.setBlockName(Constants.ID_BLOCK_CRYSTAL_LIGHT); // blockCrystalLight.setCreativeTab(creativeTab); blockReconstructor = new BlockApparatus(0); blockReconstructor.setBlockName(Constants.ID_BLOCK_APPARATUS_RECONSTRUCTOR); blockReconstructor.setCreativeTab(creativeTab); blockCreator = new BlockApparatus(1); blockCreator.setBlockName(Constants.ID_BLOCK_APPARATUS_INFUSER); blockCreator.setCreativeTab(creativeTab); blockSentry = new BlockApparatus(2); blockSentry.setBlockName(Constants.ID_BLOCK_APPARATUS_SENTRY); blockSentry.setCreativeTab(creativeTab); blockTicker = new BlockApparatus(3); blockTicker.setBlockName(Constants.ID_BLOCK_APPARATUS_TICKER); blockTicker.setCreativeTab(creativeTab); GameRegistry.registerItem(itemChaosCrystal, Constants.ID_ITEM_CHAOSCRYSTAL, Constants.MOD_ID); GameRegistry.registerItem(itemFocus, Constants.ID_ITEM_FOCUS, Constants.MOD_ID); GameRegistry.registerItem(itemCrystalGlasses, Constants.ID_ITEM_CRYSTALGLASSES, Constants.MOD_ID); GameRegistry.registerItem(itemManual, Constants.ID_ITEM_MANUAL, Constants.MOD_ID); GameRegistry.registerItem(itemLifelessShard, Constants.ID_ITEM_LIFELESS_SHARD, Constants.MOD_ID); GameRegistry.registerBlock(blockShard, null, Constants.ID_BLOCK_SHARD); GameRegistry.registerItem(itemShard, Constants.ID_BLOCK_SHARD); GameRegistry.registerBlock(blockBase, null, Constants.ID_BLOCK_BASE); GameRegistry.registerItem(new ItemMultiTexture(blockBase, blockBase, Constants.METALIST_BLOCK_BASE), Constants.ID_BLOCK_BASE); GameRegistry.registerBlock(blockLifeless, Constants.ID_BLOCK_LIFELESS); GameRegistry.registerBlock(blockReconstructor, ItemBlockApparatus.class, Constants.ID_BLOCK_APPARATUS_RECONSTRUCTOR); GameRegistry.registerBlock(blockCreator, ItemBlockApparatus.class, Constants.ID_BLOCK_APPARATUS_INFUSER); GameRegistry.registerBlock(blockSentry, ItemBlockApparatus.class, Constants.ID_BLOCK_APPARATUS_SENTRY); GameRegistry.registerBlock(blockTicker, ItemBlockApparatus.class, Constants.ID_BLOCK_APPARATUS_TICKER); // GameRegistry.registerBlock(blockCrystalLight, Constants.ID_BLOCK_CRYSTAL_LIGHT); GameRegistry.registerTileEntity(TileEntityReconstructor.class, Constants.ID_TILEENTITY_RECONSTRUCTOR); GameRegistry.registerTileEntityWithAlternatives(TileEntityInfuser.class, Constants.ID_TILEENTITY_INFUSER, Constants.ID_TILEENTITY_CREATOR); GameRegistry.registerTileEntity(TileEntitySentry.class, Constants.ID_TILEENTITY_SENTRY); GameRegistry.registerTileEntity(TileEntityTicker.class, Constants.ID_TILEENTITY_TICKER); GameRegistry.registerTileEntity(TileEntityShard.class, Constants.ID_TILEENTITY_SHARD); // biomeCrystal = new BiomeGenCrystal(getBiomeId(Constants.NAME_BIOME_CRYSTAL, 68)); genCrystalSprouts = new GenCrystalSprouts(); GameRegistry.registerWorldGenerator(genCrystalSprouts, 5); // GameRegistry.registerWorldGenerator(new GenCrystalPillars(), 0); // GameRegistry.registerWorldGenerator(new GenCrystalFloats(), 0); network = NetworkRegistry.INSTANCE.newSimpleChannel(Constants.CHANNEL_NAME); proxy.registerPackets(network); } @EventHandler public void init(FMLInitializationEvent event) { EntityRegistry.registerModEntity(EntityChaosCrystal.class, Constants.NAME_ENTITY_CHAOSCRYSTAL, 0, this, 128, 1, false); EntityRegistry.registerModEntity(EntityFocusTransfer.class, Constants.NAME_ENTITY_FOCUS_TRANSFER, 1, this, 128, 1, false); EntityRegistry.registerModEntity(EntityFocusBorder.class, Constants.NAME_ENTITY_FOCUS_BORDER, 2, this, 128, 1, false); EntityRegistry.registerModEntity(EntityFocusFilter.class, Constants.NAME_ENTITY_FOCUS_FILTER, 3, this, 128, 1, false); EntityRegistry.registerModEntity(EntityFocusFilterTarget.class, Constants.NAME_ENTITY_FOCUS_FILTER_TARGET, 4, this, 128, 1, false); proxy.registerRenderStuff(); GameRegistry.addRecipe(new ItemStack(itemChaosCrystal, 1), "RDR", "RER", "RDR", 'D', Items.diamond, 'R', new ItemStack(blockBase, 1, 1), 'E', Items.ender_pearl); GameRegistry.addRecipe(new ItemStack(itemFocus, 1, 0), "dBd", "BEB", "dBd", 'B', new ItemStack(blockBase, 1, 0), 'E', Items.ender_pearl, 'd', new ItemStack(Items.dye, 1, 4)); GameRegistry.addRecipe(new ItemStack(itemFocus, 1, 1), "dBd", "BEB", "dBd", 'B', new ItemStack(blockBase, 1, 0), 'E', Items.ender_pearl, 'd', new ItemStack(Items.dye, 1, 10)); GameRegistry.addRecipe(new ItemStack(itemFocus, 1, 2), "dBd", "BEB", "dBd", 'B', new ItemStack(blockBase, 1, 0), 'E', Items.ender_pearl, 'd', new ItemStack(Items.dye, 1, 5)); GameRegistry.addRecipe(new ItemStack(itemCrystalGlasses, 1, 0), "B B", "GBG", 'B', new ItemStack(blockBase, 1, 0), 'G', Blocks.glass_pane); GameRegistry.addRecipe(new ItemStack(blockReconstructor, 1), "gBg", "OOO", 'g', new ItemStack(Items.dye, 1, 8), 'B', new ItemStack(blockBase, 1, 0), 'O', Blocks.obsidian); GameRegistry.addRecipe(new ItemStack(blockCreator, 1), "gYg", "OOO", 'g', new ItemStack(Items.dye, 1, 8), 'Y', new ItemStack(blockBase, 1, 2), 'O', Blocks.obsidian); GameRegistry.addRecipe(new ItemStack(blockSentry, 1), "OBO", "gYg", "OOO", 'g', new ItemStack(Items.dye, 1, 8), 'B', new ItemStack(blockBase, 1, 0), 'Y', new ItemStack(blockBase, 1, 2), 'O', Blocks.obsidian); GameRegistry.addShapelessRecipe(new ItemStack(itemManual), new ItemStack(blockBase, 1, 32767), Items.map); GameRegistry.addRecipe(new ItemStack(blockLifeless, 1, 0), "sss", "sss", "sss", 's', itemLifelessShard); GameRegistry.addShapelessRecipe(new ItemStack(itemLifelessShard, 9, 0), blockLifeless); // Smelting of Crystal to clear crystal GameRegistry.addSmelting(new ItemStack(blockBase, 1, 0), new ItemStack(blockBase, 1, 3), 0); GameRegistry.addSmelting(new ItemStack(blockBase, 1, 1), new ItemStack(blockBase, 1, 3), 0); GameRegistry.addSmelting(new ItemStack(blockBase, 1, 2), new ItemStack(blockBase, 1, 3), 0); // Smelting of Crystal to clear crystal (crycked versions) GameRegistry.addSmelting(new ItemStack(blockBase, 1, 4), new ItemStack(blockBase, 1, 7), 0); GameRegistry.addSmelting(new ItemStack(blockBase, 1, 5), new ItemStack(blockBase, 1, 7), 0); GameRegistry.addSmelting(new ItemStack(blockBase, 1, 6), new ItemStack(blockBase, 1, 7), 0); // Smelting of cracked clear crytal to clear crystal GameRegistry.addSmelting(new ItemStack(blockBase, 1, 7), new ItemStack(blockBase, 1, 3), 0); // Smeleting shards to their glowing counterpart GameRegistry.addSmelting(new ItemStack(itemShard, 1, 0), new ItemStack(itemShard, 1, 4), 0); GameRegistry.addSmelting(new ItemStack(itemShard, 1, 1), new ItemStack(itemShard, 1, 5), 0); GameRegistry.addSmelting(new ItemStack(itemShard, 1, 2), new ItemStack(itemShard, 1, 6), 0); GameRegistry.addSmelting(new ItemStack(itemShard, 1, 3), new ItemStack(itemShard, 1, 7), 0); chaosRegistry = new ChaosRegistry(); Gson gson = new GsonBuilder().serializeNulls().setPrettyPrinting().setVersion(1).disableHtmlEscaping().create(); InputStream vanillaIS = ChaosCrystalMain.class.getResourceAsStream("/assets/chaoscrystal/chaosregistry/vanilla.json"); if(vanillaIS != null) { AspectModule vanilla = gson.fromJson(new InputStreamReader(vanillaIS, Charsets.UTF_8), AspectModule.class); chaosRegistry.registerAspectModule(vanilla); } ModuleVanillaWorldgen.registerRepairs(chaosRegistry); } @EventHandler public void postInit(FMLPostInitializationEvent event) { if(Config.showDebugOutput) { chaosRegistry.debugOutput(); } if(Config.showDebugUtil) { ChaosCrystalAspectUtil.open(chaosRegistry); } } }
Wireless multi-hop throughput: Preliminary testbed measurements In recent years, wireless mesh networks have emerged as a viable means of communications, not least because of their ease of deployment and cost-effectiveness. There are still, however, a number of challenges involved in designing and implementing such wireless multi-hop networks. This paper describes some of the preliminary work carried out for the development of an experimental mesh testbed employing wireless nodes that utilise chirped spread spectrum technology.
Alabama’s hopeless fake field goal in the third quarter wasn’t the biggest play in Clemson’s surgical 44-16 victory but it was the most telling. SANTA CLARA, Calif. — The moment you knew that Nick Saban knew what was happening to his team arrived with the subtlety of a crystal football being smashed by a sledgehammer. It stunned with the force of an electrical storm, and it shook a sport he has owned for a decade to its core. The greatest college football coach of all time, the man whose program has never given up on a big game, the tactician whose genius has rescued so many moments that once seemed to be slipping away, finally panicked. He ran out of answers. He admitted that Dabo Swinney and the Clemson Tigers were not only going to beat Alabama for the national championship Monday night, but that they had essentially hacked the machine. Alabama’s hopeless fake field goal to end its opening drive of the third quarter wasn’t the biggest play in Clemson’s surgical 44-16 victory at Levi’s Stadium, but it was the most telling. For once, Saban knew he didn’t have the better football team. He certainly didn’t have the better coaching staff. And unlike any game he had ever coached since bringing Alabama back to superpower status, he didn’t have a prayer without turning a few tricks. But Clemson wasn’t fooled. And now college football officially has a double dynasty. The College Football Playoff turned five years old Monday. The national championship count in this new era is now Alabama 2, Clemson 2. It doesn’t erase what Saban did before the playoff and the five overall titles he has won with the Crimson Tide. But it does illustrate that the torch, if not passed, is now shared. "We're not supposed to be here," Swinney said as he held the trophy amidst the shower of confetti on a cool California night. "We're just little old Clemson and I'm not supposed to be here. But we are and I am." Clemson's underdog swagger is officially dead. It has been replaced by a new mystique as the program that didn't just erase the Alabama gap, but instead vaporized it. And as the first modern college team to ever go 15-0, Clemson's locker room was buzzing with talk that they could go down as the best college football team of all time. "Coach Swinney has been talking all year about 'Leave no doubt,' and obviously two years ago we were very happy to win, great way to win one, but it comes down to a couple plays," co-offensive coordinator Jeff Scott said, referring to Clemson's epic 35-31 victory on a last-second touchdown in Tampa. "That was the challenge coach Swinney gave our team. Just play our best four quarters and if we do that we’ll leave no doubt." Ultimately, where this Clemson team ranks in history is not as relevant as the staggering manner in which it ran Alabama off the field. A bunch of freshmen playmakers humiliated the Crimson Tide's defense at every turn. And even without Dexter Lawrence, Clemson's best defensive lineman, the Tigers still turned quarterback Tua Tagovailoa into a gaffe machine, including a tone-setting pick-6 on Alabama's first drive, another horrible interception and multiple empty trips inside the 10-yard line. "I’m sure everybody was shocked nationwide," linebacker Isaiah Simmons said. "They’ve probably never seen the stands clear out like that with Alabama." The numbers are going to be dissected for months. From the 31 points Clemson put up in the first half to the massive lead in the second half that the Tigers kept building and building, there were all kinds of unwanted firsts for a Saban-coached team. For a decade, Alabama losses always have a dug-in quality that forces opponents to remain on edge until they can get into victory formation. This time, the Crimson Tide finally let go of the rope, watching the fourth quarter clock mercifully bleed out on them. It looked and felt different. "Obviously we have a lot of respect for them, talented group, but the way our guys have played offensively, it wasn’t a surprise," Scott said. "I told a lot of my close friends, I felt like if we played well, we could win by 10. That was just the confidence going in, really not a whole lot about Alabama but really a lot about us." He only under-shot that prediction by 18. But for all the lopsided scores in the SEC and hosannas being thrown at the feet of the Alabama offense, Clemson finally exposed some things. For one, opposing coaches suspected that Alabama's defense was mediocre on the back end all season. So when the Tide couldn't generate pressure on quarterback Trevor Lawrence with a four-man rush, he had time to find Clemson's big, fast receivers in favorable one-on-one matchups — a credit to both Clemson's skill players and an offensive line that was not expected to hold up against Alabama's front. "Trevor doesn't do what he does if he doesn't have a solid offensive line," co-offensive coordinator Tony Elliott said. "They were challenged. There were a lot of comments that were made. They were called pedestrian and they took that to heart. And they came out and wanted to prove that they’re one of the best units in the country." The other element that Clemson exploited was that the constant turnover among Saban's assistants has finally caught up to the Crimson Tide. Despite Alabama finishing with 443 yards, it was a bad night for outgoing offensive coordinator Mike Locksley as questionable playcalling in the red zone forced Alabama into some decisions, like the ill-fated fake field goal, which Swinney felt was coming to the point where Clemson spent time Monday cramming on fakes Saban had used back in 2002 at LSU. "We showed one front and (transitioned) to another and played cover-2 to it and sniffed it out," said defensive coordinator Brent Venables, whose gameplan and unique coverages Clemson prepared just for this game had a lot to do with Tagovailoa's mistakes. "It was gameplan-specific just assuming there might be a critical time in the game where they’ve got to seize momentum and make that play." But the most important point that will carry into the offseason is that this performance wasn’t a fluke, nor is Clemson a one-off. When Alabama lost to the Tigers in 2016, the national takeaway was that Deshaun Watson’s one-of-a-kind brilliance to win that game probably couldn't be replicated, especially if Saban stuck around. But now, that argument is done forever. Clemson, as of today, is the more complete program. And that isn’t just about players like Lawrence, who made elite third-down throws while avoiding the mistakes that Tagovailoa made. It was a maligned Clemson offensive line that simply manhandled the vaunted Alabama defensive front. It was Clemson’s receivers leaving Alabama defenders in the dust. And it was about an Alabama coaching staff that simply got dominated at every turn. "I just have a feeling that I didn’t do a very good job for our team, with our team, giving them the best opportunity to be successful," Saban said. Alabama can still win championships as long as Saban coaches, but the earth moved underneath his feet Monday night. Swinney is the new king of college football.
// The event handler that turns the ball back to normal public EventHandler makeBallDestroyBricksIn1HitEventHandler() { EventHandler handle = new EventHandler() { @Override public void handle(Event event) { getBall().hasPowerUp = false; } }; return handle; }
<gh_stars>0 package ru.job4j.tutorial.queue.example2; import java.util.Iterator; import java.util.LinkedList; import java.util.NoSuchElementException; public class LinkedListQueue<E> implements Queue<E> { LinkedList<E> stack; //Constructor public LinkedListQueue() { stack = (LinkedList<E>) new LinkedList<E>(); } @Override public void offer(E o) { stack.offer(o); } @Override public E remove() throws IndexOutOfBoundsException { return stack.remove(0); } @Override public E poll() { return stack.poll(); } @Override public E element() throws NoSuchElementException { return stack.element(); } @Override public E peek() { return stack.peek(); } @Override public int size() { return stack.size(); } @Override public boolean isEmpty() { return stack.isEmpty(); } @Override public boolean contains(E elem) { return stack.contains(elem); } @Override public Iterator iterator() { return stack.iterator(); } public static void main(String[] args) { LinkedListQueue<Integer> stack = new LinkedListQueue<>(); System.out.println("Is stack empty? " + stack.isEmpty()); stack.offer(6); stack.offer(9); System.out.println("Is stack empty? " + stack.isEmpty()); System.out.println("Stack size = " + stack.size()); System.out.println("Iteration"); Iterator<Integer> iterator = stack.iterator(); while (iterator.hasNext()) System.out.println(iterator.next()); System.out.println("Main methods"); try { System.out.println(stack.peek()); System.out.println(stack.remove()); System.out.println(stack.remove()); System.out.println(stack.remove()); } catch (NoSuchElementException e) { System.out.println("Stack is empty"); } catch (IndexOutOfBoundsException e) { System.out.println("Stack is empty"); } System.out.println("Is stack empty? " + stack.isEmpty()); } }
Contributed by tj on 2016-09-01 from the puff-floyd dept. September 1st, 2016: The OpenBSD team announces the availability of 6.0! We are pleased to announce the official release of OpenBSD 6.0. This is our 40th release on CD-ROM (and 41st via FTP/HTTP). We remain proud of OpenBSD's record of more than twenty years with only two remote holes in the default install. As in our previous releases, 6.0 provides significant improvements, including new features, in nearly all areas of the system: Some of the notable changes include: W^X enforcement. In their latest attempt to push better security practices to the software ecosystem, OpenBSD has turned W^X on by default for the base system. Binaries can only violate W^X if they're marked with PT_OPENBSD_WXNEEDED and their filesystem is mounted with the new wxallowed option. The installer will set this flag on the /usr/local partition (where third party packages go) by default now, but users may need to manually add it if you're upgrading. More details can be found in this email. If you don't use any W^X-violating applications, you don't need the flag at all. ARMv7 improvements. Much work has been going into the ARM area since 5.9 came out, and those changes are finally trickling down to the -release branch. All newer arm platforms have been switched to an EFI + bootloader mechanism that works just like amd64. A Flattened Device Tree (FDT) is now used for device discovery, resulting in many arm boards being supported rapidly. Development of this platform is ongoing even now, so if you're an ARM fan, be sure to watch this space closely. Continuing SMP work. The network stack has undergone more renovation, and the most important parts are that much closer to being unlocked. For desktop users, web browser responsiveness should also be better, thanks to some fixes in the scheduler. OpenSSH, OpenSMTPD, OpenNTPD, OpenBGPD, LibreSSL updates. Each sub-project has a long list of improvements of their own, so check the release page for all the bugfixes and new features. A few specific additions of interest are IETF ChaCha20-Poly1305 in LibreSSL, the new ProxyJump feature in OpenSSH, fork+exec patterns in OpenSMTPD, and hardened TLS constraints in OpenNTPD. VAX support, Linux emulation, kern.usermount removed. As with every OpenBSD release, some of the older and unmaintained bits get removed. Support for VAX hardware is no more. Support for running Linux-only binaries was also removed, having been unmaintained and likely used by hardly anyone. Finally, the kern.usermount sysctl is also no more. Administrators who want to let users mount devices will need to configure doas(1) for that task. A much more detailed list of changes between 5.9 and 6.0 can be found here. This release also includes six original songs, one being sung by project leader Theo de Raadt himself! If you haven't kept up to date with OpenBSD songs lately, there's a new CD containing all the 5.2 - 6.0 tracks. Speaking of CDs, you can also get the 6.0 CD set at the usual place. One thing to note: this will be the last version of OpenBSD to be pressed on CD. The project will now focus on internet-only distribution, giving much more flexibility in the release schedule. If you've been collecting the sets over the years, this is definitely one you'll want to have on your shelf. Be sure to check out the upgrade guide for instructions on how to bring your 5.9 boxes up to date, as well as the errata page for any last-minute fixes to apply. Happy upgrades!
Buprenorphine and methadone were equally effective in reducing opiate or cocaine use Patients 132 patients who were recruited to participate in a programme to treat opioid dependence. Inclusion criteria included a positive urine test for opioids; the Food and Drug Administration criteria for methadone maintenance; and the Diagnostic and Statistical Manual of Mental Disorders, 3rd edition, revised criteria for opioid and cocaine dependence. Exclusion criteria were dependence on alcohol or sedatives; risk of suicide or psychosis; inability to read or understand rating forms; or pregnancy. 116 patients (88%, mean age 33 y, 69% men) were included in the analysis.
<gh_stars>0 #include <Arduino.h> #include "RTC.h" #include "DCF.h" #include "Display.h" #include "Light.h" //#define TEST 1 const int RTC_CE = 50; // Chip Enable const int RTC_IO = 51; // Input/Output const int RTC_CLK = 52; // Serial Clock const int DCF_PIN = 22; // Non-inverted input pin of DCF clock. const int DCF_OUT = 23; // Second pulse from decoded DCF clock signal. //RTC realTimeClock = RTC(RTC_CE, RTC_IO, RTC_CLK); //DCF dcf77Clock = DCF(DCF_PIN, DCF_OUT); //DCF dcf77Clock = DCF(DCF_PIN); //Display display = Display(); Light light = Light(); #ifndef TEST void setup() { Serial.begin(9600); Serial.println("\n-------\nStarting"); light.setup(); // light.test(); // while(true){}; } void loop() { Serial.println("loop"); light.off(); delay(1000); for(byte t=0; t < SUNRISE_STEPS; t++) { light.showSkyAt(t); delay(25); } // Serial.print("RTC: "); Serial.println(realTimeClock.printTime()); // Serial.print("DCF: "); Serial.println(dcf77Clock.printTime()); // char quality[10]; // dcf77Clock.quality().toCharArray(quality, sizeof(quality)); // char state[20]; // dcf77Clock.state().toCharArray(state, sizeof(state)); // Serial.print("Quality: "); // Serial.println(dcf77Clock.quality()); // Serial.print("State: "); // Serial.println(dcf77Clock.state()); // dcf77Clock.printTime(); // delay(2000); // display.displayTime(quality, state); // delay(5000); } #else // --------------------------------- Unit tests -------------------------------- // These need to go in a test package but for some unclear reason PlatformIO // requires a user account for running them, which I am not agreeing with // for running local tests. So here we go, local tests. // ----------------------------------------------------------------------------- void setup() { // Test interpolation Serial.begin(9600); Serial.println("---------- tests --------------"); light.setup(); Serial.println("Test interpolation") // Interpolate: (5,255) to (10,0) gives (9,51) // Interpolate: (5,0) to (10,255) gives (9,204) // Interpolate: (50,51) to (100,204) gives (52,57) Serial.println("---showsky---"); light.showSkyAt(52); Serial.println("---showsky---"); } void loop(){ // nothing } #endif
// Using recursion: O(3^m), where m = word1.length() => Time Limit Exceeded public class MinDistance { public static int minDistance(String word1, String word2) { return minDistance(word1, word2, word1.length(), word2.length()); } public static int minDistance(String s1, String s2, int n1, int n2) { // if 1st string s1 is empty, the only option is to insert all characters of s2 into s1 if (n1 == 0) return n2; // if s2 is empty, the only option is to remove all characters of s1 if (n2 == 0) return n1; // if the last 2 chars are the same, we skip last chars and recurse for remaining strings if (s1.charAt(n1-1) == s2.charAt(n2-1)) { return minDistance(s1, s2, n1-1, n2-1); } // if last 2 chars are not the same, we consider all 3 possibilities // (insert, delete, and replace) and take the min of all 3 int insert = minDistance(s1, s2, n1, n2-1); // recurse for n1 and n2-1 int delete = minDistance(s1, s2, n1-1, n2); // recurse for n1-1 and n2 int replace = minDistance(s1, s2, n1-1, n2-1); // recurse for n1-1 and n2-1 return 1 + min(insert, delete, replace); } // Dynamic programming solution: O(n1 * n2) runtime and O(n1 * n2) space complexities public static int minDistance2(String word1, String word2) { int n1 = word1.length(), n2 = word2.length(); int[][] dp = new int[n1+1][n2+1]; for (int i = 0; i <= n1; i++) { for (int j = 0; j <= n2; j++) { // if 1st string s1 is empty, the only option is to insert all characters of s2 into s1 if (i == 0) dp[i][j] = j; // if s2 is empty, the only option is to remove all characters of s1 else if (j == 0) dp[i][j] = i; // if last 2 characters are the same, no operation is needed; we just take the previous result else if (word1.charAt(i-1) == word2.charAt(j-1)) dp[i][j] = dp[i-1][j-1]; // if last 2 chars are not the same, we consider all 3 possibilities (insert, delete, and replace) // and take the minimuk of all 3 else { dp[i][j] = 1 + min(dp[i][j-1], dp[i-1][j], dp[i-1][j-1]); } } } return dp[n1][n2]; } public static int min(int a, int b, int c) { return Math.min(a, Math.min(b, c)); } public static void main(String[] args) { System.out.println("Using recursion:"); System.out.println("minDistance(\"sunday\", \"saturday\") = " + minDistance("sunday", "saturday")); System.out.println("minDistance(\"horse\", \"ros\") = " + minDistance("horse", "ros")); System.out.println("minDistance(\"intention\", \"execution\") = " + minDistance("intention", "execution")); System.out.println("\nUsing Dynamic Programming:"); System.out.println("minDistance2(\"sunday\", \"saturday\") = " + minDistance2("sunday", "saturday")); System.out.println("minDistance2(\"horse\", \"ros\") = " + minDistance2("horse", "ros")); System.out.println("minDistance2(\"intention\", \"execution\") = " + minDistance2("intention", "execution")); } }
Gibbs Sampling Based Bayesian Analysis of Mixtures with Unknown Number of Components For mixture models with unknown number of components, Bayesian approaches, as considered by Escobar and West and Richardson and Green, are reconciled here through a simple Gibbs sampling approach. Specifically, we consider exactly the same direct set up as used by Richardson and Green, but put Dirichlet process prior on the mixture components; the latter has also been used by Escobar and West albeit in a different set up. The reconciliation we propose here yields a simple Gibbs sampling scheme for learning about all the unknowns, including the unknown number of components. Thus, we completely avoid complicated reversible jump Markov chain Monte Carlo (RJMCMC) methods, yet tackle variable dimensionality simply and efficiently. Moreover, we demonstrate, using both simulated and real data sets, and pseudo-Bayes factors, that our proposed model outperforms that of Escobar and West, while enjoying, at the same time, computational superiority over the methods proposed by Richardson and Green and Escobar and West. We also discuss issues related to clustering and argue that in principle, our approach is capable of learning about the number of clusters in the sample as well as in the population, while the approach of Escobar and West is suitable for learning about the number of clusters in the sample only. AMS subject classification. Primary.
<reponame>balajiboggaram/algorithms /** * */ package me.learn.personal.month7; import java.util.Arrays; /** * Title 945 : * * Date : Feb 26, 2021 * * @author bramanarayan * */ public class MinimumIncrementToMakeArrayUnique { /* * Logic: First sort the array. Get the (diff - between the adjacent elements) and add (diff+1) to the current element. Add the same diff to the count variable. */ public int minIncrementForUnique(int[] A) { Arrays.sort(A); int count = 0; for (int i = 1; i < A.length; i++) { if (A[i] <= A[i - 1]) { int diff = A[i - 1] - A[i] + 1; A[i] = A[i] + diff; count += diff; } } return count; } }