content
stringlengths
7
2.61M
Innovation in Innovation: The Triple Helix of University-Industry-Government Relations Innovation is increasingly based upon a Triple Helix of university-industry-government interactions. The increased importance of knowledge and the role of the university in incubation of technology-based firms has given it a more prominent place in the institutional firmament. The entrepreneurial university takes a proactive stance in putting knowledge to use and in broadening the input into the creation of academic knowledge. Thus it operates according to an interactive rather than a linear model of innovation. As firms raise their technological level, they move closer to an academic model, engaging in higher levels of training and in sharing of knowledge. Government acts as a public entrepreneur and venture capitalist in addition to its traditional regulatory role in setting the rules of the game. Moving beyond product development, innovation then becomes an endogenous process of taking the role of the other, encouraging hybridization among the institutional spheres.
The fourth annual Guam River Festival wrapped up Sunday with families enjoying caribou rides, canoeing and barbecue. The fourth annual Guam River Festival, at Valley of the Latte Adventure Park, wrapped up Sunday with families enjoying caribou rides, canoeing and barbecue. "The proceeds of the weekend will be donated to Talafofo and Inarajan," said Valley of the Latte managing director David Tydingco. "In past years, we've donated $15,000 to the municipal councils of Talofofo and Inarajan." The festival began Saturday at 10 a.m., and closed out Sunday afternoon. About 20 vendors set up under the sun, featuring local, handmade products and crafts. Local musicians serenaded attendees as they ate, played and laughed, along with entertainment provided from school dance groups. Attendees were invited to participate in a range of activities such as kayaking, canoeing and carabou rides. The weekend was a chance to celebrate 30 years of the jungle river cruise as well as the four years of the Latte Adventure Park, said John Ray Aguon, owner of Manquin Karetin Karabou, who led the caribou rides at the park. "Valley of the Latte is a living museum," said Aguon. "People have the chance to come to a real cultural site." It was also about the locals, said Dawn Reyes, local artist and managing partner of the park. "For me, it's really about the local people who come and enjoy," Reyes said. "Before a lot of people thought this was just for tourists. The festival pulls together local vendors, and its supportive of local people." The festival has seen about two thousand to three thousand people in the past, said Christine Macias, the park's administrative manager. They anticipate the festival saw a similar turn out this year. "It's going to get bigger in the future," Macias said. "We're hoping to open up the farm more, so people can explore more."
# -*- coding: utf-8 -*- """ Created on Tue May 10 20:41:24 2016 @author: subhajit """ import pandas as pd import numpy as np from sklearn.preprocessing import normalize import h5py import os os.chdir('D:\Data Science Competitions\Kaggle\Expedia Hotel Recommendations\codes') submission = pd.read_csv('../input/sample_submission.csv') # read in RF results with h5py.File('../output/probs/allpreds.h5', 'r') as hf: predshf = hf['preds_latest'] preds = 0.31*normalize(predshf.value, norm='l1', axis=1) # read in XGB results with h5py.File('../output/probs/allpreds_xgb.h5', 'r') as hf: predshf = hf['preds'] preds += 0.39*normalize(predshf.value, norm='l1', axis=1) # read in SGD results with h5py.File('../output/probs/allpreds_sgd.h5', 'r') as hf: predshf = hf['preds'] preds += 0.27*normalize(predshf.value, norm='l1', axis=1) # read in Bernoulli NB results with h5py.File('../output/probs/allpreds_bnb.h5', 'r') as hf: predshf = hf['preds'] preds += 0.03*normalize(predshf.value, norm='l1', axis=1) print('generating submission') col_ind = np.argsort(-preds, axis=1)[:,:5] hc = [' '.join(row.astype(str)) for row in col_ind] sub = pd.DataFrame(data=hc, index=submission.id) sub.reset_index(inplace=True) sub.columns = submission.columns sub.to_csv('../output/pred_sub.csv', index=False)
<reponame>Hvvang/ush<filename>src/exec/src/mx_print_processes.c #include "mx_exec.h" void mx_print_processes(t_processes *processes) { t_processes *temp = processes; if (temp) { printf("index job\n"); while (temp) { printf(" %d ", temp->index); mx_print_strarr(temp->command, " "); printf("\n"); temp = temp->next; } } }
WASHINGTON — The Federal Aviation Administration has issued a launch license for the inaugural launch of SpaceX's Falcon Heavy, scheduled for Feb. 6. The license by the FAA's Office of Commercial Space Transportation, or AST, is dated Feb. 2 and covers only the first launch of the Falcon Heavy, the largest U.S. launch vehicle since the Saturn 5. A license is required for any commercial launch from the United States or by a U.S. company regardless of location. SpaceX's first Falcon Heavy Rocket stands atop Launch Pad 39A at NASA's Kennedy Space Center in Cape Canaveral, Florida. The rocket's debut flight is scheduled for Feb. 6, 2018. The license was the final regulatory hurdle to the upcoming launch. While there were no significant doubts that the company would obtain a license, the unusual nature of this launch, featuring the first launch of a vehicle and its nontraditional payload, likely attracted additional scrutiny. The Falcon Heavy’' power is reflected in the insurance requirements contained in the license. SpaceX is required to hold third-party liability insurance, or other means of financial responsibility, for $110 million in claims for the launch. By comparison, a license issued last year for Falcon 9 launches of geostationary orbit communications satellites, also flying from Launch Complex 39A and on the same azimuth, requires only $30 to 68 million in insurance. The new license, though, makes few changes to government property insurance. Both it and the Falcon 9 license require $100 million in coverage for launches from the same pad, although the Falcon Heavy license increases the coverage for pre-flight operations from $63 million to $72 million. Even before the launch license, other parts of the FAA were preparing for the launch. The agency issued temporary airspace restrictions Feb. 2 for the launch, covering airspace around the launch site and into the Atlantic Ocean, a standard procedure for any launch from the range. The U.S. Air Force's 45th Weather Squadron, at Patrick Air Force Base in Florida, issued its first weather forecast for the launch Feb. 2 as well. That forecast predicted an 80 percent chance of acceptable weather for the launch, scheduled for a three-hour window beginning at 1:30 p.m. Eastern. The probability decreases to 70 percent if the launch slips one day to Feb. 7.
<reponame>AlbertoMonteiro/growth package api import ( "deryksr/model" "net/http" "strconv" "sync" "github.com/labstack/echo/v4" ) var srv *server var process sync.Map func initRouter(sv *server) { process.Store("busy", false) srv = sv group := srv.echo.Group("/api/v1/growth") group.POST("", createMemoryDb) group.GET("/size", dbSize) group.GET("/post/status", loadStatus) group.PUT("/:country/:indicator/:year", upsertRecord) group.GET("/:country/:indicator/:year", getRecord) group.DELETE("/:country/:indicator/:year", deleteRecord) } func createMemoryDb(ctx echo.Context) error { payload := make([]model.Growth, 0) if err := ctx.Bind(&payload); err != nil { return err } go func(payload []model.Growth) { process.Store("busy", true) for _, element := range payload { srv.database.Save(element) } process.Store("busy", false) }(payload) return ctx.JSON(http.StatusAccepted, model.Response{ Message: "In progress", }) } func upsertRecord(ctx echo.Context) error { var receive struct { Value float64 `json:"value"` } if err := ctx.Bind(&receive); err != nil { return err } year, _ := strconv.Atoi(ctx.Param("year")) record := model.Growth{ Country: ctx.Param("country"), Indicator: ctx.Param("indicator"), Year: year, Value: receive.Value, } srv.database.Upsert(record) return nil } func loadStatus(ctx echo.Context) error { var message string value, _ := process.Load("busy") if value.(bool) { message = "still in processing..." } else { message = "processing completed" } return ctx.JSON(http.StatusOK, struct { Message string `json:"msg"` Count int `json:"count"` }{ Message: message, Count: srv.database.Size(), }) } func getRecord(ctx echo.Context) error { year, _ := strconv.Atoi(ctx.Param("year")) record := model.Growth{ Country: ctx.Param("country"), Indicator: ctx.Param("indicator"), Year: year, } key := model.GenerateKey(record) result := srv.database.Read(key) if result == nil { srv.echo.Logger.Debug(result) return ctx.JSON(http.StatusOK, model.Response{ Message: "No records have been found :(", }) } return ctx.JSON(http.StatusOK, *result) } func deleteRecord(ctx echo.Context) error { year, _ := strconv.Atoi(ctx.Param("year")) record := model.Growth{ Country: ctx.Param("country"), Indicator: ctx.Param("indicator"), Year: year, } key := model.GenerateKey(record) err := srv.database.Delete(key) if err != nil { srv.echo.Logger.Debug(err) } return nil } func dbSize(ctx echo.Context) error { return ctx.JSON(http.StatusOK, struct { Size int `json:"size"` }{ Size: srv.database.Size(), }) }
Partisan Journalists on Duty: Political Gnosticism as a Means of Legitimating Quasi-militant Democracy in Crisis-driven Poland Embedded in the theory of political gnosticism and drawing upon a qualitative content analysis of 246 pieces of news released by state media, this article examines a means of legitimating anti-democratic measures deployed during the first wave of the Covid-19 pandemic in Poland. The research aims to identify and explain the nature and origins of justification frames for quasi-militant democracy. The main argument is that journalists of the most popular state television, TVP Info, used political gnosticism to legitimate quasi-militant democracy. They exploited fears of losing one's life and health to convince citizens that the limitations of civil liberties are germane to survival and development. The research shows that the occurrence of all essential components of political gnosticism, used to justify anti-democratic actions in state media, is one of the indicators of anti-democratic changes in the political structure. It also provides insight regarding the theory of democratic erosion at a level of freedom of the press by offering evidence confirming the counter-democratic nature of quasi-militant democratic consolidation.
import {Event} from '../Event'; import {StringHelper} from '../Utils/StringHelper'; import {QueryObject, UrlGenerator} from './UrlGenerator'; interface QueryParameters extends QueryObject { v: string; title: string; st: string; et?: string; dur?: string; desc?: string; in_loc?: string; inv_list?: string; rpat?: string; rend?: string; } export class Yahoo extends UrlGenerator { protected urlBase = 'https://calendar.yahoo.com/'; protected convertEventToQueryObject(event: Event): QueryParameters { return { v: '60', title: event.title, st: StringHelper.clearPunctuation(event.getStartDateAsString()), et: StringHelper.clearPunctuation(event.getEndDateAsString()), desc: event.description, in_loc: event.location, inv_list: event.hasAttendees() ? this.convertAttendeesToString(event.attendees) : undefined } } }
Quality Management quo Vadis: A Snapshot of the German Quality Management Environment The present study was a snapshot of the status of quality management in the DACH region. As part of a survey of 229 executives and employees as well as independent consultants, the current state of quality management was investigated. Basically, it can be said that quality management is largely integrated into the companies, with a few exceptions. The majority of the companies use the standardized method of ISO EN 9001:2015, a considerable proportion use the EFQM method, which places great emphasis on the deductible and assessment. The big difference among the companies surveyed is the lived spirit of quality management. It is predominantly reported that the companies have a functioning quality management system; however, many report that there is great potential for improvement in the design and use. Here quality management is often seen as a necessary evil because the certificates are needed for the customers. Quality management is seen as a compulsory exercise and not as a facilitator for innovations and continuous improvement. Business excellence in the freestyle is a foreign word. The only remedy is a reflection on a desired reflection on future-oriented business excellence. In order to achieve this, both a reengineering of the business processes and a changed mindset and leadership of the executives and the employees involved must find their way into the company.
// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. package com.azure.core.http.jdk.httpclient.implementation; import com.azure.core.http.HttpClient; import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.logging.LogLevel; import java.net.http.HttpResponse; import java.nio.ByteBuffer; import java.util.List; import java.util.concurrent.CompletableFuture; import java.util.concurrent.CompletionStage; import java.util.concurrent.Flow; import java.util.concurrent.atomic.AtomicBoolean; /** * Implementation of a {@link HttpResponse.BodySubscriber} that ignores the response body. * <p> * This is used when the {@link HttpClient} is told to ignore the response body, used when the returned body value is * {@code void} or {@code Void}. * <p> * This will log a warning message if a response body is received to indicate that there was a bug either in determining * that the response body should be ignored, the Swagger indicated no response body would be received but was, or that * the server sent a response body when it shouldn't. */ public final class BodyIgnoringSubscriber implements HttpResponse.BodySubscriber<Void> { private final CompletableFuture<Void> completableFuture; private final ClientLogger logger; private final AtomicBoolean subscribed = new AtomicBoolean(); public BodyIgnoringSubscriber(ClientLogger logger) { this.completableFuture = new CompletableFuture<>(); this.logger = logger; } @Override public CompletionStage<Void> getBody() { return completableFuture; } @Override public void onSubscribe(Flow.Subscription subscription) { if (!subscribed.compareAndSet(false, true)) { // Only can have one subscription. subscription.cancel(); } else { subscription.request(Long.MAX_VALUE); } } @Override public void onNext(List<ByteBuffer> item) { logger.log(LogLevel.WARNING, () -> "Received HTTP response body when one wasn't expected. " + "Response body will be ignored as directed."); } @Override public void onError(Throwable throwable) { completableFuture.completeExceptionally(throwable); } @Override public void onComplete() { completableFuture.complete(null); } }
<reponame>magdel/trlistener<gh_stars>0 package ru.netradar.server.queue.dao; import javax.annotation.Nonnull; import java.sql.Timestamp; import java.util.Objects; public abstract class Task { private final Long id; private Timestamp nextSendDt; private int tryN; private Timestamp expiryDt; public static final long MINUTE = 60000; public static final long HOUR = 60 * 60000; public static final long SCHEDULE_INTERVAL = 2 * MINUTE; public Task(@Nonnull Long id, Timestamp nextSendDt, int tryN, Timestamp expiryDt) { this.id = Objects.requireNonNull(id, "id"); this.nextSendDt = nextSendDt; this.tryN = tryN; this.expiryDt = expiryDt; } public Timestamp getNextSendDt() { return nextSendDt; } public int getTryN() { return tryN; } public Timestamp getExpiryDt() { return expiryDt; } @Nonnull public Long getId() { return id; } @Override public String toString() { return "Task{" + "id=" + id + ", nextSendDt=" + nextSendDt + ", tryN=" + tryN + ", expiryDt=" + expiryDt + '}'; } }
<reponame>ChuanleiGuo/AlgorithmsPlayground import java.util.ArrayList; import java.util.List; class Solution { public List<List<Integer>> combine(int n, int k) { List<List<Integer>> result = new ArrayList<>(); if (n <= 0 || k <= 0 || k > n) { return result; } generateCombinations(n, k, 1, new ArrayList<Integer>(), result); return result; } private void generateCombinations(int n, int k, int start, List<Integer> p, List<List<Integer>> result) { if (p.size() == k) { result.add(new ArrayList<Integer>(p)); return; } for (int i = start; i <= n - (k - p.size()) + 1; i++) { p.add(i); generateCombinations(n, k, i + 1, p, result); p.remove(p.size() - 1); } return; } }
Melanoma-reactive TCR-modied T Cells Generated in the Absence of Activation Retain a Less-differentiated Phenotype and Have Increased Therapeutic Potential. Adoptive T cell therapy with T cell receptor (TCR)-modied T cells has shown promise in treating metastatic melanoma and other malignancies. However, studies are needed to improve the ecacy and durability of responses of TCR-modied T cells. Standard protocols for generating TCR-modied T cells involve activating T cells through CD3 stimulation to allow for the ecient transfer of tumor-reactive receptors with viral vectors. T cell activation results in terminal differentiation and shortening of telomeres, which are likely suboptimal for therapy. In these studies, we demonstrate ecient T cell transduction with the melanoma-reactive TIL1383I TCR through culturing with interleukin 7 (IL-7) in the absence of CD3 activation. The TIL1383I TCR-modied T cells generated following IL-7 culture were enriched with nave (T N ) and memory stem cell populations (T SCM ) while maintaining longer telomere lengths. Furthermore, we demonstrated melanoma-reactivity of TIL1383I TCR-modied cells generated following IL-7 culture using in vitro assays and a superior response in an in vivo melanoma model. These results suggest that utilizing IL-7 to generate TCR-modied T cells in the absence of activation is a feasible strategy to improve adoptive T cell therapies for melanoma and other malignancies. Introduction The introduction of immunotherapies has dramatically improved the treatment of metastatic melanoma over the past two decades. High-dose interleukin-2 (IL-2), immune checkpoint inhibitors, and oncolytic viral therapy have all demonstrated clinical bene t in patients with metastatic melanoma. Despite these successes, a signi cant number of patients fail to respond and the majority of responding patients relapse. Adoptive T cell therapy (ACT) has become an exciting form of treatment for malignant disease. Tumor-in ltrating lymphocytes (TIL) have been shown to induce signi cant clinical responses in melanoma patients. However, the process of TIL preparation is laborious, time-consuming, and dependent on the presence of preexisting anti-tumor reactivity. In addition, not every patient has an accessible tumor to develop TIL cultures. Gene-modi ed T cells were developed to overcome the limitations of TIL. By transducing cells with tumor-reactive receptors, therapeutic potential is effectively transferred to patient peripheral lymphocytes. We previously described clinical and biological responses in a clinical trial of gene-modi ed T cells expressing a T cell receptor (TCR) reactive to the melanoma antigen, tyrosinase (TIL1383I). While this and other trials using melanoma-reactive TCRs show promise, further studies are needed to improve the e cacy and durability of responses of TCRmodi ed T cells for melanoma. Studies that characterized T cell subpopulations suggest that stimulation of nave cells (T N ) induces differentiation into T memory stem cells (T SCM ), followed by central memory T cells (T CM ), and subsequently shorter-lived effector memory T cells (T EM ) and effector T cells (T EFF ) in a linear manner. Both preclinical and clinical data suggest that less-differentiated populations have superior therapeutic potential. In melanoma and mesothelioma mouse models, T SCM have been shown to be more effective than other subpopulations in mediating tumor regression. Clinical trials of chimeric antigen receptor (CAR) T cells for neuroblastoma and B cell malignancies both demonstrate that frequencies of T SCM and T CM correlate with expansion, persistence, and response. Most recently, a study demonstrated that a small stem-like population in TIL product was associated with complete response in patients with metastatic melanoma while terminally differentiated TIL were associated poor persistence. Besides T cell phenotype, proliferation potential and the telomere length of cell products have also been correlated with therapeutic e cacy. A trial utilizing TIL in metastatic melanoma patients demonstrated a correlation between clinical response and longer telomere lengths in infused products. Despite these data, current methods of generating both TCR-modi ed and CAR T cells involve activation through CD3 stimulation to allow for e cient viral gene transfer. This stimulation results in differentiation, shortening of telomeres, and replicative senescence, which are likely suboptimal for therapy. Interleukin 7 (IL-7) is a T cell homeostatic regulator that induces G0 to G1 progression without inducing cell division or affecting T cell phenotype. Culturing with IL-7 has also been shown to allow for transduction of T cells with lentiviral vectors in the absence of activation. In these studies, we show that utilizing IL-7 to generate TIL1383I TCR-modi ed T cells in the absence of activation results in a cellular product with less-differentiated subpopulations, longer telomere lengths, and antigen-reactivity in vitro and in vivo. Results Generating TIL1383I TCR-modi ed T cells in the absence of activation As T cell activation likely yields a suboptimal therapeutic product, we aimed to generate melanomareactive TCR-modi ed T cells following culture with IL-7 rather than CD3 stimulation. Prior studies have suggested that progression from G0 to G1 phase of the cell cycle correlates with lentiviral transduction susceptibility. We therefore performed cell cycle analyses using acridine orange on T cells following no treatment, IL-7 culture, or CD3 activation. Cell staining from 3 donors is depicted in Fig. 1a. Analyses show that IL-7 cultured T cells had signi cantly more cells in the G1 phase of the cell cycle compared to untreated cells (means of 26% vs. 3%, p = 0.0069; Fig. 1b). CD3 activated T cells had a mean of 35% in G1, which was comparable to IL-7 cultured cells. In contrast, there was no signi cant difference between IL-7 cultured and untreated T cells in S phase. CD3 activated T cells had signi cantly more cells in S phase compared to IL-7 cultured cells (means of 10% vs. 3%, p = 0.0313; Fig. 1b). Altogether, these data suggest that culturing with IL-7 induces G0 to G1 progression, potentially rendering T cells susceptible to lentiviral transduction without commitment to S phase and cell division. We then used our lentiviral vector containing the melanoma-reactive TIL1383I TCR and a non-signaling truncated CD34 transduction marker to transduce T cells, generating TIL1383I TCR-modi ed T cells (Fig. 2a). As previously described, CD34 expression is used as a marker for gene transfer and additionally allows for the selection of transduced cells using magnetic-based technologies. We transduced T cells from 5 donors using our lentiviral vector either after no treatment, IL-7 culture, or CD3 activation. Flow cytometry analysis demonstrated a low level of CD34 expression in untreated CD3 + cells. In contrast, CD3 + cells demonstrated substantial CD34 expression when transduced after culturing with IL-7 (range of 21.7%-55.3%). As expected, activated CD3 + cells demonstrated considerable CD34 expression (range of 27.1%-62.3%; Fig. 2b). These ndings suggest that culturing with IL-7 allows for e cient genetransfer of TIL1383I TCR to T cells in the absence of CD3 activation. Characterizing the phenotypes of TIL1383I TCR-modi ed T cells generated in the absence of activation We next evaluated the phenotypes of TIL1383I TCR-modi ed T cells generated in the absence of activation to assess for potential therapeutic bene ts. As studies have demonstrated that CD4 + cells play an important role in the anti-tumor response of gene-modi ed T cells through both direct cytotoxicity and maintaining persistence, we evaluated the distribution of CD4 + and CD8 + subsets in CD3 + cells transduced either following IL-7 culture or CD3 activation. Although there was heterogeneity between donors, ow cytometry analysis on 5 donors demonstrated that CD3 + CD34 + cells transduced after culturing with IL-7 maintained a relatively balanced CD4 + /CD8 + ratio (CD4 + cells ranging from 36.3-70.3% and CD8 + cells ranging from 30.6-48.0%). Interestingly, in the donors we tested, CD3 + CD34 + cells transduced following CD3 activation were predominantly CD8 + in our experiments (CD4 + cells ranging from 5.6-23.3% and CD8 + cells ranging from 66.4-84.2%; Fig. 3a). In addition, we assessed the subset composition of TIL1383I TCR-modi ed T cells generated in the absence of activation as data suggest superior e cacy in less-differentiated populations. The differentiation markers, CD45RA, CD62L, CCR7, and CD95 were evaluated in CD3 + CD34 + cells transduced either following IL-7 culture or CD3 activation. Although there was heterogeneity between donors, CD3 + CD34 + cells transduced following IL-7 culture maintained a signi cantly higher percentage of CD45RA + CD62L + cells (T N, T SCM ) when compared to cells transduced following CD3 activation (means of 58.3% vs. 19.7%, p = 0.0014; Fig. 3b). Furthermore, a signi cant proportion of the CD45RA + CD62L + subset of CD3 + CD34 + cells transduced following IL-7 culture was also CCR7 + CD95 + (T SCM ) (range of 56.9%-89.5%). In contrast, CD3 + CD34 + cells transduced following CD3 activation demonstrated a signi cantly higher percentage of CD45RA − CD62L − (T EM ) cells when compared to cells generated following IL-7 culture (means of 40.5% vs. 15.1%, p = 0.0196; Fig. 3b). These ndings were consistent when evaluating either CD8 + or CD4 + subsets individually (Fig. 3c). Notably, there was a lower absolute cell number in the CD4 + subset of CD3 + CD34 + cells transduced following CD3 activation. A representation of the phenotypic composition of CD3 + CD34 + cells transduced following IL-7 treatment or CD3 activation is depicted in Fig. 3d. Taken together, these results suggest that generating TIL1383I TCRmodi ed T cells in the absence of activation leads to a product with a balanced CD4 + /CD8 + ratio and a less-differentiated phenotype, which may be advantageous for therapy. Assessing the proliferative potential of TIL1383i TCRmodi ed T cells generated in the absence of activation Studies have shown an established correlation between telomere length and the proliferative potential of peripheral blood lymphocytes (PBLs). We therefore compared the telomere lengths of TIL1383I TCR-modi ed T cells generated either following IL-7 culture or CD3 activation. We performed uorescence in situ hybridization (FISH) using a FITC labeled peptide nucleic acid (PNA) probe recognizing the six nucleotide telomere sequence on 3 donors. Although there was signi cant variability between donors, we found that CD3 + CD34 + cells transduced following IL-7 culture demonstrated higher uorescence when compared to cells transduced following CD3 activation, suggesting an increased presence of telomeres (Fig. 4a). Using the melanoma cell line, 624 MEL, as a control, we calculated the relative telomere length of the CD3 + CD34 + cells transduced following each condition. Analysis of 3 donors demonstrated that the relative telomere length of CD3 + CD34 + cells was signi cantly higher when transduced following IL-7 treatment compared to CD3 activation (p = 0.0073; Fig. 4b). These ndings suggest that TIL1383I TCRmodi ed T cells generated following IL-7 culture have a higher proliferative potential than cells generated following CD3 activation, which may lead to a more effective therapy. Evaluating antigen-speci c reactivity of TIL1383I TCRmodi ed T cells generated in the absence of activation To assess the antigen-speci c reactivity of TIL1383I TCR-modi ed T cells generated in the absence of activation, we performed intracellular cytokine assays following peptide stimulation on 3 donors. CD3 + CD34 + cells transduced following either IL-7 culture or CD3 activation were co-cultured with either unloaded T2 cells, T2 cells loaded with an irrelevant GP100 peptide, or T2 cells loaded with the tyrosinase peptide. Following overnight incubation, intracellular staining of CD3 + CD34 + cells transduced following IL-7 treatment demonstrated a substantial percentage of cells over background producing both IFN- and TNF- when stimulated with tyrosinase-loaded T2 cells (Fig. 5). As expected, CD3 + CD34 + cells transduced following CD3 activation had a high frequency of cells producing both IFN- and TNF- when stimulated with tyrosinase-loaded T2 cells. There was expected background cytokine production by cells incubated with media alone, unloaded T2 cells, and T2 cells loaded with an irrelevant GP100 peptide. These results demonstrate that TIL1383I TCR-modi ed T cells generated in the absence of activation are reactive in a tyrosinase-speci c manner, suggesting anti-melanoma potential. Evaluating the in vivo anti-melanoma activity of TIL1383I TCR-modi ed T cells generated in the absence of activation To assess the in vivo activity of TIL1383I TCR-modi ed cells, we established tumors through subcutaneous injection of 624 MEL into NOD/SCID/ −/− (NSG) mice (n = 12 per treatment group). Upon development of palpable tumors (day 7 post injection), 5 X 10 6 CD3 + CD34 + cells transduced either following IL-7 culture or CD3 activation were adoptively transferred intravenously into tumor-bearing mice. IL-2 was administered twice a day for 5 days following adoptive transfer to enhance T cell responses as previously described and as done in clinical trials. Tumor-bearing mice that were untreated or treated with IL-2 alone were used as controls. Mice treated with CD3 + CD34 + cells transduced following IL-7 culture demonstrated a signi cant delay in tumor progression when compared to untreated mice (p = 0.0013; Fig. 6). Furthermore, mice treated with CD3 + CD34 + cells transduced following IL-7 culture had lower tumor volumes when compared to those treated with activated CD3 + CD34 + cells (p = 0.0474; Fig. 6). In contrast, mice treated with activated CD3 + CD34 + cells did not have a statistically signi cant difference when compared to untreated mice. IL-2 treatment alone in mice did not have a signi cant effect on tumor growth (data not shown). Altogether, these data suggest that TIL1383I TCRmodi ed T cells generated following IL-7 culture have superior anti-melanoma activity in vivo on a per cell basis compared to cells generated following activation. Discussion Adoptive T cell therapy remains a promising form of treatment for metastatic melanoma. As highlighted above, T cell activation used to generate tumor-reactive T cells results in a phenotype that is likely suboptimal for therapy. In addition, TIL, TCR-modi ed T cells, and CAR T cells all typically undergo in vitro expansion to obtain a su cient number of cells for clinical response. Continued stimulation during expansion leads to further T cell differentiation, shortening of telomeres, and activation induced cell death (AICD). As cytokines have been shown to render T cells susceptible to lentiviral transduction in the absence of CD3 stimulation, there have been efforts to generate melanoma-reactive T cells in the absence of activation. One group has previously demonstrated successful transfer of a TCR reactive to the melanoma antigen, MART-1, without prior stimulation of CD3. However, TCR-modi ed or CAR T cells generated in the absence of activation have yet to be evaluated in vivo. This is likely due to the low absolute yield and the inability to select for transduced cells. In these studies, we demonstrate the e cient transfer of TIL1383I TCR and a CD34 marker allowing for magnetic-based sorting without CD3 activation. In addition, we evaluate TCR-modi ed T cells generated in the absence of activation using an in vivo system for the rst time. IL-2, IL-7, and IL-15 have been demonstrated to enhance lentiviral transduction of T cells without CD3 stimulation. However, IL-2 has been known to result in terminal differentiation and enhance AICD while both IL-2 and IL-15 induce T cell proliferation. In contrast, IL-7 is a T cell homeostatic regulator that promotes T cell survival without stimulating cell division. Cell cycle analysis in our studies con rmed that IL-7 culture transitions lymphocytes from G0 to G1 without commitment to S phase and therefore proliferation (Fig. 1). Thus, we utilized IL-7 in our studies to facilitate gene transfer in attempt to preserve maximal immune-competence. Using our lentiviral construct, we were able to e ciently generate TIL1383I TCR-modi ed T cells following IL-7 culture (Fig. 2b). In the donors we tested, cells transduced following IL-7 culture maintained a relatively balanced CD4 + /CD8 + ratio compared to the low CD4 + /CD8 + ratio we observed in activated cells. Prior studies from another group found a similarly high proportion of CD8 + cells when transducing stimulated T cells. Infusion products used in different CD19 CAR T cell trials also frequently skewed toward an either predominantly CD4 + or CD8 + population. Although the causes are not completely clear, differences in transduction and in vitro expansion protocols, including methods of T cell stimulation, cytokines, feeder cells, viral vectors, and length of expansion, all may account for inconsistent CD4 + /CD8 + ratios. Patient sex, age, ethnicities, or prior exposures may also play a role. As variability in the infusion product likely accounts for the unpredictable clinical responses to adoptive cell therapy, there have been efforts in generating a more consistent product. Studies have shown that an infusion product formulated with de ned CD4 + and CD8 + subsets in a 1:1 ratio enhances in vivo antitumor activity. This has led to a CAR T trial in which CD4 + and speci c CD8 + subsets were puri ed and transduced separately before formulated in a 1:1 ratio. Although the trial demonstrated signi cant clinical responses, the manufacturing process remains laborious. Generating TCR-modi ed T cells following IL-7 culture appears to be a straightforward strategy to achieve a similar CD4 + /CD8 + composition without the potential consequences of T cell activation. As evidence suggests that less-differentiated T cells have higher therapeutic potential, there are ongoing efforts to preserve less-differentiated phenotypes of TCR-modi ed or CAR T cells. The group that formulated an infusion product with a de ned CD4 + /CD8 + ratio used a puri ed CD8 + T CM starting population for transduction. In addition, the use of IL-7 and IL-15 during in vitro expansion has been used to maintain less-differentiated T cell populations. However, both of these strategies continue to rely on CD3 stimulation for e cient gene transfer. Even when cell products were generated from a less-differentiated CD8 + T CM population, the patients received a product that consisted of CD8 + cells that were mostly T EM. This is consistent with our studies that demonstrate signi cant T cell differentiation following activation (Fig. 3b and c). In addition, a recent study evaluating TCR-modi ed T cells speci c to the cancer-testis antigen, NY-ESO-1, following expansion with IL-7 and IL-15 demonstrated a limited enrichment of less-differentiated cells and no absolute bene t. By transducing T cells in the complete absence of activation, we obtain TIL1383I TCR-modi ed T cells with preserved T N and T SCM populations and retained telomere lengths (Figs. 3 and 4). We con rmed the tyrosinase-speci c reactivity of TIL1383I TCR-modi ed T cells generated following IL-7 culture using both in vitro and in vivo systems. Intracellular cytokine assays demonstrated cytokine production when TIL1383I TCR-modi ed cells generated in the absence of activation were incubated with tyrosinase-loaded targets. However, there appears to be a lower percentage of cytokine producing cells compared to activated TIL1383I TCR-modi ed T cells (Fig. 5). This is likely due to the nature of T N and T SCM subpopulations, which require more time to react in vitro, but have been shown to be a superior therapy in vivo. The results following overnight incubation in our experiments are likely not re ective of the overall therapeutic potential of TIL1383I TCR-modi ed T cells generated in the absence of activation. Indeed, we found a superior anti-melanoma response when mice were treated with TIL1383I TCR-modi ed T cells generated following IL-7 culture compared to mice treated with activated cells (Fig. 6). Even with e cient gene-transfer of TIL1383I TCR without CD3 stimulation, the percentage of transduced cells was lower than a typical infusion product. However, our CD34t transduction marker permits clinicalgrade magnetic selection, resulting in a highly pure transduced product with enhanced tumor-reactivity. In vitro expansion is commonly used to increase the percentage of transduced cells and obtain the required number of cells for infusion, but this comes at the expense of telomere shortening and reduced proliferative potential. It would be di cult to obtain comparable absolute numbers of gene-modi ed cells typical for infusion without in vitro expansion. However, TIL1383I TCR-modi ed T cells generated in the absence of activation have desirable qualities for therapy, so the number of cells required to see a clinical response may not be as high. Furthermore, generating a potent therapy without in vitro expansion would shorten production time and permit more timely treatment. In conclusion, we demonstrate e cient generation of melanoma-reactive TIL1383I TCR-modi ed T cells in the absence of activation by utilizing IL-7 treatment and a lentiviral vector. TIL1383I TCR-modi ed T cells generated following IL-7 culture have a balanced CD4 + /CD8 + ratio, less-differentiated phenotype, and increased proliferative potential. These TIL1383I TCR-modi ed T cells generated in the absence of activation have anti-melanoma reactivity both in vitro and in vivo. A growing body of data suggests that less-differentiated phenotypes and longer telomeres correlate with clinical response. Thus, generating TIL1383I TCR-modi ed T cells in the complete absence of activation is a feasible strategy to improve therapeutic potential. These ndings may be applied to other tumor reactive TCRs and CARs and improve adoptive T cell therapy for melanoma and other malignancies. Materials And Methods Cells Lines T2, a human TAP-de cient HLA-A2 + cell line, and HEK 293T were obtained from ATCC (Rockford, MD). 624 MEL, a melanoma cell line was previously described (Bethesda, MD). GPRTG, a 293T-based packaging cell line for production of lentiviral vector particles, was obtained from the National Gene Vector Biorepository (Indiana University, Indianapolis, IN). T2 cells were maintained in RPMI (Thermo Fisher, Walther, MA) with 10% heat-inactivated fetal bovine serum (HI-FBS; Tissue Culture Biologics, Long Beach, CA). All other cell lines were maintained in DMEM (Thermo Fisher) with 10% HI-FBS. 1 ng/mL doxycycline (Clontech Laboratories, Palo Alto, CA) was added to DMEM for GPRTG cells. Cells were maintained at 37°C in a humidi ed 5% CO 2 incubator. Cell Cycle Analysis Cell cycle analysis was performed using acridine orange as previously described. 10 6 cells were resuspended in 0.1 ml of PBS. 0.5 ml of Buffer I (20mM Citrate-Phosphate, pH 3.0, 0.1mM EDTA, 0.2M Sucrose, 0.1% Triton X-100) was added to the suspension and gently agitated. 2 mg/ml acridine orange (Sigma-Alrich) was diluted 1:100 in Buffer II (10mM Citrate-Phosphate, pH 3.8, 0.1M NaCl). 0.5 ml of Buffer II containing acridine orange was subsequently added to the suspension and gently agitated. Cell luminescence was measured using the LSR Canto ow cytometer (BD Biosciences, San Jose, CA) and data was analyzed with FlowJo software (BD Biosciences). The fraction of cells in G0, G1, S, and G2/M phases of the cell cycle was determined by DNA and RNA contents. Lentivirus Production A lentiviral vector was constructed to include the melanoma antigen (tyrosinase)-reactive TIL1383I TCR, and a truncated CD34 molecule (CD34t) as a transgene expression marker as previously described. The pLVX-E1a-N1 (Clontech, Mountain View, CA) vector was modi ed to include the TCR alpha chain, P2A self-cleaving linker, TCR beta chain, T2A linker, and CD34t. This modi ed vector was used to generate a stable GPRTG lentiviral producer cell line as follows. Viral supernatants were produced by transfecting 293T cells with the pLVX-TIL1383I TCR plasmid using Lenti-X single shots following the manufacturer's directions (Takara, Mountain View CA). GPRTG cells were spinoculated (1000 X G for 2 hours at 32°C) with viral supernatants containing 8 g/ml of polybrene (Sigma-Alrich), cultured for an additional 72 hours, and resuspended in DMEM with doxycycline. TIL1383I TCR lentiviral supernatants for T cell transductions were produced as follows. Transduced GPRTG cells were seeded in doxycycline-free DMEM in 10 cm tissue culture dishes. DMEM was replaced with Freestyle 293 expression media (Gibco, Gaithersburg, MD) 24 hours later. TIL1383I TCR lentiviral supernatant was then collected following a 48 hour incubation. Lentiviral Transduction of T cells PBLs cultured with IL-7 or activated with anti-CD3, IL-2, and IL-15 were resuspended in TIL1383I TCR lentiviral supernatant containing 8 g/ml of polybrene and plated in 24 well plates. Plates were spinoculated at 2000 X G at 32°C for 2 hours. TIL1383I TCR-transduced cells were harvested and resuspended in RPMI supplemented with either IL-7 or IL-2 and IL-15. Telomere Analysis The ow-FISH method using the telomere PNA Kit/FITC for Flow Cytometry Kit (Dako, Glostrup, Denmark) was used to analyze telomere length per manufacturer's protocol. 624 MEL cells were used as the control. Fluorescence was measured using an LSR Canto ow cytometer. Data was analyzed with FlowJo software. Intracellular Cytokine Assay Antigen reactivity of transduced cells was measured through cytokine production in an intracellular cytokine assay as previously described. Gp100:209-217 (gp100) and tyrosinase:368-376 (tyrosinase) peptides were obtained from Synthetic Biomolecules (San Diego, CA). T2 cells were pulsed with 10 g/ml of peptide for 2 hours prior to co-culture. 10 5 TIL1383I TCR-modi ed cells were co-cultured with the targets at a 1:1 ratio in a 96 well U-bottom tissue culture plate in 200 l media. Following overnight incubation, Brefeldin-A and Monensin (Biolegend) were added to the culture. After ve hours, cells were stained for surface markers for 20 minutes at room temperature. Cells were xed, permeabilized, and stained for intracellular IFN- and TNF-. Data was collected using an LSR Fortessa ow cytometer and analyzed with FlowJo software. Melanoma Xenograft Model 8-12-week old NOD/SCID/ −/− (NSG) male and female mice (Jackson Laboratory, Bar Harbor, ME) were treated under an approved IACUC protocol and complied with ARRIVE guidelines. Mice were injected subcutaneously with 5 X 10 6 624 MEL cells into anks, forming palpable tumors by day 7. At 7 days postchallenge, 5 X 10 6 TIL1383I TCR-modi ed cells were injected intravenously in 100 l of PBS. Intraperitoneal injections of IL-2 (60,000 IU) were administered twice a day for 5 days as previously described. Tumor bearing mice either treated with IL-2 alone or untreated were used as controls. Tumor size in 3 perpendicular dimensions was measured twice a week using calipers. Wilcoxon rank sum test was used to determine signi cant difference between treatment groups.
<gh_stars>0 /* ==================================================================== 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 com.arcsoft.office.fc.openxml4j.opc.internal; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.nio.channels.FileChannel; /** * Provide useful method to manage file. * * @author <NAME> * @version 0.1 */ public final class FileHelper { /** * Get the directory part of the specified file path. * * @param f * File to process. * @return The directory path from the specified */ public static File getDirectory(File f) { if (f != null) { String path = f.getPath(); int len = path.length(); int num2 = len; while (--num2 >= 0) { char ch1 = path.charAt(num2); if (ch1 == File.separatorChar) { return new File(path.substring(0, num2)); } } } return null; } /** * Copy a file. * * @param in * The source file. * @param out * The target location. * @throws IOException * If an I/O error occur. */ public static void copyFile(File in, File out) throws IOException { FileChannel sourceChannel = new FileInputStream(in).getChannel(); FileChannel destinationChannel = new FileOutputStream(out).getChannel(); sourceChannel.transferTo(0, sourceChannel.size(), destinationChannel); sourceChannel.close(); destinationChannel.close(); } /** * Get file name from the specified File object. */ public static String getFilename(File file) { if (file != null) { String path = file.getPath(); int len = path.length(); int num2 = len; while (--num2 >= 0) { char ch1 = path.charAt(num2); if (ch1 == File.separatorChar) return path.substring(num2 + 1, len); } } return ""; } }
The penultimate year of the war began with a speech exhorting Germans to persevere. Italy was no longer Germany's ally, and the Soviet army was approaching the borders of Poland, Hungary and Romania. The Allied landing in France was imminent. After addressing soldiers and his fellow Germans, Adolf Hitler turned his attention to the Lord himself in his speech to ring in the New Year of 1944. "He is aware of the goal of our struggle," he said. The Lord's "justice will continue to test us until he can pass judgment. Our duty is to ensure that we do not appear to be too weak in his eyes, but that we are given a merciful judgment that spells 'victory' and thus signifies life!" Two very different men in the German Reich noted their thoughts about Hitler's expression of religious sentiments in their diaries. The first, Victor Klemperer, lived with his wife in a "Jew house" in Dresden, where he wrote about the dictator, using a false name: "New content: Karl becomes religious. (The new approach lies in his approximation of the ecclesiastical style.)." The second, Friedrich Kellner, lived with his wife in an official apartment in a court building for the Hessian town of Laubach, where he hid his written account of the war in a living-room cabinet. In his commentary on the Hitler speech, Kellner wrote: "The Lord, who has been maligned by all National Socialists as part of their official policy, is now being implored by the Führer in his hour of need. What strange hypocrisy!" The extensive diary written by Klemperer, a professor of Romance Literature who had been fired from his job in Dresden, was published in 1995 under the title "Ich will Zeugnis ablegen bis zum letzten" ("I Will Bear Witness 1942-1945: A Diary of the Nazi Years"). It is perhaps the most important private document about the Nazis, because it offers an extremely clear-sighted and detailed account of the 12 years of the "Thousand-year Reich" from the perspective of someone who was marginalized. The account details small annoyances and major crimes, daily life and the development of Nazi propaganda. This document now has a counterpart, the diaries of judicial inspector Friedrich Kellner. The 900-page book begins in September 1938, told from the perspective of a German citizen who was not a Nazi. It also reveals what information Germans could have obtained about the Nazis if they had wanted to. An Ordinary Family Kellner, born in 1885, a few years later than Klemperer, was not a privileged man. The son of a baker and a maid, he embarked on a judicial career after graduating from the Oberrealschule, a higher vocational school. At 22, Kellner completed his one year of compulsory military service as an infantryman in the western city of Mainz, and in 1913 he married Paulina Preuß, an office clerk. The couple's only son was born three years later, when Kellner returned from the French front after being wounded in the First World War. They were an ordinary, lower middle-class family, but they were also politically active. He distributed flyers, gave speeches and recruited new members for the Social Democratic Party (SPD). Kellner had read Hitler's "Mein Kampf," and he took the book seriously, saying that it brought shame to Gutenberg. After the 1932 elections, in which the Nazi Party became the strongest faction in the parliament, the Reichstag, Kellner requested a transfer from Mainz. In 1933, two weeks before Hitler's appointment as Reich chancellor and the first wave of internal terror, he began working as a government employee in the Laubach District Court. He was an unknown entity in a town with strong Nazi sympathies. It was there that Kellner wrote his diary: a conversation he conducted with himself out of despair that was also an analysis of the present and a planned legacy. "The purpose of my record," he began, on Sept. 26, 1938, "is to capture a picture of the current mood in my surroundings, so that a future generation is not tempted to construe a 'great event' from it (a 'heroic time' or the like)." In the same passage, on the same day, Kellner revealed a bitter clear-sightedness, when he summed up German postwar history in one sentence: "Those who wish to be acquainted with contemporary society, with the souls of the 'good Germans,' should read what I have written. But I fear that very few decent people will remain after events have taken their course, and that the guilty will have no interest in seeing their disgrace documented in writing." Ten closely written volumes document the things Kellner experienced, observed and, most of all, what he read and heard. He cut out speeches and calls to action from newspapers and analyzed them, and he made notes about ordinances and decrees. He contrasted the information provided by the government with the facts, both in everyday life in Hesse and at the distant front. He listened to foreign radio stations when he could. But most of all, he analyzed the propaganda from a critical standpoint. Commenting on the 1939 "Treaty of Friendship" with the Soviet Union, he wrote: "We must resort to aligning ourselves with Russia to even have a 'friend.' Russia, of all countries. The National Socialists owe their existence entirely to the fight against Bolshevism (World Enemy No. 1, Anti-Comintern Pact). Where have you disappeared to, you warriors against Asian disgrace?" Clippings as Evidence Less than two years later, the warriors had returned, supposedly to preempt an attack by the Soviet Union. On June 22, 1941, Kellner wrote in his diary: "Once again, a country has become a victim of the non-aggression pact with Germany. No matter how our actions are justified, the truth will be found solely in the economy. Natural resources are the trump card. And if you are not compliant, I am prepared to use violence." But hardly anyone saw things the way he did. The women, over tea, liked to refer to the Germans "taking" a city, a region or even an entire country. Kellner was horrified, both by the gullibility and barbarism of the people around him. Using military news, obituaries of those who died ("for Germany's greatness and freedom"), caricatures, newspaper articles and conversations with ordinary people, Kellner fashioned an image of Nazi Germany that has never existed before in such a vivid, concise and challenging form. Until now, the discussion over German guilt has fluctuated within the broad space between two positions. The one side emphasizes the deliberate disinformation of Nazi propaganda and the notion that ordinary citizens lived in fear and terror, concluding that they couldn't have known better. The other side takes the opposite position, namely that most were aware of what was happening. Kellner's writings offer a glimpse into what everyone could have known about the war of extermination in the East, the crimes against the Jews and the acts of terror committed by the Nazi Party. He wrote about the executions of "vermin" who made "defeatist" remarks, and about "racial hygiene." In July 1941 he wrote: "The mental hospitals have become murder centers." A family that had brought their son home from an institution later inadvertently received a notice that their child had died and that his ashes would soon be delivered. "The office had forgotten to remove the name from the death list. As a result, the deliberate killing was brought to light," he wrote. Under Nazi Watch By reading Kellner's diaries and recognizing what Germans could have known, it's tempting to rethink how the expression "We knew nothing about those things!" came into being. According to Kellner, people simply ignored the information available to them out of both laziness and enthusiasm for German war victories. When this denial of reality no longer worked, when too much had been revealed about what the Nazis were doing in Germany's name, there was no turning back for the majority of Germans. "'I did that,' says my memory," Nietzsche wrote. "'I could not have done that,' says my pride, and remains inexorable. Eventually, the memory yields." Kellner himself wrote that "this pathetic German nation" had been held hostage by the perpetrators. "Everyone is convinced that we must triumph so that we are not completely lost." The Nazis themselves warned the population against the revenge of the perpetrators. For most Germans, the only conceivable end of the war was victory -- or total annihilation. Kellner lived until 1970. Despite having been under surveillance by the party and questioned several times, he escaped the concentration camps. In a denunciation written in 1940, a Nazi official named Engst wrote: "If we want to apprehend people like Kellner, we will have to lure them out of their corners and allow them to make themselves guilty. The time is not ripe for an approach like the one that was used with the Jews. This can only happen after the war." In the epilogue, the author's grandson describes how the publication of Kellner's diaries came about. German publishers were not interested at first. But then the diaries attracted attention when, in April 2005, SPIEGEL reported that former US President George Bush had looked at Kellner's original notebooks in the George Bush Presidential Library at Texas A&M University. Now that they have finally been published, the volumes are likely to find a place next to the Klemperer diaries in German libraries and on private bookshelves too.
If you're tempted to splash out on a Tesla, but looking for something with more space than the Model S, new details have emerged regarding the company's long-awaited SUV, the Model X. Tesla has confirmed that its roomier model will boast seven seats, a dual motor all-wheel drive system, semi-autonomous technology, and 'Falcon Wing' doors – we can't decide if these are cool, obnoxious, or a bit of both. The Model X will be also be available with three battery power options – 60kWh, 85kWh and 85kWh 'Performance' – with Tesla claiming it to be the first electric vehicle with towing capacity, which should result in some interesting tweaks to the car's range specs. The long wait... Tesla also claims the 85kWh options will boast a 0-60mph acceleration time, making the Model X the quickest SUV around and even capable of shaming some sports cars. Curious? Sadly, unless you've already placed your order you won't be getting behind the wheel of Tesla's new model before 2016. Following a two-year production delay as Tesla struggled to meet demand for the Model S, the Model X is sold out in the US for 2015 and other markets are unlikely to fare any better.
Saying he was "not too proud to come here and pilfer ideas," Orlando Mayor Bill Frederick and a delegation from the Project 2000 goals-setting project were feted by community leaders and briefed on key achievements here on Tuesday and Wednesday. Frederick, Project 2000 Director Linda Chapin and others in the six- member contingent said they found at least one new program they would like to transplant to Central Florida. That program is a version of the Greater Austin-San Antonio Corridor Council, which promotes economic and cultural development in the six-county area linking the cities along the 125-mile stretch of Interstate 35. Launched in late 1983 by San Antonio Mayor Henry G. Cisneros and others, the council is a forum for communities in the 5,300-square-mile area to work out energy and environmental problems, but also is an agency that markets the area nationally and internationally. Frederick, who is thinking about forming a similar organization to link Orlando, Daytona Beach, Melbourne and the cities and counties in between, said he believes the Texas model could serve Central Florida well. The Orlando area may not need an organization as complex as the 300- member San Antonio-Austin version, said Frederick after a briefing on the program Wednesday. But the creation of a network that includes the attributes of Orlando International Airport, Port Canaveral and the beach communities could yield benefits to all, he said. Although the San Antonio-Austin link more closely resembles the relationship between Orlando and Tampa, Frederick said he would prefer a Central Florida model that focuses on the east coast. "We're in competition a lot with Tampa. We needn't be in competition with Brevard County." The new organization would be different from the Greater Orlando Area Chamber of Commerce and the Industrial Development Commission of Mid-Florida. It could focus on common problems in areas such as arts and education, Frederick said. The Orlando group, which also includes WESH-Channel 2 director John E. Evans, incoming chamber president Tom Heyward, Frederick aide, Lawrie Platt, and Hans Tews, senior vice chairman of Sun Bank N.A. and Project 2000 chairman, did not land in San Antonia by accident. As Chapin notes, the two communities though different in size -- San Antonio has 850,000 residents and is the 10th largest city in the country -- share many similarities. Like Orlando, San Antonio is a high-gross tourist center -- drawing 10 million visitors a year. Soon, it will be home to a 500-acre Sea World theme park. The city also recently has been developing into a center for high-tech industries, and it stresses downtown development. But the chief reason for the visit is Target '90, the city's 93-point community improvement program that is a model for Orlando's Project 2000. Organizers say the seemingly successful community program involves more the 2,200 volunteers. Target '90 goals touch on most areas of city life, and involve such diverse things as a call for creation of a center to combat adult illiteracy to the suggestion that the city remove a sewage treatment plant from the depressed southern sector of the city to help erase a barrier to development. As Project 2000 gears for its massive publicity campaign, including a two-day televised town meeting Nov. 25 and 26 with presentations and opportunities for citizens to call in questions and opinions, Chapin said she wanted to learn how San Antonio had captured the community's enthusiasm. The delegation didn't have to look farther than Cisneros. A rising national figure who was considered by Walter Mondale as a potential vice presidential candidate in 1984, the energetic 38-year-old third-term mayor is one of Target '90's biggest boosters. Target '90 is "one of the more important things to happen in San Antonio in recent years," said Cisneros, a planner and college professor who is the first Hispanic in modern times to be elected mayor. The delegation returns to Orlando today. The tour is being paid for by the Smith Barney investment banking company.
From 2009 up to 2013, the year the Ukrainian crisis erupted, the Clinton Foundation received at least $8.6 million from the Victor Pinchuk Foundation, which is headquartered in the Ukrainian capital of Kiev, a new report claims. In 2008, Viktor Pinchuk, who made a fortune in the pipe-building business, pledged a five-year, $29-million commitment to the Clinton Global Initiative, a program that works to train future Ukrainian leaders “to modernize Ukraine.” The Wall Street Journal revealed the donations the fund received from foreigners abroad between 2009-2014 in their report published earlier this week . Several alumni of the program have already graduated into the ranks of Ukraine’s parliament, while a former Clinton pollster went to work as a lobbyist for Pinchuk at the same time Clinton was working in government. Between 2009 and 2013, the very period when Hillary Clinton was serving as US secretary of state, the Clinton Foundation appears to have received at least $8.6 million from the Victor Pinchuk Foundation. That places Ukraine as the leading contributor among foreign donators to the Clinton Foundation. The Pinchuk foundation said its donations to the Clinton-family organization were designed to make Ukraine “a successful, free, modern country based on European values.” It went on to remark that if Pinchuk was hoping to lobby the US State Department about Ukraine, “this cannot be seen as anything but a good thing,” WSJ quoted it as saying. However, critics have pointed to some disturbing aspects regarding the donations, including the coincidence of the Ukrainian crisis, which began in November 2013, and the heavy amount of cash donations being made to the Clinton Foundation on behalf of wealthy Ukrainian businessmen. In any case, given that Hillary Clinton appears to be considering a possible run in the next presidential elections, more scrutiny will be devoted to her past work with the charity that bears the Clinton name. First, as already mentioned, Clinton was serving as the US secretary of state at the time that the donations to her family’s charity were being made. Although it is true that the Clinton Foundation refused donations directly from foreign governments while Clinton was serving in the Obama administration, the door remained wide open to donations from public citizens like Pinchuk, who has advocated on behalf of stronger ties between Ukraine and the European Union. Political connections in the Pinchuk family run deep. Not only did Viktor Pinchuk serve two terms as a Ukrainian parliamentarian, but his wife is the daughter of former Ukrainian President Leonid Kuchma. After being introduced to former US President Bill Clinton by Doug Schoen, a political analyst and pollster who has worked for both Clintons, Pinchuk and his wife began making donations to Clinton-family charities, WSJ reported. During Hillary Clinton’s time at the State Department, Schoen began work as a congressional lobbyist for the Ukrainian oligarch. Schoen defended his lobbying activities, saying there was no connection to Pinchuk’s hefty donations. “We were not seeking to use any leverage or any connections or anything of the sort relating to the foundation,” he said. Schoen said he and Viktor Pinchuk met on several occasions with Clinton aides including Melanne Verveer, a Ukrainian-American who holds membership in the influential Council on Foreign Relations, as well as the Trilateral Commission. The purpose of these meetings, according to Schoen, was to encourage the US government to pressure Ukraine’s former President Viktor Yanukovich to release his jailed political opponent, Yulia Tymoshenko. Whatever the case may be, Ukraine entered a period of severe crisis on November 21, 2013, when Yanukovich suspended plans for the implementation of an association agreement with the European Union. The announcement triggered mass protests that led to Yanukovich fleeing Kiev on February 22, 2014. Social unrest eventually consumed the country, as the eastern part of Ukraine attempted to gain more independence from Kiev. Recently, both sides have agreed to a tense ceasefire, hammered out last month in Minsk, Belarus by the leaders of Ukraine, Russia, France, and Germany.
Innovation, imitation, and problem-solving in a networked group. We implemented a problem-solving task in which groups of participants simultaneously played a simple innovation game in a complex problem space, with score feedback provided after each of a number of rounds. Each participant in a group was allowed to view and imitate the guesses of others during the game. The results showed the use of social learning strategies previously studied in other species, and demonstrated benefits of social learning and nonlinear effects of group size on strategy and performance. Rather than simply encouraging conformity, groups provided information to each individual about the distribution of useful innovations in the problem space. Imitation facilitated innovation rather than displacing it, because the former allowed good solutions to be propagated and preserved for further cumulative innovations in the group. Participants generally improved their solutions through the use of fairly conservative strategies, such as changing only a small portion of one's solution at a time, and tending to imitate solutions similar to one's own. Changes in these strategies over time had the effect of making solutions increasingly entrenched, both at individual and group levels. These results showed evidence of nonlinear dynamics in the decentralization of innovation, the emergence of group phenomena from complex interactions of individual efforts, stigmergy in the use of social information, and dynamic tradeoffs between exploration and exploitation of solutions. These results also support the idea that innovation and creativity can be recognized at the group level even when group members are generally cautious and imitative.
Downtown Pasadena, California Downtown Pasadena California is the central business district of Pasadena, California. It is centered on Fair Oaks Avenue and Colorado Boulevard and is divided into three distinct neighborhoods: Old Pasadena, the Civic Center, and Monk Hill. Downtown Pasadena is known for its historical buildings that have been preserved throughout the years. Early years In the 1874, Pasadena was founded as an agricultural cooperative for orange growers and was incorporated in 1886 with its commercial center on the intersection of Fair Oaks Avenue and Colorado Boulevard. This intersection has been the center of Downtown Pasadena since then to present day. As Pasadena started to grow in size in the 1900s, grand hotels were being built which then established Pasadena's national reputation as a winter tourist destination for the wealthy. As tourism began to grow, there was an increase in money and population from the tourism allowed for the city to continue its growth throughout the years. Downtown's Golden Age During the 1900s to the 1940s, Downtown Pasadena went through rapid change through as the city's population was continuously growing. Despite The Depression that occurred in the 1930s, Downtown Pasadena continued developing as it the hotels present were converted into industrial, manufacturing, and research offices. The transition of Downtown Pasadena from a tourist destination to an industrial site allowed for the area to continue its expansion and growth. Decline and redevelopment As business started to move out of Downtown Pasadena in the 1950s, the area started to go through a period of decline. This area began to be known as Skid Row as buildings were left abandoned. Redevelopment of the downtown area started as there was an infusion of about more than $400 million in public and private money. With the infusion in money, it allowed for private property developments, street improvements, and construction of new buildings such as more parking garages and a retail shopping center. However, not all of this money was focused on new buildings as existing structures were rehabilitated. The existing buildings were redeveloped in order to recreate old Downtown Pasadena. As the redevelopment plans were completed, Downtown Pasadena went through a period of continuous growth. According to Shigley, Pasadena became a model of smart growth for California. This was because of the mixed-use buildings with housing units, retail shops, and professional services which allowed for the growth of Downtown Pasadena commercially and residentially. Old Pasadena Old Pasadena is the historic core of Downtown, and has a multitude of fine shops and restaurants (Italian and Japanese restaurants are especially numerous here). The attractions that are present around this area that involves shopping, dining, and entertainment. There are two parks, the historic Del Mar Station and Castle Green, and the headquarters of Parsons. Civic Center The Civic Center lies to the east of Old Pasadena and was built in the 1920s. It is home to Pasadena's City Hall, Paseo Colorado, the Pasadena Civic Auditorium. These buildings are known as historical landmarks. It also houses several municipal government offices, though notably not the Department of Public Works, which is in Banbury Oaks. Monk Hill Monk Hill is the westernmost part of Downtown and is home to the Norton Simon Museum and Ambassador Auditorium. Preservation efforts As Downtown Pasadena was going through a time of decline during the 1970s, the city had established a Central District Improvement Plan which to improve the conditions of the area. The plan involved the demolition of old historical buildings in order to make way for more modern buildings. However, there was a preservationist group called Pasadena Heritage that fought to save and redevelop the existing historic structures. Pasadena Heritage was founded in 1977 to save Civic Center buildings that were facing demolition. Throughout the years, Pasadena Heritage has worked to save numerous historical structures around Downtown Pasadena. Some structures that have been saved from demolition by the members of Pasadena Heritage is the Colorado Street Bridge and Pasadena Playhouse. Education Downtown Pasadena is served by Roosevelt, San Rafael, and McKinley Elementary Schools; Blair, and McKinley Middle Schools;, and Blair International Baccalaureate School; Maranatha High School is a Christian school in the area. Mass transit The Metro Gold Line has two stations Downtown, at Memorial Park and Del Mar Station. Downtown is also served by Metro Rapid lines 762 and 780; and Metro Local lines 177, 180, 181, 256, 260, 267, 686, and 687; as well as Pasadena ARTS routes 10, 20, 31, 32, 40, 51, 52, and 70; and Foothill Transit line 187.
package org.icpclive.webadmin.mainscreen.caption; import org.icpclive.webadmin.mainscreen.MainScreenService; import org.icpclive.webadmin.utils.DemonstratorController; import java.util.Collections; import java.util.List; public class AdvertisementController extends DemonstratorController<Advertisement> { public AdvertisementController() { super(new String[]{"advertisement"}, new String[]{"Advertisement"}, Advertisement.class, 1, MainScreenService.getInstance().getAdvertisementData().getContainer()); deleteDemonstrateAllButtons(); } @Override protected void recache() { // } @Override protected void setItemValue(final Advertisement item, final List<String> value) { item.setAdvertisement(value.get(0)); } @Override protected void removeItem(final Advertisement item) { MainScreenService.getInstance().getAdvertisementData().removeAdvertisement(item); } @Override protected void addItem(final List<String> fields) { MainScreenService.getInstance().getAdvertisementData().addAdvertisement(new Advertisement(fields.get(0))); } @Override protected List<String> getTextFieldValuesFromItem(final Advertisement item) { return Collections.singletonList(item.getAdvertisement()); } @Override protected String getStatus(final int id) { return MainScreenService.getInstance().getAdvertisementData().toString(); } @Override protected String setVisible(final boolean visible, final Advertisement item, int id) { return MainScreenService.getInstance().getAdvertisementData().setAdvertisementVisible(visible, item); } }
#! usr/bin/env python # -- coding: UTF-8 -- #python3 client.py 192.168.200.200 list #python3 client.py 192.168.200.200 get dosya.pdf #python3 client.py 192.168.200.200 put dosya.pdf #Egemen Inceler 170401027 from socket import * import sys import os try: s = socket(AF_INET, SOCK_DGRAM) except PermissionError: print("Lutfen root olarak calistiriniz.") host = sys.argv[1] port = 42 addr = (host,port) dosyalar="default" komut = sys.argv[2] s.sendto(komut.encode("utf-8"), addr) print("[*]Sunucu ip adresi: ", sys.argv[1], "Port:",port, "\n[*]Komut:", sys.argv[2]) if(port != 42): print("Sunucu 42.portu dinliyor.") sys.exit() if(komut.lower() == "list"): try: dosyalar, clientaddr = s.recvfrom(4096) print(dosyalar.decode("utf-8")) except : print("error") sys.exit() elif(komut.lower() == "put"): dosya_adi = sys.argv[3] dosya_adi=dosya_adi.encode("utf-8") s.sendto(dosya_adi, addr) try: f= open(dosya_adi, "rb") data = f.read(1024) while(data): if(s.sendto(data, addr)): print("gonderiliyor.") data = f.read(1024) f.close() done = "done".encode("utf-8") s.sendto(done, addr) except FileNotFoundError: print("Dosya bulunamadi") data = "FileNotFoundError".encode("utf-8") s.sendto(data, addr) s.close() elif(komut.lower() == "get"): dosya_adi = sys.argv[3] dosya_adi = dosya_adi.encode("utf-8") s.sendto(dosya_adi, addr) f=open(dosya_adi.strip(), 'wb') data, addr = s.recvfrom(1024) try: while(data): f.write(data) s.settimeout(2) data, addr = s.recvfrom(1024) except: print("Baglanti kesildi.") f.close() if(data == b"done"): print("Dosya basariyla aktarildi.") else: if(data == b"FileNotFoundError"): print("Sunucuda bu dosya bulunamadi.") print("Dosya aktariminda sorun olustu.") os.remove(dosya_adi) s.close() sys.exit()
<reponame>tinyos-io/tinyos-3.x-contrib /** * Defining the platform-independently named packet structures to be the * chip-specific MRF24J40 packet structures. * * @author * <NAME> (<EMAIL>) */ #ifndef PLATFORM_MESSAGE_H #define PLATFORM_MESSAGE_H #include "mrf24.h" #include "Serial.h" typedef union message_header { mrf24_header_t mrf24; serial_header_t serial; } message_header_t; typedef union message_footer { mrf24_footer_t mrf24; } message_footer_t; typedef union message_metadata { mrf24_metadata_t mrf24; serial_metadata_t serial; } message_metadata_t; #endif
// Code of JHSH // ronglu.c 熔爐 #include <ansi.h> inherit ITEM; int check_busy(object me); #define OBJ_PATH "/d/mingjiao/obj" void create() { set_name(HIR"熔爐"NOR, ({ "rong lu", "lu" }) ); set_weight(9000); if( clonep() ) set_default_object(__FILE__); else { set("long", "這是座大熔爐,裏面烈火燃燒,是用來打造火槍的。\n"); set("unit", "座"); set("value", 1); set("no_get", 1); } } void init() { add_action("do_fang","fang"); add_action("do_fang","put"); } int do_fang(string arg) { object me, ob, jingtie; string item, target; me = this_player(); ob = this_object(); if( me->is_busy() || query_temp("pending/job_busy", me) ) return notify_fail("你正忙着呢。\n"); if (!arg || sscanf(arg, "%s in %s", item, target) != 2 ) return notify_fail("你要將什麼東西放進哪裏?\n"); if (item != "精鐵" || target != "熔爐") return notify_fail("你要將什麼東西放進哪裏?\n"); if ( !jingtie=present("jing tie",me) ) return notify_fail("你身上並沒有精鐵。\n"); if (query_temp("in_use")) return notify_fail("這個火爐已經有人在用了!\n"); message_vision("$N把一"+query("unit", jingtie)+query("name", jingtie)+"放進熔爐。\n",me); destruct(jingtie); message_vision(HIR"$N放進燃料,拉起風箱,頃刻間就生起一爐熊熊大火!\n"NOR,me); set_temp("in_use",1); set_temp("pending/job_busy", 1, me); set_temp("gun_making", 1, me); remove_call_out("burning"); call_out("burning",10+random(5),me,0); me->start_busy((: check_busy :)); return 1; } void burning(object me, int stage) { string *burning_msg=({ HIC"爐火由紅慢慢變青。\n"NOR, HIW"爐火由青漸漸轉白。\n"NOR, HIW"精鐵"+HIR"已經開始溶化了。\n"NOR, HIW"精鐵"+HIR"已經全部溶化了,可以倒進模子了。\n"NOR, }); message_vision(burning_msg[stage],me); if (stage != 3) { remove_call_out("burning"); call_out("burning",10+random(5),me,++stage); } else { add_action("do_pour","dao"); add_action("do_pour","pour"); delete_temp("pending/job_busy", me); set_temp("pouring", 1, me); } } int do_pour(string arg) { string item, target; int busy_time=0; object me=this_player(); if( me->is_busy() || query_temp("pending/job_busy", me) ) return notify_fail("你正忙着呢。\n"); if (!arg || sscanf(arg, "%s in %s", item, target) != 2 ) return notify_fail("你要將什麼東西倒進哪裏?\n"); if (item != "鐵水" || target != "火槍模子") return notify_fail("你要將什麼東西放進哪裏?\n"); if (!present("huoqiang muzi",environment(this_object())) ) return notify_fail("這裏沒有火槍模子。\n"); if( !query_temp("pouring", me) ) return notify_fail("好像還沒輪到你吧。\n"); if( query("jing", me)<100 || query("qi", me)<100 ) return notify_fail(RED"你已經精疲力竭了!\n"NOR); message_vision("$N用土勺把溶化的鐵水小心翼翼的從爐子裏盛出來,慢慢的倒進火槍模子裏。\n",me); if (random(10) > 3) { message_vision("糟糕!$N一不小心,幾滴鐵水濺到了腳上,痛得$N哇哇大叫!\n",me); me->receive_wound("qi",100); busy_time=3; } addn("jing", -60, me); addn("neili", -80, me); busy_time=busy_time+1; me->start_busy(busy_time); remove_action("do_pour","pour"); remove_action("do_pour","dao"); add_action("add_xiaohuang","add"); return 1; } int add_xiaohuang(string arg) { string item, target; object xiaohuang; object me=this_player(); if( me->is_busy() || query_temp("pending/job_busy", me) ) return notify_fail("你正忙着呢。\n"); if (!arg || sscanf(arg, "%s in %s", item, target) != 2 ) return notify_fail("你要將什麼東西放進哪裏?\n"); if (item != "硝磺" || target != "火槍模子") return notify_fail("你要將什麼東西放進哪裏?\n"); if (!(xiaohuang=present("xiaohuang shi",me)) ) return notify_fail("你身上並沒有硝磺石。\n"); if (!present("huoqiang muzi",environment(this_object())) ) return notify_fail("這裏沒有火槍模子。\n"); if( !query_temp("pouring", me) ) return notify_fail("好像還沒輪到你吧。\n"); if( query("qi", me)<50 || query("jing", me)<50 ) return notify_fail(RED"你已經精疲力竭了!\n"NOR); message_vision("$N往火槍模子裏添了一些硝磺。\n",me); destruct(xiaohuang); addn("jing", -30, me); me->start_busy(1); remove_action("add_xiaohuang","add"); remove_call_out("job_done"); call_out("job_done",5+random(10),me); return 1; } void job_done(object me) { object huoqiang; message_vision("$N揭開模子,看來鐵水已經凝固。$N澆上一盆冷水,"+ "只聽哧哧聲響,一陣刺鼻的濃煙過後,火槍已經制成。\n",me); huoqiang=new(OBJ_PATH"/huoqiang"); huoqiang->move(me); remove_action("add_xiaohuang","add"); delete_temp("in_use"); delete_temp("gun_making", me); me->start_busy(3); } int check_busy(object me) { if( query_temp("pending/job_busy", me) ) return 1; return 0; }
/** * Wrapper to handle the case where the read {@link StateMachineContext} is {@code null}. * * @param <S> * @param <E> */ private static class StateMachinePersistWrapper<S, E> implements StateMachinePersist<S, E, String> { private final StateMachineContext<S, E> EMPTY_CONTEXT = new DefaultStateMachineContext<>(new ArrayList<>(), null, null, null, new DefaultExtendedState(), new HashMap<>(), null); private StateMachinePersist<S, E, String> delegate; public StateMachinePersistWrapper(StateMachinePersist<S, E, String> delegate) { this.delegate = delegate; } @Override public void write(StateMachineContext<S, E> context, String contextObj) throws Exception { delegate.write(context, contextObj); } @Override public StateMachineContext<S, E> read(String contextObj) throws Exception { StateMachineContext<S, E> context = delegate.read(contextObj); if(context == null) { // Workaround for a possible Spring Statemachine bug. // Calling org.springframework.statemachine.persist.DefaultStateMachinePersister.restore with a context == null // resulting in a state machine already in the initial state. If the intial state has an associated action, // it won't be executed. log.debug("No state machine context found, returning empty context: contextObj={}", contextObj); return EMPTY_CONTEXT; } else { return context; } } }
def GetProfileDir(profile_type): if (profile_type in BASE_PROFILE_TYPES or profile_type in PROFILE_CREATORS): return None path = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..', '..', '..', *PROFILE_TYPE_MAPPING[profile_type].split('/'))) assert os.path.exists(path) return path
Intensity noise and relaxation oscillation of a fiber-laser sensor array integrated in a single fiber. We modeled the intensity noise of a distributed-feedback fiber laser (DFB-FL) with external laser injection. The transfer function for injected power perturbation was obtained. Simulation indicates that the laser relaxation oscillation frequency is not affected by external laser injection and is determined by the laser pump power, which provides a promising way to investigate the actual pump power budget over the whole wavelength-division multiplexing (WDM) fiber-laser sensor array integrated in a single fiber. The intensity noise enhancement for each sensing unit thus can be evaluated exactly, and we observe an increase of 9dB in the intensity noise level for two DFB-FLs incorporated in a WDM fiber-laser array.
Wicked Anime’s Must-Watch Fall 2016 Anime Posted by NerdyShow on October 27, 2016 The fall 2016 anime season is full of surprises. At first glance, there doesn’t seem to be many exciting titles. But as you settle in for a show’s season, you’ll find much more than meets the eye. There are always those disappointments (*cough* Occultic;Nine *cough*), but expect more pleasant surprises than negative ones. Join the Wicked Anime crew and Nerdy Show members and affiliates as we highlight the fall 2016 anime YOU should be watching! Jonathan’s Pick: Yuri!!! On ICE Yaoi!!! On ICE, or as it was actually more misleadingly titled, Yuri!!! On ICE, is the next obscure sports anime to come out of Japan. Yuri Katsuki was a rising star for Japan in the Figure Skating Grand Prix, but suffered defeat in the finals. Deflated, he moves back with his family in Kyushu, considering retirement from figure skating. That was until Katsuki’s idol and five-time consecutive world champion, Viktor Nikiforov, suddenly appeared on his doorstep along with his teammate, Yuri Plisetsky, another young rising star getting ready to surpass all of the greatest in the sport. Now the two Yuris and the Russian champion Viktor set out to compete in a Grand Prix like none the world has ever seen! Why You Should Watch Almost from the opening scene, I had realized I was watching a completely different show than I had conceived in my head. Yuri!!! On ICE is a spectacularly animated comedy at a level to be expected from MAPPA, the sister studio to Madhouse. In the recent Japanese trend of making you care about sports you never thought twice about outside of the Olympics (looking at you, Haikyuu); suddenly, figure skating is a fascinating sport. And can we talk about the figure skating scenes in the show? The animators want to make sure you don’t miss a single frame. Every move is taken directly from real-time figure skating, or at least I assume that’s what they did. Every scene appears to triple axels right out of their animations cels. This level of animation is not only present in the skating scenes, but also in the normal slice of life interactions. this gives the show has two modes of animation: high quality figure skating and in-your-face cartoonish super deformation. The show can flip a switch in an instant where two characters will be having a serious conversation and seamlessly transition into a goofy face to make a caricature of the emotion they’re feeling. It’s very unique and strange, but it works. The humorous story of one awkward individual still trying to find his place in the sport is only so well complimented by the extremely diverse cast of characters in his life. Every character is so unique and doesn’t feel like a copy-and-pasted version of some trope character that we’ve seen in anime so many times. It’s an especially amazing feat with the plethora of characters in the show. So many that it’s hard to believe that all of them really are an essential puzzle piece to Yuri Katsuki’s life, but you remember every single one of them. You will also hear the best opening theme of the Fall 2016 season. Seriously, I’m listening to it every time! Now, for all that is holy, where is my freaking hockey anime?! Where to Watch Yuri!!! On ICE can be viewed on Crunchyroll and FUNimation, and has been licensed by FUNimation. Andrew’s Pick: Gi(a)rlish Number Another industry related anime? Why are these popping up every time a new season comes around? Is this some kind of new trend? Well, probably. But, I bet you it’s also because they are so much fun to watch. A while back we were given the detailed and accurate, Shirobako, about the animation industry, then last season we were delighted by the cuteness of New Game! about the video game industry. This season we are now blessed by Gi(a)rlish Number, an anime about “seiyuu” or anime voice actors. We follow a greenhorn, bratty voice actress named Karasuma Chitose who believes herself to be one of the greats after she claims a spot as a main character in a new upcoming series. Throughout her adventure growing in voice acting and her ever-swelling head getting in the way, she meets some new friends, makes some experienced enemies and slowly learns what the industry owes her — nothing. Why You Should Watch Gi(a)rlish Number seems to be the happy medium between it’s two industry-related predecessors. It’s a great mix of cute facial expressions and harsh industry realities making yet another appealing look into Japan’s entertainment industry using cute anime characters. The main character’s goal in the show is quickly established, as she seems to be unhappy with the way the other actors treat one another behind the scenes, but is far more interested in bettering herself. As a clarification, she’s less about bettering herself as a voice actress, but more about bettering herself in the industry as a whole without doing any of the hard work involved. The supporting cast who have to put up with Chitose’s attitude are perfect texture characters to respond in appropriate manners. Each are given their own hiring profile within the show to lay the groundwork for their personality type and explain exactly what part they will play in Chitose’s life on the job. Other characters have “fake” personas towards one another, which are really kind of malicious in a sense. It creates an interesting separation between the kinds of characters the voice actors play on shows, the persona they create for their fans and their true selves within the studio. The show is cute, fun and intriguing to think about, making me wonder if this is the true face of the industry that they work in. Do all seiyuu’s have a bad attitude towards one another and the shows they work on? Do Japanese voice actresses hate the kind of attention they are given? Will the bratty girls ever learn?! I’m certainly interested to find out! Where to Watch Gi(a)rlish Number can be viewed on Crunchyroll or Anime Network and is licensed by Sentai Filmworks. Evan’s Pick: Drifters During the Battle of Sekigahara, Shimazu Toyohisa finds himself critically wounded. While walking away from the fight, he finds himself transported to a massive room filled with infinite doors. After being forced through one of them, Shimazu comes across Oda Nobunaga and Nasu Yoichi, two other famous warriors that perished in battle. Soon, the trio — along with other famous fighters — align with a group known as Drifters, who must face off against another group of warriors called the Ends in order to save the world for the sake of both humanity and the Octobrist Organization. Why You Should Watch Hellsing creator Kouta Hirano is a master of crafting some of the most violent battles and sequences in manga today. With Drifters, the action, gore, and badassery is a level of no-holds-barred chaos that you’d sometimes only see in an OVA. Blood spews, heads are lopped off, bodies are impaled, and the look of glee from both heroes and villains is borderline Satanic. But man, is it gorgeous to watch! Not only do the action sequences reach film-level quality, but the character designs are beautifully detailed. Surprisingly, not only is Drifters hardcore violent, but it’s also funny as hell! Watching as Shimazu argue over Nobunaga’s authenticity is incredibly kooky, leading towards a hilarious realization that some loser family took over the village that he swore to protect two decades ago. Even as they’re told by Octobrist spy Olmuni about their task as Drifters, the trio simply tells her off in a way that’ll have you falling off your seat laughing. Drifters has it all: eye-popping violence, side-splitting hilarity, a great cast of characters, and a cool story from one of the masterminds of action horror. Plus, where else are you gonna see Joan of Arc, Butch Cassidy, and Anastasia Romanova straight-up murder the living bejesus out of an army of thousands in a single fight? If you’re looking for your fill of fist-pumping action that’ll make you shout “F**K YEAH!!!” during nearly every battle, then Drifters will easily savor your tastebuds for quite some time. Where to Watch Drifters can be viewed on Crunchyroll and FUNimation, and has been licensed by FUNimation. Jess’ Pick: Izetta the Last Witch In an alternate reality, Europe is at war. The imperialistic country of Germania has launched a full-scale invasions of neighboring countries. In the year 1940 C.E., the army focuses their attack on the Principality of Elystadt, an alpine nation known for its greenery and peaceful views. However, this country will not be conquered without a fight. A mysterious witch has joined forces with Elystadt’s princess and heir to the throne, laying waste to Germanian forces who’ve no hope of retaliation. Why You Should Watch At first glance, Izetta the Last Witch seems skippable. After all, the promotional poster depicts a girl riding a flying sniper rifle — something that hints more at fan service than a complex, intriguing plot. Though complex plots and layered characters is exactly what you’ll find in Izetta the Last Witch (though you’ll also find tidbits of fan service, but we’ll get to that later). Every episode advances a high-stakes game of political chess, as multiple countries balance a united fight against a common enemy versus a duty to protect their own country above all else. Decisions are not made without sacrifices, and the toll of those sacrifices weigh heavily on our protagonists. The standout star in the show is not our beloved witch, Izetta, as the show’s title might indicate. Instead, it’s Princess Ortfiné “Finé” Fredericka von Eylstadt’s poise and strength of character that will keep you coming for more. As the only heir to Eylstadt’s throne, she is wholly devoted to ensuring the safety and freedom of her citizens. Though she is never ruthless in her approach. It would be easy to rely solely on Izetta’s incredible power, but Finé never pressures her to fight. By ruling with kindness and empathy, Princess Finé gains undying loyalty from her constituency, as well as from her magical childhood friend. Though the war is far from won. Germania now knows of Izetta’s existence and covets her power for their own. Their armies also vastly outnumber those of Eylstadt, and it’s impossible for Izetta to protect every corner of the country. Look forward to some beautifully animated battle sequences and complex character development as the show progresses. Speaking of beautiful animation, this show does impress. Most intriguing is the design of Izetta herself. While all other characters have a more modern animation design, Izetta stands out with expressions and mannerisms from an older generation. You can definitely see some parallels between Sailor Moon, Ranma, and Kiki in her reactions. Could this be a nod to the fact that Izetta may be much older than she appears? Or are the animators just paying homage to beloved characters? Either way, it’s a lot of fun to see our quirky witch stand out in such a fun manner. As for the fan service — Ervira, the court “PR agent” gets a little hands-y when taking measurements. It’s unknown if this will continue through the series, but it’s been small enough thus far to excuse. Where to Watch Izetta the Last Witch can be viewed on Crunchyroll and FUNimation, and has been licensed by FUNimation. Everyone’s Pick: Kiss Him, Not Me! Written by Evan Bourgault Kae Serinuma is one hardcore fujoshi, going so far as to fantasize about her fellow male classmates wrapping each other in their arms. When one of her favorite anime characters bites the dust, Kae goes into a two-week depression, resulting in a major weight loss and some surprisingly cutesy looks. Upon returning to school, friends Yusuke, Nozomu, Hayato, and Asuma become both shocked and smitten by Kae’s transformation. This is a tale of four men wanting to win the heart of a newfound beauty, although that princess would rather see these princes hook up with one another. Why You Should Watch Out of all the anime this year I’ve been looking forward to the most, Kiss Him, Not Me! practically topped my chart. As a reader of Junko’s original manga, I fell in love with its twist on the reverse harem subgenre, its heroine’s fujoshi antics, and how the possible boyfriends-to-be legitimately treat Kae as a person rather than someone who is now hot. How fortunate that Brain’s Base manage to capture that same level of fun, tenderness, and hilarity in its anime adaptation. The thing I was most worried about with its adaptation was how they’d capture Kae in full-on fujoshi mode, but as soon as I saw her over-euphoric face in the opening credits, I knew Brain’s Base did it right. Her appearance whilst fantasizing is somewhat new to anime’s goofy-looks realm, but I love to compare her wavy mouth and popped-out eyes to that of a flustered Charlie Brown or Snoopy. Outside of that, the animation overall is superb, bringing forth the brightest colors that show off the light-hearted humor in a bold and beautiful way. Its script is smart and witty, capturing Junko’s style of humor wonderfully in every scene. Yes, it can be a little irksome to think that Yusuke, Nozomu, Hayato, and Asuma as a bit shallow for asking Kae out after her magical weight loss, but we quickly learn that Kae is no saint to begin with. Hopefully, the anime will progress the same way as the manga, where you’ll see that these guys actually care more about what’s inside Kae rather than what’s outside. (Personally, I thought they did a great job with showcasing this aspect in the first couple episodes of the anime.) In short, Kiss Him, Not Me! has thus far been adapted into a great rom-com anime with a silly twist. If you’re looking for the real winner of the biggest laughs and most heartfelt moments this fall season, then heed forth towards this tale of four men (and one lady, you’ll see…) attempting to win the heart of a lovely gal obsessed with BL. On a side note, whoever was in charge of the sound mixing in Episode Two deserves to be smacked! Where to Watch Kiss Him, Not Me! can be viewed on Crunchyroll and FUNimation, and has been licensed by FUNimation. Are you following Nerdy Show on Twitter, Facebook, Tumblr, & Google +?
There is a first time for everything, including for a famous Canadian singer and musician to perform on the island. And doing that on Sunday at Downtown Live in Nicosia will be Adam Gontier. Gontier is the lead singer, rhythm guitarist and main songwriter for the Canadian-American rock band Saint Asonia. But his former gig as the lead singer and rhythm guitarist of Canadian rock band Three Days Grace – which he left in 2013 – is what most people associate with Gontier. If you want to discover Gontier’s development you could start by listening to some of the four studio albums that Three Days Grace released while Gontier was a member – Three Days Grace (2003), One-X (2006), Life Starts Now (2009) and Transit of Venus (2012). The band got countless nominations and awards as well as a devoted army of fans from all over the world during the time Gontier was with it. Gontier then left and formed Saint Asonia – which is Gontier, Mike Mushok on lead guitar and Sal Giancarelii on drums and percussion – releasing a debut self-titled album Saint Asonia. Such hits as ‘Better Place’ and ‘Let Me live My life’ stormed the biggest charts of North America. The band made their debut live performance at Rock on the Range as the opening act for the main stage. Along with their first single, the band performed other original songs such as ‘Fairy Tale’, ‘Dying Slowly’ and ‘Let Me Live My Life’, but also performed Three Days Grace cover songs including ‘I Hate Everything About You’. Later the same year, 2015, they released their debut album featuring 11 tracks. Saint Asonia released their second single, ‘Blow Me Wide Open’ before booking a short headlining tour in August 2015, followed by an autumn tour. Early the following year the band joined the first part of the 2016 Disturbed tour, as an opening act. Disturbed is an American heavy metal band. Later that year Saint Asonia released a cover of the Phil Collins song, ‘I Don’t Care Anymore’, which was later released on iTunes. In February 2017, Gontier said the band was talking about releasing a second album but we are still waiting. This is really a once in a lifetime chance to witness a musician who will come from a world away to perform songs that he will forever be associated with. These will be songs from Three Days Grace, new Saint Asonia songs and masterful covers.
Absorption of microwave energy by muscle models and by birds of differing mass and geometry. Spheres composed of phantom muscle of radius 1.5, 2, 3, 4, 6 and 8 cm, as well as birds (parakeets, quail, pigeons, chickens, turkeys) were exposed to far-field plane waves at power densities of incident radiation between 182 and 560 mW/cm2 and at frequencies of 775, 915 and 2450 MHz. Specific absorption rate (SAR) patterns were determined by thermographic techniques for both spheres and birds. The measured SAR patterns in spheres were comparable to those from theoretical predictions. The SAR patterns in birds, however, varied markedly from those obtained from spheres of comparable mass. The results indicate that the geometrically complex animal is not represented by simple geometric models for making absorption studies. Thermograms of birds exposed in the flying position indicated that the SAR is high in the wings. The behavioral response of the birds to the exposure was variable. Threshold power densities for biological or behavioral reactions were determined for each bird at all three frequencies. The lowest power density associated with reactivity by the chicken was 5.8 mW/cm2 (corresponding to SARs of 3.1 W/kg in the head and 3.9 W/kg in the neck) at 775 MHz.
package com.agys.catalogs.processInstanceDataController.post; import com.agys.Constants; import com.agys.Endpoints; import com.agys.enums.Environments; import com.agys.jsonBuilder.CatalogDataLoadDataInternal; import com.agys.jsonBuilder.CatalogDataLoadDataProcessInstanceMapping; import com.agys.model.Factory; import com.agys.utils.CredentialsUtils; import com.agys.utils.JsonHelper; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; import com.jayway.restassured.http.ContentType; import com.jayway.restassured.internal.ValidatableResponseImpl; import com.jayway.restassured.response.ValidatableResponse; import lombok.extern.slf4j.Slf4j; import org.testng.annotations.BeforeTest; import org.testng.annotations.Parameters; import org.testng.annotations.Test; import static com.agys.Constants.PRINCIPAL_HEADER_NAME; import static com.jayway.restassured.RestAssured.given; import static org.testng.Assert.assertEquals; @Slf4j public class Catalog_Data_LoadData_ProcessInstance_By_ProcessInstanceId_Gui_By_GuiIdTest { private ObjectMapper mapper = new ObjectMapper(); private String correctTypes = "true"; private String mapping="465465"; private String processInstanceId ="4525f6a0-f5a3-4120-9c20-933260bf37a1"; private String guiId ="4525f6a0-f5a3-4120-9c20-933260bf37a1"; CatalogDataLoadDataProcessInstanceMapping catalogloadDataProcessInstanceMapping = CatalogDataLoadDataProcessInstanceMapping.builder().correctTypes(correctTypes) .mapping(mapping).build(); @Test public void postCatalogDataLoadDataProcessInstanceByProcessInstanceIdGuiByGuiId() throws JsonProcessingException { ValidatableResponse vr = given().header(PRINCIPAL_HEADER_NAME, Constants.PRINCIPAL_HEADER_VALUE) .contentType(ContentType.JSON).body(mapper.writeValueAsString(catalogloadDataProcessInstanceMapping) + processInstanceId).when() .post(CredentialsUtils.CATALOGS + Endpoints.middleURLDataLoadDataProcessInstanceGUI + processInstanceId + Endpoints.middleURLDataLoadDataProcessInstanceGUI1 + guiId) .then() .statusCode(201); String location = ((ValidatableResponseImpl) vr).originalResponse().header("Location"); String response = given().header(PRINCIPAL_HEADER_NAME, Constants.PRINCIPAL_HEADER_VALUE) .contentType(ContentType.JSON).body(mapper.writeValueAsString(Factory.dataModelDefVersion)).when() .get(location) .then() .contentType(ContentType.JSON).extract().response().asString(); CatalogDataLoadDataProcessInstanceMapping catalogDataLoadDataProcessInstanceMapping= JsonHelper.readValue(response, CatalogDataLoadDataProcessInstanceMapping.class); assertEquals(Factory.catalogDataLoadDataProcessInstanceMapp.getMapping(), catalogDataLoadDataProcessInstanceMapping.getMapping(), "Mappings are equals"); } @Test public void postCatalogDataLoadDataProcessInstanceByProcessInstanceIdGuiByGuiIdNoAuthentication() throws JsonProcessingException { given() .contentType(ContentType.JSON).body(mapper.writeValueAsString(catalogloadDataProcessInstanceMapping)+ processInstanceId).when() .post(CredentialsUtils.CATALOGS + Endpoints.middleURLDataLoadDataProcessInstanceGUI + processInstanceId + Endpoints.middleURLDataLoadDataProcessInstanceGUI1 + guiId) .then() .statusCode(401); } }
import { render, screen } from "@testing-library/react"; import React from "react"; import { Resizer, ResizerControlType } from "../../"; describe("Resizer", () => { test("component render test", () => { const text = "TEST"; render(<Resizer>{text}</Resizer>); const isContainerExist = !!screen.getByRole("container"); const isChildrenRendered = !!screen.getByText(text); const countOfControls = (screen.getAllByRole("control") ?? []).length; const correctCountOfControls = 3; expect(isContainerExist).toEqual(true); expect(isChildrenRendered).toEqual(true); expect(countOfControls).toEqual(correctCountOfControls); }); test("component controls management test", () => { const controls = [ResizerControlType.BOTTOM, ResizerControlType.BOTTOM]; render(<Resizer controls={controls}>TEST</Resizer>); const countOfHiddenControls = ( document.getElementsByClassName("rszr__ctrl rszr__is-hidden") ?? [] ).length; const correctCountOfHiddenControls = 2; expect(countOfHiddenControls).toEqual(correctCountOfHiddenControls); }); });
/* A Bison parser, made by GNU Bison 2.3. */ /* Skeleton implementation for Bison's Yacc-like parsers in C Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. This program 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 2, 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, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* As a special exception, you may create a larger work that contains part or all of the Bison parser skeleton and distribute that work under terms of your choice, so long as that work isn't itself a parser generator using the skeleton or a modified version thereof as a parser skeleton. Alternatively, if you modify or redistribute the parser skeleton itself, you may (at your option) remove this special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ /* C LALR(1) parser skeleton written by <NAME>, by simplifying the original so-called "semantic" parser. */ /* All symbols defined below should begin with yy or YY, to avoid infringing on user name space. This should be done even for local variables, as they might otherwise be expanded by user macros. There are some unavoidable exceptions within include files to define necessary library symbols; they are noted "INFRINGES ON USER NAME SPACE" below. */ /* Identify Bison output. */ #define YYBISON 1 /* Bison version. */ #define YYBISON_VERSION "2.3" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" /* Pure parsers. */ #define YYPURE 1 /* Using locations. */ #define YYLSP_NEEDED 0 /* Tokens. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE /* Put the tokens into the symbol table, so that GDB and other debuggers know about them. */ enum yytokentype { tAGO = 258, tDST = 259, tDAY = 260, tDAY_UNIT = 261, tDAYZONE = 262, tHOUR_UNIT = 263, tLOCAL_ZONE = 264, tMERIDIAN = 265, tMINUTE_UNIT = 266, tMONTH = 267, tMONTH_UNIT = 268, tSEC_UNIT = 269, tYEAR_UNIT = 270, tZONE = 271, tSNUMBER = 272, tUNUMBER = 273 }; #endif /* Tokens. */ #define tAGO 258 #define tDST 259 #define tDAY 260 #define tDAY_UNIT 261 #define tDAYZONE 262 #define tHOUR_UNIT 263 #define tLOCAL_ZONE 264 #define tMERIDIAN 265 #define tMINUTE_UNIT 266 #define tMONTH 267 #define tMONTH_UNIT 268 #define tSEC_UNIT 269 #define tYEAR_UNIT 270 #define tZONE 271 #define tSNUMBER 272 #define tUNUMBER 273 /* Copy the first part of user declarations. */ #line 1 "getdate.y" /* Parse a string into an internal time stamp. Copyright (C) 1999, 2000, 2002 Free Software Foundation, Inc. This program 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 2, 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/>. */ /* Originally written by <NAME> <<EMAIL>> while at the University of North Carolina at Chapel Hill. Later tweaked by a couple of people on Usenet. Completely overhauled by <NAME> <<EMAIL>> and <NAME> <<EMAIL>> in August, 1990. Modified by <NAME> <<EMAIL>> in August 1999 to do the right thing about local DST. Unlike previous versions, this version is reentrant. */ #ifdef HAVE_CONFIG_H # include <config.h> # ifdef HAVE_ALLOCA_H # include <alloca.h> # endif #endif /* Since the code of getdate.y is not included in the Emacs executable itself, there is no need to #define static in this file. Even if the code were included in the Emacs executable, it probably wouldn't do any harm to #undef it here; this will only cause problems if we try to write to a static variable, which I don't think this code needs to do. */ #ifdef emacs # undef static #endif #include <ctype.h> #include <string.h> #if HAVE_STDLIB_H # include <stdlib.h> /* for `free'; used by Bison 1.27 */ #endif #if STDC_HEADERS || (! defined isascii && ! HAVE_ISASCII) # define IN_CTYPE_DOMAIN(c) 1 #else # define IN_CTYPE_DOMAIN(c) isascii (c) #endif #define ISSPACE(c) (IN_CTYPE_DOMAIN (c) && isspace (c)) #define ISALPHA(c) (IN_CTYPE_DOMAIN (c) && isalpha (c)) #define ISLOWER(c) (IN_CTYPE_DOMAIN (c) && islower (c)) #define ISDIGIT_LOCALE(c) (IN_CTYPE_DOMAIN (c) && isdigit (c)) /* ISDIGIT differs from ISDIGIT_LOCALE, as follows: - Its arg may be any int or unsigned int; it need not be an unsigned char. - It's guaranteed to evaluate its argument exactly once. - It's typically faster. POSIX says that only '0' through '9' are digits. Prefer ISDIGIT to ISDIGIT_LOCALE unless it's important to use the locale's definition of `digit' even when the host does not conform to POSIX. */ #define ISDIGIT(c) ((unsigned) (c) - '0' <= 9) #if STDC_HEADERS || HAVE_STRING_H # include <string.h> #endif #if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 8) || __STRICT_ANSI__ # define __attribute__(x) #endif #ifndef ATTRIBUTE_UNUSED # define ATTRIBUTE_UNUSED __attribute__ ((__unused__)) #endif #define EPOCH_YEAR 1970 #define TM_YEAR_BASE 1900 #define HOUR(x) ((x) * 60) /* An integer value, and the number of digits in its textual representation. */ typedef struct { int value; int digits; } textint; /* An entry in the lexical lookup table. */ typedef struct { char const *name; int type; int value; } table; /* Meridian: am, pm, or 24-hour style. */ enum { MERam, MERpm, MER24 }; /* Information passed to and from the parser. */ typedef struct { /* The input string remaining to be parsed. */ const char *input; /* N, if this is the Nth Tuesday. */ int day_ordinal; /* Day of week; Sunday is 0. */ int day_number; /* tm_isdst flag for the local zone. */ int local_isdst; /* Time zone, in minutes east of UTC. */ int time_zone; /* Style used for time. */ int meridian; /* Gregorian year, month, day, hour, minutes, and seconds. */ textint year; int month; int day; int hour; int minutes; int seconds; /* Relative year, month, day, hour, minutes, and seconds. */ int rel_year; int rel_month; int rel_day; int rel_hour; int rel_minutes; int rel_seconds; /* Counts of nonterminals of various flavors parsed so far. */ int dates_seen; int days_seen; int local_zones_seen; int rels_seen; int times_seen; int zones_seen; /* Table of local time zone abbrevations, terminated by a null entry. */ table local_time_zone_table[3]; } parser_control; #define PC (* (parser_control *) parm) #define YYLEX_PARAM parm #define YYPARSE_PARAM parm /* Enabling traces. */ #ifndef YYDEBUG # define YYDEBUG 0 #endif /* Enabling verbose error messages. */ #ifdef YYERROR_VERBOSE # undef YYERROR_VERBOSE # define YYERROR_VERBOSE 1 #else # define YYERROR_VERBOSE 0 #endif /* Enabling the token table. */ #ifndef YYTOKEN_TABLE # define YYTOKEN_TABLE 0 #endif #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef union YYSTYPE #line 169 "getdate.y" { int intval; textint textintval; } /* Line 187 of yacc.c. */ #line 298 "getdate.c" YYSTYPE; # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 # define YYSTYPE_IS_TRIVIAL 1 #endif /* Copy the second part of user declarations. */ #line 174 "getdate.y" static int yyerror(const char *); static int yylex(YYSTYPE *, parser_control *); /* Line 216 of yacc.c. */ #line 317 "getdate.c" #ifdef short # undef short #endif #ifdef YYTYPE_UINT8 typedef YYTYPE_UINT8 yytype_uint8; #else typedef unsigned char yytype_uint8; #endif #ifdef YYTYPE_INT8 typedef YYTYPE_INT8 yytype_int8; #elif (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) typedef signed char yytype_int8; #else typedef short int yytype_int8; #endif #ifdef YYTYPE_UINT16 typedef YYTYPE_UINT16 yytype_uint16; #else typedef unsigned short int yytype_uint16; #endif #ifdef YYTYPE_INT16 typedef YYTYPE_INT16 yytype_int16; #else typedef short int yytype_int16; #endif #ifndef YYSIZE_T # ifdef __SIZE_TYPE__ # define YYSIZE_T __SIZE_TYPE__ # elif defined size_t # define YYSIZE_T size_t # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) # include <stddef.h> /* INFRINGES ON USER NAME SPACE */ # define YYSIZE_T size_t # else # define YYSIZE_T unsigned int # endif #endif #define YYSIZE_MAXIMUM ((YYSIZE_T) -1) #ifndef YY_ # if YYENABLE_NLS # if ENABLE_NLS # include <libintl.h> /* INFRINGES ON USER NAME SPACE */ # define YY_(msgid) dgettext ("bison-runtime", msgid) # endif # endif # ifndef YY_ # define YY_(msgid) msgid # endif #endif /* Suppress unused-variable warnings by "using" E. */ #if ! defined lint || defined __GNUC__ # define YYUSE(e) ((void) (e)) #else # define YYUSE(e) /* empty */ #endif /* Identity function, used to suppress warnings about constant conditions. */ #ifndef lint # define YYID(n) (n) #else #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static int YYID (int i) #else static int YYID (i) int i; #endif { return i; } #endif #if ! defined yyoverflow || YYERROR_VERBOSE /* The parser invokes alloca or malloc; define the necessary symbols. */ # ifdef YYSTACK_USE_ALLOCA # if YYSTACK_USE_ALLOCA # ifdef __GNUC__ # define YYSTACK_ALLOC __builtin_alloca # elif defined __BUILTIN_VA_ARG_INCR # include <alloca.h> /* INFRINGES ON USER NAME SPACE */ # elif defined _AIX # define YYSTACK_ALLOC __alloca # elif defined _MSC_VER # include <malloc.h> /* INFRINGES ON USER NAME SPACE */ # define alloca _alloca # else # define YYSTACK_ALLOC alloca # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ # ifndef _STDLIB_H # define _STDLIB_H 1 # endif # endif # endif # endif # endif # ifdef YYSTACK_ALLOC /* Pacify GCC's `empty if-body' warning. */ # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0)) # ifndef YYSTACK_ALLOC_MAXIMUM /* The OS might guarantee only one guard page at the bottom of the stack, and a page size can be as small as 4096 bytes. So we cannot safely invoke alloca (N) if N exceeds 4096. Use a slightly smaller number to allow for a few compiler-allocated temporary stack slots. */ # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ # endif # else # define YYSTACK_ALLOC YYMALLOC # define YYSTACK_FREE YYFREE # ifndef YYSTACK_ALLOC_MAXIMUM # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM # endif # if (defined __cplusplus && ! defined _STDLIB_H \ && ! ((defined YYMALLOC || defined malloc) \ && (defined YYFREE || defined free))) # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ # ifndef _STDLIB_H # define _STDLIB_H 1 # endif # endif # ifndef YYMALLOC # define YYMALLOC malloc # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ # endif # endif # ifndef YYFREE # define YYFREE free # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) void free (void *); /* INFRINGES ON USER NAME SPACE */ # endif # endif # endif #endif /* ! defined yyoverflow || YYERROR_VERBOSE */ #if (! defined yyoverflow \ && (! defined __cplusplus \ || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) /* A type that is properly aligned for any stack member. */ union yyalloc { yytype_int16 yyss; YYSTYPE yyvs; }; /* The size of the maximum gap between one aligned stack and the next. */ # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) /* The size of an array large to enough to hold all stacks, each with N elements. */ # define YYSTACK_BYTES(N) \ ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ + YYSTACK_GAP_MAXIMUM) /* Copy COUNT objects from FROM to TO. The source and destination do not overlap. */ # ifndef YYCOPY # if defined __GNUC__ && 1 < __GNUC__ # define YYCOPY(To, From, Count) \ __builtin_memcpy (To, From, (Count) * sizeof (*(From))) # else # define YYCOPY(To, From, Count) \ do \ { \ YYSIZE_T yyi; \ for (yyi = 0; yyi < (Count); yyi++) \ (To)[yyi] = (From)[yyi]; \ } \ while (YYID (0)) # endif # endif /* Relocate STACK from its old location to the new one. The local variables YYSIZE and YYSTACKSIZE give the old and new number of elements in the stack, and YYPTR gives the new location of the stack. Advance YYPTR to a properly aligned location for the next stack. */ # define YYSTACK_RELOCATE(Stack) \ do \ { \ YYSIZE_T yynewbytes; \ YYCOPY (&yyptr->Stack, Stack, yysize); \ Stack = &yyptr->Stack; \ yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ yyptr += yynewbytes / sizeof (*yyptr); \ } \ while (YYID (0)) #endif /* YYFINAL -- State number of the termination state. */ #define YYFINAL 2 /* YYLAST -- Last index in YYTABLE. */ #define YYLAST 52 /* YYNTOKENS -- Number of terminals. */ #define YYNTOKENS 22 /* YYNNTS -- Number of nonterminals. */ #define YYNNTS 12 /* YYNRULES -- Number of rules. */ #define YYNRULES 54 /* YYNRULES -- Number of states. */ #define YYNSTATES 64 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ #define YYUNDEFTOK 2 #define YYMAXUTOK 273 #define YYTRANSLATE(YYX) \ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ static const yytype_uint8 yytranslate[] = { 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 20, 2, 2, 21, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 19, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18 }; #if YYDEBUG /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in YYRHS. */ static const yytype_uint8 yyprhs[] = { 0, 0, 3, 4, 7, 9, 11, 13, 15, 17, 19, 21, 24, 29, 34, 41, 48, 50, 53, 55, 57, 60, 62, 65, 68, 72, 78, 82, 86, 89, 94, 97, 101, 104, 106, 109, 112, 114, 117, 120, 122, 125, 128, 130, 133, 136, 138, 141, 144, 146, 149, 152, 154, 156, 157 }; /* YYRHS -- A `-1'-separated list of the rules' RHS. */ static const yytype_int8 yyrhs[] = { 23, 0, -1, -1, 23, 24, -1, 25, -1, 26, -1, 27, -1, 29, -1, 28, -1, 30, -1, 32, -1, 18, 10, -1, 18, 19, 18, 33, -1, 18, 19, 18, 17, -1, 18, 19, 18, 19, 18, 33, -1, 18, 19, 18, 19, 18, 17, -1, 9, -1, 9, 4, -1, 16, -1, 7, -1, 16, 4, -1, 5, -1, 5, 20, -1, 18, 5, -1, 18, 21, 18, -1, 18, 21, 18, 21, 18, -1, 18, 17, 17, -1, 18, 12, 17, -1, 12, 18, -1, 12, 18, 20, 18, -1, 18, 12, -1, 18, 12, 18, -1, 31, 3, -1, 31, -1, 18, 15, -1, 17, 15, -1, 15, -1, 18, 13, -1, 17, 13, -1, 13, -1, 18, 6, -1, 17, 6, -1, 6, -1, 18, 8, -1, 17, 8, -1, 8, -1, 18, 11, -1, 17, 11, -1, 11, -1, 18, 14, -1, 17, 14, -1, 14, -1, 18, -1, -1, 10, -1 }; /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { 0, 192, 192, 194, 198, 200, 202, 204, 206, 208, 210, 214, 221, 228, 236, 243, 255, 257, 262, 264, 266, 271, 276, 281, 289, 294, 314, 321, 329, 334, 340, 345, 354, 363, 367, 369, 371, 373, 375, 377, 379, 381, 383, 385, 387, 389, 391, 393, 395, 397, 399, 401, 406, 443, 444 }; #endif #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. First, the terminals, then, starting at YYNTOKENS, nonterminals. */ static const char *const yytname[] = { "$end", "error", "$undefined", "tAGO", "tDST", "tDAY", "tDAY_UNIT", "tDAYZONE", "tHOUR_UNIT", "tLOCAL_ZONE", "tMERIDIAN", "tMINUTE_UNIT", "tMONTH", "tMONTH_UNIT", "tSEC_UNIT", "tYEAR_UNIT", "tZONE", "tSNUMBER", "tUNUMBER", "':'", "','", "'/'", "$accept", "spec", "item", "time", "local_zone", "zone", "day", "date", "rel", "relunit", "number", "o_merid", 0 }; #endif # ifdef YYPRINT /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to token YYLEX-NUM. */ static const yytype_uint16 yytoknum[] = { 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 58, 44, 47 }; # endif /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ static const yytype_uint8 yyr1[] = { 0, 22, 23, 23, 24, 24, 24, 24, 24, 24, 24, 25, 25, 25, 25, 25, 26, 26, 27, 27, 27, 28, 28, 28, 29, 29, 29, 29, 29, 29, 29, 29, 30, 30, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 32, 33, 33 }; /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ static const yytype_uint8 yyr2[] = { 0, 2, 0, 2, 1, 1, 1, 1, 1, 1, 1, 2, 4, 4, 6, 6, 1, 2, 1, 1, 2, 1, 2, 2, 3, 5, 3, 3, 2, 4, 2, 3, 2, 1, 2, 2, 1, 2, 2, 1, 2, 2, 1, 2, 2, 1, 2, 2, 1, 2, 2, 1, 1, 0, 1 }; /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state STATE-NUM when YYTABLE doesn't specify something else to do. Zero means the default is an error. */ static const yytype_uint8 yydefact[] = { 2, 0, 1, 21, 42, 19, 45, 16, 48, 0, 39, 51, 36, 18, 0, 52, 3, 4, 5, 6, 8, 7, 9, 33, 10, 22, 17, 28, 20, 41, 44, 47, 38, 50, 35, 23, 40, 43, 11, 46, 30, 37, 49, 34, 0, 0, 0, 32, 0, 27, 31, 26, 53, 24, 29, 54, 13, 0, 12, 0, 53, 25, 15, 14 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int8 yydefgoto[] = { -1, 1, 16, 17, 18, 19, 20, 21, 22, 23, 24, 58 }; /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ #define YYPACT_NINF -17 static const yytype_int8 yypact[] = { -17, 0, -17, 1, -17, -17, -17, 19, -17, -14, -17, -17, -17, 32, 26, 14, -17, -17, -17, -17, -17, -17, -17, 27, -17, -17, -17, 22, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -16, -17, -17, -17, 29, 25, 30, -17, 31, -17, -17, -17, 28, 23, -17, -17, -17, 33, -17, 34, -7, -17, -17, -17 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int8 yypgoto[] = { -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -10 }; /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If positive, shift that token. If negative, reduce the rule which number is the opposite. If zero, do what YYDEFACT says. If YYTABLE_NINF, syntax error. */ #define YYTABLE_NINF -1 static const yytype_uint8 yytable[] = { 2, 49, 50, 55, 27, 3, 4, 5, 6, 7, 62, 8, 9, 10, 11, 12, 13, 14, 15, 35, 36, 25, 37, 26, 38, 39, 40, 41, 42, 43, 47, 44, 29, 45, 30, 46, 28, 31, 55, 32, 33, 34, 48, 52, 59, 56, 51, 57, 53, 54, 63, 60, 61 }; static const yytype_uint8 yycheck[] = { 0, 17, 18, 10, 18, 5, 6, 7, 8, 9, 17, 11, 12, 13, 14, 15, 16, 17, 18, 5, 6, 20, 8, 4, 10, 11, 12, 13, 14, 15, 3, 17, 6, 19, 8, 21, 4, 11, 10, 13, 14, 15, 20, 18, 21, 17, 17, 19, 18, 18, 60, 18, 18 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing symbol of state STATE-NUM. */ static const yytype_uint8 yystos[] = { 0, 23, 0, 5, 6, 7, 8, 9, 11, 12, 13, 14, 15, 16, 17, 18, 24, 25, 26, 27, 28, 29, 30, 31, 32, 20, 4, 18, 4, 6, 8, 11, 13, 14, 15, 5, 6, 8, 10, 11, 12, 13, 14, 15, 17, 19, 21, 3, 20, 17, 18, 17, 18, 18, 18, 10, 17, 19, 33, 21, 18, 18, 17, 33 }; #define yyerrok (yyerrstatus = 0) #define yyclearin (yychar = YYEMPTY) #define YYEMPTY (-2) #define YYEOF 0 #define YYACCEPT goto yyacceptlab #define YYABORT goto yyabortlab #define YYERROR goto yyerrorlab /* Like YYERROR except do call yyerror. This remains here temporarily to ease the transition to the new meaning of YYERROR, for GCC. Once GCC version 2 has supplanted version 1, this can go. */ #define YYFAIL goto yyerrlab #define YYRECOVERING() (!!yyerrstatus) #define YYBACKUP(Token, Value) \ do \ if (yychar == YYEMPTY && yylen == 1) \ { \ yychar = (Token); \ yylval = (Value); \ yytoken = YYTRANSLATE (yychar); \ YYPOPSTACK (1); \ goto yybackup; \ } \ else \ { \ yyerror (YY_("syntax error: cannot back up")); \ YYERROR; \ } \ while (YYID (0)) #define YYTERROR 1 #define YYERRCODE 256 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. If N is 0, then set CURRENT to the empty location which ends the previous symbol: RHS[0] (always defined). */ #define YYRHSLOC(Rhs, K) ((Rhs)[K]) #ifndef YYLLOC_DEFAULT # define YYLLOC_DEFAULT(Current, Rhs, N) \ do \ if (YYID (N)) \ { \ (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ } \ else \ { \ (Current).first_line = (Current).last_line = \ YYRHSLOC (Rhs, 0).last_line; \ (Current).first_column = (Current).last_column = \ YYRHSLOC (Rhs, 0).last_column; \ } \ while (YYID (0)) #endif /* YY_LOCATION_PRINT -- Print the location on the stream. This macro was not mandated originally: define only if we know we won't break user code: when these are the locations we know. */ #ifndef YY_LOCATION_PRINT # if YYLTYPE_IS_TRIVIAL # define YY_LOCATION_PRINT(File, Loc) \ fprintf (File, "%d.%d-%d.%d", \ (Loc).first_line, (Loc).first_column, \ (Loc).last_line, (Loc).last_column) # else # define YY_LOCATION_PRINT(File, Loc) ((void) 0) # endif #endif /* YYLEX -- calling `yylex' with the right arguments. */ #ifdef YYLEX_PARAM # define YYLEX yylex (&yylval, YYLEX_PARAM) #else # define YYLEX yylex (&yylval) #endif /* Enable debugging if requested. */ #if YYDEBUG # ifndef YYFPRINTF # include <stdio.h> /* INFRINGES ON USER NAME SPACE */ # define YYFPRINTF fprintf # endif # define YYDPRINTF(Args) \ do { \ if (yydebug) \ YYFPRINTF Args; \ } while (YYID (0)) # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ do { \ if (yydebug) \ { \ YYFPRINTF (stderr, "%s ", Title); \ yy_symbol_print (stderr, \ Type, Value); \ YYFPRINTF (stderr, "\n"); \ } \ } while (YYID (0)) /*--------------------------------. | Print this symbol on YYOUTPUT. | `--------------------------------*/ /*ARGSUSED*/ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static void yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) #else static void yy_symbol_value_print (yyoutput, yytype, yyvaluep) FILE *yyoutput; int yytype; YYSTYPE const * const yyvaluep; #endif { if (!yyvaluep) return; # ifdef YYPRINT if (yytype < YYNTOKENS) YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); # else YYUSE (yyoutput); # endif switch (yytype) { default: break; } } /*--------------------------------. | Print this symbol on YYOUTPUT. | `--------------------------------*/ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static void yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) #else static void yy_symbol_print (yyoutput, yytype, yyvaluep) FILE *yyoutput; int yytype; YYSTYPE const * const yyvaluep; #endif { if (yytype < YYNTOKENS) YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); else YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); yy_symbol_value_print (yyoutput, yytype, yyvaluep); YYFPRINTF (yyoutput, ")"); } /*------------------------------------------------------------------. | yy_stack_print -- Print the state stack from its BOTTOM up to its | | TOP (included). | `------------------------------------------------------------------*/ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static void yy_stack_print (yytype_int16 *bottom, yytype_int16 *top) #else static void yy_stack_print (bottom, top) yytype_int16 *bottom; yytype_int16 *top; #endif { YYFPRINTF (stderr, "Stack now"); for (; bottom <= top; ++bottom) YYFPRINTF (stderr, " %d", *bottom); YYFPRINTF (stderr, "\n"); } # define YY_STACK_PRINT(Bottom, Top) \ do { \ if (yydebug) \ yy_stack_print ((Bottom), (Top)); \ } while (YYID (0)) /*------------------------------------------------. | Report that the YYRULE is going to be reduced. | `------------------------------------------------*/ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static void yy_reduce_print (YYSTYPE *yyvsp, int yyrule) #else static void yy_reduce_print (yyvsp, yyrule) YYSTYPE *yyvsp; int yyrule; #endif { int yynrhs = yyr2[yyrule]; int yyi; unsigned long int yylno = yyrline[yyrule]; YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", yyrule - 1, yylno); /* The symbols being reduced. */ for (yyi = 0; yyi < yynrhs; yyi++) { fprintf (stderr, " $%d = ", yyi + 1); yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], &(yyvsp[(yyi + 1) - (yynrhs)]) ); fprintf (stderr, "\n"); } } # define YY_REDUCE_PRINT(Rule) \ do { \ if (yydebug) \ yy_reduce_print (yyvsp, Rule); \ } while (YYID (0)) /* Nonzero means print parse trace. It is left uninitialized so that multiple parsers can coexist. */ int yydebug; #else /* !YYDEBUG */ # define YYDPRINTF(Args) # define YY_SYMBOL_PRINT(Title, Type, Value, Location) # define YY_STACK_PRINT(Bottom, Top) # define YY_REDUCE_PRINT(Rule) #endif /* !YYDEBUG */ /* YYINITDEPTH -- initial size of the parser's stacks. */ #ifndef YYINITDEPTH # define YYINITDEPTH 200 #endif /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only if the built-in stack extension method is used). Do not make this value too large; the results are undefined if YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) evaluated with infinite-precision integer arithmetic. */ #ifndef YYMAXDEPTH # define YYMAXDEPTH 10000 #endif #if YYERROR_VERBOSE # ifndef yystrlen # if defined __GLIBC__ && defined _STRING_H # define yystrlen strlen # else /* Return the length of YYSTR. */ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static YYSIZE_T yystrlen (const char *yystr) #else static YYSIZE_T yystrlen (yystr) const char *yystr; #endif { YYSIZE_T yylen; for (yylen = 0; yystr[yylen]; yylen++) continue; return yylen; } # endif # endif # ifndef yystpcpy # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE # define yystpcpy stpcpy # else /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in YYDEST. */ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static char * yystpcpy (char *yydest, const char *yysrc) #else static char * yystpcpy (yydest, yysrc) char *yydest; const char *yysrc; #endif { char *yyd = yydest; const char *yys = yysrc; while ((*yyd++ = *yys++) != '\0') continue; return yyd - 1; } # endif # endif # ifndef yytnamerr /* Copy to YYRES the contents of YYSTR after stripping away unnecessary quotes and backslashes, so that it's suitable for yyerror. The heuristic is that double-quoting is unnecessary unless the string contains an apostrophe, a comma, or backslash (other than backslash-backslash). YYSTR is taken from yytname. If YYRES is null, do not copy; instead, return the length of what the result would have been. */ static YYSIZE_T yytnamerr (char *yyres, const char *yystr) { if (*yystr == '"') { YYSIZE_T yyn = 0; char const *yyp = yystr; for (;;) switch (*++yyp) { case '\'': case ',': goto do_not_strip_quotes; case '\\': if (*++yyp != '\\') goto do_not_strip_quotes; /* Fall through. */ default: if (yyres) yyres[yyn] = *yyp; yyn++; break; case '"': if (yyres) yyres[yyn] = '\0'; return yyn; } do_not_strip_quotes: ; } if (! yyres) return yystrlen (yystr); return yystpcpy (yyres, yystr) - yyres; } # endif /* Copy into YYRESULT an error message about the unexpected token YYCHAR while in state YYSTATE. Return the number of bytes copied, including the terminating null byte. If YYRESULT is null, do not copy anything; just return the number of bytes that would be copied. As a special case, return 0 if an ordinary "syntax error" message will do. Return YYSIZE_MAXIMUM if overflow occurs during size calculation. */ static YYSIZE_T yysyntax_error (char *yyresult, int yystate, int yychar) { int yyn = yypact[yystate]; if (! (YYPACT_NINF < yyn && yyn <= YYLAST)) return 0; else { int yytype = YYTRANSLATE (yychar); YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]); YYSIZE_T yysize = yysize0; YYSIZE_T yysize1; int yysize_overflow = 0; enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; int yyx; # if 0 /* This is so xgettext sees the translatable formats that are constructed on the fly. */ YY_("syntax error, unexpected %s"); YY_("syntax error, unexpected %s, expecting %s"); YY_("syntax error, unexpected %s, expecting %s or %s"); YY_("syntax error, unexpected %s, expecting %s or %s or %s"); YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"); # endif char *yyfmt; char const *yyf; static char const yyunexpected[] = "syntax error, unexpected %s"; static char const yyexpecting[] = ", expecting %s"; static char const yyor[] = " or %s"; char yyformat[sizeof yyunexpected + sizeof yyexpecting - 1 + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2) * (sizeof yyor - 1))]; char const *yyprefix = yyexpecting; /* Start YYX at -YYN if negative to avoid negative indexes in YYCHECK. */ int yyxbegin = yyn < 0 ? -yyn : 0; /* Stay within bounds of both yycheck and yytname. */ int yychecklim = YYLAST - yyn + 1; int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; int yycount = 1; yyarg[0] = yytname[yytype]; yyfmt = yystpcpy (yyformat, yyunexpected); for (yyx = yyxbegin; yyx < yyxend; ++yyx) if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) { if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) { yycount = 1; yysize = yysize0; yyformat[sizeof yyunexpected - 1] = '\0'; break; } yyarg[yycount++] = yytname[yyx]; yysize1 = yysize + yytnamerr (0, yytname[yyx]); yysize_overflow |= (yysize1 < yysize); yysize = yysize1; yyfmt = yystpcpy (yyfmt, yyprefix); yyprefix = yyor; } yyf = YY_(yyformat); yysize1 = yysize + yystrlen (yyf); yysize_overflow |= (yysize1 < yysize); yysize = yysize1; if (yysize_overflow) return YYSIZE_MAXIMUM; if (yyresult) { /* Avoid sprintf, as that infringes on the user's name space. Don't have undefined behavior even if the translation produced a string with the wrong number of "%s"s. */ char *yyp = yyresult; int yyi = 0; while ((*yyp = *yyf) != '\0') { if (*yyp == '%' && yyf[1] == 's' && yyi < yycount) { yyp += yytnamerr (yyp, yyarg[yyi++]); yyf += 2; } else { yyp++; yyf++; } } } return yysize; } } #endif /* YYERROR_VERBOSE */ /*-----------------------------------------------. | Release the memory associated to this symbol. | `-----------------------------------------------*/ /*ARGSUSED*/ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static void yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) #else static void yydestruct (yymsg, yytype, yyvaluep) const char *yymsg; int yytype; YYSTYPE *yyvaluep; #endif { YYUSE (yyvaluep); if (!yymsg) yymsg = "Deleting"; YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); switch (yytype) { default: break; } } /* Prevent warnings from -Wmissing-prototypes. */ #ifdef YYPARSE_PARAM #if defined __STDC__ || defined __cplusplus int yyparse (void *YYPARSE_PARAM); #else int yyparse (); #endif #else /* ! YYPARSE_PARAM */ #if defined __STDC__ || defined __cplusplus int yyparse (void); #else int yyparse (); #endif #endif /* ! YYPARSE_PARAM */ /*----------. | yyparse. | `----------*/ #ifdef YYPARSE_PARAM #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) int yyparse (void *YYPARSE_PARAM) #else int yyparse (YYPARSE_PARAM) void *YYPARSE_PARAM; #endif #else /* ! YYPARSE_PARAM */ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) int yyparse (void) #else int yyparse () #endif #endif { /* The look-ahead symbol. */ int yychar; /* The semantic value of the look-ahead symbol. */ YYSTYPE yylval; /* Number of syntax errors so far. */ int yynerrs; int yystate; int yyn; int yyresult; /* Number of tokens to shift before error messages enabled. */ int yyerrstatus; /* Look-ahead token as an internal (translated) token number. */ int yytoken = 0; #if YYERROR_VERBOSE /* Buffer for error messages, and its allocated size. */ char yymsgbuf[128]; char *yymsg = yymsgbuf; YYSIZE_T yymsg_alloc = sizeof yymsgbuf; #endif /* Three stacks and their tools: `yyss': related to states, `yyvs': related to semantic values, `yyls': related to locations. Refer to the stacks thru separate pointers, to allow yyoverflow to reallocate them elsewhere. */ /* The state stack. */ yytype_int16 yyssa[YYINITDEPTH]; yytype_int16 *yyss = yyssa; yytype_int16 *yyssp; /* The semantic value stack. */ YYSTYPE yyvsa[YYINITDEPTH]; YYSTYPE *yyvs = yyvsa; YYSTYPE *yyvsp; #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) YYSIZE_T yystacksize = YYINITDEPTH; /* The variables used to return semantic value and location from the action routines. */ YYSTYPE yyval; /* The number of symbols on the RHS of the reduced rule. Keep to zero when no symbol should be popped. */ int yylen = 0; YYDPRINTF ((stderr, "Starting parse\n")); yystate = 0; yyerrstatus = 0; yynerrs = 0; yychar = YYEMPTY; /* Cause a token to be read. */ /* Initialize stack pointers. Waste one element of value and location stack so that they stay on the same level as the state stack. The wasted elements are never initialized. */ yyssp = yyss; yyvsp = yyvs; goto yysetstate; /*------------------------------------------------------------. | yynewstate -- Push a new state, which is found in yystate. | `------------------------------------------------------------*/ yynewstate: /* In all cases, when you get here, the value and location stacks have just been pushed. So pushing a state here evens the stacks. */ yyssp++; yysetstate: *yyssp = yystate; if (yyss + yystacksize - 1 <= yyssp) { /* Get the current used size of the three stacks, in elements. */ YYSIZE_T yysize = yyssp - yyss + 1; #ifdef yyoverflow { /* Give user a chance to reallocate the stack. Use copies of these so that the &'s don't force the real ones into memory. */ YYSTYPE *yyvs1 = yyvs; yytype_int16 *yyss1 = yyss; /* Each stack pointer address is followed by the size of the data in use in that stack, in bytes. This used to be a conditional around just the two extra args, but that might be undefined if yyoverflow is a macro. */ yyoverflow (YY_("memory exhausted"), &yyss1, yysize * sizeof (*yyssp), &yyvs1, yysize * sizeof (*yyvsp), &yystacksize); yyss = yyss1; yyvs = yyvs1; } #else /* no yyoverflow */ # ifndef YYSTACK_RELOCATE goto yyexhaustedlab; # else /* Extend the stack our own way. */ if (YYMAXDEPTH <= yystacksize) goto yyexhaustedlab; yystacksize *= 2; if (YYMAXDEPTH < yystacksize) yystacksize = YYMAXDEPTH; { yytype_int16 *yyss1 = yyss; union yyalloc *yyptr = (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); if (! yyptr) goto yyexhaustedlab; YYSTACK_RELOCATE (yyss); YYSTACK_RELOCATE (yyvs); # undef YYSTACK_RELOCATE if (yyss1 != yyssa) YYSTACK_FREE (yyss1); } # endif #endif /* no yyoverflow */ yyssp = yyss + yysize - 1; yyvsp = yyvs + yysize - 1; YYDPRINTF ((stderr, "Stack size increased to %lu\n", (unsigned long int) yystacksize)); if (yyss + yystacksize - 1 <= yyssp) YYABORT; } YYDPRINTF ((stderr, "Entering state %d\n", yystate)); goto yybackup; /*-----------. | yybackup. | `-----------*/ yybackup: /* Do appropriate processing given the current state. Read a look-ahead token if we need one and don't already have one. */ /* First try to decide what to do without reference to look-ahead token. */ yyn = yypact[yystate]; if (yyn == YYPACT_NINF) goto yydefault; /* Not known => get a look-ahead token if don't already have one. */ /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */ if (yychar == YYEMPTY) { YYDPRINTF ((stderr, "Reading a token: ")); yychar = YYLEX; } if (yychar <= YYEOF) { yychar = yytoken = YYEOF; YYDPRINTF ((stderr, "Now at end of input.\n")); } else { yytoken = YYTRANSLATE (yychar); YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); } /* If the proper action on seeing token YYTOKEN is to reduce or to detect an error, take that action. */ yyn += yytoken; if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) goto yydefault; yyn = yytable[yyn]; if (yyn <= 0) { if (yyn == 0 || yyn == YYTABLE_NINF) goto yyerrlab; yyn = -yyn; goto yyreduce; } if (yyn == YYFINAL) YYACCEPT; /* Count tokens shifted since error; after three, turn off error status. */ if (yyerrstatus) yyerrstatus--; /* Shift the look-ahead token. */ YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); /* Discard the shifted token unless it is eof. */ if (yychar != YYEOF) yychar = YYEMPTY; yystate = yyn; *++yyvsp = yylval; goto yynewstate; /*-----------------------------------------------------------. | yydefault -- do the default action for the current state. | `-----------------------------------------------------------*/ yydefault: yyn = yydefact[yystate]; if (yyn == 0) goto yyerrlab; goto yyreduce; /*-----------------------------. | yyreduce -- Do a reduction. | `-----------------------------*/ yyreduce: /* yyn is the number of a rule to reduce with. */ yylen = yyr2[yyn]; /* If YYLEN is nonzero, implement the default value of the action: `$$ = $1'. Otherwise, the following line sets YYVAL to garbage. This behavior is undocumented and Bison users should not rely upon it. Assigning to YYVAL unconditionally makes the parser a bit smaller, and it avoids a GCC warning that YYVAL may be used uninitialized. */ yyval = yyvsp[1-yylen]; YY_REDUCE_PRINT (yyn); switch (yyn) { case 4: #line 199 "getdate.y" { PC.times_seen++; ;} break; case 5: #line 201 "getdate.y" { PC.local_zones_seen++; ;} break; case 6: #line 203 "getdate.y" { PC.zones_seen++; ;} break; case 7: #line 205 "getdate.y" { PC.dates_seen++; ;} break; case 8: #line 207 "getdate.y" { PC.days_seen++; ;} break; case 9: #line 209 "getdate.y" { PC.rels_seen++; ;} break; case 11: #line 215 "getdate.y" { PC.hour = (yyvsp[(1) - (2)].textintval).value; PC.minutes = 0; PC.seconds = 0; PC.meridian = (yyvsp[(2) - (2)].intval); ;} break; case 12: #line 222 "getdate.y" { PC.hour = (yyvsp[(1) - (4)].textintval).value; PC.minutes = (yyvsp[(3) - (4)].textintval).value; PC.seconds = 0; PC.meridian = (yyvsp[(4) - (4)].intval); ;} break; case 13: #line 229 "getdate.y" { PC.hour = (yyvsp[(1) - (4)].textintval).value; PC.minutes = (yyvsp[(3) - (4)].textintval).value; PC.meridian = MER24; PC.zones_seen++; PC.time_zone = (yyvsp[(4) - (4)].textintval).value % 100 + ((yyvsp[(4) - (4)].textintval).value / 100) * 60; ;} break; case 14: #line 237 "getdate.y" { PC.hour = (yyvsp[(1) - (6)].textintval).value; PC.minutes = (yyvsp[(3) - (6)].textintval).value; PC.seconds = (yyvsp[(5) - (6)].textintval).value; PC.meridian = (yyvsp[(6) - (6)].intval); ;} break; case 15: #line 244 "getdate.y" { PC.hour = (yyvsp[(1) - (6)].textintval).value; PC.minutes = (yyvsp[(3) - (6)].textintval).value; PC.seconds = (yyvsp[(5) - (6)].textintval).value; PC.meridian = MER24; PC.zones_seen++; PC.time_zone = (yyvsp[(6) - (6)].textintval).value % 100 + ((yyvsp[(6) - (6)].textintval).value / 100) * 60; ;} break; case 16: #line 256 "getdate.y" { PC.local_isdst = (yyvsp[(1) - (1)].intval); ;} break; case 17: #line 258 "getdate.y" { PC.local_isdst = (yyvsp[(1) - (2)].intval) < 0 ? 1 : (yyvsp[(1) - (2)].intval) + 1; ;} break; case 18: #line 263 "getdate.y" { PC.time_zone = (yyvsp[(1) - (1)].intval); ;} break; case 19: #line 265 "getdate.y" { PC.time_zone = (yyvsp[(1) - (1)].intval) + 60; ;} break; case 20: #line 267 "getdate.y" { PC.time_zone = (yyvsp[(1) - (2)].intval) + 60; ;} break; case 21: #line 272 "getdate.y" { PC.day_ordinal = 1; PC.day_number = (yyvsp[(1) - (1)].intval); ;} break; case 22: #line 277 "getdate.y" { PC.day_ordinal = 1; PC.day_number = (yyvsp[(1) - (2)].intval); ;} break; case 23: #line 282 "getdate.y" { PC.day_ordinal = (yyvsp[(1) - (2)].textintval).value; PC.day_number = (yyvsp[(2) - (2)].intval); ;} break; case 24: #line 290 "getdate.y" { PC.month = (yyvsp[(1) - (3)].textintval).value; PC.day = (yyvsp[(3) - (3)].textintval).value; ;} break; case 25: #line 295 "getdate.y" { /* Interpret as YYYY/MM/DD if the first value has 4 or more digits, otherwise as MM/DD/YY. The goal in recognizing YYYY/MM/DD is solely to support legacy machine-generated dates like those in an RCS log listing. If you want portability, use the ISO 8601 format. */ if (4 <= (yyvsp[(1) - (5)].textintval).digits) { PC.year = (yyvsp[(1) - (5)].textintval); PC.month = (yyvsp[(3) - (5)].textintval).value; PC.day = (yyvsp[(5) - (5)].textintval).value; } else { PC.month = (yyvsp[(1) - (5)].textintval).value; PC.day = (yyvsp[(3) - (5)].textintval).value; PC.year = (yyvsp[(5) - (5)].textintval); } ;} break; case 26: #line 315 "getdate.y" { /* ISO 8601 format. YYYY-MM-DD. */ PC.year = (yyvsp[(1) - (3)].textintval); PC.month = -(yyvsp[(2) - (3)].textintval).value; PC.day = -(yyvsp[(3) - (3)].textintval).value; ;} break; case 27: #line 322 "getdate.y" { /* e.g. 17-JUN-1992. */ PC.day = (yyvsp[(1) - (3)].textintval).value; PC.month = (yyvsp[(2) - (3)].intval); PC.year.value = -(yyvsp[(3) - (3)].textintval).value; PC.year.digits = (yyvsp[(3) - (3)].textintval).digits; ;} break; case 28: #line 330 "getdate.y" { PC.month = (yyvsp[(1) - (2)].intval); PC.day = (yyvsp[(2) - (2)].textintval).value; ;} break; case 29: #line 335 "getdate.y" { PC.month = (yyvsp[(1) - (4)].intval); PC.day = (yyvsp[(2) - (4)].textintval).value; PC.year = (yyvsp[(4) - (4)].textintval); ;} break; case 30: #line 341 "getdate.y" { PC.day = (yyvsp[(1) - (2)].textintval).value; PC.month = (yyvsp[(2) - (2)].intval); ;} break; case 31: #line 346 "getdate.y" { PC.day = (yyvsp[(1) - (3)].textintval).value; PC.month = (yyvsp[(2) - (3)].intval); PC.year = (yyvsp[(3) - (3)].textintval); ;} break; case 32: #line 355 "getdate.y" { PC.rel_seconds = -PC.rel_seconds; PC.rel_minutes = -PC.rel_minutes; PC.rel_hour = -PC.rel_hour; PC.rel_day = -PC.rel_day; PC.rel_month = -PC.rel_month; PC.rel_year = -PC.rel_year; ;} break; case 34: #line 368 "getdate.y" { PC.rel_year += (yyvsp[(1) - (2)].textintval).value * (yyvsp[(2) - (2)].intval); ;} break; case 35: #line 370 "getdate.y" { PC.rel_year += (yyvsp[(1) - (2)].textintval).value * (yyvsp[(2) - (2)].intval); ;} break; case 36: #line 372 "getdate.y" { PC.rel_year += (yyvsp[(1) - (1)].intval); ;} break; case 37: #line 374 "getdate.y" { PC.rel_month += (yyvsp[(1) - (2)].textintval).value * (yyvsp[(2) - (2)].intval); ;} break; case 38: #line 376 "getdate.y" { PC.rel_month += (yyvsp[(1) - (2)].textintval).value * (yyvsp[(2) - (2)].intval); ;} break; case 39: #line 378 "getdate.y" { PC.rel_month += (yyvsp[(1) - (1)].intval); ;} break; case 40: #line 380 "getdate.y" { PC.rel_day += (yyvsp[(1) - (2)].textintval).value * (yyvsp[(2) - (2)].intval); ;} break; case 41: #line 382 "getdate.y" { PC.rel_day += (yyvsp[(1) - (2)].textintval).value * (yyvsp[(2) - (2)].intval); ;} break; case 42: #line 384 "getdate.y" { PC.rel_day += (yyvsp[(1) - (1)].intval); ;} break; case 43: #line 386 "getdate.y" { PC.rel_hour += (yyvsp[(1) - (2)].textintval).value * (yyvsp[(2) - (2)].intval); ;} break; case 44: #line 388 "getdate.y" { PC.rel_hour += (yyvsp[(1) - (2)].textintval).value * (yyvsp[(2) - (2)].intval); ;} break; case 45: #line 390 "getdate.y" { PC.rel_hour += (yyvsp[(1) - (1)].intval); ;} break; case 46: #line 392 "getdate.y" { PC.rel_minutes += (yyvsp[(1) - (2)].textintval).value * (yyvsp[(2) - (2)].intval); ;} break; case 47: #line 394 "getdate.y" { PC.rel_minutes += (yyvsp[(1) - (2)].textintval).value * (yyvsp[(2) - (2)].intval); ;} break; case 48: #line 396 "getdate.y" { PC.rel_minutes += (yyvsp[(1) - (1)].intval); ;} break; case 49: #line 398 "getdate.y" { PC.rel_seconds += (yyvsp[(1) - (2)].textintval).value * (yyvsp[(2) - (2)].intval); ;} break; case 50: #line 400 "getdate.y" { PC.rel_seconds += (yyvsp[(1) - (2)].textintval).value * (yyvsp[(2) - (2)].intval); ;} break; case 51: #line 402 "getdate.y" { PC.rel_seconds += (yyvsp[(1) - (1)].intval); ;} break; case 52: #line 407 "getdate.y" { if (PC.dates_seen && ! PC.rels_seen && (PC.times_seen || 2 < (yyvsp[(1) - (1)].textintval).digits)) PC.year = (yyvsp[(1) - (1)].textintval); else { if (4 < (yyvsp[(1) - (1)].textintval).digits) { PC.dates_seen++; PC.day = (yyvsp[(1) - (1)].textintval).value % 100; PC.month = ((yyvsp[(1) - (1)].textintval).value / 100) % 100; PC.year.value = (yyvsp[(1) - (1)].textintval).value / 10000; PC.year.digits = (yyvsp[(1) - (1)].textintval).digits - 4; } else { PC.times_seen++; if ((yyvsp[(1) - (1)].textintval).digits <= 2) { PC.hour = (yyvsp[(1) - (1)].textintval).value; PC.minutes = 0; } else { PC.hour = (yyvsp[(1) - (1)].textintval).value / 100; PC.minutes = (yyvsp[(1) - (1)].textintval).value % 100; } PC.seconds = 0; PC.meridian = MER24; } } ;} break; case 53: #line 443 "getdate.y" { (yyval.intval) = MER24; ;} break; case 54: #line 445 "getdate.y" { (yyval.intval) = (yyvsp[(1) - (1)].intval); ;} break; /* Line 1267 of yacc.c. */ #line 1935 "getdate.c" default: break; } YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); YYPOPSTACK (yylen); yylen = 0; YY_STACK_PRINT (yyss, yyssp); *++yyvsp = yyval; /* Now `shift' the result of the reduction. Determine what state that goes to, based on the state we popped back to and the rule number reduced by. */ yyn = yyr1[yyn]; yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) yystate = yytable[yystate]; else yystate = yydefgoto[yyn - YYNTOKENS]; goto yynewstate; /*------------------------------------. | yyerrlab -- here on detecting error | `------------------------------------*/ yyerrlab: /* If not already recovering from an error, report this error. */ if (!yyerrstatus) { ++yynerrs; #if ! YYERROR_VERBOSE yyerror (YY_("syntax error")); #else { YYSIZE_T yysize = yysyntax_error (0, yystate, yychar); if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM) { YYSIZE_T yyalloc = 2 * yysize; if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM)) yyalloc = YYSTACK_ALLOC_MAXIMUM; if (yymsg != yymsgbuf) YYSTACK_FREE (yymsg); yymsg = (char *) YYSTACK_ALLOC (yyalloc); if (yymsg) yymsg_alloc = yyalloc; else { yymsg = yymsgbuf; yymsg_alloc = sizeof yymsgbuf; } } if (0 < yysize && yysize <= yymsg_alloc) { (void) yysyntax_error (yymsg, yystate, yychar); yyerror (yymsg); } else { yyerror (YY_("syntax error")); if (yysize != 0) goto yyexhaustedlab; } } #endif } if (yyerrstatus == 3) { /* If just tried and failed to reuse look-ahead token after an error, discard it. */ if (yychar <= YYEOF) { /* Return failure if at end of input. */ if (yychar == YYEOF) YYABORT; } else { yydestruct ("Error: discarding", yytoken, &yylval); yychar = YYEMPTY; } } /* Else will try to reuse look-ahead token after shifting the error token. */ goto yyerrlab1; /*---------------------------------------------------. | yyerrorlab -- error raised explicitly by YYERROR. | `---------------------------------------------------*/ yyerrorlab: /* Pacify compilers like GCC when the user code never invokes YYERROR and the label yyerrorlab therefore never appears in user code. */ if (/*CONSTCOND*/ 0) goto yyerrorlab; /* Do not reclaim the symbols of the rule which action triggered this YYERROR. */ YYPOPSTACK (yylen); yylen = 0; YY_STACK_PRINT (yyss, yyssp); yystate = *yyssp; goto yyerrlab1; /*-------------------------------------------------------------. | yyerrlab1 -- common code for both syntax error and YYERROR. | `-------------------------------------------------------------*/ yyerrlab1: yyerrstatus = 3; /* Each real token shifted decrements this. */ for (;;) { yyn = yypact[yystate]; if (yyn != YYPACT_NINF) { yyn += YYTERROR; if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) { yyn = yytable[yyn]; if (0 < yyn) break; } } /* Pop the current state because it cannot handle the error token. */ if (yyssp == yyss) YYABORT; yydestruct ("Error: popping", yystos[yystate], yyvsp); YYPOPSTACK (1); yystate = *yyssp; YY_STACK_PRINT (yyss, yyssp); } if (yyn == YYFINAL) YYACCEPT; *++yyvsp = yylval; /* Shift the error token. */ YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); yystate = yyn; goto yynewstate; /*-------------------------------------. | yyacceptlab -- YYACCEPT comes here. | `-------------------------------------*/ yyacceptlab: yyresult = 0; goto yyreturn; /*-----------------------------------. | yyabortlab -- YYABORT comes here. | `-----------------------------------*/ yyabortlab: yyresult = 1; goto yyreturn; #ifndef yyoverflow /*-------------------------------------------------. | yyexhaustedlab -- memory exhaustion comes here. | `-------------------------------------------------*/ yyexhaustedlab: yyerror (YY_("memory exhausted")); yyresult = 2; /* Fall through. */ #endif yyreturn: if (yychar != YYEOF && yychar != YYEMPTY) yydestruct ("Cleanup: discarding lookahead", yytoken, &yylval); /* Do not reclaim the symbols of the rule which action triggered this YYABORT or YYACCEPT. */ YYPOPSTACK (yylen); YY_STACK_PRINT (yyss, yyssp); while (yyssp != yyss) { yydestruct ("Cleanup: popping", yystos[*yyssp], yyvsp); YYPOPSTACK (1); } #ifndef yyoverflow if (yyss != yyssa) YYSTACK_FREE (yyss); #endif #if YYERROR_VERBOSE if (yymsg != yymsgbuf) YYSTACK_FREE (yymsg); #endif /* Make sure YYID is used. */ return YYID (yyresult); } #line 448 "getdate.y" /* Include this file down here because bison inserts code above which may define-away `const'. We want the prototype for get_date to have the same signature as the function definition. */ #include "modules/getdate.h" #ifndef gmtime struct tm *gmtime (const time_t *); #endif #ifndef localtime struct tm *localtime (const time_t *); #endif #ifndef mktime time_t mktime (struct tm *); #endif static table const meridian_table[] = { { "AM", tMERIDIAN, MERam }, { "A.M.", tMERIDIAN, MERam }, { "PM", tMERIDIAN, MERpm }, { "P.M.", tMERIDIAN, MERpm }, { 0, 0, 0 } }; static table const dst_table[] = { { "DST", tDST, 0 } }; static table const month_and_day_table[] = { { "JANUARY", tMONTH, 1 }, { "FEBRUARY", tMONTH, 2 }, { "MARCH", tMONTH, 3 }, { "APRIL", tMONTH, 4 }, { "MAY", tMONTH, 5 }, { "JUNE", tMONTH, 6 }, { "JULY", tMONTH, 7 }, { "AUGUST", tMONTH, 8 }, { "SEPTEMBER",tMONTH, 9 }, { "SEPT", tMONTH, 9 }, { "OCTOBER", tMONTH, 10 }, { "NOVEMBER", tMONTH, 11 }, { "DECEMBER", tMONTH, 12 }, { "SUNDAY", tDAY, 0 }, { "MONDAY", tDAY, 1 }, { "TUESDAY", tDAY, 2 }, { "TUES", tDAY, 2 }, { "WEDNESDAY",tDAY, 3 }, { "WEDNES", tDAY, 3 }, { "THURSDAY", tDAY, 4 }, { "THUR", tDAY, 4 }, { "THURS", tDAY, 4 }, { "FRIDAY", tDAY, 5 }, { "SATURDAY", tDAY, 6 }, { 0, 0, 0 } }; static table const time_units_table[] = { { "YEAR", tYEAR_UNIT, 1 }, { "MONTH", tMONTH_UNIT, 1 }, { "FORTNIGHT",tDAY_UNIT, 14 }, { "WEEK", tDAY_UNIT, 7 }, { "DAY", tDAY_UNIT, 1 }, { "HOUR", tHOUR_UNIT, 1 }, { "MINUTE", tMINUTE_UNIT, 1 }, { "MIN", tMINUTE_UNIT, 1 }, { "SECOND", tSEC_UNIT, 1 }, { "SEC", tSEC_UNIT, 1 }, { 0, 0, 0 } }; /* Assorted relative-time words. */ static table const relative_time_table[] = { { "TOMORROW", tMINUTE_UNIT, 24 * 60 }, { "YESTERDAY",tMINUTE_UNIT, - (24 * 60) }, { "TODAY", tMINUTE_UNIT, 0 }, { "NOW", tMINUTE_UNIT, 0 }, { "LAST", tUNUMBER, -1 }, { "THIS", tUNUMBER, 0 }, { "NEXT", tUNUMBER, 1 }, { "FIRST", tUNUMBER, 1 }, /*{ "SECOND", tUNUMBER, 2 }, */ { "THIRD", tUNUMBER, 3 }, { "FOURTH", tUNUMBER, 4 }, { "FIFTH", tUNUMBER, 5 }, { "SIXTH", tUNUMBER, 6 }, { "SEVENTH", tUNUMBER, 7 }, { "EIGHTH", tUNUMBER, 8 }, { "NINTH", tUNUMBER, 9 }, { "TENTH", tUNUMBER, 10 }, { "ELEVENTH", tUNUMBER, 11 }, { "TWELFTH", tUNUMBER, 12 }, { "AGO", tAGO, 1 }, { 0, 0, 0 } }; /* The time zone table. This table is necessarily incomplete, as time zone abbreviations are ambiguous; e.g. Australians interpret "EST" as Eastern time in Australia, not as US Eastern Standard Time. You cannot rely on getdate to handle arbitrary time zone abbreviations; use numeric abbreviations like `-0500' instead. */ static table const time_zone_table[] = { { "GMT", tZONE, HOUR ( 0) }, /* Greenwich Mean */ { "UT", tZONE, HOUR ( 0) }, /* Universal (Coordinated) */ { "UTC", tZONE, HOUR ( 0) }, { "WET", tZONE, HOUR ( 0) }, /* Western European */ { "WEST", tDAYZONE, HOUR ( 0) }, /* Western European Summer */ { "BST", tDAYZONE, HOUR ( 0) }, /* British Summer */ { "ART", tZONE, -HOUR ( 3) }, /* Argentina */ { "BRT", tZONE, -HOUR ( 3) }, /* Brazil */ { "BRST", tDAYZONE, -HOUR ( 3) }, /* Brazil Summer */ { "NST", tZONE, -(HOUR ( 3) + 30) }, /* Newfoundland Standard */ { "NDT", tDAYZONE,-(HOUR ( 3) + 30) }, /* Newfoundland Daylight */ { "AST", tZONE, -HOUR ( 4) }, /* Atlantic Standard */ { "ADT", tDAYZONE, -HOUR ( 4) }, /* Atlantic Daylight */ { "CLT", tZONE, -HOUR ( 4) }, /* Chile */ { "CLST", tDAYZONE, -HOUR ( 4) }, /* Chile Summer */ { "EST", tZONE, -HOUR ( 5) }, /* Eastern Standard */ { "EDT", tDAYZONE, -HOUR ( 5) }, /* Eastern Daylight */ { "CST", tZONE, -HOUR ( 6) }, /* Central Standard */ { "CDT", tDAYZONE, -HOUR ( 6) }, /* Central Daylight */ { "MST", tZONE, -HOUR ( 7) }, /* Mountain Standard */ { "MDT", tDAYZONE, -HOUR ( 7) }, /* Mountain Daylight */ { "PST", tZONE, -HOUR ( 8) }, /* Pacific Standard */ { "PDT", tDAYZONE, -HOUR ( 8) }, /* Pacific Daylight */ { "AKST", tZONE, -HOUR ( 9) }, /* Alaska Standard */ { "AKDT", tDAYZONE, -HOUR ( 9) }, /* Alaska Daylight */ { "HST", tZONE, -HOUR (10) }, /* Hawaii Standard */ { "HAST", tZONE, -HOUR (10) }, /* Hawaii-Aleutian Standard */ { "HADT", tDAYZONE, -HOUR (10) }, /* Hawaii-Aleutian Daylight */ { "SST", tZONE, -HOUR (12) }, /* Samoa Standard */ { "WAT", tZONE, HOUR ( 1) }, /* West Africa */ { "CET", tZONE, HOUR ( 1) }, /* Central European */ { "CEST", tDAYZONE, HOUR ( 1) }, /* Central European Summer */ { "MET", tZONE, HOUR ( 1) }, /* Middle European */ { "MEZ", tZONE, HOUR ( 1) }, /* Middle European */ { "MEST", tDAYZONE, HOUR ( 1) }, /* Middle European Summer */ { "MESZ", tDAYZONE, HOUR ( 1) }, /* Middle European Summer */ { "EET", tZONE, HOUR ( 2) }, /* Eastern European */ { "EEST", tDAYZONE, HOUR ( 2) }, /* Eastern European Summer */ { "CAT", tZONE, HOUR ( 2) }, /* Central Africa */ { "SAST", tZONE, HOUR ( 2) }, /* South Africa Standard */ { "EAT", tZONE, HOUR ( 3) }, /* East Africa */ { "MSK", tZONE, HOUR ( 3) }, /* Moscow */ { "MSD", tDAYZONE, HOUR ( 3) }, /* Moscow Daylight */ { "IST", tZONE, (HOUR ( 5) + 30) }, /* India Standard */ { "SGT", tZONE, HOUR ( 8) }, /* Singapore */ { "KST", tZONE, HOUR ( 9) }, /* Korea Standard */ { "JST", tZONE, HOUR ( 9) }, /* Japan Standard */ { "GST", tZONE, HOUR (10) }, /* Guam Standard */ { "NZST", tZONE, HOUR (12) }, /* New Zealand Standard */ { "NZDT", tDAYZONE, HOUR (12) }, /* New Zealand Daylight */ { 0, 0, 0 } }; /* Military time zone table. */ static table const military_table[] = { { "A", tZONE, -HOUR ( 1) }, { "B", tZONE, -HOUR ( 2) }, { "C", tZONE, -HOUR ( 3) }, { "D", tZONE, -HOUR ( 4) }, { "E", tZONE, -HOUR ( 5) }, { "F", tZONE, -HOUR ( 6) }, { "G", tZONE, -HOUR ( 7) }, { "H", tZONE, -HOUR ( 8) }, { "I", tZONE, -HOUR ( 9) }, { "K", tZONE, -HOUR (10) }, { "L", tZONE, -HOUR (11) }, { "M", tZONE, -HOUR (12) }, { "N", tZONE, HOUR ( 1) }, { "O", tZONE, HOUR ( 2) }, { "P", tZONE, HOUR ( 3) }, { "Q", tZONE, HOUR ( 4) }, { "R", tZONE, HOUR ( 5) }, { "S", tZONE, HOUR ( 6) }, { "T", tZONE, HOUR ( 7) }, { "U", tZONE, HOUR ( 8) }, { "V", tZONE, HOUR ( 9) }, { "W", tZONE, HOUR (10) }, { "X", tZONE, HOUR (11) }, { "Y", tZONE, HOUR (12) }, { "Z", tZONE, HOUR ( 0) }, { 0, 0, 0 } }; static int to_hour (int hours, int meridian) { switch (meridian) { case MER24: return 0 <= hours && hours < 24 ? hours : -1; case MERam: return 0 < hours && hours < 12 ? hours : hours == 12 ? 0 : -1; case MERpm: return 0 < hours && hours < 12 ? hours + 12 : hours == 12 ? 12 : -1; default: abort (); } /* NOTREACHED */ return 0; } static int to_year (textint textyear) { int year = textyear.value; if (year < 0) year = -year; /* XPG4 suggests that years 00-68 map to 2000-2068, and years 69-99 map to 1969-1999. */ if (textyear.digits == 2) year += year < 69 ? 2000 : 1900; return year; } static table const * lookup_zone (parser_control const *pc, char const *name) { table const *tp; /* Try local zone abbreviations first; they're more likely to be right. */ for (tp = pc->local_time_zone_table; tp->name; tp++) if (strcmp (name, tp->name) == 0) return tp; for (tp = time_zone_table; tp->name; tp++) if (strcmp (name, tp->name) == 0) return tp; return 0; } #if ! HAVE_TM_GMTOFF /* Yield the difference between *A and *B, measured in seconds, ignoring leap seconds. The body of this function is taken directly from the GNU C Library; see src/strftime.c. */ static int tm_diff (struct tm const *a, struct tm const *b) { /* Compute intervening leap days correctly even if year is negative. Take care to avoid int overflow in leap day calculations, but it's OK to assume that A and B are close to each other. */ int a4 = (a->tm_year >> 2) + (TM_YEAR_BASE >> 2) - ! (a->tm_year & 3); int b4 = (b->tm_year >> 2) + (TM_YEAR_BASE >> 2) - ! (b->tm_year & 3); int a100 = a4 / 25 - (a4 % 25 < 0); int b100 = b4 / 25 - (b4 % 25 < 0); int a400 = a100 >> 2; int b400 = b100 >> 2; int intervening_leap_days = (a4 - b4) - (a100 - b100) + (a400 - b400); int years = a->tm_year - b->tm_year; int days = (365 * years + intervening_leap_days + (a->tm_yday - b->tm_yday)); return (60 * (60 * (24 * days + (a->tm_hour - b->tm_hour)) + (a->tm_min - b->tm_min)) + (a->tm_sec - b->tm_sec)); } #endif /* ! HAVE_TM_GMTOFF */ static table const * lookup_word (parser_control const *pc, char *word) { char *p; char *q; size_t wordlen; table const *tp; int i; int abbrev; /* Make it uppercase. */ for (p = word; *p; p++) if (ISLOWER ((unsigned char) *p)) *p = toupper ((unsigned char) *p); for (tp = meridian_table; tp->name; tp++) if (strcmp (word, tp->name) == 0) return tp; /* See if we have an abbreviation for a month. */ wordlen = strlen (word); abbrev = wordlen == 3 || (wordlen == 4 && word[3] == '.'); for (tp = month_and_day_table; tp->name; tp++) if ((abbrev ? strncmp (word, tp->name, 3) : strcmp (word, tp->name)) == 0) return tp; if ((tp = lookup_zone (pc, word))) return tp; if (strcmp (word, dst_table[0].name) == 0) return dst_table; for (tp = time_units_table; tp->name; tp++) if (strcmp (word, tp->name) == 0) return tp; /* Strip off any plural and try the units table again. */ if (word[wordlen - 1] == 'S') { word[wordlen - 1] = '\0'; for (tp = time_units_table; tp->name; tp++) if (strcmp (word, tp->name) == 0) return tp; word[wordlen - 1] = 'S'; /* For "this" in relative_time_table. */ } for (tp = relative_time_table; tp->name; tp++) if (strcmp (word, tp->name) == 0) return tp; /* Military time zones. */ if (wordlen == 1) for (tp = military_table; tp->name; tp++) if (word[0] == tp->name[0]) return tp; /* Drop out any periods and try the time zone table again. */ for (i = 0, p = q = word; (*p = *q); q++) if (*q == '.') i = 1; else p++; if (i && (tp = lookup_zone (pc, word))) return tp; return 0; } static int yylex (YYSTYPE *lvalp, parser_control *pc) { unsigned char c; int count; for (;;) { while (c = *pc->input, ISSPACE (c)) pc->input++; if (ISDIGIT (c) || c == '-' || c == '+') { char const *p; int sign; int value; if (c == '-' || c == '+') { sign = c == '-' ? -1 : 1; c = *++pc->input; if (! ISDIGIT (c)) /* skip the '-' sign */ continue; } else sign = 0; p = pc->input; value = 0; do { value = 10 * value + c - '0'; c = *++p; } while (ISDIGIT (c)); lvalp->textintval.value = sign < 0 ? -value : value; lvalp->textintval.digits = p - pc->input; pc->input = p; return sign ? tSNUMBER : tUNUMBER; } if (ISALPHA (c)) { char buff[20]; char *p = buff; table const *tp; do { if (p < buff + sizeof buff - 1) *p++ = c; c = *++pc->input; } while (ISALPHA (c) || c == '.'); *p = '\0'; tp = lookup_word (pc, buff); if (! tp) return '?'; lvalp->intval = tp->value; return tp->type; } if (c != '(') return *pc->input++; count = 0; do { c = *pc->input++; if (c == '\0') return c; if (c == '(') count++; else if (c == ')') count--; } while (count > 0); } } /* Do nothing if the parser reports an error. */ static int yyerror (const char *s ATTRIBUTE_UNUSED) { return 0; } /* Parse a date/time string P. Return the corresponding time_t value, or (time_t) -1 if there is an error. P can be an incomplete or relative time specification; if so, use *NOW as the basis for the returned time. */ time_t get_date (const char *p, const time_t *now) { time_t Start = now ? *now : time (0); struct tm *tmp = localtime (&Start); struct tm tm; struct tm tm0; parser_control pc; if (! tmp) return -1; pc.input = p; pc.year.value = tmp->tm_year + TM_YEAR_BASE; pc.year.digits = 4; pc.month = tmp->tm_mon + 1; pc.day = tmp->tm_mday; pc.hour = tmp->tm_hour; pc.minutes = tmp->tm_min; pc.seconds = tmp->tm_sec; tm.tm_isdst = tmp->tm_isdst; pc.meridian = MER24; pc.rel_seconds = 0; pc.rel_minutes = 0; pc.rel_hour = 0; pc.rel_day = 0; pc.rel_month = 0; pc.rel_year = 0; pc.dates_seen = 0; pc.days_seen = 0; pc.rels_seen = 0; pc.times_seen = 0; pc.local_zones_seen = 0; pc.zones_seen = 0; #if HAVE_STRUCT_TM_TM_ZONE pc.local_time_zone_table[0].name = tmp->tm_zone; pc.local_time_zone_table[0].type = tLOCAL_ZONE; pc.local_time_zone_table[0].value = tmp->tm_isdst; pc.local_time_zone_table[1].name = 0; /* Probe the names used in the next three calendar quarters, looking for a tm_isdst different from the one we already have. */ { int quarter; for (quarter = 1; quarter <= 3; quarter++) { time_t probe = Start + quarter * (90 * 24 * 60 * 60); struct tm *probe_tm = localtime (&probe); if (probe_tm && probe_tm->tm_zone && probe_tm->tm_isdst != pc.local_time_zone_table[0].value) { { pc.local_time_zone_table[1].name = probe_tm->tm_zone; pc.local_time_zone_table[1].type = tLOCAL_ZONE; pc.local_time_zone_table[1].value = probe_tm->tm_isdst; pc.local_time_zone_table[2].name = 0; } break; } } } #else #if HAVE_TZNAME { # ifndef tzname extern char *tzname[]; # endif int i; for (i = 0; i < 2; i++) { pc.local_time_zone_table[i].name = tzname[i]; pc.local_time_zone_table[i].type = tLOCAL_ZONE; pc.local_time_zone_table[i].value = i; } pc.local_time_zone_table[i].name = 0; } #else pc.local_time_zone_table[0].name = 0; #endif #endif if (pc.local_time_zone_table[0].name && pc.local_time_zone_table[1].name && ! strcmp (pc.local_time_zone_table[0].name, pc.local_time_zone_table[1].name)) { /* This locale uses the same abbrevation for standard and daylight times. So if we see that abbreviation, we don't know whether it's daylight time. */ pc.local_time_zone_table[0].value = -1; pc.local_time_zone_table[1].name = 0; } if (yyparse (&pc) != 0 || 1 < pc.times_seen || 1 < pc.dates_seen || 1 < pc.days_seen || 1 < (pc.local_zones_seen + pc.zones_seen) || (pc.local_zones_seen && 1 < pc.local_isdst)) return -1; tm.tm_year = to_year (pc.year) - TM_YEAR_BASE + pc.rel_year; tm.tm_mon = pc.month - 1 + pc.rel_month; tm.tm_mday = pc.day + pc.rel_day; if (pc.times_seen || (pc.rels_seen && ! pc.dates_seen && ! pc.days_seen)) { tm.tm_hour = to_hour (pc.hour, pc.meridian); if (tm.tm_hour < 0) return -1; tm.tm_min = pc.minutes; tm.tm_sec = pc.seconds; } else { tm.tm_hour = tm.tm_min = tm.tm_sec = 0; } /* Let mktime deduce tm_isdst if we have an absolute time stamp, or if the relative time stamp mentions days, months, or years. */ if (pc.dates_seen | pc.days_seen | pc.times_seen | pc.rel_day | pc.rel_month | pc.rel_year) tm.tm_isdst = -1; /* But if the input explicitly specifies local time with or without DST, give mktime that information. */ if (pc.local_zones_seen) tm.tm_isdst = pc.local_isdst; tm0 = tm; Start = mktime (&tm); if (Start == (time_t) -1) { /* Guard against falsely reporting errors near the time_t boundaries when parsing times in other time zones. For example, if the min time_t value is 1970-01-01 00:00:00 UTC and we are 8 hours ahead of UTC, then the min localtime value is 1970-01-01 08:00:00; if we apply mktime to 1970-01-01 00:00:00 we will get an error, so we apply mktime to 1970-01-02 08:00:00 instead and adjust the time zone by 24 hours to compensate. This algorithm assumes that there is no DST transition within a day of the time_t boundaries. */ if (pc.zones_seen) { tm = tm0; if (tm.tm_year <= EPOCH_YEAR - TM_YEAR_BASE) { tm.tm_mday++; pc.time_zone += 24 * 60; } else { tm.tm_mday--; pc.time_zone -= 24 * 60; } Start = mktime (&tm); } if (Start == (time_t) -1) return Start; } if (pc.days_seen && ! pc.dates_seen) { tm.tm_mday += ((pc.day_number - tm.tm_wday + 7) % 7 + 7 * (pc.day_ordinal - (0 < pc.day_ordinal))); tm.tm_isdst = -1; Start = mktime (&tm); if (Start == (time_t) -1) return Start; } if (pc.zones_seen) { int delta = pc.time_zone * 60; #ifdef HAVE_TM_GMTOFF delta -= tm.tm_gmtoff; #else struct tm *gmt = gmtime (&Start); if (! gmt) return -1; delta -= tm_diff (&tm, gmt); #endif if ((Start < Start - delta) != (delta < 0)) return -1; /* time_t overflow */ Start -= delta; } /* Add relative hours, minutes, and seconds. Ignore leap seconds; i.e. "+ 10 minutes" means 600 seconds, even if one of them is a leap second. Typically this is not what the user wants, but it's too hard to do it the other way, because the time zone indicator must be applied before relative times, and if mktime is applied again the time zone will be lost. */ { time_t t0 = Start; long d1 = 60 * 60 * (long) pc.rel_hour; time_t t1 = t0 + d1; long d2 = 60 * (long) pc.rel_minutes; time_t t2 = t1 + d2; int d3 = pc.rel_seconds; time_t t3 = t2 + d3; if ((d1 / (60 * 60) ^ pc.rel_hour) | (d2 / 60 ^ pc.rel_minutes) | ((t0 + d1 < t0) ^ (d1 < 0)) | ((t1 + d2 < t1) ^ (d2 < 0)) | ((t2 + d3 < t2) ^ (d3 < 0))) return -1; Start = t3; } return Start; } #if TEST #include <stdio.h> int main (int ac, char **av) { char buff[BUFSIZ]; time_t d; printf ("Enter date, or blank line to exit.\n\t> "); fflush (stdout); buff[BUFSIZ - 1] = 0; while (fgets (buff, BUFSIZ - 1, stdin) && buff[0]) { d = get_date (buff, 0); if (d == (time_t) -1) printf ("Bad format - couldn't convert.\n"); else printf ("%s", ctime (&d)); printf ("\t> "); fflush (stdout); } return 0; } #endif /* defined TEST */
<gh_stars>0 #include "pattern_collection_generator_hillclimbing.h" #include "canonical_pdbs_heuristic.h" #include "incremental_canonical_pdbs.h" #include "pattern_database.h" #include "utils.h" #include "validation.h" #include "../option_parser.h" #include "../plugin.h" #include "../task_utils/causal_graph.h" #include "../task_utils/sampling.h" #include "../task_utils/task_properties.h" #include "../utils/collections.h" #include "../utils/countdown_timer.h" #include "../utils/logging.h" #include "../utils/markup.h" #include "../utils/math.h" #include "../utils/memory.h" #include "../utils/rng.h" #include "../utils/rng_options.h" #include "../utils/timer.h" #include <algorithm> #include <cassert> #include <iostream> #include <limits> using namespace std; namespace pdbs { /* Since this exception class is only used for control flow and thus has no need for an error message, we use a standalone class instead of inheriting from utils::Exception. */ class HillClimbingTimeout { }; static vector<int> get_goal_variables(const TaskProxy &task_proxy) { vector<int> goal_vars; GoalsProxy goals = task_proxy.get_goals(); goal_vars.reserve(goals.size()); for (FactProxy goal : goals) { goal_vars.push_back(goal.get_variable().get_id()); } assert(utils::is_sorted_unique(goal_vars)); return goal_vars; } /* When growing a pattern, we only want to consider successor patterns that are *interesting*. A pattern is interesting if the subgraph of the causal graph induced by the pattern satisfies the following two properties: A. it is weakly connected (considering all kinds of arcs) B. from every variable in the pattern, a goal variable is reachable by a path that only uses pre->eff arcs We can use the assumption that the pattern we want to extend is already interesting, so the question is how an interesting pattern can be obtained from an interesting pattern by adding one variable. There are two ways to do this: 1. Add a *predecessor* of an existing variable along a pre->eff arc. 2. Add any *goal variable* that is a weakly connected neighbour of an existing variable (using any kind of arc). Note that in the iPDB paper, the second case was missed. Adding it significantly helps with performance in our experiments (see issue743, msg6595). In our implementation, for efficiency we replace condition 2. by only considering causal graph *successors* (along either pre->eff or eff--eff arcs), because these can be obtained directly, and the missing case (predecessors along pre->eff arcs) is already covered by the first condition anyway. This method precomputes all variables which satisfy conditions 1. or 2. for a given neighbour variable already in the pattern. */ static vector<vector<int>> compute_relevant_neighbours(const TaskProxy &task_proxy) { const causal_graph::CausalGraph &causal_graph = task_proxy.get_causal_graph(); const vector<int> goal_vars = get_goal_variables(task_proxy); vector<vector<int>> connected_vars_by_variable; VariablesProxy variables = task_proxy.get_variables(); connected_vars_by_variable.reserve(variables.size()); for (VariableProxy var : variables) { int var_id = var.get_id(); // Consider variables connected backwards via pre->eff arcs. const vector<int> &pre_to_eff_predecessors = causal_graph.get_eff_to_pre(var_id); // Consider goal variables connected (forwards) via eff--eff and pre->eff arcs. const vector<int> &causal_graph_successors = causal_graph.get_successors(var_id); vector<int> goal_variable_successors; set_intersection( causal_graph_successors.begin(), causal_graph_successors.end(), goal_vars.begin(), goal_vars.end(), back_inserter(goal_variable_successors)); // Combine relevant goal and non-goal variables. vector<int> relevant_neighbours; set_union( pre_to_eff_predecessors.begin(), pre_to_eff_predecessors.end(), goal_variable_successors.begin(), goal_variable_successors.end(), back_inserter(relevant_neighbours)); connected_vars_by_variable.push_back(move(relevant_neighbours)); } return connected_vars_by_variable; } PatternCollectionGeneratorHillclimbing::PatternCollectionGeneratorHillclimbing(const Options &opts) : pdb_max_size(opts.get<int>("pdb_max_size")), collection_max_size(opts.get<int>("collection_max_size")), num_samples(opts.get<int>("num_samples")), min_improvement(opts.get<int>("min_improvement")), max_time(opts.get<double>("max_time")), rng(utils::parse_rng_from_options(opts)), num_rejected(0), hill_climbing_timer(0) { } int PatternCollectionGeneratorHillclimbing::generate_candidate_pdbs( const TaskProxy &task_proxy, const vector<vector<int>> &relevant_neighbours, const PatternDatabase &pdb, set<Pattern> &generated_patterns, PDBCollection &candidate_pdbs) { const Pattern &pattern = pdb.get_pattern(); int pdb_size = pdb.get_size(); int max_pdb_size = 0; for (int pattern_var : pattern) { assert(utils::in_bounds(pattern_var, relevant_neighbours)); const vector<int> &connected_vars = relevant_neighbours[pattern_var]; // Only use variables which are not already in the pattern. vector<int> relevant_vars; set_difference( connected_vars.begin(), connected_vars.end(), pattern.begin(), pattern.end(), back_inserter(relevant_vars)); for (int rel_var_id : relevant_vars) { VariableProxy rel_var = task_proxy.get_variables()[rel_var_id]; int rel_var_size = rel_var.get_domain_size(); if (utils::is_product_within_limit(pdb_size, rel_var_size, pdb_max_size)) { Pattern new_pattern(pattern); new_pattern.push_back(rel_var_id); sort(new_pattern.begin(), new_pattern.end()); if (!generated_patterns.count(new_pattern)) { /* If we haven't seen this pattern before, generate a PDB for it and add it to candidate_pdbs if its size does not surpass the size limit. */ generated_patterns.insert(new_pattern); candidate_pdbs.push_back( make_shared<PatternDatabase>(task_proxy, new_pattern)); max_pdb_size = max(max_pdb_size, candidate_pdbs.back()->get_size()); } } else { ++num_rejected; } } } return max_pdb_size; } void PatternCollectionGeneratorHillclimbing::sample_states( const sampling::RandomWalkSampler &sampler, int init_h, vector<State> &samples) { assert(samples.empty()); samples.reserve(num_samples); for (int i = 0; i < num_samples; ++i) { samples.push_back(sampler.sample_state( init_h, [this](const State &state) { return current_pdbs->is_dead_end(state); })); if (hill_climbing_timer->is_expired()) { throw HillClimbingTimeout(); } } } pair<int, int> PatternCollectionGeneratorHillclimbing::find_best_improving_pdb( const vector<State> &samples, const vector<int> &samples_h_values, PDBCollection &candidate_pdbs) { /* TODO: The original implementation by Haslum et al. uses A* to compute h values for the sample states only instead of generating all PDBs. improvement: best improvement (= highest count) for a pattern so far. We require that a pattern must have an improvement of at least one in order to be taken into account. */ int improvement = 0; int best_pdb_index = -1; // Iterate over all candidates and search for the best improving pattern/pdb for (size_t i = 0; i < candidate_pdbs.size(); ++i) { if (hill_climbing_timer->is_expired()) throw HillClimbingTimeout(); const shared_ptr<PatternDatabase> &pdb = candidate_pdbs[i]; if (!pdb) { /* candidate pattern is too large or has already been added to the canonical heuristic. */ continue; } /* If a candidate's size added to the current collection's size exceeds the maximum collection size, then forget the pdb. */ int combined_size = current_pdbs->get_size() + pdb->get_size(); if (combined_size > collection_max_size) { candidate_pdbs[i] = nullptr; continue; } /* Calculate the "counting approximation" for all sample states: count the number of samples for which the current pattern collection heuristic would be improved if the new pattern was included into it. */ /* TODO: The original implementation by Haslum et al. uses m/t as a statistical confidence interval to stop the A*-search (which they use, see above) earlier. */ int count = 0; vector<PatternClique> pattern_cliques = current_pdbs->get_pattern_cliques(pdb->get_pattern()); for (int sample_id = 0; sample_id < num_samples; ++sample_id) { const State &sample = samples[sample_id]; assert(utils::in_bounds(sample_id, samples_h_values)); int h_collection = samples_h_values[sample_id]; if (is_heuristic_improved( *pdb, sample, h_collection, *current_pdbs->get_pattern_databases(), pattern_cliques)) { ++count; } } if (count > improvement) { improvement = count; best_pdb_index = i; } if (count > 0) { utils::g_log << "pattern: " << candidate_pdbs[i]->get_pattern() << " - improvement: " << count << endl; } } return make_pair(improvement, best_pdb_index); } bool PatternCollectionGeneratorHillclimbing::is_heuristic_improved( const PatternDatabase &pdb, const State &sample, int h_collection, const PDBCollection &pdbs, const vector<PatternClique> &pattern_cliques) { const vector<int> &sample_data = sample.get_unpacked_values(); // h_pattern: h-value of the new pattern int h_pattern = pdb.get_value(sample_data); if (h_pattern == numeric_limits<int>::max()) { return true; } // h_collection: h-value of the current collection heuristic if (h_collection == numeric_limits<int>::max()) return false; vector<int> h_values; h_values.reserve(pdbs.size()); for (const shared_ptr<PatternDatabase> &p : pdbs) { int h = p->get_value(sample_data); if (h == numeric_limits<int>::max()) return false; h_values.push_back(h); } for (const PatternClique &clilque : pattern_cliques) { int h_clique = 0; for (PatternID pattern_id : clilque) { h_clique += h_values[pattern_id]; } if (h_pattern + h_clique > h_collection) { /* return true if a pattern clique is found for which the condition is met */ return true; } } return false; } void PatternCollectionGeneratorHillclimbing::hill_climbing( const TaskProxy &task_proxy) { hill_climbing_timer = new utils::CountdownTimer(max_time); utils::g_log << "Average operator cost: " << task_properties::get_average_operator_cost(task_proxy) << endl; const vector<vector<int>> relevant_neighbours = compute_relevant_neighbours(task_proxy); // Candidate patterns generated so far (used to avoid duplicates). set<Pattern> generated_patterns; // The PDBs for the patterns in generated_patterns that satisfy the size // limit to avoid recomputation. PDBCollection candidate_pdbs; // The maximum size over all PDBs in candidate_pdbs. int max_pdb_size = 0; for (const shared_ptr<PatternDatabase> &current_pdb : *(current_pdbs->get_pattern_databases())) { int new_max_pdb_size = generate_candidate_pdbs( task_proxy, relevant_neighbours, *current_pdb, generated_patterns, candidate_pdbs); max_pdb_size = max(max_pdb_size, new_max_pdb_size); } /* NOTE: The initial set of candidate patterns (in generated_patterns) is guaranteed to be "normalized" in the sense that there are no duplicates and patterns are sorted. */ utils::g_log << "Done calculating initial candidate PDBs" << endl; int num_iterations = 0; State initial_state = task_proxy.get_initial_state(); sampling::RandomWalkSampler sampler(task_proxy, *rng); vector<State> samples; vector<int> samples_h_values; try { while (true) { ++num_iterations; int init_h = current_pdbs->get_value(initial_state); utils::g_log << "current collection size is " << current_pdbs->get_size() << endl; utils::g_log << "current initial h value: "; if (current_pdbs->is_dead_end(initial_state)) { utils::g_log << "infinite => stopping hill climbing" << endl; break; } else { utils::g_log << init_h << endl; } samples.clear(); samples_h_values.clear(); sample_states(sampler, init_h, samples); for (const State &sample : samples) { samples_h_values.push_back(current_pdbs->get_value(sample)); } pair<int, int> improvement_and_index = find_best_improving_pdb(samples, samples_h_values, candidate_pdbs); int improvement = improvement_and_index.first; int best_pdb_index = improvement_and_index.second; if (improvement < min_improvement) { utils::g_log << "Improvement below threshold. Stop hill climbing." << endl; break; } // Add the best PDB to the CanonicalPDBsHeuristic. assert(best_pdb_index != -1); const shared_ptr<PatternDatabase> &best_pdb = candidate_pdbs[best_pdb_index]; const Pattern &best_pattern = best_pdb->get_pattern(); utils::g_log << "found a better pattern with improvement " << improvement << endl; utils::g_log << "pattern: " << best_pattern << endl; current_pdbs->add_pdb(best_pdb); // Generate candidate patterns and PDBs for next iteration. int new_max_pdb_size = generate_candidate_pdbs( task_proxy, relevant_neighbours, *best_pdb, generated_patterns, candidate_pdbs); max_pdb_size = max(max_pdb_size, new_max_pdb_size); // Remove the added PDB from candidate_pdbs. candidate_pdbs[best_pdb_index] = nullptr; utils::g_log << "Hill climbing time so far: " << hill_climbing_timer->get_elapsed_time() << endl; } } catch (HillClimbingTimeout &) { utils::g_log << "Time limit reached. Abort hill climbing." << endl; } utils::g_log << "Hill climbing iterations: " << num_iterations << endl; utils::g_log << "Hill climbing generated patterns: " << generated_patterns.size() << endl; utils::g_log << "Hill climbing rejected patterns: " << num_rejected << endl; utils::g_log << "Hill climbing maximum PDB size: " << max_pdb_size << endl; utils::g_log << "Hill climbing time: " << hill_climbing_timer->get_elapsed_time() << endl; delete hill_climbing_timer; hill_climbing_timer = nullptr; } PatternCollectionInformation PatternCollectionGeneratorHillclimbing::generate( const shared_ptr<AbstractTask> &task) { TaskProxy task_proxy(*task); utils::Timer timer; utils::g_log << "Generating patterns using the hill climbing generator..." << endl; // Generate initial collection: a pattern for each goal variable. PatternCollection initial_pattern_collection; for (FactProxy goal : task_proxy.get_goals()) { int goal_var_id = goal.get_variable().get_id(); initial_pattern_collection.emplace_back(1, goal_var_id); } current_pdbs = utils::make_unique_ptr<IncrementalCanonicalPDBs>( task_proxy, initial_pattern_collection); utils::g_log << "Done calculating initial pattern collection: " << timer << endl; State initial_state = task_proxy.get_initial_state(); if (!current_pdbs->is_dead_end(initial_state) && max_time > 0) { hill_climbing(task_proxy); } PatternCollectionInformation pci = current_pdbs->get_pattern_collection_information(); dump_pattern_collection_generation_statistics( "Hill climbing generator", timer(), pci); return pci; } void add_hillclimbing_options(OptionParser &parser) { parser.add_option<int>( "pdb_max_size", "maximal number of states per pattern database ", "2000000", Bounds("1", "infinity")); parser.add_option<int>( "collection_max_size", "maximal number of states in the pattern collection", "20000000", Bounds("1", "infinity")); parser.add_option<int>( "num_samples", "number of samples (random states) on which to evaluate each " "candidate pattern collection", "1000", Bounds("1", "infinity")); parser.add_option<int>( "min_improvement", "minimum number of samples on which a candidate pattern " "collection must improve on the current one to be considered " "as the next pattern collection ", "10", Bounds("1", "infinity")); parser.add_option<double>( "max_time", "maximum time in seconds for improving the initial pattern " "collection via hill climbing. If set to 0, no hill climbing " "is performed at all. Note that this limit only affects hill " "climbing. Use max_time_dominance_pruning to limit the time " "spent for pruning dominated patterns.", "infinity", Bounds("0.0", "infinity")); utils::add_rng_options(parser); } void check_hillclimbing_options( OptionParser &parser, const Options &opts) { if (opts.get<int>("min_improvement") > opts.get<int>("num_samples")) parser.error("minimum improvement must not be higher than number of " "samples"); } static shared_ptr<PatternCollectionGenerator> _parse(OptionParser &parser) { add_hillclimbing_options(parser); Options opts = parser.parse(); if (parser.help_mode()) return nullptr; check_hillclimbing_options(parser, opts); if (parser.dry_run()) return nullptr; return make_shared<PatternCollectionGeneratorHillclimbing>(opts); } static shared_ptr<Heuristic> _parse_ipdb(OptionParser &parser) { parser.document_synopsis( "iPDB", "This pattern generation method is an adaption of the algorithm " "described in the following paper:" + utils::format_conference_reference( {"<NAME>", "<NAME>", "<NAME>", "<NAME>", "<NAME>"}, "Domain-Independent Construction of Pattern Database Heuristics for" " Cost-Optimal Planning", "http://www.informatik.uni-freiburg.de/~ki/papers/haslum-etal-aaai07.pdf", "Proceedings of the 22nd AAAI Conference on Artificial" " Intelligence (AAAI 2007)", "1007-1012", "AAAI Press", "2007") + "For implementation notes, see:" + utils::format_conference_reference( {"<NAME>", "<NAME>", "<NAME>"}, "Efficient Implementation of Pattern Database Heuristics for" " Classical Planning", "https://ai.dmi.unibas.ch/papers/sievers-et-al-socs2012.pdf", "Proceedings of the Fifth Annual Symposium on Combinatorial" " Search (SoCS 2012)", "105-111", "AAAI Press", "2012")); parser.document_note( "Note", "The pattern collection created by the algorithm will always contain " "all patterns consisting of a single goal variable, even if this " "violates the pdb_max_size or collection_max_size limits."); parser.document_language_support("action costs", "supported"); parser.document_language_support("conditional effects", "not supported"); parser.document_language_support("axioms", "not supported"); parser.document_property("admissible", "yes"); parser.document_property("consistent", "yes"); parser.document_property("safe", "yes"); parser.document_property("preferred operators", "no"); parser.document_note( "Note", "This pattern generation method uses the canonical pattern collection " "heuristic."); parser.document_note( "Implementation Notes", "The following will very briefly describe the algorithm and explain " "the differences between the original implementation from 2007 and the " "new one in Fast Downward.\n\n" "The aim of the algorithm is to output a pattern collection for which " "the Evaluator#Canonical_PDB yields the best heuristic estimates.\n\n" "The algorithm is basically a local search (hill climbing) which " "searches the \"pattern neighbourhood\" (starting initially with a " "pattern for each goal variable) for improving the pattern collection. " "This is done as described in the section \"pattern construction as " "search\" in the paper, except for the corrected search " "neighbourhood discussed below. For evaluating the " "neighbourhood, the \"counting approximation\" as introduced in the " "paper was implemented. An important difference however consists in " "the fact that this implementation computes all pattern databases for " "each candidate pattern rather than using A* search to compute the " "heuristic values only for the sample states for each pattern.\n\n" "Also the logic for sampling the search space differs a bit from the " "original implementation. The original implementation uses a random " "walk of a length which is binomially distributed with the mean at the " "estimated solution depth (estimation is done with the current pattern " "collection heuristic). In the Fast Downward implementation, also a " "random walk is used, where the length is the estimation of the number " "of solution steps, which is calculated by dividing the current " "heuristic estimate for the initial state by the average operator " "costs of the planning task (calculated only once and not updated " "during sampling!) to take non-unit cost problems into account. This " "yields a random walk of an expected lenght of np = 2 * estimated " "number of solution steps. If the random walk gets stuck, it is being " "restarted from the initial state, exactly as described in the " "original paper.\n\n" "The section \"avoiding redundant evaluations\" describes how the " "search neighbourhood of patterns can be restricted to variables that " "are relevant to the variables already included in the pattern by " "analyzing causal graphs. There is a mistake in the paper that leads " "to some relevant neighbouring patterns being ignored. See the [errata " "https://ai.dmi.unibas.ch/research/publications.html] for details. This " "mistake has been addressed in this implementation. " "The second approach described in the paper (statistical confidence " "interval) is not applicable to this implementation, as it doesn't use " "A* search but constructs the entire pattern databases for all " "candidate patterns anyway.\n" "The search is ended if there is no more improvement (or the " "improvement is smaller than the minimal improvement which can be set " "as an option), however there is no limit of iterations of the local " "search. This is similar to the techniques used in the original " "implementation as described in the paper.", true); add_hillclimbing_options(parser); /* Add, possibly among others, the options for dominance pruning. Note that using dominance pruning during hill climbing could lead to fewer discovered patterns and pattern collections. A dominated pattern (or pattern collection) might no longer be dominated after more patterns are added. We thus only use dominance pruning on the resulting collection. */ add_canonical_pdbs_options_to_parser(parser); Heuristic::add_options_to_parser(parser); Options opts = parser.parse(); if (parser.help_mode()) return nullptr; check_hillclimbing_options(parser, opts); if (parser.dry_run()) return nullptr; shared_ptr<PatternCollectionGeneratorHillclimbing> pgh = make_shared<PatternCollectionGeneratorHillclimbing>(opts); Options heuristic_opts; heuristic_opts.set<shared_ptr<AbstractTask>>( "transform", opts.get<shared_ptr<AbstractTask>>("transform")); heuristic_opts.set<bool>( "cache_estimates", opts.get<bool>("cache_estimates")); heuristic_opts.set<shared_ptr<PatternCollectionGenerator>>( "patterns", pgh); heuristic_opts.set<double>( "max_time_dominance_pruning", opts.get<double>("max_time_dominance_pruning")); return make_shared<CanonicalPDBsHeuristic>(heuristic_opts); } static Plugin<Evaluator> _plugin_ipdb("ipdb", _parse_ipdb, "heuristics_pdb"); static Plugin<PatternCollectionGenerator> _plugin("hillclimbing", _parse); }
Two-photon exchange and polarization physics in electron-proton scattering We discuss effects of two-photon exchange (TPE) in various observables of the elastic ep-scattering. The imaginary part of the TPE amplitude manifests in target and beam normal spin asymmetries. The real part contributes to the cross-section. A model-independent phenomenological analysis of experimental data is performed. Its results are compared with theoretical calculations.
/////////////////////////////////////////////////////////////////////////////// // Copyright (C) Microsoft Corporation, 2000. // // pshdrval.hpp // // Direct3D Reference Device - PixelShader validation // /////////////////////////////////////////////////////////////////////////////// #ifndef __PSHDRVAL_HPP__ #define __PSHDRVAL_HPP__ #define PS_INST_TOKEN_RESERVED_MASK 0xbfff0000 // bits 16-23, 24-29, 31 must be 0 #define PS_DSTPARAM_TOKEN_RESERVED_MASK 0x4000e000 // bits 13-15, 30 must be 0 #define PS_SRCPARAM_TOKEN_RESERVED_MASK 0x4000e000 // bits 13-15, 30 must be 0 //----------------------------------------------------------------------------- // CPSInstruction //----------------------------------------------------------------------------- class CPSInstruction : public CBaseInstruction { public: CPSInstruction(CPSInstruction* pPrevInst) : CBaseInstruction(pPrevInst) { m_bTexOp = FALSE; m_bTexMOp = FALSE; m_bTexOpThatReadsTexture = FALSE; m_bCoIssue = FALSE; m_CycleNum = (UINT)-1; }; void CalculateComponentReadMasks(DWORD dwVersion); BOOL m_bTexOp; BOOL m_bTexMOp; BOOL m_bTexOpThatReadsTexture; BOOL m_bCoIssue; UINT m_CycleNum; // identical for co-issued instructions }; //----------------------------------------------------------------------------- // CBasePShaderValidator //----------------------------------------------------------------------------- class CBasePShaderValidator : public CBaseShaderValidator { protected: UINT m_CycleNum; UINT m_TexOpCount; UINT m_BlendOpCount; UINT m_TotalOpCount; // not necessarily the sum of TexOpCount and BlendOpCount.... CRegisterFile* m_pTempRegFile; CRegisterFile* m_pInputRegFile; CRegisterFile* m_pConstRegFile; CRegisterFile* m_pTextureRegFile; CBaseInstruction* AllocateNewInstruction(CBaseInstruction*pPrevInst); BOOL DecodeNextInstruction(); virtual BOOL InitValidation() = 0; virtual BOOL ApplyPerInstructionRules() = 0; virtual void ApplyPostInstructionsRules() = 0; virtual void IsCurrInstTexOp() = 0; public: CBasePShaderValidator( const DWORD* pCode, const D3DCAPS8* pCaps, DWORD Flags ); ~CBasePShaderValidator(); }; //----------------------------------------------------------------------------- // CPShaderValidator10 //----------------------------------------------------------------------------- class CPShaderValidator10 : public CBasePShaderValidator { private: UINT m_TexOpCount; UINT m_BlendOpCount; UINT m_TotalOpCount; // not necessarily the sum of TexOpCount and BlendOpCount.... UINT m_TexMBaseDstReg; BOOL ApplyPerInstructionRules(); void ApplyPostInstructionsRules(); void IsCurrInstTexOp(); BOOL InitValidation(); BOOL Rule_InstructionRecognized(); BOOL Rule_InstructionSupportedByVersion(); BOOL Rule_ValidParamCount(); BOOL Rule_ValidSrcParams(); BOOL Rule_NegateAfterSat(); BOOL Rule_SatBeforeBiasOrComplement(); BOOL Rule_MultipleDependentTextureReads(); BOOL Rule_SrcNoLongerAvailable(); BOOL Rule_SrcInitialized(); BOOL Rule_ValidDstParam(); BOOL Rule_ValidRegisterPortUsage(); BOOL Rule_TexRegsDeclaredInOrder(); BOOL Rule_TexOpAfterNonTexOp(); BOOL Rule_ValidTEXM3xSequence(); // Call per instruction AND after all instructions seen BOOL Rule_ValidTEXM3xRegisterNumbers(); BOOL Rule_ValidCNDInstruction(); BOOL Rule_ValidCMPInstruction(); BOOL Rule_ValidLRPInstruction(); BOOL Rule_ValidDEFInstruction(); BOOL Rule_ValidDP3Instruction(); BOOL Rule_ValidDP4Instruction(); BOOL Rule_ValidInstructionPairing(); BOOL Rule_ValidInstructionCount(); // Call per instruction AND after all instructions seen BOOL Rule_R0Written(); // Call after all instructions seen. public: CPShaderValidator10( const DWORD* pCode, const D3DCAPS8* pCaps, DWORD Flags ); }; //----------------------------------------------------------------------------- // CPShaderValidator14 //----------------------------------------------------------------------------- class CPShaderValidator14 : public CBasePShaderValidator { private: UINT m_BlendOpCount; int m_Phase; // 1 == dependent read setup block, 2 == second pass BOOL m_bPhaseMarkerInShader; // shader is preprocessed to set this bool CPSInstruction* m_pPhaseMarkerInst; // only set at the moment marker is encountered in shader DWORD m_TempRegsWithZappedAlpha; // bitmask of temp regs for which alpha was zapped // (initialized->uninitialized) after the phase marker DWORD m_TempRegsWithZappedBlue; // bitmask of temp regs for which blue was zapped // (initialized->uninitialized) due to texcrd with .rg writemask BOOL ApplyPerInstructionRules(); void ApplyPostInstructionsRules(); void IsCurrInstTexOp(); BOOL InitValidation(); BOOL Rule_InstructionRecognized(); BOOL Rule_InstructionSupportedByVersion(); BOOL Rule_ValidParamCount(); BOOL Rule_ValidSrcParams(); BOOL Rule_LimitedUseOfProjModifier(); BOOL Rule_MultipleDependentTextureReads(); BOOL Rule_SrcInitialized(); BOOL Rule_ValidMarker(); BOOL Rule_ValidDstParam(); BOOL Rule_ValidRegisterPortUsage(); BOOL Rule_ValidTexOpStageAndRegisterUsage(); BOOL Rule_TexOpAfterArithmeticOp(); BOOL Rule_ValidTEXDEPTHInstruction(); BOOL Rule_ValidTEXKILLInstruction(); BOOL Rule_ValidBEMInstruction(); BOOL Rule_ValidDEFInstruction(); BOOL Rule_ValidInstructionPairing(); BOOL Rule_ValidInstructionCount(); // Call per instruction AND after all instructions seen BOOL Rule_R0Written(); // Call after all instructions seen. public: CPShaderValidator14( const DWORD* pCode, const D3DCAPS8* pCaps, DWORD Flags ); }; #endif __PSHDRVAL_HPP__
This invention relates in general to digital signal processing and in particular to generating an auxiliary symbol in place of a decision symbol for adjusting a QAM demodulator as a part of a receiver in which the decision-feedback loops are not yet synchronized. Decision-feedback loops utilized in quadrature amplitude modulation (QAM) receivers typically need to be quickly brought into synchronization or “lock” when digital signals locked to a quadrature signal pair are received. Such loops are used, for example, for the adjustment of sampling instants, for the adjustment of an equalizer that removes linear distortion during the reception of the quadrature signal pair, or in an automatic gain control circuit to adapt the received signals to the dynamic range. In encoded form, these digital signals, which may also be referred to as symbols, may represent a single-bit or multiple-bit binary value. Encoding for transmission may be accomplished via the quadrature signal pair, which corresponds to a vector that at given instants of time takes up discrete positions in the amplitude and phase space of the quadrature signal pair. These instants of time typically follow each other at equal intervals and generally are sampled by the sampling clock pulses as precisely as possible. Besides QAM, another typical transmission method is phase-shift keying (PSK). In a conventional receiver for receiving digital signals, a complex multiplier or mixer, which may be controlled by a local oscillator, may downconvert the received QAM signal, which may be modulated onto a carrier frequency for transmission, to the baseband frequency. If digital signal processing is used, this downconversion can take place prior to or after analog-to-digital conversion, with the signal advantageously being sampled and digitized at the symbol rate or a multiple thereof. If the digitization rate is an even-numbered multiple of the symbol rate, each of the symbol clock pulses typically coincides with a sample value. The digitization rate may advantageously be locked to the recovered symbol rate via a phase-locked loop. Instead, if the digitization rate is free running in relation to the symbol rate, the symbol may be formed as time information via an all-digital sample-rate conversion. In this manner, a temporal interpolation between the digitized sample values of the received digital signal may be controlled. Automatic gain control circuits help to achieve a relatively high utilization of the respective dynamic range and to map the received symbols onto the symbol decision stage. An adaptive equalizer typically reduces intersymbol interference, which may result from linear distortion caused by the transmitter, the transmission path, or the receiver. In prior art demodulators for QAM or PSK signals, the circuits for controlling the frequency and phase of the local oscillator (e.g., the automatic gain control, the symbol clock recovery, and the adaptive equalizer) typically look at the differences between the received symbol and that element of the predetermined symbol alphabet which may be regarded by a decision stage as the most probable symbol that matches the received symbol. This type of control over the decision symbol is usually referred to as decision-feedback control. Since in prior-art digital demodulators the decision-feedback loops are coupled together, bringing these loops into a synchronization or lock condition may be difficult to achieve in a relatively rapid timeframe as long as the control for the carrier of the local oscillator is not yet stable in frequency and phase. Frequently, the synchronization or lock condition of the decision-feedback loops can be achieved if the respective frequencies and phases are relatively close to their desired values. Examples of decision-feedback loops are found in a book by K. D. Kammeyer, “Nachrichtenübertragung”, published by B. G. Teubner, Stuttgart, 2nd edition, 1996, pages 429 to 433, in Chapter 5.7.3, “Adaptiver Entzerrer mit quantisierter Rückführung”, pages 200 to 202, in Chapter 5.8.3, “Entscheidungsrückgekoppelte Taktregelung”, pages 213 to 215, and in Chapter 12.2.2, “Entscheidungsrückgekoppelte Trägerphasenregelung im Basisband”, pages 429 to 431. What is needed is a QAM demodulator that utilizes a relatively more reliable auxiliary symbol instead of a relatively less reliable decision symbol to adjust the decision-feedback loops within the demodulator.
<reponame>bireports/nextreports-server /* * 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 ro.nextreports.server.search; import ro.nextreports.server.dao.StorageDao; import ro.nextreports.server.domain.Entity; import ro.nextreports.server.domain.Report; import ro.nextreports.server.service.StorageService; /** * Created by IntelliJ IDEA. * User: mihai.panaitescu * Date: May 7, 2008 * Time: 11:02:31 AM */ public class DescriptionSearchCondition extends SearchCondition { private DescriptionSearchEntry searchEntry; public DescriptionSearchCondition(StorageDao storageDao, DescriptionSearchEntry searchEntry) { set(storageDao); this.searchEntry = searchEntry; } @Override public int getStatus(StorageService storageService, Entity entity) { Report report; if (entity instanceof Report) { report = (Report)entity; } else { return INVALID; } boolean foundByDescription = false; String entityDesc = report.getDescription(); if (entityDesc == null) { return FALSE; } String searchDesc = searchEntry.getDescription(); if (searchEntry.isIgnoredCase()) { entityDesc = entityDesc.toLowerCase(); if (searchDesc != null) { searchDesc = searchDesc.toLowerCase(); } } if (searchDesc != null) { if ((entityDesc != null) && entityDesc.contains(searchDesc)) { foundByDescription = true; } } return foundByDescription ? TRUE : FALSE; } }
Hip Anatomy and Ontogeny of Lower Limb Musculature in Three Species of Nonhuman Primates The hip region is examined to determine what aspects of musculoskeletal anatomy are precociously developed in primate species with highly specialized modes of locomotion. Muscles of the hind limb were removed and weighed in each specimen, and the hip joint of selected specimens was studied in stained serial sections. No perinatal differences among species are evident, but in adults, the hip joint of Galago moholi (a leaping specialist) appears to have proportionally thick articular cartilage (relative to the subchondral plate) compared to two species of cheirogaleids. Muscle mass distribution in the hind limbs confirms previous observations that the quadriceps femoris muscle is especially large in Galago (in percent mass of the entire hind limb), while the hip region is smaller compared to the more quadrupedal cheirogaleids. Across age groups, the species with the least specialized locomotion as adults, Cheirogaleus medius, shows little or no change in proximal to distal percentage distribution of muscle mass. Galago has a larger percentage mass gain in the thigh. We suggest that muscle mass gain to specific limb segments may be a critical milestone for primates with extremely specialized modes of locomotion. Introduction The hip region of primates varies considerably in morphology and relative dimensions, and previous investigations have identified correlates to positional and locomotor behaviors (and see Anemone, 1993 for review). Musculoskeletal specializations differentiate primates that employ certain locomotor patterns, such as vertical clinging and leaping, from other primates. For example, leaping specialists (such as indriids, tarsioids, lepilemurids, and some galagids) have a more proximally positioned lesser and third trochanters. These primates also have relatively large muscle compartments for hip extensors, knee extensors, or ankle plantarflexors, an adaptation related to emphasis on hind limb propulsion via leaping. In comparing leaping versus quadrupedal primates, certain aspects of the anatomy of the hip have received relatively little scrutiny. Joint microanatomy in primates has received little attention (but see Dewire and Simkin, 1996 ). We are aware of no microanatomical studies of articular cartilage (AC) on strepsirrhine taxa. Ossification patterns of joints are well studied in haplorhines, but strepsirrhines are understudied by comparison. Generally, development of the hip has received far less attention than other anatomical regions. Muscular anatomy of the limbs has been well studied but rarely regarding ontogeny. Recently, we investigated the ontogeny of muscle mass distribution in the hind limb of primates that use primarily leaping modes of locomotion versus arboreal or terrestrial quadrupedalism. Again, in this study, less emphasis was placed on the hip due to difficulty in dissecting the region in the smallest infants. In the present study, we expand the scope of a previous investigation from our laboratory. Musculoskeletal structure of the hip region is studied in sample of perinatal and adult strepsirrhine primates that differ in locomotor behaviors. Specifically, distribution of muscle mass in the hip and other segments, as well as microanatomy of the hip joint, are studied in arboreal quadrupeds and a leaping specialist. These data are examined to determine what aspects of musculoskeletal anatomy are precociously developed in primate species with highly specialized modes of locomotion. Sample and Species Characteristics. The sample included eight Galago moholi (4 adult, 4 perinatal), nine Cheirogaleus medius (4 adult, 5 perinatal), and nine Microcebus murinus (6 adult, 3 perinatal). Muscle mass data described in this study incorporate some previously published data. Two of the adult and three perinatal C. medius were previously measured and combined with newly measured specimens (2 adult, 2 perinatal) to achieve a larger sampling of the species. All muscle mass data on M. murinus were previously published, and are graphically compared to the other species. The species under study were selected based on their contrasting locomotor patterns, as described by Walker. The southern lesser bushbaby (G. moholi) uses vertical clinging and leaping patterns of locomotion and uses upright locomotion on terrestrial substrates. Although some galagids employ more quadrupedal behaviors than others, G. moholi resembles G. senegalensis in its heavy reliance on leaping behaviors and vertical posture. The fat-tailed dwarf lemur (C. medius) and gray mouse lemur (M. murinus) use arboreal quadrupedalism for locomotion. However, M. murinus is described to employ the most leaping behaviors among the cheirogaleids. In addition to behavioral differences, a comparison of the differences in their development may help with interpretation of our findings. Based on behavioral and life-history observations, G. moholi and the cheirogaleids studied here have key differences in ontogeny. Some similarities do exist. In all species, infants are described to perfect their locomotor behaviors over the course of months. Infant C. medius are cached in nests for about two weeks, except when carried orally. G. moholi (and G. senegalensis) similarly show a preference to stay in the nest box for 1-2 weeks but are described to be very active. Some milestones, such as weaning, are achieved earlier in the cheirogaleids than G. moholi (and also compared to G. senegalensis). During infancy, the comparison seems more starkly different. For example, newborn M. murinus are described as more altricial than G. moholi (e.g., the former born with eyes closed, the latter, eyes open). G. moholi may be more precocious in development of its locomotor specialty. Doyle asserts captive infants of this species are extremely active in the nest and can make small jumps within 10 days although they continue to become stronger leapers during the first 2 months. In contrast, M. murinus exhibits leaping behaviors after about 3 weeks, and the first movements by C. medius are described as similar to adults but clumsy (see review of cheirogaleid locomotor ontogeny by Atzeva et al. ). A study of captive C. medius noted "jumping and running" by postnatal days 27 to 30, and all adult locomotor behaviors were seen by day 40. Based on these descriptions, we assume that cheirogaleids are somewhat less precocious than G. moholi in the development of locomotor behavior. These present study, in part, assesses whether hind limb musculoskeletal characteristics differ based on preciousness. Investigative Methods. All specimens were acquired as cadaveric remains from the Duke Lemur Center, except one perinatal Galago cadaver (courtesy of L. Martin). All specimens died of natural causes and most were immersed in formalin or frozen and then immersed in formalin. One perinatal G. moholi was fixed in 70% ethanol. The captive primates were maintained in a seminatural environment that allowed the use of their preferred pattern of locomotion without restriction. All specimens were available as a result of natural deaths in captivity. Perinatal and older infant cadavers were stillborn or postnatal deaths from 0 to 15 days postnatal age. No grossly obvious pathologies, such as limb or limb joint deformities, were found among perinatal specimens. The same protocol was used for the dissection and weighing of all specimens. Dissection protocol included removal of skin and connective tissue to expose underlying limb musculature. Infants were dissected with the aid of a dissecting microscope. Once the underlying musculature was revealed, muscles were identified and removed. After removal, muscles were grouped according to function and were weighed by a single investigator. Weights were obtained for the following functional groups: hip extensors, hip adductors, hamstrings, quadriceps, superficial ankle flexor, deep ankle flexors, hip external rotators, anterior compartment of the leg, and the lateral compartment of the leg (Table 1). Muscles responsible for several movements were weighed individually (e.g., sartorius). Certain muscle groups (such as the external rotators) were too small to reliably dissect in some infants. This prevented certain analyses, such as functional groupings of hip muscles in infants. Intrinsic muscles of the hands and feet were difficult to remove and were excluded from the data. Some individual muscles in infants were found to have a mass near the 0.001 level of accuracy. In these cases, the entire functional muscle compartments were removed and weighed as a unit weighed as a unit. All muscles were removed from bone and connective tissue and blotted dry with paper towel prior to weighing. Muscle masses were obtained with a Mettler AJ100 scale and were recorded to the nearest 0.001 g for infants and to the nearest 0.01 g for the adult specimens. Muscles/muscle groups were weighed twice and the average of the two recordings was used. In cases of measurement discrepancy exceeding 10%, a third measurement was taken and the outlier thrown out. The present study employs relatively small samples. However, this sample is larger than previous studies on hind limb muscle masses in prosimian species and allows nonparametric statistical tests. Since the infant samples were ) were compared regarding the percentage of muscle mass for hind limb propulsion, including hip extensors, knee extensors, and ankle plantarflexors. Data were compared between groups using a Kruskal-Wallis oneway analysis of variance test. Differences between species were then assessed using a Mann Whitney U-Test. Statistical significance was determined using a sequential Bonferroni correction. We regarded each muscle group and an independent series of tests, with three post hoc tests to determine which pairs were different. With our threshold at P ≤.05, the pair with the lowest P value in the Mann Whitney U-Test was considered significant at P ≤.017, followed by P ≤.025 and P ≤.05. Joint histology was studied in a subset of this sample. Hip joint tissues were extracted in all adults except two dwarf lemurs (which are now part of the collection of the Carnegie Museum, Section of Mammals). One perinatal specimen of each species was used to establish degree of ossification at the hip joint. In addition, a single perinatal Galagoides demidoff was available for study to broaden the comparative perspective. Following muscle dissection, the hip joint was removed by cutting across the iliac blade, through the pubic symphysis, and across the surgical neck of the femur. The hip joint was decalcified using a sodium citrate-formic acid solution (duration: approximately two weeks for infants; approximately one and a half months for adults). Following decalcification, joints were briefly returned to 10% buffered formalin and processed by graded dehydration, clearing in xylene, and paraffin embedding. During paraffin embedding, joints were positioned in the embedding tray so that the femur would be sectioned, as nearly as possible, in the frontal plane. The hip joints were then serially sectioned at 10 to 12 m using a Leica rotary microtome, and every tenth section was stained with hematoxylin-eosin for general structural examination. Selected sections were stained using two procedures to identify connective tissues, Gomori trichrome and Picro-Ponceau. Using either of these procedures, highly collagenous tissues (such as bone) are more densely stained than cartilage, thus allowing identification of the boundary between the subchondral bone and AC. These preparations were used for a preliminary analysis of AC thickness in the adult primates. Sections that appeared to be in the midlevel through the femoral head were photographed at 25 to 50 using a Leica DMLB photomicroscope with a DKC-5000 Catseye Digital Still Camera System (Sony Electronics Inc., Montvale, NJ, USA). Images were then opened using ImageJ 1.43 (NIH). For measuring AC thickness, the joint surface was measured at different locations. This was undertaken because all parts of AC do not exist in an identical biomechanical regimen, and no single locus can be assumed to reflect average AC thickness. Our method loosely follows Mork et al. who assessed the cartilage of the temporomandibular joint in three zones. Since our measurements were based on subchondral bony landmarks, we could not use identical positions with these regions (e.g., specific positions along arc length), because trabecular attachments obscure the deepest extent of subchondral bone. Using the 25 micrographs, the joint surfaces were examined by microscopy to locate superior, middle, and inferior thirds. Then, higher magnification (50) images of each third were photographed. Measurements were taken near the center of each region, avoiding loci where trabeculae interfaced with the subchondral bone. In each third, two measurements were taken, each along a line that measured the depth from the hip joint cavity to the marrow cavity of the femur. First, the image was calibrated in pixel dimensions to a stage micrometer that was photographed at 50. Then, the distance from the surface of the AC (facing the joint cavity) to the deepest extent of the subchondral plate (facing the marrow cavity) was measured. Next, following the same line, the distance from the joint surface to the interface of the AC and subchondral plate was measured. By subtracting these two dimensions, subchondral plate thickness was computed. detail, since almost no novel aspects could be observed. The hip musculature of G. moholi showed no notable departure from the description of hip musculature of G. senegalensis by Stevens et al.. In the cheirogaleids, hip musculature closely resembled previous descriptions of M. murinus and C. major by Jouffroy. However, it is noted that the gluteus superficialis posterior is more complex in the M. murinus specimens than noted in previous reports or compared to C. medius. After superficial muscles are resected (Figures 1(a) and 1(b)), and the caudofemoralis and femorococcygeus is removed from their origin point (Figure 1(c)), a smaller muscle is visible in most of our M. murinus specimens, running in parallel to the femorococcygeus (Figures 1(c)-1(g)). The muscle is differentiated from the femorococcygeus in all but one of the M. murinus. This small muscle has an ischial origin and insertion to the femoral shaft (Figure 1(c)) as seen in the femorococcygeus, but it has a deeper, more distal origin and a more proximal insertion. Musculature and Muscle Mass The relative distribution of all hind limb musculature in adult samples is shown in Figures 2 to 4 (graphs in Figures 3 and 4 are modeled after Demes et al. ). Data on the two species dissected for this study are compared to findings on M. murinus (source: Atzeva et al. ). For the lower limb, excluding the intrinsic foot muscles, most muscle mass comprises thigh musculature in all species (Figure 2). The thigh muscle mass is proportionally greatest in G. moholi (74%) and least in C. medius (50%). In the cheirogaleids, muscle masses of the leg and hip are similar (close to 25%), whereas G. moholi has a notably small percentage (11%) distributed to the hip. When considered as functional groups according to joint motion (Figure 3) or functional groups within each segment (Figure 4), cheirogaleids and G. moholi show differing organization of mass. Overall, the muscles involved in propulsion comprise 71% of hind limb muscle mass in Galago compared to 62% in Microcebus and 55% in Cheirogaleus (Figure 3). Both cheirogaleids possess a proportionately large percentage of hip extensor muscle mass compared to the G. moholi. In the latter, knee extensors are by far the largest percentage mass for hind limb propulsion ( Figure 3). Kruskal-Wallis one-way analysis of variance tests revealed significant (P <.05) differences among the three species for percentage hip extensors, percentage knee extensors, and percentage ankle plantarflexors ( Table 2). Mann-Whitney U-tests revealed that there are significant (lowest threshold at P <.017, following sequential Bonferroni corrections) intragroup differences in percentage hip flexors (Galago < Microcebus), knee extensors (Microcebus < Galago), and ankle plantarflexors (Galago < Microcebus). In Figure 4, hamstrings are excluded from the hip extensor mass, thus emphasizing the gluteal extensors (gluteus superficialis posterior, gluteus medius, and gluteus minimus). In all three species, gluteal extensors represent the least percentage mass for limb propulsion, but they are especially minimal in G. moholi. Across ages, all three species show a relative shift in muscle mass toward the thigh, that is, the thigh increases to a greater extent than other segments ( Figure 5). This mass shift is more pronounced in G. moholi (with a 7% increase from perinatal to adult) and M. murinus (9% increase) than in C. medius (4% increase). Since iliopsoas could not be measured in perinatal specimens of M. murinus the percentage comparisons in Figure 5 should be viewed with some caution. A more complete comparison of age changes in muscle mass distribution is possible between C. medius and G. moholi, in which only hip external rotators are excluded from percentage calculations ( Figure 6). When iliopsoas is included, C. medius appears to change very little in mass distribution from perinatal to adult samples; a percentage mass shift to the thigh is not detected at all. In G. moholi, the percentage mass shift to the thigh appears slightly greater (8%), and there is a proportional decrease in leg muscle mass (6%). Joint Microanatomy and Ossification Centers. Articular cartilage thickness appears to differ more between the acetabulum and femur in C. medius (Figures 7(a) and 7(b)) compared to M. murinus (Figure 7(c)). Thickness of the AC appears proportionally greater in G. moholi (Figure 8) compared to cheirogaleids. Analysis of AC thickness supports these qualitative observations. These quantitative results should be regarded as preliminary since only one of the two C. medius and three of the four G. moholi were suitable for measurements Figure 3: Distribution of hind limb musculature in three species of primates at adult age. Percentage mass of functional groups is indicated (i.e., hamstring mm included with hip extensors). Graphs based on mean muscle mass presented in Table 1 (the others had indistinct deep or superficial limits of the AC). In G. moholi, average AC thickness of the acetabulum is more than 2-fold greater than that of the femoral head (Table 3). A similar, though less pronounced disparity, is observed in C. medius. In M. murinus, this relationship is not observed; average femoral AC thickness is slightly greater than that for the acetabulum ( Table 3). Thickness of the subchondral plate follows the same trend among species (Table 3). However, ratios of AC thickness/subchondral plate thickness are highest for both joints in G. moholi compared to the cheirogaleids ( Table 3). Sections of selected perinatal hip joints suggest no appreciable differences among species (Figures 9 and 10). In all cases the secondary ossifications center at the proximal femur is cartilaginous (Figures 9(a)-9(c) and 10(c)-10(e)). The os coxae show ossification in all species. Cartilage closely adjacent to the joint remains largely unossified (Figures 9, 10(a), 10(b), 10(d), and 10(e)). But primary ossification centers such as the iliac blade are well ossified (Figure 10(a)). Gross Anatomy of the Hip. Gross organization of hip musculature has been well described previously. The gross descriptions of muscular anatomy offer little additional insight to previous descriptions, except for a possible accessory muscle. As the muscle lies on the extensor side of the hip joint, this might best be considered a deep head of the femorococcygeus. The remainder of this discussion will be devoted to more novel results. Microanatomy of the Hip Joint. Although joint morphology has been subject to great scrutiny by students of primate anatomy (e.g., ), few studies have considered joint microstructure. The relatively recent increase in availability of high-resolution, nondestructive methods, such a computed tomography, seems to make the topic of great potential interest. The thickness of the subchondral plate in primates was studied using computed tomography by. Use of this statistical correction was extensively discussed by Cabin and Mitchell. They noted that failure to use this correction inflates Type I errors (falsely rejecting the null hypothesis), while "overzealous use" of this correction inflates Type II errors (falsely accepting the null hypothesis. One possible approach would be to pool all post hoc tests for correction, in which case the range of corrected P values is.006 to.05. In this case, none of the pairs are significantly different, but the likelihood of Type II errors appears markedly increased. We applied the sequential Bonferroni correction separately for the three Mann Whitney U-tests that followed each Kruskal-Wallis test. Dewire and Simkin. These authors found little variation in the thickness of the subchondral plate in the femur but significant variation in subchondral plate thickness of the acetabulum (increased thickness with increased body size among primates). An unknown in their study, unavailable using computed tomography, is the thickness of AC across primates. Micro-MRI, currently of great promise for studying osteoarthritis, may provide a viable avenue for studying AC in cadaveric primates. The destructive methods used to study AC in this study are admittedly an undesirable means to produce large samples of nonhuman primates for quantitative analyses. As a result, our sample is too small for a quantitative analysis. At present, however, no other method allows the same resolution to describe AC in minute detail. Thus our preliminary observations may provide insight for future studies. In two of the species (C. medius and G. moholi), the AC thickness of the acetabulum was thicker than that of the femur, which could reflect development of concave and convex surfaces under different stress histories. This relationship was not apparent in M. murinus, however. A difference observed between cheirogaleids and G. moholi was the greater thickness of AC in the latter. Paraffin sectioning can produce distortions that might alter the apparent thickness of tissues. For example, slight deviations in cutting plane could hypothetically make AC appear thicker from surface to subchondral plate if sectioning is not at a right angle to the subchondral plate. While consistent cutting planes can be hard to achieve with paraffin blocks, there is a strong basis for an assertion that the results reflect true species differences. First, the range of AC thickness of G. moholi specimens exceeded that of the other two species; in the case of the acetabular AC, there is no overlap with the other species (Table 3). Secondly, the AC/subchondral plate thickness ratios are highest in G. moholi. Thus, the greater thickness of the AC is proportional to the subchondral plate. Presumably, planar distortion would affect not just the AC, but the subchondral plate as well. Variations in articular cartilage thickness have been related to body weight in humans, where it has been suggested larger individuals have thicker AC in lower limb joints, and some scaling of AC thickness to body mass could be inferred by comparing M. murinus to the other species. AC thickness has also been related to anisotropic properties of the tissue, based on its tendency to grow based on region-specific response to the magnitude of hydrostatic pressure due to compressive loading. That species differences relate only to body size seems unlikely since G. moholi is not greatly larger than C. medius. Thus, species differences may also relate to the contrasting locomotory behavior of cheirogaleids compared to Galago. At the present time, a broad perspective on primate AC is lacking, due to the lack of similar studies. An analysis of a larger taxonomic sample of primates, optimally with nondestructive methods, is needed to establish diversity in joint microanatomy as well as functional correlates. Distribution of Muscle Mass. These findings also provide an update on results presented by Atzeva et al.. That study focused on ontogenetic changes in limb muscle mass distribution in cheirogaleids and other primates, with a limited discussion of hip musculature, since it could not be reliably dissected in perinatal specimens. By including the hip muscle mass in the present study, a clearer view of the entire limb muscle mass distribution is provided here. The results of the present study confirm certain previous findings on muscular specializations of prosimian primates, for example, the well-developed thigh muscle mass in adult lesser galagos. In this regard, our findings on G. moholi are similar to those by Demes et al. for G. senegalensis and provide statistical support for the observation that the quadriceps femoris is the dominant musculature group for leaping specialists (vertical clinger and leaper especially). In cheirogaleids, there is a greater balance of mass between musculature associated with propulsion (hip and knee extensors and ankle plantarflexors) and "other" muscles ( Figures 3 and 4), as seen in the quadrupedal Varecia variegata. There are subtle differences between the cheirogaleids; it is unclear if these are functionally significant. However, it may be noteworthy that the species' locomotor behavior is not described identically. M. murinus is described to employ leaping behaviors with great frequency, whereas C. medius has a generalized arboreal quadrupedal style of locomotion. Locomotor Behavior and Musculoskeletal Ontogeny. Infant primates are not immediately adept at locomotion, perhaps especially those with highly specialized modes. At least, some leaping specialists are known to undergo postnatal proportional changes in the limbs and trunk. Thus maturation of the skeletal system among species is of interest. Watts argued that ossification sequences in the limbs are similar in many hominoids, New World monkeys, and prosimians (a term used here as a grade of primates). If true, the results on degree of ossification of the hip are unsurprising. Despite the different locomotor tendencies between cheirogaleids and galagids, and some locomotor differences within these families, all perinatal specimens were similar in the extent of ossification at the hip. Further work seems important. Very few prosimians have been studied regarding early skeletal maturation. In addition, our focus on the hip leaves unknown whether more distal joints vary in extent of ossification. Our sample provides more detailed information on ontogeny of hind limb muscle mass. Previously, Atzeva et al. observed that among five species of prosimian primates, the ratio of total hind limb muscle mass/body mass is smaller in infants than in adults, suggesting primates are relatively poorly muscled at birth. The findings in this study support this observation. If external hip rotators are excluded (since these were not measured in all cases) the total hind limb muscle mass/body mass ratio in C. medius is 0.04 for adults and 0.01 for infants. In G. moholi, the ratio is 0.06 for adults and 0.02 for infants. The ratio in infants could actually be inflated, since one of the G. moholi specimens was two weeks old. If this represents a broad characteristic of primates, it suggests that one advantage for the relatively long dependency of infant primates is for hind limb muscular gain. Our data on ontogenetic changes in relative muscle mass are based on a slightly larger sample than a previous report, allowing some additional interpretation. The increased sample of C. medius yielded a larger overall hind limb muscle mass for adults (5.95 g) and a smaller overall hind limb muscle mass for infants (0.01 g). Correspondingly, the adult/infant muscle group ratios is higher in this study ( Table 1, see columns 3, 6) compared to those of Atzeva et al. and is higher than the ratios for G. moholi for all muscle groups. This indicates a greater postnatal muscle mass gain in C. medius. This may be interpreted to indicate that a greater degree of altriciality is associated with relatively less muscle mass at birth. The relatively altricial Varecia variegata also had high ratios. Previously, musculoskeletal changes across age have been discussed in terms of how they relate to locomotor ontogeny particularly and how does ontogeny of locomotor anatomy relate to the transition from an unspecialized strategy (e.g., crawling) to the adult strategies, as observed in captive and wild leaping specialists. Atzeva et al. found some specializations are exhibited precociously at birth. Within hind limb segments, muscular mass distribution reflects adult locomotor behaviors. For example, leaping specialists tend to have proportionally large knee extensors in the thigh and perhaps large leg plantarflexors. Muscular mass is not distributed similarly between limb segments across age, however. Previous studies have noted a shift in limb muscle mass from distal to proximal segments. In one sense, this mass shift appears to correspond to a transition from predominantly grasping limb activities to locomotor activities in the limbs (see Raichlen,, for discussion). However, Atzeva et al. noted that this shift occurs in all primates that they studied, including those that ride their mothers and those that are instead carried orally. Thus, an additional factor may underlie this proximal mass gain. The results of the present study may shed additional light on this issue, by showing a pronounced muscle mass shift to the thigh in a species that habitually uses leaping behaviors as adults. For G. moholi, at least, the reliance on knee extensors for leaping makes the thigh an arguably critical segment for mass gain. An interesting question would be to determine if a species relying more extensively on the hip musculature for leaping (e.g., the sifaka) gains proportionally more mass in that segment. Interestingly, the species with the least specialized (here, meaning the most dedicatedly quadrupedal) locomotion as adults, C. medius, appears to show little or no change in proximal to distal percentage distribution of muscle mass between age groups. Thus, muscle mass gain to specific limb segments may be a critical milestone for primates with extremely specialized modes of locomotion.
<filename>src/simp2c_l3.cpp #include <avr/interrupt.h> #include <avr/io.h> #include "simp2c_l2.h" #include "simp2c_l3.h" #include "timer.h" #include "io.h" struct SCtx { CSimp2c simp2c; uint8_t data[3]; uint8_t bitcnt; uint8_t bytecnt; }; static SCtx g_ctx; ISR(PCINT0_vect) { switch (g_ctx.simp2c(io_get_simp2c())) { case CSimp2c::EVT_SYNC: g_ctx.bitcnt = 0; g_ctx.bytecnt = 0; g_ctx.data[0] = g_ctx.data[1] = g_ctx.data[2] = 0; break; case CSimp2c::EVT_BIT_1: if (g_ctx.bytecnt <= 2) g_ctx.data[g_ctx.bytecnt] |= 1 << g_ctx.bitcnt; /* FALLTHROUGH */ case CSimp2c::EVT_BIT_0: if (++g_ctx.bitcnt == 8) { g_ctx.bitcnt = 0; if (g_ctx.bytecnt <= 2) if (++g_ctx.bytecnt == 3) timer_update(g_ctx.data); } break; case CSimp2c::EVT_ERROR: g_ctx.bytecnt = 0xFF; g_ctx.data[2] = 0xFF; break; default: break; } } void simp2c_l3_init() { PCMSK = IO_PCMSK; GIMSK |= _BV(PCIE); }
// Consumes given json, no need to free it after. bool sendJSON(int socket, cJSON *json) { ASSERT(json); char *jsonText = cJSON_PrintUnformatted(json); cJSON_Delete(json); bool ret = chunkedSend(socket, jsonText); free(jsonText); return ret; }
General anesthesia in an office-based plastic surgical facility: a report on more than 23,000 consecutive office-based procedures under general anesthesia with no significant anesthetic complications. The popularity of elective office-based plastic surgery has increased significantly over the past two decades. The continuing demand for improved aesthetic results has stimulated the development of ever more complex plastic surgical techniques. These techniques may require extended periods of operative time spent under anesthesia. Patients have come to expect an almost perfect anesthetic and surgical experience, with safety and comfort being their foremost concerns. Because of increasingly complex and lengthy operations, the authors believe that intravenous sedation, used for many years in their plastic surgery practice, is now suboptimal for most longer and complex surgical procedures. In their experience, under most circumstances, general anesthesia provides the optimal anesthetic experience for the patient, anesthesiologist, and surgeon. The authors present a consecutive 18-year study of general anesthesia in more than 23,000 procedures in an accredited, office-based plastic surgical facility that offers a very safe and uniformly pleasant anesthesia experience for patients. There were no intraoperative or postoperative deaths and no significant complications. The authors' experience differs from the common perception that general anesthesia is too risky for aesthetic surgery procedures.
Design and Construction of a Small Scale Sugarcane Juice Extractor The production of sugarcane is increasing in Nigeria nowadays. Juice extracted from sugarcane can be used extensively in manufacturing brown sugar, industrial sugar and bioethanol fuel through the process of fermentation; hence, the need to develop a machine that can extract juice from sugarcane effectively. This work involves the design, fabrication and performance evaluation of sugarcane juice extractor. The machine was designed to extract juice from sugarcane at small scale level suitable for small and medium scale sugarcane processors. The prototype machine was designed, fabricated and assembled in the Department of Agricultural and Bio-resources Engineering, Ahmadu Bello University, Zaria. The machine consists of rollers, gears, cane guide, juice collector, frame, and prime mover. The developed machine was evaluated using koma variety of cane and obtained an output capacity of 148.2 kg/h and extraction efficiency of 67.44%, respectively at a speed of 30 rpm. The production cost stood at N 90,000 which is affordable and therefore recommended for small scale processors.
Domestic Minor Sex Trafficking: Medical Follow-up for Victimized and High-Risk Youth. Domestic minor sex trafficking (DMST) has become an increasingly recognized issue associated with both immediate and long-term physical and mental health consequences. Guidelines have focused on potential risk factors, recruitment practices, and health consequences for these youth assisting in identification and intervention efforts. However, recommendations have not been established for continuous medical intervention and follow-up for this vulnerable patient population that includes both patients involved in and at high risk for DMST. Our goal is to highlight preliminary recommendations for and the importance of medical visits for these youth. A comprehensive physical examination, STI testing and treatment, and pregnancy prevention options are important to address the patients' concerns for their body and identify acute and chronic injuries. Further, collaborating with other medical and non-medical providers can provide essential resources for the multifaceted needs of DMST patients.
# http://codeforces.com/contest/849/problem/A n = int(input()) seq = [(int(x) % 2) for x in input().split()] def solve(ss): n = len(ss) if ss[0] == 1 and ss[n-1] == 1: if n % 2 == 1: return 1 else: # find next 1 at odd index i = 1 next_ss = None for i in range(1, n-1, 2): if ss[i] == 1: next_ss = i break if next_ss is None: return None else: res = solve(ss[i:]) if res is None: return None else: return 1 + res else: return None cnt = solve(seq) if cnt is None or cnt % 2 == 0: print("NO") else: print("YES")
<gh_stars>1-10 /* * Copyright 2010 Google Inc. * * Licensed 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.gwtproject.i18n.client; import org.gwtproject.i18n.shared.cldr.I18N; /** * @author <NAME> * Created by treblereel 12/6/20 */ @I18N({"ar","en", "es", "de", "fr", "it", "ru", "fil", "pl", "es_AR", "es_MX", "nb", "pa_Arab", "es_419", "pa"}) public class I18nApp { }
use std::i32; use byteorder::{BigEndian, ByteOrder}; use super::{Header, Packet, Error, Question, Name, QueryType, QueryClass}; use super::{Type, Class, ResourceRecord, OptRecord, RRData}; const OPT_RR_START: [u8; 3] = [0, 0, 41]; impl<'a> Packet<'a> { pub fn parse(data: &[u8]) -> Result<Packet, Error> { let header = Header::parse(data)?; let mut offset = Header::size(); let mut questions = Vec::with_capacity(header.questions as usize); for _ in 0..header.questions { let name = Name::scan(&data[offset..], data)?; offset += name.byte_len(); if offset + 4 > data.len() { return Err(Error::UnexpectedEOF); } let qtype = QueryType::parse( BigEndian::read_u16(&data[offset..offset+2]))?; offset += 2; let (prefer_unicast, qclass) = parse_qclass_code( BigEndian::read_u16(&data[offset..offset+2]))?; offset += 2; questions.push(Question { qname: name, qtype: qtype, prefer_unicast: prefer_unicast, qclass: qclass, }); } let mut answers = Vec::with_capacity(header.answers as usize); for _ in 0..header.answers { answers.push(try!(parse_record(data, &mut offset))); } let mut nameservers = Vec::with_capacity(header.nameservers as usize); for _ in 0..header.nameservers { nameservers.push(try!(parse_record(data, &mut offset))); } let mut additional = Vec::with_capacity(header.additional as usize); let mut opt = None; for _ in 0..header.additional { if offset + 3 <= data.len() && data[offset..offset+3] == OPT_RR_START { if opt.is_none() { opt = Some(try!(parse_opt_record(data, &mut offset))); } else { return Err(Error::AdditionalOPT); } } else { additional.push(try!(parse_record(data, &mut offset))); } } Ok(Packet { header: header, questions: questions, answers: answers, nameservers: nameservers, additional: additional, opt: opt, }) } } fn parse_qclass_code(value: u16) -> Result<(bool, QueryClass), Error> { let prefer_unicast = value & 0x8000 == 0x8000; let qclass_code = value & 0x7FFF; let qclass = try!(QueryClass::parse(qclass_code)); Ok((prefer_unicast, qclass)) } fn parse_class_code(value: u16) -> Result<(bool, Class), Error> { let is_unique = value & 0x8000 == 0x8000; let class_code = value & 0x7FFF; let cls = try!(Class::parse(class_code)); Ok((is_unique, cls)) } // Generic function to parse answer, nameservers, and additional records. fn parse_record<'a>(data: &'a [u8], offset: &mut usize) -> Result<ResourceRecord<'a>, Error> { let name = try!(Name::scan(&data[*offset..], data)); *offset += name.byte_len(); if *offset + 10 > data.len() { return Err(Error::UnexpectedEOF); } let typ = try!(Type::parse( BigEndian::read_u16(&data[*offset..*offset+2]))); *offset += 2; let class_code = BigEndian::read_u16(&data[*offset..*offset+2]); let (multicast_unique, cls) = try!(parse_class_code(class_code)); *offset += 2; let mut ttl = BigEndian::read_u32(&data[*offset..*offset+4]); if ttl > i32::MAX as u32 { ttl = 0; } *offset += 4; let rdlen = BigEndian::read_u16(&data[*offset..*offset+2]) as usize; *offset += 2; if *offset + rdlen > data.len() { return Err(Error::UnexpectedEOF); } let data = try!(RRData::parse(typ, &data[*offset..*offset+rdlen], data)); *offset += rdlen; Ok(ResourceRecord { name: name, multicast_unique: multicast_unique, cls: cls, ttl: ttl, data: data, }) } // Function to parse an RFC 6891 OPT Pseudo RR fn parse_opt_record<'a>(data: &'a [u8], offset: &mut usize) -> Result<OptRecord<'a>, Error> { if *offset + 11 > data.len() { return Err(Error::UnexpectedEOF); } *offset += 1; let typ = try!(Type::parse( BigEndian::read_u16(&data[*offset..*offset+2]))); if typ != Type::OPT { return Err(Error::InvalidType(typ as u16)); } *offset += 2; let udp = BigEndian::read_u16(&data[*offset..*offset+2]); *offset += 2; let extrcode = data[*offset]; *offset += 1; let version = data[*offset]; *offset += 1; let flags = BigEndian::read_u16(&data[*offset..*offset+2]); *offset += 2; let rdlen = BigEndian::read_u16(&data[*offset..*offset+2]) as usize; *offset += 2; if *offset + rdlen > data.len() { return Err(Error::UnexpectedEOF); } let data = try!(RRData::parse(typ, &data[*offset..*offset+rdlen], data)); *offset += rdlen; Ok(OptRecord { udp: udp, extrcode: extrcode, version: version, flags: flags, data: data, }) } #[cfg(test)] mod test { use std::net::{Ipv4Addr, Ipv6Addr}; use dns_parser::{Packet, Header}; use dns_parser::Opcode; use dns_parser::ResponseCode::{NameError, NoError}; use dns_parser::QueryType as QT; use dns_parser::QueryClass as QC; use dns_parser::Class as C; use dns_parser::RRData; #[test] fn parse_example_query() { let query = b"\x06%\x01\x00\x00\x01\x00\x00\x00\x00\x00\x00\ \x07example\x03com\x00\x00\x01\x00\x01"; let packet = Packet::parse(query).unwrap(); assert_eq!(packet.header, Header { id: 1573, query: true, opcode: Opcode::StandardQuery, authoritative: false, truncated: false, recursion_desired: true, recursion_available: false, authenticated_data: false, checking_disabled: false, response_code: NoError, questions: 1, answers: 0, nameservers: 0, additional: 0, }); assert_eq!(packet.questions.len(), 1); assert_eq!(packet.questions[0].qtype, QT::A); assert_eq!(packet.questions[0].qclass, QC::IN); assert_eq!(&packet.questions[0].qname.to_string()[..], "example.com"); assert_eq!(packet.answers.len(), 0); } #[test] fn parse_example_response() { let response = b"\x06%\x81\x80\x00\x01\x00\x01\x00\x00\x00\x00\ \x07example\x03com\x00\x00\x01\x00\x01\ \xc0\x0c\x00\x01\x00\x01\x00\x00\x04\xf8\ \x00\x04]\xb8\xd8\""; let packet = Packet::parse(response).unwrap(); assert_eq!(packet.header, Header { id: 1573, query: false, opcode: Opcode::StandardQuery, authoritative: false, truncated: false, recursion_desired: true, recursion_available: true, authenticated_data: false, checking_disabled: false, response_code: NoError, questions: 1, answers: 1, nameservers: 0, additional: 0, }); assert_eq!(packet.questions.len(), 1); assert_eq!(packet.questions[0].qtype, QT::A); assert_eq!(packet.questions[0].qclass, QC::IN); assert_eq!(&packet.questions[0].qname.to_string()[..], "example.com"); assert_eq!(packet.answers.len(), 1); assert_eq!(&packet.answers[0].name.to_string()[..], "example.com"); assert_eq!(packet.answers[0].multicast_unique, false); assert_eq!(packet.answers[0].cls, C::IN); assert_eq!(packet.answers[0].ttl, 1272); match packet.answers[0].data { RRData::A(addr) => { assert_eq!(addr, Ipv4Addr::new(93, 184, 216, 34)); } ref x => panic!("Wrong rdata {:?}", x), } } #[test] fn parse_txt_response_multiple_strings() { let response = b"\x06%\x81\x80\x00\x01\x00\x01\x00\x00\x00\x00\ \x08facebook\x03com\x00\x00\x10\x00\x01\ \xc0\x0c\x00\x10\x00\x01\x00\x01\x51\x3d\x00\x23\ \x15\x76\x3d\x73\x70\x66\x31\x20\x72\x65\x64\x69\ \x72\x65\x63\x74\x3d\x5f\x73\x70\x66\x2e\ \x0c\x66\x61\x63\x65\x62\x6f\x6f\x6b\x2e\x63\x6f\x6d"; let packet = Packet::parse(response).unwrap(); assert_eq!(packet.header, Header { id: 1573, query: false, opcode: Opcode::StandardQuery, authoritative: false, truncated: false, recursion_desired: true, recursion_available: true, authenticated_data: false, checking_disabled: false, response_code: NoError, questions: 1, answers: 1, nameservers: 0, additional: 0, }); assert_eq!(packet.questions.len(), 1); assert_eq!(packet.questions[0].qtype, QT::TXT); assert_eq!(packet.questions[0].qclass, QC::IN); assert_eq!(&packet.questions[0].qname.to_string()[..], "facebook.com"); assert_eq!(packet.answers.len(), 1); assert_eq!(&packet.answers[0].name.to_string()[..], "facebook.com"); assert_eq!(packet.answers[0].multicast_unique, false); assert_eq!(packet.answers[0].cls, C::IN); assert_eq!(packet.answers[0].ttl, 86333); match packet.answers[0].data { RRData::TXT(ref text) => { assert_eq!(text, "v=spf1 redirect=_spf.facebook.com") } ref x => panic!("Wrong rdata {:?}", x), } } #[test] fn parse_response_with_multicast_unique() { let response = b"\x06%\x81\x80\x00\x01\x00\x01\x00\x00\x00\x00\ \x07example\x03com\x00\x00\x01\x00\x01\ \xc0\x0c\x00\x01\x80\x01\x00\x00\x04\xf8\ \x00\x04]\xb8\xd8\""; let packet = Packet::parse(response).unwrap(); assert_eq!(packet.answers.len(), 1); assert_eq!(packet.answers[0].multicast_unique, true); assert_eq!(packet.answers[0].cls, C::IN); } #[test] fn parse_ns_response() { let response = b"\x4a\xf0\x81\x80\x00\x01\x00\x01\x00\x01\x00\x00\ \x03www\x05skype\x03com\x00\x00\x01\x00\x01\ \xc0\x0c\x00\x05\x00\x01\x00\x00\x0e\x10\ \x00\x1c\x07\x6c\x69\x76\x65\x63\x6d\x73\x0e\x74\ \x72\x61\x66\x66\x69\x63\x6d\x61\x6e\x61\x67\x65\ \x72\x03\x6e\x65\x74\x00\ \xc0\x42\x00\x02\x00\x01\x00\x01\xd5\xd3\x00\x11\ \x01\x67\x0c\x67\x74\x6c\x64\x2d\x73\x65\x72\x76\x65\x72\x73\ \xc0\x42"; let packet = Packet::parse(response).unwrap(); assert_eq!(packet.header, Header { id: 19184, query: false, opcode: Opcode::StandardQuery, authoritative: false, truncated: false, recursion_desired: true, recursion_available: true, authenticated_data: false, checking_disabled: false, response_code: NoError, questions: 1, answers: 1, nameservers: 1, additional: 0, }); assert_eq!(packet.questions.len(), 1); assert_eq!(packet.questions[0].qtype, QT::A); assert_eq!(packet.questions[0].qclass, QC::IN); assert_eq!(&packet.questions[0].qname.to_string()[..], "www.skype.com"); assert_eq!(packet.answers.len(), 1); assert_eq!(&packet.answers[0].name.to_string()[..], "www.skype.com"); assert_eq!(packet.answers[0].cls, C::IN); assert_eq!(packet.answers[0].ttl, 3600); match packet.answers[0].data { RRData::CNAME(cname) => { assert_eq!(&cname.to_string()[..], "livecms.trafficmanager.net"); } ref x => panic!("Wrong rdata {:?}", x), } assert_eq!(packet.nameservers.len(), 1); assert_eq!(&packet.nameservers[0].name.to_string()[..], "net"); assert_eq!(packet.nameservers[0].cls, C::IN); assert_eq!(packet.nameservers[0].ttl, 120275); match packet.nameservers[0].data { RRData::NS(ns) => { assert_eq!(&ns.to_string()[..], "g.gtld-servers.net"); } ref x => panic!("Wrong rdata {:?}", x), } } #[test] fn parse_soa_response() { let response = b"\x9f\xc5\x85\x83\x00\x01\x00\x00\x00\x01\x00\x00\ \x0edlkfjkdjdslfkj\x07youtube\x03com\x00\x00\x01\x00\x01\ \xc0\x1b\x00\x06\x00\x01\x00\x00\x2a\x30\x00\x1e\xc0\x1b\ \x05admin\xc0\x1b\x77\xed\x2a\x73\x00\x00\x51\x80\x00\x00\ \x0e\x10\x00\x00\x3a\x80\x00\x00\x2a\x30"; let packet = Packet::parse(response).unwrap(); assert_eq!(packet.header, Header { id: 40901, query: false, opcode: Opcode::StandardQuery, authoritative: true, truncated: false, recursion_desired: true, recursion_available: true, authenticated_data: false, checking_disabled: false, response_code: NameError, questions: 1, answers: 0, nameservers: 1, additional: 0, }); assert_eq!(packet.questions.len(), 1); assert_eq!(packet.questions[0].qtype, QT::A); assert_eq!(packet.questions[0].qclass, QC::IN); assert_eq!(&packet.questions[0].qname.to_string()[..], "dlkfjkdjdslfkj.youtube.com"); assert_eq!(packet.answers.len(), 0); assert_eq!(packet.nameservers.len(), 1); assert_eq!(&packet.nameservers[0].name.to_string()[..], "youtube.com"); assert_eq!(packet.nameservers[0].cls, C::IN); assert_eq!(packet.nameservers[0].multicast_unique, false); assert_eq!(packet.nameservers[0].ttl, 10800); match packet.nameservers[0].data { RRData::SOA(ref soa_rec) => { assert_eq!(&soa_rec.primary_ns.to_string()[..], "youtube.com"); assert_eq!(&soa_rec.mailbox.to_string()[..], "admin.youtube.com"); assert_eq!(soa_rec.serial, 2012031603); assert_eq!(soa_rec.refresh, 20864); assert_eq!(soa_rec.retry, 3600); assert_eq!(soa_rec.expire, 14976); assert_eq!(soa_rec.minimum_ttl, 10800); } ref x => panic!("Wrong rdata {:?}", x), } } #[test] fn parse_ptr_response() { let response = b"\x53\xd6\x81\x80\x00\x01\x00\x01\x00\x00\x00\x00\ \x0269\x0293\x0275\x0272\x07in-addr\x04arpa\x00\ \x00\x0c\x00\x01\ \xc0\x0c\x00\x0c\x00\x01\x00\x01\x51\x80\x00\x1e\ \x10pool-72-75-93-69\x07verizon\x03net\x00"; let packet = Packet::parse(response).unwrap(); assert_eq!(packet.header, Header { id: 21462, query: false, opcode: Opcode::StandardQuery, authoritative: false, truncated: false, recursion_desired: true, recursion_available: true, authenticated_data: false, checking_disabled: false, response_code: NoError, questions: 1, answers: 1, nameservers: 0, additional: 0, }); assert_eq!(packet.questions.len(), 1); assert_eq!(packet.questions[0].qtype, QT::PTR); assert_eq!(packet.questions[0].qclass, QC::IN); assert_eq!(&packet.questions[0].qname.to_string()[..], "172.16.58.3.in-addr.arpa"); assert_eq!(packet.answers.len(), 1); assert_eq!(&packet.answers[0].name.to_string()[..], "172.16.58.3.in-addr.arpa"); assert_eq!(packet.answers[0].cls, C::IN); assert_eq!(packet.answers[0].ttl, 86400); match packet.answers[0].data { RRData::PTR(name) => { assert_eq!(&name.to_string()[..], "pool-72-75-93-69.verizon.net"); } ref x => panic!("Wrong rdata {:?}", x), } } #[test] fn parse_additional_record_response() { let response = b"\x4a\xf0\x81\x80\x00\x01\x00\x01\x00\x01\x00\x01\ \x03www\x05skype\x03com\x00\x00\x01\x00\x01\ \xc0\x0c\x00\x05\x00\x01\x00\x00\x0e\x10\ \x00\x1c\x07\x6c\x69\x76\x65\x63\x6d\x73\x0e\x74\ \x72\x61\x66\x66\x69\x63\x6d\x61\x6e\x61\x67\x65\ \x72\x03\x6e\x65\x74\x00\ \xc0\x42\x00\x02\x00\x01\x00\x01\xd5\xd3\x00\x11\ \x01\x67\x0c\x67\x74\x6c\x64\x2d\x73\x65\x72\x76\x65\x72\x73\ \xc0\x42\ \x01\x61\xc0\x55\x00\x01\x00\x01\x00\x00\xa3\x1c\ \x00\x04\xc0\x05\x06\x1e"; let packet = Packet::parse(response).unwrap(); assert_eq!(packet.header, Header { id: 19184, query: false, opcode: Opcode::StandardQuery, authoritative: false, truncated: false, recursion_desired: true, recursion_available: true, authenticated_data: false, checking_disabled: false, response_code: NoError, questions: 1, answers: 1, nameservers: 1, additional: 1, }); assert_eq!(packet.questions.len(), 1); assert_eq!(packet.questions[0].qtype, QT::A); assert_eq!(packet.questions[0].qclass, QC::IN); assert_eq!(&packet.questions[0].qname.to_string()[..], "www.skype.com"); assert_eq!(packet.answers.len(), 1); assert_eq!(&packet.answers[0].name.to_string()[..], "www.skype.com"); assert_eq!(packet.answers[0].cls, C::IN); assert_eq!(packet.answers[0].ttl, 3600); match packet.answers[0].data { RRData::CNAME(cname) => { assert_eq!(&cname.to_string()[..], "livecms.trafficmanager.net"); } ref x => panic!("Wrong rdata {:?}", x), } assert_eq!(packet.nameservers.len(), 1); assert_eq!(&packet.nameservers[0].name.to_string()[..], "net"); assert_eq!(packet.nameservers[0].cls, C::IN); assert_eq!(packet.nameservers[0].ttl, 120275); match packet.nameservers[0].data { RRData::NS(ns) => { assert_eq!(&ns.to_string()[..], "g.gtld-servers.net"); } ref x => panic!("Wrong rdata {:?}", x), } assert_eq!(packet.additional.len(), 1); assert_eq!(&packet.additional[0].name.to_string()[..], "a.gtld-servers.net"); assert_eq!(packet.additional[0].cls, C::IN); assert_eq!(packet.additional[0].ttl, 41756); match packet.additional[0].data { RRData::A(addr) => { assert_eq!(addr, Ipv4Addr::new(192, 5, 6, 30)); } ref x => panic!("Wrong rdata {:?}", x), } } #[test] fn parse_multiple_answers() { let response = b"\x9d\xe9\x81\x80\x00\x01\x00\x06\x00\x00\x00\x00\ \x06google\x03com\x00\x00\x01\x00\x01\xc0\x0c\ \x00\x01\x00\x01\x00\x00\x00\xef\x00\x04@\xe9\ \xa4d\xc0\x0c\x00\x01\x00\x01\x00\x00\x00\xef\ \x00\x04@\xe9\xa4\x8b\xc0\x0c\x00\x01\x00\x01\ \x00\x00\x00\xef\x00\x04@\xe9\xa4q\xc0\x0c\x00\ \x01\x00\x01\x00\x00\x00\xef\x00\x04@\xe9\xa4f\ \xc0\x0c\x00\x01\x00\x01\x00\x00\x00\xef\x00\x04@\ \xe9\xa4e\xc0\x0c\x00\x01\x00\x01\x00\x00\x00\xef\ \x00\x04@\xe9\xa4\x8a"; let packet = Packet::parse(response).unwrap(); assert_eq!(packet.header, Header { id: 40425, query: false, opcode: Opcode::StandardQuery, authoritative: false, truncated: false, recursion_desired: true, recursion_available: true, authenticated_data: false, checking_disabled: false, response_code: NoError, questions: 1, answers: 6, nameservers: 0, additional: 0, }); assert_eq!(packet.questions.len(), 1); assert_eq!(packet.questions[0].qtype, QT::A); assert_eq!(packet.questions[0].qclass, QC::IN); assert_eq!(&packet.questions[0].qname.to_string()[..], "google.com"); assert_eq!(packet.answers.len(), 6); let ips = vec![ Ipv4Addr::new(64, 233, 164, 100), Ipv4Addr::new(64, 233, 164, 139), Ipv4Addr::new(64, 233, 164, 113), Ipv4Addr::new(64, 233, 164, 102), Ipv4Addr::new(64, 233, 164, 101), Ipv4Addr::new(64, 233, 164, 138), ]; for i in 0..6 { assert_eq!(&packet.answers[i].name.to_string()[..], "google.com"); assert_eq!(packet.answers[i].cls, C::IN); assert_eq!(packet.answers[i].ttl, 239); match packet.answers[i].data { RRData::A(addr) => { assert_eq!(addr, ips[i]); } ref x => panic!("Wrong rdata {:?}", x), } } } #[test] fn parse_srv_query() { let query = b"[\xd9\x01\x00\x00\x01\x00\x00\x00\x00\x00\x00\ \x0c_xmpp-server\x04_tcp\x05gmail\x03com\x00\x00!\x00\x01"; let packet = Packet::parse(query).unwrap(); assert_eq!(packet.header, Header { id: 23513, query: true, opcode: Opcode::StandardQuery, authoritative: false, truncated: false, recursion_desired: true, recursion_available: false, authenticated_data: false, checking_disabled: false, response_code: NoError, questions: 1, answers: 0, nameservers: 0, additional: 0, }); assert_eq!(packet.questions.len(), 1); assert_eq!(packet.questions[0].qtype, QT::SRV); assert_eq!(packet.questions[0].qclass, QC::IN); assert_eq!(packet.questions[0].prefer_unicast, false); assert_eq!(&packet.questions[0].qname.to_string()[..], "_xmpp-server._tcp.gmail.com"); assert_eq!(packet.answers.len(), 0); } #[test] fn parse_multicast_prefer_unicast_query() { let query = b"\x06%\x01\x00\x00\x01\x00\x00\x00\x00\x00\x00\ \x07example\x03com\x00\x00\x01\x80\x01"; let packet = Packet::parse(query).unwrap(); assert_eq!(packet.questions.len(), 1); assert_eq!(packet.questions[0].qtype, QT::A); assert_eq!(packet.questions[0].qclass, QC::IN); assert_eq!(packet.questions[0].prefer_unicast, true); } #[test] fn parse_srv_response() { let response = b"[\xd9\x81\x80\x00\x01\x00\x05\x00\x00\x00\x00\ \x0c_xmpp-server\x04_tcp\x05gmail\x03com\x00\x00!\x00\x01\ \xc0\x0c\x00!\x00\x01\x00\x00\x03\x84\x00 \x00\x05\x00\x00\ \x14\x95\x0bxmpp-server\x01l\x06google\x03com\x00\xc0\x0c\x00!\ \x00\x01\x00\x00\x03\x84\x00%\x00\x14\x00\x00\x14\x95\ \x04alt3\x0bxmpp-server\x01l\x06google\x03com\x00\ \xc0\x0c\x00!\x00\x01\x00\x00\x03\x84\x00%\x00\x14\x00\x00\ \x14\x95\x04alt1\x0bxmpp-server\x01l\x06google\x03com\x00\ \xc0\x0c\x00!\x00\x01\x00\x00\x03\x84\x00%\x00\x14\x00\x00\ \x14\x95\x04alt2\x0bxmpp-server\x01l\x06google\x03com\x00\ \xc0\x0c\x00!\x00\x01\x00\x00\x03\x84\x00%\x00\x14\x00\x00\ \x14\x95\x04alt4\x0bxmpp-server\x01l\x06google\x03com\x00"; let packet = Packet::parse(response).unwrap(); assert_eq!(packet.header, Header { id: 23513, query: false, opcode: Opcode::StandardQuery, authoritative: false, truncated: false, recursion_desired: true, recursion_available: true, authenticated_data: false, checking_disabled: false, response_code: NoError, questions: 1, answers: 5, nameservers: 0, additional: 0, }); assert_eq!(packet.questions.len(), 1); assert_eq!(packet.questions[0].qtype, QT::SRV); assert_eq!(packet.questions[0].qclass, QC::IN); assert_eq!(&packet.questions[0].qname.to_string()[..], "_xmpp-server._tcp.gmail.com"); assert_eq!(packet.answers.len(), 5); let items = vec![ (5, 0, 5269, "xmpp-server.l.google.com"), (20, 0, 5269, "alt3.xmpp-server.l.google.com"), (20, 0, 5269, "alt1.xmpp-server.l.google.com"), (20, 0, 5269, "alt2.xmpp-server.l.google.com"), (20, 0, 5269, "alt4.xmpp-server.l.google.com"), ]; for i in 0..5 { assert_eq!(&packet.answers[i].name.to_string()[..], "_xmpp-server._tcp.gmail.com"); assert_eq!(packet.answers[i].cls, C::IN); assert_eq!(packet.answers[i].ttl, 900); match *&packet.answers[i].data { RRData::SRV { priority, weight, port, target } => { assert_eq!(priority, items[i].0); assert_eq!(weight, items[i].1); assert_eq!(port, items[i].2); assert_eq!(target.to_string(), (items[i].3).to_string()); } ref x => panic!("Wrong rdata {:?}", x), } } } #[test] fn parse_mx_response() { let response = b"\xe3\xe8\x81\x80\x00\x01\x00\x05\x00\x00\x00\x00\ \x05gmail\x03com\x00\x00\x0f\x00\x01\xc0\x0c\x00\x0f\x00\x01\ \x00\x00\x04|\x00\x1b\x00\x05\rgmail-smtp-in\x01l\x06google\xc0\ \x12\xc0\x0c\x00\x0f\x00\x01\x00\x00\x04|\x00\t\x00\ \n\x04alt1\xc0)\xc0\x0c\x00\x0f\x00\x01\x00\x00\x04|\ \x00\t\x00(\x04alt4\xc0)\xc0\x0c\x00\x0f\x00\x01\x00\ \x00\x04|\x00\t\x00\x14\x04alt2\xc0)\xc0\x0c\x00\x0f\ \x00\x01\x00\x00\x04|\x00\t\x00\x1e\x04alt3\xc0)"; let packet = Packet::parse(response).unwrap(); assert_eq!(packet.header, Header { id: 58344, query: false, opcode: Opcode::StandardQuery, authoritative: false, truncated: false, recursion_desired: true, recursion_available: true, authenticated_data: false, checking_disabled: false, response_code: NoError, questions: 1, answers: 5, nameservers: 0, additional: 0, }); assert_eq!(packet.questions.len(), 1); assert_eq!(packet.questions[0].qtype, QT::MX); assert_eq!(packet.questions[0].qclass, QC::IN); assert_eq!(&packet.questions[0].qname.to_string()[..], "gmail.com"); assert_eq!(packet.answers.len(), 5); let items = vec![ ( 5, "gmail-smtp-in.l.google.com"), (10, "alt1.gmail-smtp-in.l.google.com"), (40, "alt4.gmail-smtp-in.l.google.com"), (20, "alt2.gmail-smtp-in.l.google.com"), (30, "alt3.gmail-smtp-in.l.google.com"), ]; for i in 0..5 { assert_eq!(&packet.answers[i].name.to_string()[..], "gmail.com"); assert_eq!(packet.answers[i].cls, C::IN); assert_eq!(packet.answers[i].ttl, 1148); match *&packet.answers[i].data { RRData::MX { preference, exchange } => { assert_eq!(preference, items[i].0); assert_eq!(exchange.to_string(), (items[i].1).to_string()); } ref x => panic!("Wrong rdata {:?}", x), } } } #[test] fn parse_aaaa_response() { let response = b"\xa9\xd9\x81\x80\x00\x01\x00\x01\x00\x00\x00\x00\x06\ google\x03com\x00\x00\x1c\x00\x01\xc0\x0c\x00\x1c\x00\x01\x00\x00\ \x00\x8b\x00\x10*\x00\x14P@\t\x08\x12\x00\x00\x00\x00\x00\x00 \x0e"; let packet = Packet::parse(response).unwrap(); assert_eq!(packet.header, Header { id: 43481, query: false, opcode: Opcode::StandardQuery, authoritative: false, truncated: false, recursion_desired: true, recursion_available: true, authenticated_data: false, checking_disabled: false, response_code: NoError, questions: 1, answers: 1, nameservers: 0, additional: 0, }); assert_eq!(packet.questions.len(), 1); assert_eq!(packet.questions[0].qtype, QT::AAAA); assert_eq!(packet.questions[0].qclass, QC::IN); assert_eq!(&packet.questions[0].qname.to_string()[..], "google.com"); assert_eq!(packet.answers.len(), 1); assert_eq!(&packet.answers[0].name.to_string()[..], "google.com"); assert_eq!(packet.answers[0].cls, C::IN); assert_eq!(packet.answers[0].ttl, 139); match packet.answers[0].data { RRData::AAAA(addr) => { assert_eq!(addr, Ipv6Addr::new( 0x2A00, 0x1450, 0x4009, 0x812, 0, 0, 0, 0x200e) ); } ref x => panic!("Wrong rdata {:?}", x), } } #[test] fn parse_cname_response() { let response = b"\xfc\x9d\x81\x80\x00\x01\x00\x06\x00\x02\x00\x02\x03\ cdn\x07sstatic\x03net\x00\x00\x01\x00\x01\xc0\x0c\x00\x05\x00\x01\ \x00\x00\x00f\x00\x02\xc0\x10\xc0\x10\x00\x01\x00\x01\x00\x00\x00\ f\x00\x04h\x10g\xcc\xc0\x10\x00\x01\x00\x01\x00\x00\x00f\x00\x04h\ \x10k\xcc\xc0\x10\x00\x01\x00\x01\x00\x00\x00f\x00\x04h\x10h\xcc\ \xc0\x10\x00\x01\x00\x01\x00\x00\x00f\x00\x04h\x10j\xcc\xc0\x10\ \x00\x01\x00\x01\x00\x00\x00f\x00\x04h\x10i\xcc\xc0\x10\x00\x02\ \x00\x01\x00\x00\x99L\x00\x0b\x08cf-dns02\xc0\x10\xc0\x10\x00\x02\ \x00\x01\x00\x00\x99L\x00\x0b\x08cf-dns01\xc0\x10\xc0\xa2\x00\x01\ \x00\x01\x00\x00\x99L\x00\x04\xad\xf5:5\xc0\x8b\x00\x01\x00\x01\x00\ \x00\x99L\x00\x04\xad\xf5;\x04"; let packet = Packet::parse(response).unwrap(); assert_eq!(packet.header, Header { id: 64669, query: false, opcode: Opcode::StandardQuery, authoritative: false, truncated: false, recursion_desired: true, recursion_available: true, authenticated_data: false, checking_disabled: false, response_code: NoError, questions: 1, answers: 6, nameservers: 2, additional: 2, }); assert_eq!(packet.questions.len(), 1); assert_eq!(packet.questions[0].qtype, QT::A); assert_eq!(packet.questions[0].qclass, QC::IN); assert_eq!(&packet.questions[0].qname.to_string()[..], "cdn.sstatic.net"); assert_eq!(packet.answers.len(), 6); assert_eq!(&packet.answers[0].name.to_string()[..], "cdn.sstatic.net"); assert_eq!(packet.answers[0].cls, C::IN); assert_eq!(packet.answers[0].ttl, 102); match packet.answers[0].data { RRData::CNAME(cname) => { assert_eq!(&cname.to_string(), "sstatic.net"); } ref x => panic!("Wrong rdata {:?}", x), } let ips = vec![ Ipv4Addr::new(104, 16, 103, 204), Ipv4Addr::new(104, 16, 107, 204), Ipv4Addr::new(104, 16, 104, 204), Ipv4Addr::new(104, 16, 106, 204), Ipv4Addr::new(104, 16, 105, 204), ]; for i in 1..6 { assert_eq!(&packet.answers[i].name.to_string()[..], "sstatic.net"); assert_eq!(packet.answers[i].cls, C::IN); assert_eq!(packet.answers[i].ttl, 102); match packet.answers[i].data { RRData::A(addr) => { assert_eq!(addr, ips[i-1]); } ref x => panic!("Wrong rdata {:?}", x), } } } #[test] fn parse_example_query_edns() { let query = b"\x95\xce\x01\x00\x00\x01\x00\x00\x00\x00\x00\x01\ \x06google\x03com\x00\x00\x01\x00\ \x01\x00\x00\x29\x10\x00\x00\x00\x00\x00\x00\x00"; let packet = Packet::parse(query).unwrap(); assert_eq!(packet.header, Header { id: 38350, query: true, opcode: Opcode::StandardQuery, authoritative: false, truncated: false, recursion_desired: true, recursion_available: false, authenticated_data: false, checking_disabled: false, response_code: NoError, questions: 1, answers: 0, nameservers: 0, additional: 1, }); assert_eq!(packet.questions.len(), 1); assert_eq!(packet.questions[0].qtype, QT::A); assert_eq!(packet.questions[0].qclass, QC::IN); assert_eq!(&packet.questions[0].qname.to_string()[..], "google.com"); assert_eq!(packet.answers.len(), 0); match packet.opt { Some(opt) => { assert_eq!(opt.udp, 4096); assert_eq!(opt.extrcode, 0); assert_eq!(opt.version, 0); assert_eq!(opt.flags, 0); }, None => panic!("Missing OPT RR") } } }
# -*- coding: utf-8 -*- import numpy as np class Transformations(object): """Collection of static methods for geometric transformations Dependencies: numpy (np) NOTE: Homogenous coordinates are used, i.e. 4-th dimension is 1: P(x/y/z/1) This is necessary so that also translation can be handled using matrix operations Several geometric operations can be combined into one transformation matrix by multiplying all individual transformations. Multiplication via numpy.dot() --> A*B: A.dot(B) Order is from right (1st transformation) to left (last transformation) Example: Rotate (R) then translate (T1) then scale (S) then mirror (M) then translate (T2) Setup individual transformation matrices >>> R = rotate3D(...) >>> T1 = translate3D(...) >>> S = scale3D(...) >>> M = mirror3D(...) >>> T2 = translate3D(...) Compile combined transformation matrix >>> MATRIX = T2.dot(M.dot(S.dot(T1.dot(R)))) Apply combined transformation to points(s) >>> P = (1., 2., 6., 1.) >>> P_new = MATRIX.dot(P) """ @staticmethod def rotate3D(axis='x', phi=0.0, degree=True): """Calculate 3D transformation matrix for rotation around one of the coordinate system axis Args: axis (str, optional): Rotation axis phi (float, optional): Rotation angle degree (bool, optional): Specifies if input is in degree or radians EXAMPLE: Rotate point P around x-axis by 90° to get P_rot >>> P = (1., 2., 6., 1.) >>> rotmat = rotate3D(axis='x', phi=90.0) >>> P_rot = rotmat.dot(P) """ if degree: phi = phi / 180.0 * np.pi if axis == 'x': # 3D rotation x-axis ROT = np.array([[1.0, 0.0, 0.0, 0.0], [0.0, np.cos(phi), -np.sin(phi), 0.0], [0.0, np.sin(phi), np.cos(phi), 0.0], [0.0, 0.0, 0.0, 1.0]]) elif axis == 'y': # 3D rotation y-axis ROT = np.array([[np.cos(phi), 0.0, np.sin(phi), 0.0], [0.0, 1.0, 0.0, 0.0], [-np.sin(phi), 0.0, np.cos(phi), 0.0], [0.0, 0.0, 0.0, 1.0]]) elif axis == 'z': # 3D rotation z-axis ROT = np.array([[np.cos(phi), -np.sin(phi), 0.0, 0.0], [np.sin(phi), np.cos(phi), 0.0, 0.0], [0.0, 0.0, 1.0, 0.0], [0.0, 0.0, 0.0, 1.0]]) return ROT @staticmethod def translate3D(vector): """Calculate 3D transformation matrix for translation along a given vector Args: vector (tuple): x, y, z coordinates of translation vector EXAMPLE: Translate point P along vector to get P_trans >>> P = (1., 2., 6., 1.) >>> vector = (10., 0., 0., 1.) >>> transmat = translate3D(vector) >>> P_trans = transmat.dot(P) """ TRANS = np.array([[1.0, 0.0, 0.0, vector[0]], [0.0, 1.0, 0.0, vector[1]], [0.0, 0.0, 1.0, vector[2]], [0.0, 0.0, 0.0, 1.0]]) return TRANS @staticmethod def scale3D(scale): """Calculate 3D transformation matrix for scaling Args: scale (tuple): Scaling factors for each axis EXAMPLE: Scale point P by sx, sy, sz to get P_scale >>> P = (1., 2., 6., 1.) >>> scale = (2., 2., 2.) >>> scalemat = scale3D(scale) >>> P_scale = scalemat.dot(P) """ SCALE = np.array([[scale[0], 0.0, 0.0, 0.0], [0.0, scale[1], 0.0, 0.0], [0.0, 0.0, scale[2], 0.0], [0.0, 0.0, 0.0, 1.0]]) return SCALE @staticmethod def mirror3D(plane='xy'): """Calculate 3D transformation matrix for mirroring wrt to xy, xz, yz planes EXAMPLE: Mirror point P wrt xy-plane to get P_mirror >>> P = (1., 2., 6., 1.) >>> mirmat = mirror3D(plane='xy') >>> P_rot = mirmat.dot(P) """ if plane == 'xy': # 3D mirroring wrt xy-plane MIRROR = np.array([[1.0, 0.0, 0.0, 0.0], [0.0, 1.0, 0.0, 0.0], [0.0, 0.0, -1.0, 0.0], [0.0, 0.0, 0.0, 1.0]]) elif plane == 'xz': # 3D mirroring wrt xz-plane MIRROR = np.array([[1.0, 0.0, 0.0, 0.0], [0.0, -1.0, 0.0, 0.0], [0.0, 0.0, 1.0, 0.0], [0.0, 0.0, 0.0, 1.0]]) elif plane == 'yz': # 3D mirroring wrt yz-plane MIRROR = np.array([[-1.0, 0.0, 0.0, 0.0], [0.0, 1.0, 0.0, 0.0], [0.0, 0.0, 1.0, 0.0], [0.0, 0.0, 0.0, 1.0]]) return MIRROR class Utils(object): """Collection of utility functions (static methods). """ def __init__(self): pass @staticmethod def unit_vector(vector): """ Returns the unit vector of the vector. """ return vector / np.linalg.norm(vector) @staticmethod def angle_between(a, b, degree=False): """Returns the angle between vectors 'a' and 'b' """ a_u = Utils.unit_vector(a) b_u = Utils.unit_vector(b) angle = np.arccos(np.clip(np.dot(a_u, b_u), -1.0, 1.0)) if degree: angle *= 180.0 / np.pi return angle
The pilot design in uplink (UL) multiple antenna systems presents a very difficult problem and the pilot design must accommodate a number of different considerations. From the perspective of demodulation performance, it is best to concentrate the pilot power exactly to the frequency and time resources used for data. This is referred to as in-band pilot. From the perspective of being able to schedule users onto different frequencies, it is beneficial to transmit a wider band pilot. This is referred to as out-band pilot. For a closed loop transmission from multiple antennas, the pilot design must solve the same problem as for channel dependent scheduling. That is to design a pilot transmission, which provides robust data demodulation, while simultaneously providing the possibility to calculate Channel Quality Indicator/Frequency correction Burst (CQI/FB) that is needed to align the transmissions from the multiple antennas at the receiver. The Long Term Evolution (LTE) Technical report (3GPP TR25.814 v1.0.3, Rel7), suggests and only states that the pilots in uplink (UL) may be multiplexed in frequency division multiplex (FDM) or time division multiplex (TDM) or code division multiplex (CDM) or the combination of them, and that the pilot signals are transmitted within two short blocks. The multiplexing mentioned in the prior art means multiplexing between different pilot signals for example, from multiple user equipments (UE's). The multiplexing methods mentioned in the LTE technical report do not refer to or suggest multiplexing between antenna-specific and beam-specific pilots. Although in-band and out-of band solutions are known as well as antenna-specific pilots and beam-specific pilots, it is not known to combine the two. According to the inventors' knowledge and understanding, the multiplexing method between antenna-specific and beam-specific pilots does not exist in the LTE system. In LTE, the term “antenna-specific” pilot is also known as “common” pilot and the term “beam-specific” pilot is also known as “dedicated” pilot. It is desirable to provide a pilot design transmission in uplink (UL) in multiple antenna systems by combining the antenna-specific and beam-specific pilots.
GUELPH, Ontario, Jan. 6, 2013 /PRNewswire-FirstCall/ -- Canadian Solar Inc. (NASDAQ: CSIQ) (the "Company," or "Canadian Solar"), one of the world's largest solar power companies, today announced the successful completion and grid connection of a 30 MW ground mounted solar power project in Tumushuke City, Xinjiang Uyghur Autonomous Region in Western China. This project was developed by CSI Solar Power (China) Inc., a subsidiary of Canadian Solar Inc., with Gaochuangte New Energy as the EPC contractor. Covering an area of about 100 hectares, the project is 9.5 kilometers away from the downtown area of Tumushuke City. Construction on the project commenced in June 2013 and ended in December 2013, with electricity generation starting in the late December of 2013. Approximately 129,600 Canadian Solar CS6P-235P modules with power output of 235Wp were used. With the annual electricity generation projected to be 41.97 million KWh, this solar power plant is expected to displace over 13.4 thousand tons of standard coal consumption every year, while reducing annual emissions of carbon dioxide, sulfur dioxide and oxides by over 35 thousand tons, 114 tons and 99 tons respectively. "We are pleased to announce the completion and grid connection of this ground mounted project, which is so far the largest one we have completed in China. With the efforts of our strong and experienced project development team and the support of key financial institutions, we are well positioned to continue to execute on our solar power project pipeline in China in the quarters ahead," commented Dr. Shawn Qu, Chairman and Chief Executive Officer of Canadian Solar. "As a leading global solar power solutions provider with a strong track record of execution, we remain committed to supporting the adoption of green solar energy in China and around the world."
By Mark N. Katz Mark N. Katz is an assistant professor of government and politics at George Mason University. THE game of chess needs to be modernized. It is seriously outmoded in its present state.Chess is supposed to represent war between two opposing nations. But while chess may have had some resemblance to war in the Middle Ages, it has no resemblance to modern warfare. Even the pieces in chess reflect its medieval origins: Each side has a king and queen, two knights and two castles. Each side also has two bishops, reflecting the important role that churchmen played in politics back then. Finally, each side has eight pawns - a pejorative term demonstrating class prejudice, which is unacceptable now. More important than the outmoded nomenclature of the chess pieces, though, is the plodding pace at which the game proceeds. In traditional chess, the players can take as long as they like when it is their turn to decide which piece to move, but they can only move one piece per turn. This isn't like modern war. One side is not going to politely wait around while the other side decides what it will do. Modern war, as the Gulf conflict demonstrated, is fast-paced. Both sides are moving lots of pieces at once. I would like to propose a few modifications that would make chess more relevant today. First, the medieval nomenclature should be thrown out. The king should become president, the knights should become generals, and the pawns should become soldiers. I'm not sure what to do about the bishops. Maybe they should become admirals to make up for the short shrift chess has long given to navies. The castles should become air force generals. This way, all three services would be represented in the game, just as they are in actual war. I can't understand how the medievals thought castles could move, anyway. Deciding what the queen should become is more difficult. Perhaps she should become secretary of state or National Security Council adviser. Actually, the players should be able to give all their pieces whatever titles they prefer. Some might prefer a democracy, others a dictatorship. The titles do not matter just as long as each piece makes the same type of moves as they do in traditional chess and the object of the game is to capture the other side's king (or president, general secretary, chief ayatolla h, or whatever). Second, instead of moving only one piece, the players should be allowed to move as many pieces as they want, one move per turn. This would definitely speed up the pace of the game. This modification could lead to a problem: A player might "forget" whether he or she has moved a piece during a turn. It is up to the opponent to monitor whether the other player has moved his or her pieces only once. This too would reflect real life. As we all know, nations often violate the rules of war to their own advantage. They will only stop if their opponents make them stop. There is also the danger that one player would falsely accuse the other of breaking the rules of the game. But this happens in modern war, too. Third, each player will have the right to declare once during the game that one of the opponent's pawns (or soldiers) is actually a spy working for the first player. That player can then move the turncoat pawn against the opponent for the rest of game. This modification will force each side to anticipate and plan for the disloyalty of any of his or her pawns. It is an important change because it would realistically reflect the preoccupation of modern governments about spies within their ranks. A final modification could be introduced for advanced players. The game board could be enlarged and configured with eight sides for eight players. To get anywhere, players would have to enter coalitions with one another. Coalitions could change during the course of the game. This, too, would resemble modern war. If chess is modernized in this way, I admit that it will be far more difficult and confusing than the type of conflict traditional chess was designed to imitate.
Design and Performance of Vaneless Volutes for Radial Inflow Turbines: Part 3: Experimental Investigation of the Internal Flow Structure An experimental study is presented which considers the flow structure in the vaneless volute of a radial inflow turbine. The data show evidence of significant secondary flows around the volute. The volute tested generated a uniform free vortex type structure and produced a uniform mass flow distribution around the periphery of the rotor. The flow within the volute was turbulent although this did not appear to have a detrimental effect on the overall performance of the volute. However, the turbine performance appears to be insensitive to variations in the inlet conditions in the axial direction.
<reponame>KBvsMJ/ReactiveCocoaDemo<gh_stars>1-10 // // LoginViewModel.h // SXJFRAC_MVVMDEMO // // Created by shanlin on 2017/9/11. // Copyright © 2017年 shanxingjinfu. All rights reserved. // #import <Foundation/Foundation.h> #import "LoginModel.h" @interface LoginViewModel : NSObject @property(nonatomic,strong) LoginModel *userModel; @property(nonatomic,strong,readonly) RACCommand *loginCommand; @end
def add(self, item: InType) -> None: self.results.append(ray.put(item))
It hasn&apos;t been a great week for Japanese automakers. Fresh on the heels of Toyota temporarily halting sales of eight models over concerns about accelerator pedals sticking, Honda announced Friday a voluntary recall of 646,000 cars worldwide to examine window swtiches that can melt or catch fire when exposed to an extreme amount of liquid. The only model affected by Honda&apos;s action is the 2007-2008 Fit subcompact, 141,140 of which have been sold in the United States. The problem stems from a master power window switch on the driver&apos;s side that needs to be replaced or retrofitted with a waterproof skirt. There have been seven reported cases of the part melting in the U.S., two involving fire. A Honda spokesperson tells Foxnews.com that no injuries have been linked to the defect at this time. Honda&apos;s action comes in the wake of Toyota&apos;s recall of over 4.2 million vehicles worldwide stemming from a faulty accelerator pedal assembly that could become stuck and cause unintended acceleration. That recall affects certain 2009-2010 RAV4s, certain 2009-2010 Corollas, 2009-2010 Matrixes, 2005-2010 Avalons, certain 2007-2010 Camrys, certain 2010 Highlanders, 2007-2010 Tundras and 2008-2010 Sequoias. Toyota has come under extreme public scrutiny for its handling of the situation, as it initially continued manufacturing and selling affected models even after the recall was announced. Then on Tuesday, Toyota halted the production and sale of eight models in North America, including the popular Camry and Corolla, while redesigned parts are produced and distributed to factories and dealers. To date,Toyota says that no accidents have been linked to the problem. A House Oversight and Government Reform Committee hearing on the matter has been scheduled for February 4th entitled "Toyota Gas Pedals: Is the Public at Risk?" A Feb. 25 hearing by the House Energy and Commerce Committee has also been scheduled.
<gh_stars>0 package me.cybulski.public_transport.model; import org.apache.commons.lang3.builder.EqualsBuilder; import org.apache.commons.lang3.builder.HashCodeBuilder; import org.apache.commons.lang3.builder.ToStringBuilder; /** * An object representing a vehicle. * * @author <NAME> */ public class Vehicle { protected final Position position; protected final VehicleType vehicleType; public Vehicle(Position position, VehicleType vehicleType) { this.position = position; this.vehicleType = vehicleType; } public Position getPosition() { return position; } public VehicleType getVehicleType() { return vehicleType; } @Override public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof Vehicle)) return false; Vehicle vehicle = (Vehicle) o; return new EqualsBuilder() .append(position, vehicle.position) .append(vehicleType, vehicle.vehicleType) .isEquals(); } @Override public int hashCode() { return new HashCodeBuilder(17, 37) .append(position) .append(vehicleType) .toHashCode(); } @Override public String toString() { return new ToStringBuilder(this) .append("position", position) .append("vehicleType", vehicleType) .toString(); } }
The intellectually accomplished duo have each won a $3 million prize in life sciences for their respective groundbreaking work: Zhuang invented a super-resolution microscope that enables scientists to get a deep, detailed look at the cells of the human body; while Amon has determined how extra or missing chromosomes in a person’s genetic makeup can lead to disease. The pair of local smartypants will be acknowledged during the seventh annual event, which applauds achievements in science, physics and mathematics. Besides being in the presence of their bigwig peers from the scientific community, Zhuang and Amon will also be rubbing elbows with celebs from, well, the world. Actor Pierce Brosnan will be the host for the evening, and other high-profile presenters include Orlando Bloom, Ron Howard, Julianne Moore, Thandie Newton, Lupita Nyong’o and Zoe Saldana. The ceremony will also include musical performances from Academy Award winner and four-time Grammy Award winner Lionel Richie, as well as China’s pop sensation G.E.M.. It’s all going down at the NASA Ames Research Center in Mountain View, Calif., on Sunday at 10 p.m. It will be broadcast live on National Geographic, as well as streamed on Facebook and YouTube.
Security of RFID Systems - A Hybrid Approach The use of RFID (Radio Frequency Identification) technology can be employed for tracking and detecting each container, pallet, case, and product uniquely in the supply chain. It connects the supply chain stakeholders (i.e., suppliers, manufacturers, wholesalers/distributors, retailers and customers) and allows them to exchange data and product information. Despite these potential benefits, security issues are the key factor in the deployment of a RFID-enabled system in the global supply chain. This paper proposes a hybrid approach to secure RFID transmission in Supply Chain Management (SCM) systems using modified Wired Equivalent Encryption (WEP) and Rivest, Shamir and Adleman (RSA) cryptosystem. The proposed system also addresses the common loop hole of WEP key algorithm and makes it more secure compare to the existing modified WEP key process.
Sequential malt lymphomas of the stomach, small intestine, and gall bladder. Low grade lymphomas of mucosa associated lymphoid tissue (MALT) are indolent neoplasms that, although tending to remain localised for many years, may spread to other mucosal sites. A 53 year old woman treated by total gastrectomy for low grade MALT lymphoma of the stomach developed a recurrence in the small bowel 18 years later, and a further recurrence involving the gall bladder after three years in complete clinical remission after chemotherapy. In situ hybridisation showed that the small intestine and gall bladder recurrences had the same pattern of light chain restriction. Tumour from all three sites was shown to be derived from a single clone by the demonstration of an identical immunoglobulin heavy chain gene rearrangement by the polymerase chain reaction. The case illustrates the propensity of MALT lymphomas to "home" to mucosal sites and gives an insight into their behavior over an extended follow up.
get out the lie detector test! Harper's not telling us the real policy! Citizens group has put up Website. Check it out!!! www.ctip.info, really disturbing, and why no scrutiny by the media??? SICKENING STUFF! The link doesn't work for me , I only get an error message. The problem with the link is the comma. Try this. skeptical, are you sure this was worth starting three [edit: five, now] threads? It looks like standard CPC boilerplate and contains nothing that isn't widely known already. Is this the document you're talking about? It says nothing about flat income taxes, or an army of 160,000. Sorry guys, got your message. Just so damn mad that media didn't tell people the whole truth. Harper's plans are for U.S. style health insurance premiums, not just private delivery of Healthcare...stripping of all pollution laws? who told us about that? He's scrapping Multiculturalism, downloading the cost of every single program including Post Secondary onto cash strapped provinces...and his decentralization policy, bunch of pilot states, that's how Soviet Union collapsed...not funny to me, I care about all of us,and the media is pushing Harper into power...as a moderate!!!! SICK LIES! I'm just shook and worried, and I don't care how you vote, just kick their butts out of here, LET OTHERS KNOW, OR WE'LL BE SO SORRY! This guy is 1000 times worse than Harris!!!!!!!!!! What is a pilot state? To Oliver Cromwell: read the material,and you'll see where the facts were drawn. You cannot get the full drift. The document itself says army capable for COMBAT, does that sound like peace-keeping to you? And Harper did say 80,000 regular forces, and the same number of reserves, so Bush uses huge number of reserves too! Back few weeks ago their defense critic said he wanted army of 140,000, SO WHERE'S THE DISCREPANCY with that. And just two days ago, on mid-morning news, Harper said he WILL SEND TROOPS TO IRAQ! What's on this website is not readily known to voters...do seniors know that "they will maintain support for low-income seniors"? NO! This means that all those on pensions will be cut off after a certain point, and it's their own pension money!!!! And all of the people who will need this pension, paid into it for years...that money will be gone!!! If you have a dad or mum, or grandparents,do you think anyone told them about this! NO! This is not the cold hearted Canada I want, and blast them, Seniors and the disabled? Come on, that's way over the line in my books! Krago: Pilot state is a loosely connected, uncoordinated, very weak conglomeration, so strong on their own that you don't have a country! Ontario, B.C., Newfoundland, New Brunswick would have more power in the country, but the Federal government sets no standards for anything in this country, provinces run like separate entities, don't you know that's what busted the Soviet Union! We aren't like the Soviets, and we deserve to be strong and united. Separately each province will be fending for everthing on it's own, and they will become so independent and so different there won't be a COUNTRY! Don't you understand what happens when you weaken the Federation into separate pieces, no one gets any issue dealt with federally... Fed's only collects taxes and has a huge army! What kind of country do you call that? You call that a civilized strong nation! I call that a recipe for the complete bust up of my country, and any nazi who recommends this has got a fight on their hands! Yes the question should be "Why does the Conservative-Reforms-Alliance party essentially want to break up Canada. I though that was Gilles Duceppes job? Deep down Harper does want to make radical, radical changes to the country and shame on the media for not doing their jobs and analyzing the repercussions. No imaginations to the mediocre media out there.
The present invention relates to methods for water purification processing and the economic utilization of waste waters produced from water purification processing. The disposal of saline water has become an expensive problem for society. For example, approximately 1.61 billion gallons of water containing approximately 800,000 tons of mixed sodium, calcium and magnesium chlorides and sulfates is produced from water treatment operations and oil fields in the state of California alone. This saline water must be disposed of, costing the state millions of dollars each year. Meanwhile, the United States Geological survey recently determined that New Mexico has an astounding 15 billion acre feet of brackish ground water, and a single basin in West Texas alone was found to have 760 million acre feet of brackish ground water. Many coal beds are located where traditional mining is not feasible. Instead, the coal beds are stripped of their associated methane by pumping water from the coal bed strata. Methane migrates to gas wells where it is pumped out and transported for public use. The removed water is usually of moderate salinity, typically 900 to 1500 parts per million (ppm) of total dissolved salts (TDS). Unfortunately, the water is typically high in sodium and carbonate and/or bicarbonate. Meanwhile, the disposal of waste water has become even more problematic in other parts of the world. As a result, billions of dollars are spent each year toward efforts to dispose of waste waters. Accordingly, it would be highly advantageous to provide improved methods of disposing of salty waters. It would even be more advantageous to provide methods of utilizing salty waters which provide a benefit to society, instead of simply disposing of the unwanted waters. Water purification typically produces a first effluent of relatively “clean water” and a second effluent of “waste water” which includes unwanted contaminants. For purposes herein, clean water is defined to mean water including less than 0.05% by weight of the chloride, sulfate or carbonate salts of sodium, potassium, calcium or iron or combinations thereof. In addition to waste water, there is a substantial amount of “moderately saline water” around the world that has less salinity than waste water but which is not generally acceptable for irrigation or animal consumption. Thus, this moderately saline water has severely limited application and usefulness. As defined herein, “moderately saline water” means water that has 0.05% or more by weight and less than 1.00% by weight of the chloride, sulfate or carbonate salts of sodium, potassium, calcium or magnesium, or combinations thereof. Known water purification processes proceed by numerous methods including ion-exchange, membrane softening, electrolysis, evaporation and precipitation. The softening of hard water take place by removing calcium and magnesium which is required for both industrial and household use. Known water softening processes proceed either by way of ion-exchange, membrane softening or precipitation. In the ion-exchange processes, the calcium (Ca2+) and magnesium (Mg2+) ions are exchanged for sodium (Na+) and the regeneration of the ion-exchange resin is achieved with a large excess of NaCl. This process creates a regeneration effluent being a relatively concentrated aqueous solution of sodium, calcium and magnesium chlorides which has to be discarded. Consequently, by this method, considerable amounts of sodium, calcium and magnesium salts in solution must be disposed of. Alternatively, it is possible to soften water by using weak acid resins which exchange hydrogen (H+) for calcium (Ca2+) and magnesium (Mg2+), and to regenerate the spent resins with a mineral acid. While this method creates less waste water, it is more expensive and yields relatively acidic soft water which is corrosive. Meanwhile, membrane softening concentrates the calcium, magnesium salts and salts of other divalent ions to produce waste waters which require costly disposal. The precipitation process has traditionally been carried out by the “lime soda” process in which lime is added to hard water to convert water soluble calcium bicarbonate into water insoluble calcium carbonate. This process also results in waste water which is difficult to filter and requires cumbersome treatment. My previously issued patent, U.S. Pat. No. 5,300,123 relates to the purification of impure solid salts. Even this process produces salty waste water which must be disposed of. My later-issued patents U.S. Pat. Nos. 6,071,411 6,374,539 and 6,651,383 relate to the processing and utilization of processed waste waters. These processes preferably employ ion-exchange, preferably using sodium sulfate or calcium sulfate, to alter the salt content of treated water. Moreover, the resulting salts, clean effluents and waste water effluents are useful for various applications including the treatment of soils for improving dust control, soil stabilization, adjusting the soil's sodium adsorption ratio (SAR), and treating root rot. Unfortunately, even with all of the various water treatment processes of the prior art, there are billions of gallons of waste water and moderately saline water that are discarded or not utilized because it is far too expensive to purify such waters using known water treatment processes. This overabundance of water is troubling because there is an overwhelming world-wide need for water, particularly for human and livestock consumption. A recent report from the United Nations states that more than 50 percent of the nations in the world will face water stress or water shortages by the year 2025. By 2050, as much as 75 percent of the worlds's population could face water scarcity. Even more troubling, in impoverished countries humans and animals often suffer from calcium and magnesium deficiencies even though there may be millions of gallons of nearby saline waters. These saline waters typically contain some calcium and magnesium but are too high in sodium to be drinkable. Unfortunately, due to the expense and unavailability of equipment, this water cannot be processed for human or animal consumption. Instead, milk is recommended to provide an adequate diet of calcium and magnesium but milk is typically not affordable or available in sufficient quantities to meet the needs of children in developing countries or even the needs of children in poor areas of developed countries. It would be an incredible development if the saline water could be treated to lower the sodium but increase or maintain the calcium and magnesium to levels suitable for human and livestock consumption. Water is also in great demand for soil treatment, particularly for irrigation. Unfortunately, waste waters typically have saline content which is not suitable for nearby irrigation. Thus, it would be extraordinarily advantageous if an inexpensive process were developed for processing waste waters to produce an effluent suitable for irrigation. Wind erosion of soil is also a significant problem throughout the world. Due to small particle size and poor cohesion, finely divided soil is sensitive to the influence of wind. Such finely divided soil is found in agricultural lands, dunes, lake beds, construction sites and roads under construction. Erosion by wind causes the drifting of masses of soil in the form of dust. The erosion by wind causes the inconvenience of dust formation and the loss of valuable matter such as seed, fertilizer and plantlets. Dust storms are a danger to traffic and a health risk to persons located in the vicinity. Finally, it would be desirable if all of the aforementioned objectives could be accomplished while overcoming the expensive and problematic concerns facing this country and the rest of the world, specifically, the disposing of saline waters. It would further be desirable if this objective could be obtained while simultaneously meeting with above described needs.
def userExists(self, username): if not username: return False try: win32security.LookupAccountName('', username) return True except (win32security.error, pywintypes.error) as error: (number, name, message) = error if number == ERROR_NONE_MAPPED: return False error_text = u'[%s] %s %s' % (number, name, message) self.raiseFailedtoCheckUserExists(username, error_text)
Thermally Induced Variation of the Turn-ON Voltage of an IndiumGalliumZinc Oxide Thin-Film Transistor The thermal processing of an indium-gallium-zinc oxide (IGZO) thin-film transistor (TFT) with annealing-induced source/drain (S/D) regions was found to induce a negative shift in the turn-ON voltage (VON) of the TFT. Such shifts are consistent with the presence of positive ions, and correlated with the detection of indium, gallium, and zinc, in the dielectric layer adjacent to the channel region. The origin of these species is attributed to the thermally induced dissociation of the IGZO in the S/D regions of the TFT, and the subsequent migration of some of the dissociated species to the dielectric layer above the channel region. It was found that the process-induced shifts in VON depended on not only the heat-treatment condition but also the structural configuration of the TFT. Since the thermal processes are practically unavoidable during the fabrication of an IGZO TFT and it is unlikely the dissociation of IGZO is unique to the present device architecture, attention must be paid to the effects of the potential migration of such ionic species on the device characteristics, regardless of the transistor structure.
<commit_msg>Allow logging to be configured at compilation time. <commit_before>// // lelib.h // lelib // // Created by Petr on 27.10.13. // Copyright (c) 2013 JLizard. All rights reserved. // #define LE_DEBUG_LOGS 1 #if LE_DEBUG_LOGS #define LE_DEBUG(...) NSLog(__VA_ARGS__) #else #define LE_DEBUG(...) #endif #import "LELog.h" #import "lecore.h" <commit_after>// // lelib.h // lelib // // Created by Petr on 27.10.13. // Copyright (c) 2013 JLizard. All rights reserved. // #ifndef LE_DEBUG_LOGS #ifdef DEBUG #define LE_DEBUG_LOGS 1 #else #define LE_DEBUG_LOGS 0 #endif #endif #if LE_DEBUG_LOGS #define LE_DEBUG(...) NSLog(__VA_ARGS__) #else #define LE_DEBUG(...) #endif #import "LELog.h" #import "lecore.h"
Braille was invented by a nineteenth century man named Louis Braille, who was completely blind. Braille's story starts when he was three years old. He was playing in his father's shop in Coupvray, France, and somehow managed to injure his eye. Though he was offered the best medical attention available at the time, it wasn't enough—an infection soon developed and spread to his other eye, rendering him blind in both eyes. While a tragedy for him, had this accident not happened, we wouldn't have braille today. There was a system of reading in place for the blind at the time, which consisted of tracing a finger along raised letters. However, this system meant that reading was painfully slow and it was difficult to discerning by touch the relatively complex letters of the alphabet. As a result, many people struggled to master the embossed letter system. In 1821, Braille's teacher, Dr. Alexandre Francois-Rene Pignier, invited a man named Charles Barbier to speak to a classroom of young blind students at the National Institute for Blind Youth in Paris. Barbier had developed a "night writing" system for the military using raised dots after Napoleon requested a system of communication that soldiers could use even in darkness without making any sound in the process. Barbier's system was too complex for the military and was rejected. However, it was thought that it might be useful for the blind, which led Dr. Pignier to invite Barbier to come demonstrate it. As it stood, the Barbier invention wasn't quite up to functioning as a system of touch-based reading and writing, being overly complex (using a 6×6 dot matrix to represent letters and certain phonemes). Further, this large dot matrix made it so unless you had very large fingertips, you couldn't feel all the dots in a single matrix without moving your finger. Still, Braille was inspired and, as a young teenager, he began experimenting. He took a piece of paper, a slate, and a stylus, punching holes and attempting to find something that worked. In 1825, Braille was just barely sixteen, but he thought he had hit upon something that was functional and superior to the existing embossed letter system. His original code consisted of six dots arranged in two parallel rows, each set of rows representing a letter. This configuration was simpler than Barbier's system, but still versatile enough to allow for up to 64 variations, enough for all the letters of the alphabet and punctuation. It was also easily adapted to languages other than French. Most importantly, rather than needing to trace out a whole letter, it was much easier to feel the configuration of dots, making reading for the blind significantly faster and easier. Dr. Pignier was pleased with Braille's work and encouraged his students to use Braille's new system. Unfortunately when Dr. Pignier introduced The History of France written in braille for his students, he was dismissed from his position as headmaster, due to his insistence on pushing Braille's system rather than the standard embossed letter system of the day. Nonetheless, Braille himself became a teacher at the Institute and taught his code to the students who passed through, spreading the knowledge. In 1834, when Braille was in his mid-20s, he was invited to demonstrate the uses of braille at the Exposition of Industry, which was being held in Paris that year, further spurring its popularity. By this time, Braille had also published a book about how to use the code. It was mostly written in embossed letters with braille thrown in to demonstrate its use. Despite this, the National Institute for Blind Youth that Braille worked at still refused to officially adopt his system. It wouldn't be until 1854, two years after Braille died and eight years after a school in Amsterdam started using it as their primary reading/writing system, that Braille's former school finally adopted braille due to students overwhelmingly demanding the change. By the late nineteenth century, braille had been adopted throughout most of the world, excepting the United States, who held out until 1916. These days, books for the blind in English are typically written in Grade 2 braille. It is a system that combines letters and substitutes letters for words. For instance, the letter "y" is used to represent the word "you" and the letter "b" represents the word "but". In some respects, Grade 2 braille is a lot like "chatspeak" and takes shortcuts to make for an easier reading and writing experience. In addition to taking a shorter time to read, it also takes up less space, saving paper used on braille books. Today, English speaking blind children are mostly taught Grade 2 braille, though Grade 1 braille (every letter written out) is still sometimes taught in early elementary school. There is also a Grade 3 braille for any non-standard shorthands. Braille also developed a system known as decapoint. Decapoint configurations more closely resemble letters, making it easier for sighted people to read it. He even helped develop a machine that would make decapoint easier to write, so that the dots didn't have to be hand-written with a stylus. It was called a "raphigraphe," and it was developed with the help of Pierre-Francois-Victor Foucault in the late 1830s and early 1840s. Emily Upton writes for the wildly popular interesting fact website TodayIFoundOut.com. To subscribe to Today I Found Out's "Daily Knowledge" newsletter, click here or like them on Facebook here. You can also check 'em out on YouTube. This post has been republished with permission from TodayIFoundOut.com.
The opinions expressed by columnists are their own and do not represent the views of Townhall.com. If you ever had any doubt that Donald Trump was right that the mainstream media is the enemy of the American people, CNN corrected your inexplicable inability to comprehend this painfully obvious truth by choosing July 4th to threaten some guy for daring to make fun of Its Medianess Holiness. Apparently, if you dare defy the media it has the right to wreck your life - as long as you are an anti-Obama rodeo clown or a meme-making rando on Reddit. If you are a zillionaire like Anthony Scaramucci with the bucks to hire top flight law firms and Gawkerize its lame carcass - which I would have done in a split-second if CNN had lied about me the way it did about him - then you get a free pass. Instead of comforting the afflicted and afflicting the comfortable, CNN's new motto is apparently “Confront the afflicted and settle with the comfortable.” Every time I see the CNN logo I hear James Earl Jones's voice intoning “This is CNN, and we suck.” But actually, maybe we should all thank CNN for its work guaranteeing Trump’s second term. Now, before we move on, someone is going to point out that the meme guy is kind of a jerk and said stuff that offends decent people. So? How is that the point? This is a multi-billion dollar media corporation using all its power to threaten an individual into not criticizing it. How is that ever okay? And don't pretend for a minute this media extortion precedent gets limited to outlier Reddit guys. Normal Americans are next. The media babbles about “principles,” but as soon as they become inconvenient then out the window go those precious “principles.” A silly wrestling gif supporting the president “promotes violence against the media,” but a week before that funding a play where President Trump is stabbed to death was artful political commentary? That’s my objection to all this recent “principles” talk. They are never actually promoting “principles.” It is always a scam and a pose designed to stop other people from acting in, or defending, their own interests. These “principles” never, ever require the people allegedly holding them to not act in, or defend, their interests. CNN has all sorts of “principles” it uses to bludgeon its opponents, none of which ever seem to limit CNN’s own actions. How convenient. President Trump sees this and not only calls it out but refuses to back down even an inch in the face of the media’s predictable “Oh, well, I never!” campaign of conservashaming. That's why we see wussy Fredocon Republicans like Jeb! and Kasich trotted out to sadly shake their heads; they're always willing to submit to this nonsense and obediently trash conservatives in the name of principles that they never, ever apply to the media or to their liberal string-pullers. But Trump doesn't play that, and whatever his other faults, it's glorious. Normal Americans are receptive to Trump’s attacks on the media because they hate the mainstream media too. They are now woke to the unarguable fact that the mainstream media is almost entirely composed of liberal activists who hate normal people and who see absolutely nothing wrong with using their platform to aggressively promote a leftist agenda, all while presenting themselves as non-partisan public servants. It’s all a lie, and we know it, and beyond the hate directed at us, having the hypocrisy of it rubbed in our faces is even more galling. You know, if you want the prestige and honor due a nonpartisan, objective truth teller, you need to actually be a nonpartisan, objective truth teller. If you won't do the hard work of doing that, then you don't get the benefit. You want respect? Try earning it. But the media doesn't want to have to do that. It wants its cake, and to eat it too, and further, it wants to make us bake it lots of cakes and write on them “Best Wishes Upon Your Voluntary Transformation From Boy To Girl By The Mere Power Of Your Wanting To Because That Is Totally A Thing And So Is Global Warming And Russians.” It’s reassuring to see the near universal contempt for CNN’s creepy extortion gambit, and perhaps by the time this column runs the CNN brain trust will have listened to their general counsel, who has probably aged 15 years in the last 15 days, and apologized, retracted, and fired everyone associated with this unbelievable idiocy. Or it might double down, because CNN's innovative ratings strategy appears to be focused entirely toward identifying and pursuing a smaller, more select audience composed solely of members of the elite Complete Idiot demographic. Whatever. I just want CNN to collapse, and I want to laugh at its twitching corpse. And then superstars like noted legal scholar Chris Cuomo can focus on important things, like his new puppy Woofy. Perhaps the best part of all of this is the indisputable fact that CNN’s own actions have validated every bad thing Trump has ever said about the lying media. That he was totally and completely correct about CNN's moral bankruptcy makes it all the sweeter. As much as it is a joy to see CNN shred its pretenses and act openly as we always knew it wanted to, this sort of thing is not good. There is a cultural war underway already, and this only makes it more likely to get worse. When the media takes a side, it makes the other side its enemy. That’s a conscious choice. And CNN seems happy to help feed the fire by embracing its liberal fascist id.
Volume-Enhanced Compatible Remeshing of 3D Models Compatible remeshing provides meshes with common connectivity structures. The existing compatible remeshing methods usually suffer from high computational cost or poor quality. In this paper, we present a fast method for computing compatible meshes with high quality. Given two closed, oriented, and topologically equivalent surfaces and a sparse set of corresponding landmarks, we first compute a bijective inter-surface mapping, from which compatible meshes are generated. We then improve the remeshing quality by using a volume-enhanced optimization. In contrast to previous work, our method designs a fast volume-enhanced improvement procedure that directly reduces the isometric distortion of the map between the compatible meshes. Our method also tries to preserve the shapes of the input meshes by projecting the vertices of the compatible meshes onto the input surfaces. Central to this approach is the use of the monotone preconditioned conjugate gradient method, which minimizes the energies effectively and efficiently. Compared with state-of-the-art methods, our method performs about one order of magnitude faster with better remeshing quality. We demonstrate the efficiency and efficacy of our method using various model pairs.
The contrast between current economic conditions and the near-term outlook is striking. For now, we seem to be enjoying the sugar high from a tax cut that proved to be a Keynesian stimulus rather than a growth game-changer. Post contributor Jared Bernstein notes, “Deficit-financed tax cuts and spending added about a point to the 2018 growth rate. Unless Congress adds a lot more to the deficit than expected . . . the fiscal fade will give up that point by the second half of the year, and we’ll divert back to the trend growth rate of around 2 percent (though at least one credible forecast is for 1 percent).” Since “the Trump tax cuts have both cost more and done less than Republicans said they would,” the question remains: What happens as the stimulus fades but the huge debt remains? Former car czar Steven Rattner, among the most sober and least partisan economists, reminds us that the Trump economic “miracle” wasn’t as miraculous as advertised. “The problem with Mr. Trump’s victory lap is that job growth during his administration has been slightly slower than it was during the last 22 months of Mr. Obama’s tenure: 4.2 million Americans hired under Mr. Trump versus 4.8 million under Mr. Obama,” he explains. “More worrisome is that Mr. Trump’s policies have done little to help manufacturing workers, whose votes in key states helped elect him; their share of total employment has not improved.” It’s true that low unemployment has finally helped push wages upward but, nevertheless, we’re left with “the middle 80 percent of Americans with wages that continued to decline in real terms through 2017 and only inched up in 2018,” Rattner says. So now we look to growth predictions for 2019. Then came some worrisome data: Third quarter growth was revised downward; U.S. manufacturing growth reached “a 15-month low for the index, while job creation also slowed to an 18-month low”; and the housing market continued to slump. (“Pending sales of homes in the U.S. fell again in November to a four-year low in another sign of widespread weakness in the real estate market that’s likely to continue into 2019.″) That doesn’t mean we are on the doorstep of a recession, but it does mean that we are ending a period of giddy economic news — without the ordinary fiscal and monetary tools at our disposal to keep the economy buoyant. Trump has relied on the economy he inherited and the tax-cut bubble to keep his presidency afloat. Without those benefits, Trump faces the consequences of his own policies — and a Trump slump that threatens his increasingly narrow base of political support. Matt O’Brien: Republicans are celebrating the one-year anniversary of the Trump tax cuts. They shouldn’t be. Robert J. Samuelson: Inflation is back. Will it kill the economy?
Molecular Analysis of Sucrose Metabolism ofErwinia amylovora and Influence on Bacterial Virulence ABSTRACT Sucrose is an important storage and transport sugar of plants and an energy source for many phytopathogenic bacteria. To analyze regulation and biochemistry of sucrose metabolism of the fire blight pathogen Erwinia amylovora, a chromosomal fragment which enabled Escherichia coli to utilize sucrose as sole carbon source was cloned. By transposon mutagenesis, the scrregulon of E. amylovora was tagged, and its nucleotide sequence was determined. Five open reading frames, with the genesscrK, scrY, scrA, scrB, and scrR, had high homology to genes of the scrregulons from Klebsiella pneumoniae and plasmid pUR400.scrB and scrR of E. amylovora were fused to a histidine tag and to the maltose-binding protein (MalE) ofE. coli, respectively. ScrB (53 kDa) catalyzed the hydrolysis of sucrose with a Km of 125 mM. Binding of a MalE-ScrR fusion protein to an scrYAB promoter fragment was shown by gel mobility shifts. This complex dissociated in the presence of fructose but not after addition of sucrose. Expression of the scr regulon was studied with an scrYABpromoter-green fluorescent protein gene fusion and measured by flow cytometry and spectrofluorometry. The operon was affected by catabolite repression and induced by sucrose or fructose. The level of gene induction correlated to the sucrose concentration in plant tissue, as shown by flow cytometry. Sucrose mutants created by site-directed mutagenesis did not produce significant fire blight symptoms on apple seedlings, indicating the importance of sucrose metabolism for colonization of host plants by E. amylovora.
package com.kkmcn.sensordemo; import android.content.Context; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.BaseAdapter; import android.widget.TextView; import com.kkmcn.kbeaconlib2.KBAdvPackage.KBAccSensorValue; import com.kkmcn.kbeaconlib2.KBAdvPackage.KBAdvPacketEddyTLM; import com.kkmcn.kbeaconlib2.KBAdvPackage.KBAdvPacketSensor; import com.kkmcn.kbeaconlib2.KBAdvPackage.KBAdvType; import com.kkmcn.kbeaconlib2.KBeacon; public class LeDeviceListAdapter extends BaseAdapter { // Adapter for holding devices found through scanning. public interface ListDataSource { KBeacon getBeaconDevice(int nIndex); int getCount(); } private ListDataSource mDataSource; private Context mContext; public LeDeviceListAdapter(ListDataSource c, Context ctx) { super(); mDataSource = c; mContext = ctx; } @Override public int getCount() { return mDataSource.getCount(); } @Override public Object getItem(int i) { return mDataSource.getBeaconDevice(i); } @Override public long getItemId(int i) { return i; } @Override public View getView(int i, View view, ViewGroup viewGroup) { ViewHolder viewHolder; // General ListView optimization code. if (view == null) { view = LayoutInflater.from(mContext).inflate(R.layout.listitem_device, null); viewHolder = new ViewHolder(); viewHolder.deviceName = view .findViewById(R.id.beacon_name); viewHolder.deviceMacAddr = view .findViewById(R.id.beacon_mac_address); viewHolder.rssiState = view .findViewById(R.id.beacon_rssi); viewHolder.deviceBatteryVoltage = view .findViewById(R.id.beacon_battery_voltage); viewHolder.deviceTemperature = view .findViewById(R.id.beacon_temperature); viewHolder.deviceHumidity = view .findViewById(R.id.beacon_humidity); viewHolder.deviceAccPosition = view .findViewById(R.id.beacon_acc_position); view.setTag(viewHolder); } else { viewHolder = (ViewHolder) view.getTag(); } KBeacon device = mDataSource.getBeaconDevice(i); if (device == null) { return null; } if (device.getName() != null && device.getName().length() > 0) { viewHolder.deviceName.setText(device.getName()); } //common field String strMacAddress = mContext.getString(R.string.BEACON_MAC_ADDRESS) + device.getMac(); viewHolder.deviceMacAddr.setText(strMacAddress); String strRssiValue = mContext.getString(R.string.BEACON_RSSI_VALUE) + device.getRssi(); viewHolder.rssiState.setText(strRssiValue); //ibeacon data KBAdvPacketEddyTLM eddyTLM = (KBAdvPacketEddyTLM) device.getAdvPacketByType(KBAdvType.EddyTLM); KBAdvPacketSensor kSensor = (KBAdvPacketSensor) device.getAdvPacketByType(KBAdvType.Sensor); if (eddyTLM != null) { //battery percent String strBatteryPercent = mContext.getString(R.string.BEACON_BATTERY) + eddyTLM.getBatteryLevel(); viewHolder.deviceBatteryVoltage.setText(strBatteryPercent); //temperature String strMajorID = mContext.getString(R.string.BEACON_TEMPERATURE) + eddyTLM.getTemperature(); viewHolder.deviceTemperature.setText(strMajorID); } //eddy tlm if (kSensor != null) { if (kSensor.getBatteryLevel() != null) { String strTemp = mContext.getString(R.string.BEACON_VOLTAGE) + kSensor.getBatteryLevel() + "mV"; viewHolder.deviceBatteryVoltage.setText(strTemp); } if (kSensor.getTemperature() != null) { String strTemp = mContext.getString(R.string.BEACON_TEMPERATURE) + kSensor.getTemperature() + "℃"; viewHolder.deviceTemperature.setText(strTemp); } if (kSensor.getHumidity() != null) { String strTemp = mContext.getString(R.string.BEACON_HUM) + kSensor.getHumidity() + "%"; viewHolder.deviceHumidity.setText(strTemp); } KBAccSensorValue accSensorValue = kSensor.getAccSensor(); if (accSensorValue != null) { String strTemp = mContext.getString(R.string.BEACON_ACC_POS) + "x=" + accSensorValue.xAis + ",y=" + accSensorValue.yAis + ",z=" + accSensorValue.zAis; viewHolder.deviceAccPosition.setText(strTemp); } } return view; } class ViewHolder { TextView deviceName; //名称 TextView rssiState; //状态 TextView deviceBatteryVoltage; TextView deviceMacAddr; TextView deviceTemperature; TextView deviceHumidity; TextView deviceAccPosition; } }
from dataclasses import dataclass, field from typing import Optional __NAMESPACE__ = "http://www.opengis.net/gml" @dataclass class UnitOfMeasureType: uom: Optional[str] = field( default=None, metadata={ "type": "Attribute", "required": True, "pattern": r"[^: \n\r\t]+", }, )
Antioxidant Properties of Aminoethylcysteine Ketimine Decarboxylated Dimer: A Review Aminoethylcysteine ketimine decarboxylated dimer is a natural sulfur-containing compound detected in human plasma and urine, in mammalian brain and in many common edible vegetables. Over the past decade many studies have been undertaken to identify its metabolic role. Attention has been focused on its antioxidant properties and on its reactivity against oxygen and nitrogen reactive species. These properties have been studied in different model systems starting from plasma lipoproteins to specific cellular lines. All these studies report that aminoethylcysteine ketimine decarboxylated dimer is able to interact both with reactive oxygen and nitrogen species (hydrogen peroxide, superoxide anion, hydroxyl radical, peroxynitrite and its derivatives). Its antioxidant activity is similar to that of Vitamin E while higher than other hydrophilic antioxidants, such as trolox and N-acetylcysteine. Introduction Oxygen is the key molecule which enables aerobic metabolism in living organisms. However, due to its high reactivity, it is also able to damage bio-molecules by producing reactive oxygen species (ROS). For this reason living organisms have developed a large and complex network of antioxidant molecules and enzymes, able to protect cellular components such as nucleic acids, proteins and lipids from oxidative damage. According to a general definition, antioxidants can slow down or prevent the oxidation of other molecules by removing free radical intermediates. Cellular antioxidants can mainly act in two ways: (i) preventing these reactive species from being formed, or (ii) inactivating them before they are able to damage cellular components. ROS production occurs physiologically during aerobic metabolism and the main role of the antioxidant network present within the cell is to buffer their overproduction, by keeping them at a level where their physiological role can be carried out (i.e., redox signaling). An imbalance of the antioxidant system may cause severe cellular damage and lead to oxidative stress condition, which is often involved in the pathogenesis of important diseases, such as cancer and atherosclerosis. This imbalance is also implicated in other pathological conditions (such as malaria and rheumatoid arthritis) and could play a role in neurodegenerative diseases and ageing processes. In the last decades, research has been focused on prevention of oxidative damage. The molecular mechanisms involved in the radical scavenging activity of many natural antioxidants and the role they have in human health have been extensively studied. A lot of attention has been focused on dietary antioxidants (-tocopherol, -carotene, ascorbic acid), as they may act together with endogenous antioxidant metabolites and enzymes (superoxide dismutase, glutathione peroxidase, catalase) in reducing ROS level. Several epidemiological studies have already highlighted that a high intake of plant products rich in antioxidants is associated with a reduced risk of a number of severe chronic diseases, such as atherosclerosis and cancer. The protection that fruits and vegetables provide against several diseases has been attributed to various antioxidants present in these species, such as vitamin C, vitamin E, -tocopherol, -carotene and polyphenolic compounds. In recent years the work of our research group has been focused on a small group of natural sulfur-containing iminoacids deriving from L-cystathionine, L-lanthionine and (S)-2-aminoethyl-L-cysteine. All of them have been identified in biological tissues and fluids but, until now, their biological function is still unclear. Among these compounds, aminoethylcysteine ketimine decarboxylated dimer was also detected in many edible vegetables and, while a physiological role has not yet been described for this molecule, its antioxidant properties have been extensively explored and are described in this review. Sulfur-Containing Antioxidants Sulfur plays a critical role in biology, it is widely distributed among living organisms and, particularly, is found in many peptides, proteins and low molecular weight compounds. Among the sulfur species found in plants, bacteria, fungi and animals, there are many agents with unique chemical and biochemical properties, which are linked to redox processes, metal binding and catalytic reactions. The antibiotic and anticarcinogenic properties of sulfur compounds such as thiols, thiosulfinates, thiosulfonates, isothiocyanates, sulfoxides, sulfones, sulfinates and polysulfides make them interesting from a pharmacological perspective. The full impact of sulfur in biological systems becomes evident when one considers the diversity of sulfur species and the reactions in which sulfur is involved. These reactions are the result of: (i) the range of different oxidation states sulfur can occupy in vivo; (ii) the abundance of different chemotypes possible for each oxidation state; (iii) the various chemical properties that each chemotype exhibits in addition to redox activity, i.e., electrostatic interactions, hydrogen bonding, acid-base properties, nucleophilicity and electrophilicity, metal-binding and catalysis. Among these properties, redox-activity, metal binding and nucleophilic substitution are the mechanism most frequently employed by cells to remove oxidative stressors, adventitious metal ions and toxic substances. In recent years, increasing attention has been focused on the discovery of new physiological sulfur compounds that show antioxidant activities. Among these, a very interesting one is aminoethylcysteine ketimine decarboxylated dimer (Figure 1), which is a member of a group of eterocyclic ketimines containing sulfur and nitrogen arising from the metabolism of L-cystathionine, L-lanthionine and (S)-2-aminoethyl-L-cysteine. Many of these ketimines and their derivatives have been found in detectable amounts in mammalian tissues and fluids. Aminoethylcysteine Ketimine Decarboxylated Dimer The chemical synthesis of 1 was first achieved by Hermann and coworkers in 1961 in very good yields starting from cysteamine and bromopyruvic acid. Over the past several years, this molecule has been detected in many mammalian tissues and fluids (human plasma, 2-3 M,, human urine and in bovine cerebellum, 0.6-1 nmol/g wet weight ). Recently it was also identified in the brain of cysteamine-treated rats. These findings seem particularly important because they allow formulating new hypotheses on the metabolic origin of this molecule. According to Pinto and coworkers, 1 cannot be detected in the brain of rats that are not fed a cysteamine-supplemented diet, suggesting that the brain has the capacity to synthesize 1 when supplied with an adequate amount of this aminothiol. In fact, although a metabolic route leading to in vivo formation of 1 has not been identified yet, one of the current hypotheses is that it can be formed in vivo from the dimerization of aminoethylcysteine ketimine, followed by a spontaneous decarboxylation step (Scheme 1). Scheme 1. Hypothetical pathway leading to the in vivo synthesis of 1. Compound 2 can be endogenously synthesized starting from cysteamine and serine in a two-steps biosynthetic path involving cystathionine -synthase and glutamine transaminase. As 1 has been detected in many common Mediterranean edible vegetables (where it is present at a concentration range of nmol/g plant material), it can be alternatively considered a vitamin-like compound being introduced in the diet. Besides efforts to detect this molecule in biological samples, over the past decade many studies have been undertaken to identify its metabolic role. Attention has been focused on its antioxidant properties and on its reactivity against oxygen and nitrogen reactive species. These properties have been studied in different model systems starting from plasma lipoproteins to specific cellular lines. All these studies report that 1 is able to interact with reactive oxygen and nitrogen species (hydrogen peroxide, superoxide anion, hydroxyl radical, peroxynitrite and its derivatives) in all the tested models. In addition, in order to understand the molecular mechanism underlying its antioxidant properties, research efforts have been focused on the oxidation products of 1. Until now three different products have been isolated and characterized, while several others need further analyses to be identified. As expected, sulfur plays a key role in the antioxidant properties of 1. Each sulfur atom can be oxidized to sulfoxide and subsequently to sulfone, leading to the formation of several oxidized species. In addition, a dimeric form and a dehydrogenated product of 1 were also detected, suggesting that the molecular architecture is as important as the presence of sulfur groups. Aminoethylcysteine Ketimine Decarboxylated Dimer as Scavenger of Reactive Oxygen Species Various processes inside the cell produce reactive oxygen species (ROS). Some of the most common ROS are hydrogen peroxide (H 2 O 2 ), superoxide ion (O 2 − ), hydroxide and hydroxyl ions (OH − and OH-respectively). Compound 1 is able to quench ROS leading to the formation of different oxidative products. In Scheme 2 two oxidation products of 1, which have been isolated and characterized so far, are shown. Compound 4, which shows an additional unsaturation with respect to 1, may arise from an oxidative dehydrogenation path that involves the carbons 10 and 10a of the tricyclic structure. This molecule is formed in vitro in the presence of CuCl 2 /tert-butyl hydroperoxide (t-BOOH) or 2,2'-azo-bis-2-amidinopropane hydrochloride. Compound 5 is produced when 1 reacts with hydrogen peroxide. Several other species have been identified by GC-MS but not yet unambiguously characterized. Among these, the chromatographic analysis shows the presence of at least four different oxidation products, whose mass and fragmentation patterns suggest the formation of 1-sulfone, 4-sulfoxide, 4-sulfone and hydroxyl-1, on the basis of that reported by Pecci et al.. As already mentioned, endogenous ROS are known to play an important role in ethiopathogenesis of some common and severe chronic diseases, such as atherosclerosis. Besides the in vitro studies carried out to test the quenching activity of 1 towards ROS, ex vivo assays on isolated human low-density lipoproteins (LDL) were performed. It is known that oxidation of LDL is an important event implicated in the pathogenesis of atherosclerosis. Oxidized LDL that are no longer recognized by the LDL receptor of the macrophages, are internalized in these cells, via the scavenger receptor pathway, leading to the formation of foam cells. The resistance of LDL to oxidative modification is linked to its fatty acids composition and to circulating levels of antioxidant compounds. Compound 1 has already been found to be associated to plasma lipoproteins in humans, while another study demonstrated its efficacy in inhibiting the copper-catalyzed oxidation of human LDL. Cu 2+ catalyzes the lipoprotein oxidation in two main ways: (i) at the protein moiety level ; (ii) at the lipid moiety level, via decomposion of pre-existing lipid hydroperoxides and generation of peroxyl-and alkoxyl radicals, which initiate lipid peroxidation. Since 1 shows scavenging activity against peroxyl (or alkoxyl) radicals, the main propagating species involved in the LDL lipoperoxidation, it seems reasonable to hypothesize that this could be the possible molecular protection mechanism carried out by 1 against LDL oxidation. The biological relevance of this study is that AECK-DD is active at concentrations comparable to those found in human plasma. For this reason AECK-DD antioxidant properties were also tested on a human U937 monocytic cell line in the presence of the oxidant t-BOOH. In fact, it has been recognized that monocyte-endothelium adhesion is a crucial early event in atherogenesis and that plasma antioxidants can prevent or reduce it. U937 is a well characterized cell line and the response of this cell line to various inflammatory agents has been well documented. The antioxidant activity of 1 is carried out within the U937 cells, as its uptake has been demonstrated by HPLC-ECD and GC-MS analyses. A 24 h treatment with 50 and 250 M AECK-DD, resulted in the incorporation of 0.10 ± 0.01 and 0.47 ± 0.08 ng AECK-DD 10 cells respectively. In addition, 1 did not display any cytotoxic effect up to the range of mM concentration in the culture medium. Further, at this concentration level, no pro-apoptotic effect has been observed by DNA fragmentation measurements. Compound 1 in concentration range 4-100 M protects U937 cells from oxidative injury, as revealed by the higher viability maintained with respect to control cells during t-BOOH treatment. It is reported that low concentrations of t-BOOH lethally affect cultured cells by a mechanism that is dependent on the cellular lipids peroxidation. Therefore, an association of 1 to cellular membranes due to its hydrophobicity could explain its high efficiency in protecting cells against t-BOOH-induced oxidative injury. The antioxidant activity of 1 was compared with other known antioxidants with similar results to that of vitamin E, and higher than other hydrophilic antioxidants tested (trolox and N-acetylcysteine). The results obtained by Macone and coworkers indicated that the ability of 1 to protect human monocytic U937 cells from t-BOOH-induced oxidative stress seems to be mediated by its ability to maintain both intracellular glutathione levels and a reducing environment inside the cell, and to slow down the onset of lipid peroxidation. The protective effect of 1 might be due to a direct quenching of free radicals, produced during t-BOOH treatment, by 1 itself. Moreover, data indicate that 1 is able to significantly reduce the intracellular level of pro-oxidant species in U937 cells in basal conditions. Such studies demonstrated for the first time an antioxidant action of 1 inside the cells, and its ability to modulate cellular response to oxidative stress. As already mentioned, the concentration of 1 in which its antioxidant activity is carried out, is in the range of that measured in human plasma from healthy subjects in fasting conditions. In addition, due to the presence of 1 in human diet, the physiological concentrations of this molecule in non-fasting conditions may be expected to be even higher than those measured in fasting humans. Therefore it can be suggested that, at the concentrations present in human plasma, 1 can really play a significant role in the modulation of oxidative processes in vivo. Aminoethylcysteine Ketimine Decarboxylated Dimer as Scavenger of Reactive Nitrogen Species Reactive nitrogen species (RNS) are a family of molecules derived from nitric oxide ( NO). In particular, the product of the diffusion-controlled reaction between nitric oxide ( NO) and superoxide anion (O 2 − ) is peroxynitrite (ONOO − /ONOOH), a strong oxidizing and nitrating agent that reacts with several biomolecules. Besides its activity as oxidative process modulator, a scavenging activity on peroxynitrite has been described for 1. Peroxynitrite is an endogenous mediator of various forms of tissue damage in several human pathologies, including neurodegenerative diseases, atherosclerosis, inflammatory and autoimmune diseases.. Peroxynitrite is known to mediate oxidation of suitable substrates, either through a direct two-electron mechanism or through an indirect one-electron reaction involving hydroxyl ( OH) and nitrogen dioxide ( NO 2 ) radicals released during peroxynitrite homolysis [59,. Under physiological conditions, peroxynitrite predominantly reacts with carbon dioxide and the oxidative reactions of peroxynitrite are mediated by (i) the carbonate radical anion (CO 3 − ); (ii) NO 2 generated by decomposition of the short-lived peroxynitrite-CO 2 adduct. After reaction with peroxynitrite, 1 undergoes oxidative modifications, yielding a dimeric form of the parent compound (Scheme 3), which has so far been isolated and characterized using 1D and 2D nuclear magnetic resonanceand ion trap mass spectrometry. The proposed mechanism for the formation of the peroxynitrite-oxidation derivative of 1 involves the radical dimerization of 1. Peroxynitrite induces lipid peroxidation, oxidizes protein and non-protein thiol groups and reacts with tyrosine to yield 3-nitrotyrosine. The occurrence of 3-nitrotyrosine is considered the molecular footprint left by reaction of RNS with biomolecules, while nitrated tyrosine residues are actually considered as biomarkers in a variety of pathophysiological conditions. In addition, peroxynitrite can oxidize free methionine and methionine residues in proteins, e.g., in the 1 -antiproteinase ( 1 AP), where the oxidation of a critical methionine residue destroys the 1 AP activity. Peroxynitrite also plays a role in the oxidation of low density lipoprotein. Its generation in vivo leads to oxidative modification of blood lipoprotein, which is thought to be a critical event in the development of cardiovascular diseases, including atherosclerosis. Tyrosine, when exposed to peroxynitrite at neutral pH, undergoes nitration to form 3-nitrotyrosine. Compound 1 decreases the peroxynitrite-mediated tyrosine nitration in a concentration-dependent manner. In the M range concentration of 1, reduction of nitration was higher than 50%. At higher (100 M) concentration, the nitration is even completely prevented. Compared with other sulfur compounds with established antioxidant activity, 1 showed a protective effect similar to that of glutathioneand N-acetylcysteine, but higher than that of methionine. As reported above, peroxynitrite can oxidize methionine residues in proteins. Treatment of 1 AP with peroxynitrite causes a strong reduction in its elastase inhibitory capacity, as a consequence of the oxidation of a critical methionine. Compound 1 was able to carry out complete protection against 1 AP inactivation, even at concentrations much lower than those of peroxynitrite. Compound 1 did not show any protective effect if added to 1 AP preincubated with peroxynitrite, indicating that 1 did not reverse but prevent 1 AP inactivation by scavenging peroxynitrite and/or its decomposition products. It has been previously reported that peroxynitrite is able to oxidatively modify LDL. LDL preincubation with 1 before peroxynitrite addition clearly demonstrated the effectiveness of 1 in decreasing peroxynitrite-mediated LDL oxidation. Compound 1 was able to prevent the oxidation of LDL almost completely.. These results showed that 1 is a powerful scavenger of peroxynitrite and/or its derived species as it could efficiently protect tyrosine against nitration, 1 AP against inactivation and LDL against modification. At present these data do not give indications about the mechanism of protection. Compound 1 could act by directly scavenging peroxynitrite or via a combination with reactive intermediates of peroxynitrite decomposition. Conclusions Over the past decade many studies have been undertaken to identify the metabolic role of aminoethylcysteine ketimine decarboxylate dimer, a natural sulfur-containing compound detected in human plasma and urine, mammalian brain and in many common edible vegetables. Attention has been focused on its antioxidant properties and on its reactivity against oxygen and nitrogen reactive species. All the reviewed studies report that aminoethylcysteine ketimine decarboxylate dimer is able to interact both with reactive oxygen and nitrogen species (hydrogen peroxide, superoxide anion, hydroxyl radical, peroxynitrite and its derivatives) protecting human low-density lipoprotein and cultured monocytes against oxidative injury. In these model systems, its antioxidant activity produced similar results to that of Vitamin E and higher than other hydrophilic antioxidant, such as trolox and N-acetylcysteine. In addition, 1 is able to quench ROS and RNS leading to the formation of different oxidative products that have been isolated and characterized. The study of several other oxidation products will lead to a better understanding of the molecular mechanism that underlies its powerful action as an antioxidant.
Butter, eggs and cream cheese should be at room temperature. In saucepan, bring milk and buttermilk to a boil. When it reaches a boiling point, turn off heat and remove pan. Pour hot milk in mixing bowl, allow the butter to melt in. Then stir in sugar. Touch the milk mixture to test temperature: It should feel lukewarm. Stir in yeast and let sit for 10 minutes. Use a dough hook or spatula and mix the ingredients on low speed. Add eggs, salt and flour. Knead dough for 10 minutes. Cover bowl with plastic: allow dough to rise until doubled, about 90 minutes. Separately,mix ail of the orange filling ingredients in a medium bowl. Let the mixture sit until you are ready to roll out the dough. Preheat oven to 375 degrees. Take the dough out of the bowl; place on clean and floured surface. Roll the dough out in to a large rectangle, about 18-by-20 inches. Evenly spread the filling over the dough rectangle, leaving an inch of dough uncovered. Start at the edge with the filling and roll the dough into itself with both of your hands. When it's one long roll, cut the log to make 12 rolls; place in well-buttered pan in middle oven rack for even baking. For icing: Combine all icing ingredients except orange zest into a bowl. Beat until smooth. Gently fold in zest. After 20 minutes, remove rolls from oven: immediately spread half of the icing on top. After 7 minutes, spread the other half of the icing. Garnish with orange zest. Margie De Mario-Getuldsen, East Rockaway. N.Y. Make chocolate cake according to box directions. Spray Pam in a 9x13 inch cake pan. Spread chocolate cake evenly in pan. In a separate bowl mix ricotta. sugar vanilla and eggs until well combined. Carefully pour and spread the ricotta mixture over the cake. I don't go to the very ends. Do not mix into chocolate cake. Just allow it to sit on top. The cake will rise over ricotta when cooking. Cook in a preheated 350 degree oven for anywhere from 1 hour to 75 minutes, whenever cake is firm to the touch. Allow cake to completely cool. This takes time. Then place in fridge overnight if possible. For the Icing: Blend milk and instant pudding till it gets thick. Then add whole container of cool whip and combine well. Makes a very light mousse icing. Store both the cake and icing in the fridge. I put the icing on the side and allow everyone to put as big a dollop of mousse as they want on their slice of cake. Peel bananas and microwave 5 minutes; Strain and discard liquid. Mash. Then cream butter and sugar; add eggs and vanilla. Mix flour, soda, salt and cinnamon and blend with the creamed mixture. Fold in mashed cooled bananas. Fold in nuts, reserve a little. Put batter in pan and top with reserve nuts and sprinkle brown sugar. Bake in a 350 degree oven for 1 hour. Test with toothpick. The bread is done when the center is dry.
class PRDD: """A Pandas Resilient Distributed Dataset (PRDD), is an extension of a Spark RDD. You can access the underlying RDD at _rdd, but be careful doing so. Note: RDDs are lazy, so you operations are not performed until required.""" def __init__(self, rdd): self._rdd = rdd @classmethod def from_rdd(cls, rdd): """Construct a PRDD from an RDD. No checking or validation occurs.""" return PRDD(rdd) def to_spark_sql(self): """A Sparkling Pandas specific function to turn a DDF into something that Spark SQL can query. To use the result you will need to call sqlCtx.inferSchema(rdd) and then register the result as a table. Once Spark 1.1 is released this function may be deprecated and replacted with to_spark_sql_schema_rdd.""" raise NotImplementedError("Method deprecated, please use " "to_spark_sql_schema_rdd instead!") def applymap(self, func, **kwargs): """Return a new PRDD by applying a function to each element of each pandas DataFrame.""" return self.from_rdd( self._rdd.map(lambda data: data.applymap(func), **kwargs)) def __getitem__(self, key): """Returns a new PRDD of elements from that key.""" return self.from_rdd(self._rdd.map(lambda x: x[key])) def groupby(self, *args, **kwargs): """Takes the same parameters as groupby on DataFrame. Like with groupby on DataFrame disabling sorting will result in an even larger performance improvement. This returns a Sparkling Pandas L{GroupBy} object which supports many of the same operations as regular GroupBy but not all.""" from sparklingpandas.groupby import GroupBy return GroupBy(self._rdd, *args, **kwargs) @property def dtypes(self): """ Return the dtypes associated with this object Uses the types from the first frame. """ return self._rdd.first().dtypes @property def ftypes(self): """ Return the ftypes associated with this object Uses the types from the first frame. """ return self._rdd.first().ftypes def get_dtype_counts(self): """ Return the counts of dtypes in this object Uses the information from the first frame """ return self._rdd.first().get_dtype_counts() def get_ftype_counts(self): """ Return the counts of ftypes in this object Uses the information from the first frame """ return self._rdd.first().get_ftype_counts() @property def axes(self): return (self._rdd.map(lambda frame: frame.axes) .reduce(lambda xy, ab: [xy[0].append(ab[0]), xy[1]])) @property def shape(self): return (self._rdd.map(lambda frame: frame.shape) .reduce(lambda xy, ab: (xy[0] + ab[0], xy[1]))) def collect(self): """Collect the elements in an PRDD and concatenate the partition.""" # The order of the frame order appends is based on the implementation # of reduce which calls our function with # f(valueToBeAdded, accumulator) so we do our reduce implementation. def append_frames(frame_a, frame_b): return frame_a.append(frame_b) return self._custom_rdd_reduce(append_frames) def _custom_rdd_reduce(self, reduce_func): """Provides a custom RDD reduce which preserves ordering if the RDD has been sorted. This is useful for us because we need this functionality as many pandas operations support sorting the results. The standard reduce in PySpark does not have this property. Note that when PySpark no longer does partition reduces locally this code will also need to be updated.""" def accumulating_iter(iterator): acc = None for obj in iterator: if acc is None: acc = obj else: acc = reduce_func(acc, obj) if acc is not None: yield acc vals = self._rdd.mapPartitions(accumulating_iter).collect() return reduce(accumulating_iter, vals) def stats(self, columns): """Compute the stats for each column provided in columns. Parameters ---------- columns : list of str, contains all columns to compute stats on. """ def reduce_func(sc1, sc2): return sc1.merge_pstats(sc2) return self._rdd.mapPartitions(lambda partition: [ PStatCounter(dataframes=partition, columns=columns)])\ .reduce(reduce_func)
// Returns remote IP address of the requested client func Remote(req *http.Request) (net.IP, error) { ip, _, err := net.SplitHostPort(req.RemoteAddr) if err != nil { return nil, err } remoteIP := net.ParseIP(ip) if remoteIP == nil { return nil, errors.New("Not a remote IP") } return remoteIP, nil }
<gh_stars>1-10 /** * \file PnlWdbeNavDescr.cpp * job handler for job PnlWdbeNavDescr (implementation) * \copyright (C) 2016-2020 MPSI Technologies GmbH * \author <NAME> (auto-generation) * \date created: 28 Nov 2020 */ // IP header --- ABOVE #ifdef WDBECMBD #include <Wdbecmbd.h> #else #include <Wdbed.h> #endif #include "PnlWdbeNavDescr.h" #include "PnlWdbeNavDescr_blks.cpp" #include "PnlWdbeNavDescr_evals.cpp" using namespace std; using namespace Sbecore; using namespace Xmlio; // IP ns.cust --- INSERT /****************************************************************************** class PnlWdbeNavDescr ******************************************************************************/ PnlWdbeNavDescr::PnlWdbeNavDescr( XchgWdbe* xchg , DbsWdbe* dbswdbe , const ubigint jrefSup , const uint ixWdbeVLocale ) : JobWdbe(xchg, VecWdbeVJob::PNLWDBENAVDESCR, jrefSup, ixWdbeVLocale) { jref = xchg->addJob(dbswdbe, this, jrefSup); feedFLstBnk.tag = "FeedFLstBnk"; feedFLstCmd.tag = "FeedFLstCmd"; feedFLstErr.tag = "FeedFLstErr"; feedFLstFst.tag = "FeedFLstFst"; feedFLstGen.tag = "FeedFLstGen"; feedFLstMod.tag = "FeedFLstMod"; feedFLstPin.tag = "FeedFLstPin"; feedFLstPph.tag = "FeedFLstPph"; feedFLstPrc.tag = "FeedFLstPrc"; feedFLstPrt.tag = "FeedFLstPrt"; feedFLstSig.tag = "FeedFLstSig"; feedFLstVar.tag = "FeedFLstVar"; feedFLstVec.tag = "FeedFLstVec"; feedFLstVit.tag = "FeedFLstVit"; // IP constructor.cust1 --- INSERT // IP constructor.cust2 --- INSERT set<uint> moditems; refreshMod(dbswdbe, moditems); refreshVec(dbswdbe, moditems); refreshVit(dbswdbe, moditems); refreshCmd(dbswdbe, moditems); refreshErr(dbswdbe, moditems); refreshPph(dbswdbe, moditems); refreshBnk(dbswdbe, moditems); refreshPin(dbswdbe, moditems); refreshGen(dbswdbe, moditems); refreshPrt(dbswdbe, moditems); refreshSig(dbswdbe, moditems); refreshPrc(dbswdbe, moditems); refreshFst(dbswdbe, moditems); refreshVar(dbswdbe, moditems); refresh(dbswdbe, moditems); xchg->addClstn(VecWdbeVCall::CALLWDBEHUSRRUNVMOD_CRDUSREQ, jref, Clstn::VecVJobmask::ALL, 0, false, Arg(), 0, Clstn::VecVJactype::LOCK); // IP constructor.cust3 --- INSERT xchg->addIxRefClstn(VecWdbeVCall::CALLWDBEHUSRRUNVMOD_CRDUSREQ, jref, Clstn::VecVJobmask::ALL, 0, false, VecWdbeVCard::CRDWDBEMOD, xchg->getRefPreset(VecWdbeVPreset::PREWDBEOWNER, jref)); xchg->addIxRefClstn(VecWdbeVCall::CALLWDBEHUSRRUNVMOD_CRDUSREQ, jref, Clstn::VecVJobmask::ALL, 0, false, VecWdbeVCard::CRDWDBEVEC, xchg->getRefPreset(VecWdbeVPreset::PREWDBEOWNER, jref)); xchg->addIxRefClstn(VecWdbeVCall::CALLWDBEHUSRRUNVMOD_CRDUSREQ, jref, Clstn::VecVJobmask::ALL, 0, false, VecWdbeVCard::CRDWDBEVIT, xchg->getRefPreset(VecWdbeVPreset::PREWDBEOWNER, jref)); xchg->addIxRefClstn(VecWdbeVCall::CALLWDBEHUSRRUNVMOD_CRDUSREQ, jref, Clstn::VecVJobmask::ALL, 0, false, VecWdbeVCard::CRDWDBECMD, xchg->getRefPreset(VecWdbeVPreset::PREWDBEOWNER, jref)); xchg->addIxRefClstn(VecWdbeVCall::CALLWDBEHUSRRUNVMOD_CRDUSREQ, jref, Clstn::VecVJobmask::ALL, 0, false, VecWdbeVCard::CRDWDBEERR, xchg->getRefPreset(VecWdbeVPreset::PREWDBEOWNER, jref)); xchg->addIxRefClstn(VecWdbeVCall::CALLWDBEHUSRRUNVMOD_CRDUSREQ, jref, Clstn::VecVJobmask::ALL, 0, false, VecWdbeVCard::CRDWDBEPPH, xchg->getRefPreset(VecWdbeVPreset::PREWDBEOWNER, jref)); xchg->addIxRefClstn(VecWdbeVCall::CALLWDBEHUSRRUNVMOD_CRDUSREQ, jref, Clstn::VecVJobmask::ALL, 0, false, VecWdbeVCard::CRDWDBEBNK, xchg->getRefPreset(VecWdbeVPreset::PREWDBEOWNER, jref)); xchg->addIxRefClstn(VecWdbeVCall::CALLWDBEHUSRRUNVMOD_CRDUSREQ, jref, Clstn::VecVJobmask::ALL, 0, false, VecWdbeVCard::CRDWDBEPIN, xchg->getRefPreset(VecWdbeVPreset::PREWDBEOWNER, jref)); xchg->addIxRefClstn(VecWdbeVCall::CALLWDBEHUSRRUNVMOD_CRDUSREQ, jref, Clstn::VecVJobmask::ALL, 0, false, VecWdbeVCard::CRDWDBEGEN, xchg->getRefPreset(VecWdbeVPreset::PREWDBEOWNER, jref)); xchg->addIxRefClstn(VecWdbeVCall::CALLWDBEHUSRRUNVMOD_CRDUSREQ, jref, Clstn::VecVJobmask::ALL, 0, false, VecWdbeVCard::CRDWDBEPRT, xchg->getRefPreset(VecWdbeVPreset::PREWDBEOWNER, jref)); xchg->addIxRefClstn(VecWdbeVCall::CALLWDBEHUSRRUNVMOD_CRDUSREQ, jref, Clstn::VecVJobmask::ALL, 0, false, VecWdbeVCard::CRDWDBESIG, xchg->getRefPreset(VecWdbeVPreset::PREWDBEOWNER, jref)); xchg->addIxRefClstn(VecWdbeVCall::CALLWDBEHUSRRUNVMOD_CRDUSREQ, jref, Clstn::VecVJobmask::ALL, 0, false, VecWdbeVCard::CRDWDBEPRC, xchg->getRefPreset(VecWdbeVPreset::PREWDBEOWNER, jref)); xchg->addIxRefClstn(VecWdbeVCall::CALLWDBEHUSRRUNVMOD_CRDUSREQ, jref, Clstn::VecVJobmask::ALL, 0, false, VecWdbeVCard::CRDWDBEFST, xchg->getRefPreset(VecWdbeVPreset::PREWDBEOWNER, jref)); xchg->addIxRefClstn(VecWdbeVCall::CALLWDBEHUSRRUNVMOD_CRDUSREQ, jref, Clstn::VecVJobmask::ALL, 0, false, VecWdbeVCard::CRDWDBEVAR, xchg->getRefPreset(VecWdbeVPreset::PREWDBEOWNER, jref)); }; PnlWdbeNavDescr::~PnlWdbeNavDescr() { // IP destructor.spec --- INSERT // IP destructor.cust --- INSERT xchg->removeJobByJref(jref); }; // IP cust --- INSERT DpchEngWdbe* PnlWdbeNavDescr::getNewDpchEng( set<uint> items ) { DpchEngWdbe* dpcheng = NULL; if (items.empty()) { dpcheng = new DpchEngWdbeConfirm(true, jref, ""); } else { insert(items, DpchEngData::JREF); dpcheng = new DpchEngData(jref, &contiac, &feedFLstBnk, &feedFLstCmd, &feedFLstErr, &feedFLstFst, &feedFLstGen, &feedFLstMod, &feedFLstPin, &feedFLstPph, &feedFLstPrc, &feedFLstPrt, &feedFLstSig, &feedFLstVar, &feedFLstVec, &feedFLstVit, &statshr, items); }; return dpcheng; }; void PnlWdbeNavDescr::refreshLstMod( DbsWdbe* dbswdbe , set<uint>& moditems ) { StatShr oldStatshr(statshr); statshr.LstModAvail = evalLstModAvail(dbswdbe); statshr.ButModViewActive = evalButModViewActive(dbswdbe); statshr.ButModNewcrdActive = evalButModNewcrdActive(dbswdbe); if (statshr.diff(&oldStatshr).size() != 0) insert(moditems, DpchEngData::STATSHR); }; void PnlWdbeNavDescr::refreshMod( DbsWdbe* dbswdbe , set<uint>& moditems ) { ContIac oldContiac(contiac); ListWdbeHistRMUserUniversal rst; WdbeHistRMUserUniversal* rec = NULL; // contiac contiac.numFLstMod = 0; // feedFLstMod feedFLstMod.clear(); dbswdbe->tblwdbehistrmuseruniversal->loadRstByUsrCrd(xchg->getRefPreset(VecWdbeVPreset::PREWDBEOWNER, jref), VecWdbeVCard::CRDWDBEMOD, false, rst); for (unsigned int i = 0; i < rst.nodes.size(); i++) { rec = rst.nodes[i]; feedFLstMod.appendRefTitles(rec->ref, StubWdbe::getStubModStd(dbswdbe, rec->unvUref, ixWdbeVLocale)); }; insert(moditems, DpchEngData::FEEDFLSTMOD); if (contiac.diff(&oldContiac).size() != 0) insert(moditems, DpchEngData::CONTIAC); refreshLstMod(dbswdbe, moditems); }; void PnlWdbeNavDescr::refreshLstVec( DbsWdbe* dbswdbe , set<uint>& moditems ) { StatShr oldStatshr(statshr); statshr.LstVecAvail = evalLstVecAvail(dbswdbe); statshr.ButVecViewActive = evalButVecViewActive(dbswdbe); statshr.ButVecNewcrdActive = evalButVecNewcrdActive(dbswdbe); if (statshr.diff(&oldStatshr).size() != 0) insert(moditems, DpchEngData::STATSHR); }; void PnlWdbeNavDescr::refreshVec( DbsWdbe* dbswdbe , set<uint>& moditems ) { ContIac oldContiac(contiac); ListWdbeHistRMUserUniversal rst; WdbeHistRMUserUniversal* rec = NULL; // contiac contiac.numFLstVec = 0; // feedFLstVec feedFLstVec.clear(); dbswdbe->tblwdbehistrmuseruniversal->loadRstByUsrCrd(xchg->getRefPreset(VecWdbeVPreset::PREWDBEOWNER, jref), VecWdbeVCard::CRDWDBEVEC, false, rst); for (unsigned int i = 0; i < rst.nodes.size(); i++) { rec = rst.nodes[i]; feedFLstVec.appendRefTitles(rec->ref, StubWdbe::getStubVecStd(dbswdbe, rec->unvUref, ixWdbeVLocale)); }; insert(moditems, DpchEngData::FEEDFLSTVEC); if (contiac.diff(&oldContiac).size() != 0) insert(moditems, DpchEngData::CONTIAC); refreshLstVec(dbswdbe, moditems); }; void PnlWdbeNavDescr::refreshLstVit( DbsWdbe* dbswdbe , set<uint>& moditems ) { StatShr oldStatshr(statshr); statshr.LstVitAvail = evalLstVitAvail(dbswdbe); statshr.ButVitViewActive = evalButVitViewActive(dbswdbe); if (statshr.diff(&oldStatshr).size() != 0) insert(moditems, DpchEngData::STATSHR); }; void PnlWdbeNavDescr::refreshVit( DbsWdbe* dbswdbe , set<uint>& moditems ) { ContIac oldContiac(contiac); ListWdbeHistRMUserUniversal rst; WdbeHistRMUserUniversal* rec = NULL; // contiac contiac.numFLstVit = 0; // feedFLstVit feedFLstVit.clear(); dbswdbe->tblwdbehistrmuseruniversal->loadRstByUsrCrd(xchg->getRefPreset(VecWdbeVPreset::PREWDBEOWNER, jref), VecWdbeVCard::CRDWDBEVIT, false, rst); for (unsigned int i = 0; i < rst.nodes.size(); i++) { rec = rst.nodes[i]; feedFLstVit.appendRefTitles(rec->ref, StubWdbe::getStubVitStd(dbswdbe, rec->unvUref, ixWdbeVLocale)); }; insert(moditems, DpchEngData::FEEDFLSTVIT); if (contiac.diff(&oldContiac).size() != 0) insert(moditems, DpchEngData::CONTIAC); refreshLstVit(dbswdbe, moditems); }; void PnlWdbeNavDescr::refreshLstCmd( DbsWdbe* dbswdbe , set<uint>& moditems ) { StatShr oldStatshr(statshr); statshr.LstCmdAvail = evalLstCmdAvail(dbswdbe); statshr.ButCmdViewActive = evalButCmdViewActive(dbswdbe); statshr.ButCmdNewcrdActive = evalButCmdNewcrdActive(dbswdbe); if (statshr.diff(&oldStatshr).size() != 0) insert(moditems, DpchEngData::STATSHR); }; void PnlWdbeNavDescr::refreshCmd( DbsWdbe* dbswdbe , set<uint>& moditems ) { ContIac oldContiac(contiac); ListWdbeHistRMUserUniversal rst; WdbeHistRMUserUniversal* rec = NULL; // contiac contiac.numFLstCmd = 0; // feedFLstCmd feedFLstCmd.clear(); dbswdbe->tblwdbehistrmuseruniversal->loadRstByUsrCrd(xchg->getRefPreset(VecWdbeVPreset::PREWDBEOWNER, jref), VecWdbeVCard::CRDWDBECMD, false, rst); for (unsigned int i = 0; i < rst.nodes.size(); i++) { rec = rst.nodes[i]; feedFLstCmd.appendRefTitles(rec->ref, StubWdbe::getStubCmdStd(dbswdbe, rec->unvUref, ixWdbeVLocale)); }; insert(moditems, DpchEngData::FEEDFLSTCMD); if (contiac.diff(&oldContiac).size() != 0) insert(moditems, DpchEngData::CONTIAC); refreshLstCmd(dbswdbe, moditems); }; void PnlWdbeNavDescr::refreshLstErr( DbsWdbe* dbswdbe , set<uint>& moditems ) { StatShr oldStatshr(statshr); statshr.LstErrAvail = evalLstErrAvail(dbswdbe); statshr.ButErrViewActive = evalButErrViewActive(dbswdbe); statshr.ButErrNewcrdActive = evalButErrNewcrdActive(dbswdbe); if (statshr.diff(&oldStatshr).size() != 0) insert(moditems, DpchEngData::STATSHR); }; void PnlWdbeNavDescr::refreshErr( DbsWdbe* dbswdbe , set<uint>& moditems ) { ContIac oldContiac(contiac); ListWdbeHistRMUserUniversal rst; WdbeHistRMUserUniversal* rec = NULL; // contiac contiac.numFLstErr = 0; // feedFLstErr feedFLstErr.clear(); dbswdbe->tblwdbehistrmuseruniversal->loadRstByUsrCrd(xchg->getRefPreset(VecWdbeVPreset::PREWDBEOWNER, jref), VecWdbeVCard::CRDWDBEERR, false, rst); for (unsigned int i = 0; i < rst.nodes.size(); i++) { rec = rst.nodes[i]; feedFLstErr.appendRefTitles(rec->ref, StubWdbe::getStubErrStd(dbswdbe, rec->unvUref, ixWdbeVLocale)); }; insert(moditems, DpchEngData::FEEDFLSTERR); if (contiac.diff(&oldContiac).size() != 0) insert(moditems, DpchEngData::CONTIAC); refreshLstErr(dbswdbe, moditems); }; void PnlWdbeNavDescr::refreshLstPph( DbsWdbe* dbswdbe , set<uint>& moditems ) { StatShr oldStatshr(statshr); statshr.LstPphAvail = evalLstPphAvail(dbswdbe); statshr.ButPphViewActive = evalButPphViewActive(dbswdbe); statshr.ButPphNewcrdActive = evalButPphNewcrdActive(dbswdbe); if (statshr.diff(&oldStatshr).size() != 0) insert(moditems, DpchEngData::STATSHR); }; void PnlWdbeNavDescr::refreshPph( DbsWdbe* dbswdbe , set<uint>& moditems ) { ContIac oldContiac(contiac); ListWdbeHistRMUserUniversal rst; WdbeHistRMUserUniversal* rec = NULL; // contiac contiac.numFLstPph = 0; // feedFLstPph feedFLstPph.clear(); dbswdbe->tblwdbehistrmuseruniversal->loadRstByUsrCrd(xchg->getRefPreset(VecWdbeVPreset::PREWDBEOWNER, jref), VecWdbeVCard::CRDWDBEPPH, false, rst); for (unsigned int i = 0; i < rst.nodes.size(); i++) { rec = rst.nodes[i]; feedFLstPph.appendRefTitles(rec->ref, StubWdbe::getStubPphStd(dbswdbe, rec->unvUref, ixWdbeVLocale)); }; insert(moditems, DpchEngData::FEEDFLSTPPH); if (contiac.diff(&oldContiac).size() != 0) insert(moditems, DpchEngData::CONTIAC); refreshLstPph(dbswdbe, moditems); }; void PnlWdbeNavDescr::refreshLstBnk( DbsWdbe* dbswdbe , set<uint>& moditems ) { StatShr oldStatshr(statshr); statshr.LstBnkAvail = evalLstBnkAvail(dbswdbe); statshr.ButBnkViewActive = evalButBnkViewActive(dbswdbe); statshr.ButBnkNewcrdActive = evalButBnkNewcrdActive(dbswdbe); if (statshr.diff(&oldStatshr).size() != 0) insert(moditems, DpchEngData::STATSHR); }; void PnlWdbeNavDescr::refreshBnk( DbsWdbe* dbswdbe , set<uint>& moditems ) { ContIac oldContiac(contiac); ListWdbeHistRMUserUniversal rst; WdbeHistRMUserUniversal* rec = NULL; // contiac contiac.numFLstBnk = 0; // feedFLstBnk feedFLstBnk.clear(); dbswdbe->tblwdbehistrmuseruniversal->loadRstByUsrCrd(xchg->getRefPreset(VecWdbeVPreset::PREWDBEOWNER, jref), VecWdbeVCard::CRDWDBEBNK, false, rst); for (unsigned int i = 0; i < rst.nodes.size(); i++) { rec = rst.nodes[i]; feedFLstBnk.appendRefTitles(rec->ref, StubWdbe::getStubBnkStd(dbswdbe, rec->unvUref, ixWdbeVLocale)); }; insert(moditems, DpchEngData::FEEDFLSTBNK); if (contiac.diff(&oldContiac).size() != 0) insert(moditems, DpchEngData::CONTIAC); refreshLstBnk(dbswdbe, moditems); }; void PnlWdbeNavDescr::refreshLstPin( DbsWdbe* dbswdbe , set<uint>& moditems ) { StatShr oldStatshr(statshr); statshr.LstPinAvail = evalLstPinAvail(dbswdbe); statshr.ButPinViewActive = evalButPinViewActive(dbswdbe); statshr.ButPinNewcrdActive = evalButPinNewcrdActive(dbswdbe); if (statshr.diff(&oldStatshr).size() != 0) insert(moditems, DpchEngData::STATSHR); }; void PnlWdbeNavDescr::refreshPin( DbsWdbe* dbswdbe , set<uint>& moditems ) { ContIac oldContiac(contiac); ListWdbeHistRMUserUniversal rst; WdbeHistRMUserUniversal* rec = NULL; // contiac contiac.numFLstPin = 0; // feedFLstPin feedFLstPin.clear(); dbswdbe->tblwdbehistrmuseruniversal->loadRstByUsrCrd(xchg->getRefPreset(VecWdbeVPreset::PREWDBEOWNER, jref), VecWdbeVCard::CRDWDBEPIN, false, rst); for (unsigned int i = 0; i < rst.nodes.size(); i++) { rec = rst.nodes[i]; feedFLstPin.appendRefTitles(rec->ref, StubWdbe::getStubPinStd(dbswdbe, rec->unvUref, ixWdbeVLocale)); }; insert(moditems, DpchEngData::FEEDFLSTPIN); if (contiac.diff(&oldContiac).size() != 0) insert(moditems, DpchEngData::CONTIAC); refreshLstPin(dbswdbe, moditems); }; void PnlWdbeNavDescr::refreshLstGen( DbsWdbe* dbswdbe , set<uint>& moditems ) { StatShr oldStatshr(statshr); statshr.LstGenAvail = evalLstGenAvail(dbswdbe); statshr.ButGenViewActive = evalButGenViewActive(dbswdbe); if (statshr.diff(&oldStatshr).size() != 0) insert(moditems, DpchEngData::STATSHR); }; void PnlWdbeNavDescr::refreshGen( DbsWdbe* dbswdbe , set<uint>& moditems ) { ContIac oldContiac(contiac); ListWdbeHistRMUserUniversal rst; WdbeHistRMUserUniversal* rec = NULL; // contiac contiac.numFLstGen = 0; // feedFLstGen feedFLstGen.clear(); dbswdbe->tblwdbehistrmuseruniversal->loadRstByUsrCrd(xchg->getRefPreset(VecWdbeVPreset::PREWDBEOWNER, jref), VecWdbeVCard::CRDWDBEGEN, false, rst); for (unsigned int i = 0; i < rst.nodes.size(); i++) { rec = rst.nodes[i]; feedFLstGen.appendRefTitles(rec->ref, StubWdbe::getStubGenStd(dbswdbe, rec->unvUref, ixWdbeVLocale)); }; insert(moditems, DpchEngData::FEEDFLSTGEN); if (contiac.diff(&oldContiac).size() != 0) insert(moditems, DpchEngData::CONTIAC); refreshLstGen(dbswdbe, moditems); }; void PnlWdbeNavDescr::refreshLstPrt( DbsWdbe* dbswdbe , set<uint>& moditems ) { StatShr oldStatshr(statshr); statshr.LstPrtAvail = evalLstPrtAvail(dbswdbe); statshr.ButPrtViewActive = evalButPrtViewActive(dbswdbe); if (statshr.diff(&oldStatshr).size() != 0) insert(moditems, DpchEngData::STATSHR); }; void PnlWdbeNavDescr::refreshPrt( DbsWdbe* dbswdbe , set<uint>& moditems ) { ContIac oldContiac(contiac); ListWdbeHistRMUserUniversal rst; WdbeHistRMUserUniversal* rec = NULL; // contiac contiac.numFLstPrt = 0; // feedFLstPrt feedFLstPrt.clear(); dbswdbe->tblwdbehistrmuseruniversal->loadRstByUsrCrd(xchg->getRefPreset(VecWdbeVPreset::PREWDBEOWNER, jref), VecWdbeVCard::CRDWDBEPRT, false, rst); for (unsigned int i = 0; i < rst.nodes.size(); i++) { rec = rst.nodes[i]; feedFLstPrt.appendRefTitles(rec->ref, StubWdbe::getStubPrtStd(dbswdbe, rec->unvUref, ixWdbeVLocale)); }; insert(moditems, DpchEngData::FEEDFLSTPRT); if (contiac.diff(&oldContiac).size() != 0) insert(moditems, DpchEngData::CONTIAC); refreshLstPrt(dbswdbe, moditems); }; void PnlWdbeNavDescr::refreshLstSig( DbsWdbe* dbswdbe , set<uint>& moditems ) { StatShr oldStatshr(statshr); statshr.LstSigAvail = evalLstSigAvail(dbswdbe); statshr.ButSigViewActive = evalButSigViewActive(dbswdbe); if (statshr.diff(&oldStatshr).size() != 0) insert(moditems, DpchEngData::STATSHR); }; void PnlWdbeNavDescr::refreshSig( DbsWdbe* dbswdbe , set<uint>& moditems ) { ContIac oldContiac(contiac); ListWdbeHistRMUserUniversal rst; WdbeHistRMUserUniversal* rec = NULL; // contiac contiac.numFLstSig = 0; // feedFLstSig feedFLstSig.clear(); dbswdbe->tblwdbehistrmuseruniversal->loadRstByUsrCrd(xchg->getRefPreset(VecWdbeVPreset::PREWDBEOWNER, jref), VecWdbeVCard::CRDWDBESIG, false, rst); for (unsigned int i = 0; i < rst.nodes.size(); i++) { rec = rst.nodes[i]; feedFLstSig.appendRefTitles(rec->ref, StubWdbe::getStubSigStd(dbswdbe, rec->unvUref, ixWdbeVLocale)); }; insert(moditems, DpchEngData::FEEDFLSTSIG); if (contiac.diff(&oldContiac).size() != 0) insert(moditems, DpchEngData::CONTIAC); refreshLstSig(dbswdbe, moditems); }; void PnlWdbeNavDescr::refreshLstPrc( DbsWdbe* dbswdbe , set<uint>& moditems ) { StatShr oldStatshr(statshr); statshr.LstPrcAvail = evalLstPrcAvail(dbswdbe); statshr.ButPrcViewActive = evalButPrcViewActive(dbswdbe); if (statshr.diff(&oldStatshr).size() != 0) insert(moditems, DpchEngData::STATSHR); }; void PnlWdbeNavDescr::refreshPrc( DbsWdbe* dbswdbe , set<uint>& moditems ) { ContIac oldContiac(contiac); ListWdbeHistRMUserUniversal rst; WdbeHistRMUserUniversal* rec = NULL; // contiac contiac.numFLstPrc = 0; // feedFLstPrc feedFLstPrc.clear(); dbswdbe->tblwdbehistrmuseruniversal->loadRstByUsrCrd(xchg->getRefPreset(VecWdbeVPreset::PREWDBEOWNER, jref), VecWdbeVCard::CRDWDBEPRC, false, rst); for (unsigned int i = 0; i < rst.nodes.size(); i++) { rec = rst.nodes[i]; feedFLstPrc.appendRefTitles(rec->ref, StubWdbe::getStubPrcStd(dbswdbe, rec->unvUref, ixWdbeVLocale)); }; insert(moditems, DpchEngData::FEEDFLSTPRC); if (contiac.diff(&oldContiac).size() != 0) insert(moditems, DpchEngData::CONTIAC); refreshLstPrc(dbswdbe, moditems); }; void PnlWdbeNavDescr::refreshLstFst( DbsWdbe* dbswdbe , set<uint>& moditems ) { StatShr oldStatshr(statshr); statshr.LstFstAvail = evalLstFstAvail(dbswdbe); statshr.ButFstViewActive = evalButFstViewActive(dbswdbe); if (statshr.diff(&oldStatshr).size() != 0) insert(moditems, DpchEngData::STATSHR); }; void PnlWdbeNavDescr::refreshFst( DbsWdbe* dbswdbe , set<uint>& moditems ) { ContIac oldContiac(contiac); ListWdbeHistRMUserUniversal rst; WdbeHistRMUserUniversal* rec = NULL; // contiac contiac.numFLstFst = 0; // feedFLstFst feedFLstFst.clear(); dbswdbe->tblwdbehistrmuseruniversal->loadRstByUsrCrd(xchg->getRefPreset(VecWdbeVPreset::PREWDBEOWNER, jref), VecWdbeVCard::CRDWDBEFST, false, rst); for (unsigned int i = 0; i < rst.nodes.size(); i++) { rec = rst.nodes[i]; feedFLstFst.appendRefTitles(rec->ref, StubWdbe::getStubFstStd(dbswdbe, rec->unvUref, ixWdbeVLocale)); }; insert(moditems, DpchEngData::FEEDFLSTFST); if (contiac.diff(&oldContiac).size() != 0) insert(moditems, DpchEngData::CONTIAC); refreshLstFst(dbswdbe, moditems); }; void PnlWdbeNavDescr::refreshLstVar( DbsWdbe* dbswdbe , set<uint>& moditems ) { StatShr oldStatshr(statshr); statshr.LstVarAvail = evalLstVarAvail(dbswdbe); statshr.ButVarViewActive = evalButVarViewActive(dbswdbe); if (statshr.diff(&oldStatshr).size() != 0) insert(moditems, DpchEngData::STATSHR); }; void PnlWdbeNavDescr::refreshVar( DbsWdbe* dbswdbe , set<uint>& moditems ) { ContIac oldContiac(contiac); ListWdbeHistRMUserUniversal rst; WdbeHistRMUserUniversal* rec = NULL; // contiac contiac.numFLstVar = 0; // feedFLstVar feedFLstVar.clear(); dbswdbe->tblwdbehistrmuseruniversal->loadRstByUsrCrd(xchg->getRefPreset(VecWdbeVPreset::PREWDBEOWNER, jref), VecWdbeVCard::CRDWDBEVAR, false, rst); for (unsigned int i = 0; i < rst.nodes.size(); i++) { rec = rst.nodes[i]; feedFLstVar.appendRefTitles(rec->ref, StubWdbe::getStubVarStd(dbswdbe, rec->unvUref, ixWdbeVLocale)); }; insert(moditems, DpchEngData::FEEDFLSTVAR); if (contiac.diff(&oldContiac).size() != 0) insert(moditems, DpchEngData::CONTIAC); refreshLstVar(dbswdbe, moditems); }; void PnlWdbeNavDescr::refresh( DbsWdbe* dbswdbe , set<uint>& moditems , const bool unmute ) { if (muteRefresh && !unmute) return; muteRefresh = true; // IP refresh --- INSERT muteRefresh = false; }; void PnlWdbeNavDescr::updatePreset( DbsWdbe* dbswdbe , const uint ixWdbeVPreset , const ubigint jrefTrig , const bool notif ) { // IP updatePreset --- BEGIN set<uint> moditems; refresh(dbswdbe, moditems); refreshLstMod(dbswdbe, moditems); refreshLstVec(dbswdbe, moditems); refreshLstVit(dbswdbe, moditems); refreshLstCmd(dbswdbe, moditems); refreshLstErr(dbswdbe, moditems); refreshLstPph(dbswdbe, moditems); refreshLstBnk(dbswdbe, moditems); refreshLstPin(dbswdbe, moditems); refreshLstGen(dbswdbe, moditems); refreshLstPrt(dbswdbe, moditems); refreshLstSig(dbswdbe, moditems); refreshLstPrc(dbswdbe, moditems); refreshLstFst(dbswdbe, moditems); refreshLstVar(dbswdbe, moditems); if (notif && !moditems.empty()) xchg->submitDpch(getNewDpchEng(moditems)); // IP updatePreset --- END }; void PnlWdbeNavDescr::handleRequest( DbsWdbe* dbswdbe , ReqWdbe* req ) { if (req->ixVBasetype == ReqWdbe::VecVBasetype::CMD) { reqCmd = req; if (req->cmd == "cmdset") { } else { cout << "\tinvalid command!" << endl; }; if (!req->retain) reqCmd = NULL; } else if (req->ixVBasetype == ReqWdbe::VecVBasetype::DPCHAPP) { if (req->dpchapp->ixWdbeVDpch == VecWdbeVDpch::DPCHAPPWDBEINIT) { handleDpchAppWdbeInit(dbswdbe, (DpchAppWdbeInit*) (req->dpchapp), &(req->dpcheng)); } else if (req->dpchapp->ixWdbeVDpch == VecWdbeVDpch::DPCHAPPWDBENAVDESCRDATA) { DpchAppData* dpchappdata = (DpchAppData*) (req->dpchapp); if (dpchappdata->has(DpchAppData::CONTIAC)) { handleDpchAppDataContiac(dbswdbe, &(dpchappdata->contiac), &(req->dpcheng)); }; } else if (req->dpchapp->ixWdbeVDpch == VecWdbeVDpch::DPCHAPPWDBENAVDESCRDO) { DpchAppDo* dpchappdo = (DpchAppDo*) (req->dpchapp); if (dpchappdo->ixVDo != 0) { if (dpchappdo->ixVDo == VecVDo::BUTMODVIEWCLICK) { handleDpchAppDoButModViewClick(dbswdbe, &(req->dpcheng)); } else if (dpchappdo->ixVDo == VecVDo::BUTMODNEWCRDCLICK) { handleDpchAppDoButModNewcrdClick(dbswdbe, &(req->dpcheng)); } else if (dpchappdo->ixVDo == VecVDo::BUTVECVIEWCLICK) { handleDpchAppDoButVecViewClick(dbswdbe, &(req->dpcheng)); } else if (dpchappdo->ixVDo == VecVDo::BUTVECNEWCRDCLICK) { handleDpchAppDoButVecNewcrdClick(dbswdbe, &(req->dpcheng)); } else if (dpchappdo->ixVDo == VecVDo::BUTVITVIEWCLICK) { handleDpchAppDoButVitViewClick(dbswdbe, &(req->dpcheng)); } else if (dpchappdo->ixVDo == VecVDo::BUTCMDVIEWCLICK) { handleDpchAppDoButCmdViewClick(dbswdbe, &(req->dpcheng)); } else if (dpchappdo->ixVDo == VecVDo::BUTCMDNEWCRDCLICK) { handleDpchAppDoButCmdNewcrdClick(dbswdbe, &(req->dpcheng)); } else if (dpchappdo->ixVDo == VecVDo::BUTERRVIEWCLICK) { handleDpchAppDoButErrViewClick(dbswdbe, &(req->dpcheng)); } else if (dpchappdo->ixVDo == VecVDo::BUTERRNEWCRDCLICK) { handleDpchAppDoButErrNewcrdClick(dbswdbe, &(req->dpcheng)); } else if (dpchappdo->ixVDo == VecVDo::BUTPPHVIEWCLICK) { handleDpchAppDoButPphViewClick(dbswdbe, &(req->dpcheng)); } else if (dpchappdo->ixVDo == VecVDo::BUTPPHNEWCRDCLICK) { handleDpchAppDoButPphNewcrdClick(dbswdbe, &(req->dpcheng)); } else if (dpchappdo->ixVDo == VecVDo::BUTBNKVIEWCLICK) { handleDpchAppDoButBnkViewClick(dbswdbe, &(req->dpcheng)); } else if (dpchappdo->ixVDo == VecVDo::BUTBNKNEWCRDCLICK) { handleDpchAppDoButBnkNewcrdClick(dbswdbe, &(req->dpcheng)); } else if (dpchappdo->ixVDo == VecVDo::BUTPINVIEWCLICK) { handleDpchAppDoButPinViewClick(dbswdbe, &(req->dpcheng)); } else if (dpchappdo->ixVDo == VecVDo::BUTPINNEWCRDCLICK) { handleDpchAppDoButPinNewcrdClick(dbswdbe, &(req->dpcheng)); } else if (dpchappdo->ixVDo == VecVDo::BUTGENVIEWCLICK) { handleDpchAppDoButGenViewClick(dbswdbe, &(req->dpcheng)); } else if (dpchappdo->ixVDo == VecVDo::BUTPRTVIEWCLICK) { handleDpchAppDoButPrtViewClick(dbswdbe, &(req->dpcheng)); } else if (dpchappdo->ixVDo == VecVDo::BUTSIGVIEWCLICK) { handleDpchAppDoButSigViewClick(dbswdbe, &(req->dpcheng)); } else if (dpchappdo->ixVDo == VecVDo::BUTPRCVIEWCLICK) { handleDpchAppDoButPrcViewClick(dbswdbe, &(req->dpcheng)); } else if (dpchappdo->ixVDo == VecVDo::BUTFSTVIEWCLICK) { handleDpchAppDoButFstViewClick(dbswdbe, &(req->dpcheng)); } else if (dpchappdo->ixVDo == VecVDo::BUTVARVIEWCLICK) { handleDpchAppDoButVarViewClick(dbswdbe, &(req->dpcheng)); }; }; }; }; }; void PnlWdbeNavDescr::handleDpchAppWdbeInit( DbsWdbe* dbswdbe , DpchAppWdbeInit* dpchappwdbeinit , DpchEngWdbe** dpcheng ) { *dpcheng = getNewDpchEng({DpchEngData::ALL}); }; void PnlWdbeNavDescr::handleDpchAppDataContiac( DbsWdbe* dbswdbe , ContIac* _contiac , DpchEngWdbe** dpcheng ) { set<uint> diffitems; set<uint> moditems; diffitems = _contiac->diff(&contiac); if (has(diffitems, ContIac::NUMFLSTMOD)) { contiac.numFLstMod = _contiac->numFLstMod; refreshLstMod(dbswdbe, moditems); }; if (has(diffitems, ContIac::NUMFLSTVEC)) { contiac.numFLstVec = _contiac->numFLstVec; refreshLstVec(dbswdbe, moditems); }; if (has(diffitems, ContIac::NUMFLSTVIT)) { contiac.numFLstVit = _contiac->numFLstVit; refreshLstVit(dbswdbe, moditems); }; if (has(diffitems, ContIac::NUMFLSTCMD)) { contiac.numFLstCmd = _contiac->numFLstCmd; refreshLstCmd(dbswdbe, moditems); }; if (has(diffitems, ContIac::NUMFLSTERR)) { contiac.numFLstErr = _contiac->numFLstErr; refreshLstErr(dbswdbe, moditems); }; if (has(diffitems, ContIac::NUMFLSTPPH)) { contiac.numFLstPph = _contiac->numFLstPph; refreshLstPph(dbswdbe, moditems); }; if (has(diffitems, ContIac::NUMFLSTBNK)) { contiac.numFLstBnk = _contiac->numFLstBnk; refreshLstBnk(dbswdbe, moditems); }; if (has(diffitems, ContIac::NUMFLSTPIN)) { contiac.numFLstPin = _contiac->numFLstPin; refreshLstPin(dbswdbe, moditems); }; if (has(diffitems, ContIac::NUMFLSTGEN)) { contiac.numFLstGen = _contiac->numFLstGen; refreshLstGen(dbswdbe, moditems); }; if (has(diffitems, ContIac::NUMFLSTPRT)) { contiac.numFLstPrt = _contiac->numFLstPrt; refreshLstPrt(dbswdbe, moditems); }; if (has(diffitems, ContIac::NUMFLSTSIG)) { contiac.numFLstSig = _contiac->numFLstSig; refreshLstSig(dbswdbe, moditems); }; if (has(diffitems, ContIac::NUMFLSTPRC)) { contiac.numFLstPrc = _contiac->numFLstPrc; refreshLstPrc(dbswdbe, moditems); }; if (has(diffitems, ContIac::NUMFLSTFST)) { contiac.numFLstFst = _contiac->numFLstFst; refreshLstFst(dbswdbe, moditems); }; if (has(diffitems, ContIac::NUMFLSTVAR)) { contiac.numFLstVar = _contiac->numFLstVar; refreshLstVar(dbswdbe, moditems); }; insert(moditems, DpchEngData::CONTIAC); *dpcheng = getNewDpchEng(moditems); }; void PnlWdbeNavDescr::handleDpchAppDoButModViewClick( DbsWdbe* dbswdbe , DpchEngWdbe** dpcheng ) { WdbeHistRMUserUniversal* husrRunv = NULL; ubigint jrefNew = 0; if (statshr.LstModAvail && statshr.ButModViewActive) { if (dbswdbe->tblwdbehistrmuseruniversal->loadRecByRef(feedFLstMod.getRefByNum(contiac.numFLstMod), &husrRunv)) { xchg->triggerIxRefSrefIntvalToRefCall(dbswdbe, VecWdbeVCall::CALLWDBECRDOPEN, jref, husrRunv->ixWdbeVPreset, husrRunv->preUref, "CrdWdbeMod", husrRunv->unvUref, jrefNew); delete husrRunv; }; if (jrefNew == 0) *dpcheng = new DpchEngWdbeConfirm(false, 0, ""); else *dpcheng = new DpchEngWdbeConfirm(true, jrefNew, "CrdWdbeMod"); }; }; void PnlWdbeNavDescr::handleDpchAppDoButModNewcrdClick( DbsWdbe* dbswdbe , DpchEngWdbe** dpcheng ) { ubigint jrefNew = 0; if (statshr.ButModNewcrdActive) { xchg->triggerIxRefSrefIntvalToRefCall(dbswdbe, VecWdbeVCall::CALLWDBECRDOPEN, jref, 0, 0, "CrdWdbeMod", 0, jrefNew); if (jrefNew == 0) *dpcheng = new DpchEngWdbeConfirm(false, 0, ""); else *dpcheng = new DpchEngWdbeConfirm(true, jrefNew, "CrdWdbeMod"); }; }; void PnlWdbeNavDescr::handleDpchAppDoButVecViewClick( DbsWdbe* dbswdbe , DpchEngWdbe** dpcheng ) { WdbeHistRMUserUniversal* husrRunv = NULL; ubigint jrefNew = 0; if (statshr.LstVecAvail && statshr.ButVecViewActive) { if (dbswdbe->tblwdbehistrmuseruniversal->loadRecByRef(feedFLstVec.getRefByNum(contiac.numFLstVec), &husrRunv)) { xchg->triggerIxRefSrefIntvalToRefCall(dbswdbe, VecWdbeVCall::CALLWDBECRDOPEN, jref, husrRunv->ixWdbeVPreset, husrRunv->preUref, "CrdWdbeVec", husrRunv->unvUref, jrefNew); delete husrRunv; }; if (jrefNew == 0) *dpcheng = new DpchEngWdbeConfirm(false, 0, ""); else *dpcheng = new DpchEngWdbeConfirm(true, jrefNew, "CrdWdbeVec"); }; }; void PnlWdbeNavDescr::handleDpchAppDoButVecNewcrdClick( DbsWdbe* dbswdbe , DpchEngWdbe** dpcheng ) { ubigint jrefNew = 0; if (statshr.ButVecNewcrdActive) { xchg->triggerIxRefSrefIntvalToRefCall(dbswdbe, VecWdbeVCall::CALLWDBECRDOPEN, jref, 0, 0, "CrdWdbeVec", 0, jrefNew); if (jrefNew == 0) *dpcheng = new DpchEngWdbeConfirm(false, 0, ""); else *dpcheng = new DpchEngWdbeConfirm(true, jrefNew, "CrdWdbeVec"); }; }; void PnlWdbeNavDescr::handleDpchAppDoButVitViewClick( DbsWdbe* dbswdbe , DpchEngWdbe** dpcheng ) { WdbeHistRMUserUniversal* husrRunv = NULL; ubigint jrefNew = 0; if (statshr.LstVitAvail && statshr.ButVitViewActive) { if (dbswdbe->tblwdbehistrmuseruniversal->loadRecByRef(feedFLstVit.getRefByNum(contiac.numFLstVit), &husrRunv)) { xchg->triggerIxRefSrefIntvalToRefCall(dbswdbe, VecWdbeVCall::CALLWDBECRDOPEN, jref, husrRunv->ixWdbeVPreset, husrRunv->preUref, "CrdWdbeVit", husrRunv->unvUref, jrefNew); delete husrRunv; }; if (jrefNew == 0) *dpcheng = new DpchEngWdbeConfirm(false, 0, ""); else *dpcheng = new DpchEngWdbeConfirm(true, jrefNew, "CrdWdbeVit"); }; }; void PnlWdbeNavDescr::handleDpchAppDoButCmdViewClick( DbsWdbe* dbswdbe , DpchEngWdbe** dpcheng ) { WdbeHistRMUserUniversal* husrRunv = NULL; ubigint jrefNew = 0; if (statshr.LstCmdAvail && statshr.ButCmdViewActive) { if (dbswdbe->tblwdbehistrmuseruniversal->loadRecByRef(feedFLstCmd.getRefByNum(contiac.numFLstCmd), &husrRunv)) { xchg->triggerIxRefSrefIntvalToRefCall(dbswdbe, VecWdbeVCall::CALLWDBECRDOPEN, jref, husrRunv->ixWdbeVPreset, husrRunv->preUref, "CrdWdbeCmd", husrRunv->unvUref, jrefNew); delete husrRunv; }; if (jrefNew == 0) *dpcheng = new DpchEngWdbeConfirm(false, 0, ""); else *dpcheng = new DpchEngWdbeConfirm(true, jrefNew, "CrdWdbeCmd"); }; }; void PnlWdbeNavDescr::handleDpchAppDoButCmdNewcrdClick( DbsWdbe* dbswdbe , DpchEngWdbe** dpcheng ) { ubigint jrefNew = 0; if (statshr.ButCmdNewcrdActive) { xchg->triggerIxRefSrefIntvalToRefCall(dbswdbe, VecWdbeVCall::CALLWDBECRDOPEN, jref, 0, 0, "CrdWdbeCmd", 0, jrefNew); if (jrefNew == 0) *dpcheng = new DpchEngWdbeConfirm(false, 0, ""); else *dpcheng = new DpchEngWdbeConfirm(true, jrefNew, "CrdWdbeCmd"); }; }; void PnlWdbeNavDescr::handleDpchAppDoButErrViewClick( DbsWdbe* dbswdbe , DpchEngWdbe** dpcheng ) { WdbeHistRMUserUniversal* husrRunv = NULL; ubigint jrefNew = 0; if (statshr.LstErrAvail && statshr.ButErrViewActive) { if (dbswdbe->tblwdbehistrmuseruniversal->loadRecByRef(feedFLstErr.getRefByNum(contiac.numFLstErr), &husrRunv)) { xchg->triggerIxRefSrefIntvalToRefCall(dbswdbe, VecWdbeVCall::CALLWDBECRDOPEN, jref, husrRunv->ixWdbeVPreset, husrRunv->preUref, "CrdWdbeErr", husrRunv->unvUref, jrefNew); delete husrRunv; }; if (jrefNew == 0) *dpcheng = new DpchEngWdbeConfirm(false, 0, ""); else *dpcheng = new DpchEngWdbeConfirm(true, jrefNew, "CrdWdbeErr"); }; }; void PnlWdbeNavDescr::handleDpchAppDoButErrNewcrdClick( DbsWdbe* dbswdbe , DpchEngWdbe** dpcheng ) { ubigint jrefNew = 0; if (statshr.ButErrNewcrdActive) { xchg->triggerIxRefSrefIntvalToRefCall(dbswdbe, VecWdbeVCall::CALLWDBECRDOPEN, jref, 0, 0, "CrdWdbeErr", 0, jrefNew); if (jrefNew == 0) *dpcheng = new DpchEngWdbeConfirm(false, 0, ""); else *dpcheng = new DpchEngWdbeConfirm(true, jrefNew, "CrdWdbeErr"); }; }; void PnlWdbeNavDescr::handleDpchAppDoButPphViewClick( DbsWdbe* dbswdbe , DpchEngWdbe** dpcheng ) { WdbeHistRMUserUniversal* husrRunv = NULL; ubigint jrefNew = 0; if (statshr.LstPphAvail && statshr.ButPphViewActive) { if (dbswdbe->tblwdbehistrmuseruniversal->loadRecByRef(feedFLstPph.getRefByNum(contiac.numFLstPph), &husrRunv)) { xchg->triggerIxRefSrefIntvalToRefCall(dbswdbe, VecWdbeVCall::CALLWDBECRDOPEN, jref, husrRunv->ixWdbeVPreset, husrRunv->preUref, "CrdWdbePph", husrRunv->unvUref, jrefNew); delete husrRunv; }; if (jrefNew == 0) *dpcheng = new DpchEngWdbeConfirm(false, 0, ""); else *dpcheng = new DpchEngWdbeConfirm(true, jrefNew, "CrdWdbePph"); }; }; void PnlWdbeNavDescr::handleDpchAppDoButPphNewcrdClick( DbsWdbe* dbswdbe , DpchEngWdbe** dpcheng ) { ubigint jrefNew = 0; if (statshr.ButPphNewcrdActive) { xchg->triggerIxRefSrefIntvalToRefCall(dbswdbe, VecWdbeVCall::CALLWDBECRDOPEN, jref, 0, 0, "CrdWdbePph", 0, jrefNew); if (jrefNew == 0) *dpcheng = new DpchEngWdbeConfirm(false, 0, ""); else *dpcheng = new DpchEngWdbeConfirm(true, jrefNew, "CrdWdbePph"); }; }; void PnlWdbeNavDescr::handleDpchAppDoButBnkViewClick( DbsWdbe* dbswdbe , DpchEngWdbe** dpcheng ) { WdbeHistRMUserUniversal* husrRunv = NULL; ubigint jrefNew = 0; if (statshr.LstBnkAvail && statshr.ButBnkViewActive) { if (dbswdbe->tblwdbehistrmuseruniversal->loadRecByRef(feedFLstBnk.getRefByNum(contiac.numFLstBnk), &husrRunv)) { xchg->triggerIxRefSrefIntvalToRefCall(dbswdbe, VecWdbeVCall::CALLWDBECRDOPEN, jref, husrRunv->ixWdbeVPreset, husrRunv->preUref, "CrdWdbeBnk", husrRunv->unvUref, jrefNew); delete husrRunv; }; if (jrefNew == 0) *dpcheng = new DpchEngWdbeConfirm(false, 0, ""); else *dpcheng = new DpchEngWdbeConfirm(true, jrefNew, "CrdWdbeBnk"); }; }; void PnlWdbeNavDescr::handleDpchAppDoButBnkNewcrdClick( DbsWdbe* dbswdbe , DpchEngWdbe** dpcheng ) { ubigint jrefNew = 0; if (statshr.ButBnkNewcrdActive) { xchg->triggerIxRefSrefIntvalToRefCall(dbswdbe, VecWdbeVCall::CALLWDBECRDOPEN, jref, 0, 0, "CrdWdbeBnk", 0, jrefNew); if (jrefNew == 0) *dpcheng = new DpchEngWdbeConfirm(false, 0, ""); else *dpcheng = new DpchEngWdbeConfirm(true, jrefNew, "CrdWdbeBnk"); }; }; void PnlWdbeNavDescr::handleDpchAppDoButPinViewClick( DbsWdbe* dbswdbe , DpchEngWdbe** dpcheng ) { WdbeHistRMUserUniversal* husrRunv = NULL; ubigint jrefNew = 0; if (statshr.LstPinAvail && statshr.ButPinViewActive) { if (dbswdbe->tblwdbehistrmuseruniversal->loadRecByRef(feedFLstPin.getRefByNum(contiac.numFLstPin), &husrRunv)) { xchg->triggerIxRefSrefIntvalToRefCall(dbswdbe, VecWdbeVCall::CALLWDBECRDOPEN, jref, husrRunv->ixWdbeVPreset, husrRunv->preUref, "CrdWdbePin", husrRunv->unvUref, jrefNew); delete husrRunv; }; if (jrefNew == 0) *dpcheng = new DpchEngWdbeConfirm(false, 0, ""); else *dpcheng = new DpchEngWdbeConfirm(true, jrefNew, "CrdWdbePin"); }; }; void PnlWdbeNavDescr::handleDpchAppDoButPinNewcrdClick( DbsWdbe* dbswdbe , DpchEngWdbe** dpcheng ) { ubigint jrefNew = 0; if (statshr.ButPinNewcrdActive) { xchg->triggerIxRefSrefIntvalToRefCall(dbswdbe, VecWdbeVCall::CALLWDBECRDOPEN, jref, 0, 0, "CrdWdbePin", 0, jrefNew); if (jrefNew == 0) *dpcheng = new DpchEngWdbeConfirm(false, 0, ""); else *dpcheng = new DpchEngWdbeConfirm(true, jrefNew, "CrdWdbePin"); }; }; void PnlWdbeNavDescr::handleDpchAppDoButGenViewClick( DbsWdbe* dbswdbe , DpchEngWdbe** dpcheng ) { WdbeHistRMUserUniversal* husrRunv = NULL; ubigint jrefNew = 0; if (statshr.LstGenAvail && statshr.ButGenViewActive) { if (dbswdbe->tblwdbehistrmuseruniversal->loadRecByRef(feedFLstGen.getRefByNum(contiac.numFLstGen), &husrRunv)) { xchg->triggerIxRefSrefIntvalToRefCall(dbswdbe, VecWdbeVCall::CALLWDBECRDOPEN, jref, husrRunv->ixWdbeVPreset, husrRunv->preUref, "CrdWdbeGen", husrRunv->unvUref, jrefNew); delete husrRunv; }; if (jrefNew == 0) *dpcheng = new DpchEngWdbeConfirm(false, 0, ""); else *dpcheng = new DpchEngWdbeConfirm(true, jrefNew, "CrdWdbeGen"); }; }; void PnlWdbeNavDescr::handleDpchAppDoButPrtViewClick( DbsWdbe* dbswdbe , DpchEngWdbe** dpcheng ) { WdbeHistRMUserUniversal* husrRunv = NULL; ubigint jrefNew = 0; if (statshr.LstPrtAvail && statshr.ButPrtViewActive) { if (dbswdbe->tblwdbehistrmuseruniversal->loadRecByRef(feedFLstPrt.getRefByNum(contiac.numFLstPrt), &husrRunv)) { xchg->triggerIxRefSrefIntvalToRefCall(dbswdbe, VecWdbeVCall::CALLWDBECRDOPEN, jref, husrRunv->ixWdbeVPreset, husrRunv->preUref, "CrdWdbePrt", husrRunv->unvUref, jrefNew); delete husrRunv; }; if (jrefNew == 0) *dpcheng = new DpchEngWdbeConfirm(false, 0, ""); else *dpcheng = new DpchEngWdbeConfirm(true, jrefNew, "CrdWdbePrt"); }; }; void PnlWdbeNavDescr::handleDpchAppDoButSigViewClick( DbsWdbe* dbswdbe , DpchEngWdbe** dpcheng ) { WdbeHistRMUserUniversal* husrRunv = NULL; ubigint jrefNew = 0; if (statshr.LstSigAvail && statshr.ButSigViewActive) { if (dbswdbe->tblwdbehistrmuseruniversal->loadRecByRef(feedFLstSig.getRefByNum(contiac.numFLstSig), &husrRunv)) { xchg->triggerIxRefSrefIntvalToRefCall(dbswdbe, VecWdbeVCall::CALLWDBECRDOPEN, jref, husrRunv->ixWdbeVPreset, husrRunv->preUref, "CrdWdbeSig", husrRunv->unvUref, jrefNew); delete husrRunv; }; if (jrefNew == 0) *dpcheng = new DpchEngWdbeConfirm(false, 0, ""); else *dpcheng = new DpchEngWdbeConfirm(true, jrefNew, "CrdWdbeSig"); }; }; void PnlWdbeNavDescr::handleDpchAppDoButPrcViewClick( DbsWdbe* dbswdbe , DpchEngWdbe** dpcheng ) { WdbeHistRMUserUniversal* husrRunv = NULL; ubigint jrefNew = 0; if (statshr.LstPrcAvail && statshr.ButPrcViewActive) { if (dbswdbe->tblwdbehistrmuseruniversal->loadRecByRef(feedFLstPrc.getRefByNum(contiac.numFLstPrc), &husrRunv)) { xchg->triggerIxRefSrefIntvalToRefCall(dbswdbe, VecWdbeVCall::CALLWDBECRDOPEN, jref, husrRunv->ixWdbeVPreset, husrRunv->preUref, "CrdWdbePrc", husrRunv->unvUref, jrefNew); delete husrRunv; }; if (jrefNew == 0) *dpcheng = new DpchEngWdbeConfirm(false, 0, ""); else *dpcheng = new DpchEngWdbeConfirm(true, jrefNew, "CrdWdbePrc"); }; }; void PnlWdbeNavDescr::handleDpchAppDoButFstViewClick( DbsWdbe* dbswdbe , DpchEngWdbe** dpcheng ) { WdbeHistRMUserUniversal* husrRunv = NULL; ubigint jrefNew = 0; if (statshr.LstFstAvail && statshr.ButFstViewActive) { if (dbswdbe->tblwdbehistrmuseruniversal->loadRecByRef(feedFLstFst.getRefByNum(contiac.numFLstFst), &husrRunv)) { xchg->triggerIxRefSrefIntvalToRefCall(dbswdbe, VecWdbeVCall::CALLWDBECRDOPEN, jref, husrRunv->ixWdbeVPreset, husrRunv->preUref, "CrdWdbeFst", husrRunv->unvUref, jrefNew); delete husrRunv; }; if (jrefNew == 0) *dpcheng = new DpchEngWdbeConfirm(false, 0, ""); else *dpcheng = new DpchEngWdbeConfirm(true, jrefNew, "CrdWdbeFst"); }; }; void PnlWdbeNavDescr::handleDpchAppDoButVarViewClick( DbsWdbe* dbswdbe , DpchEngWdbe** dpcheng ) { WdbeHistRMUserUniversal* husrRunv = NULL; ubigint jrefNew = 0; if (statshr.LstVarAvail && statshr.ButVarViewActive) { if (dbswdbe->tblwdbehistrmuseruniversal->loadRecByRef(feedFLstVar.getRefByNum(contiac.numFLstVar), &husrRunv)) { xchg->triggerIxRefSrefIntvalToRefCall(dbswdbe, VecWdbeVCall::CALLWDBECRDOPEN, jref, husrRunv->ixWdbeVPreset, husrRunv->preUref, "CrdWdbeVar", husrRunv->unvUref, jrefNew); delete husrRunv; }; if (jrefNew == 0) *dpcheng = new DpchEngWdbeConfirm(false, 0, ""); else *dpcheng = new DpchEngWdbeConfirm(true, jrefNew, "CrdWdbeVar"); }; }; void PnlWdbeNavDescr::handleCall( DbsWdbe* dbswdbe , Call* call ) { if (call->ixVCall == VecWdbeVCall::CALLWDBEHUSRRUNVMOD_CRDUSREQ) { call->abort = handleCallWdbeHusrRunvMod_crdUsrEq(dbswdbe, call->jref, call->argInv.ix, call->argInv.ref); }; }; bool PnlWdbeNavDescr::handleCallWdbeHusrRunvMod_crdUsrEq( DbsWdbe* dbswdbe , const ubigint jrefTrig , const uint ixInv , const ubigint refInv ) { bool retval = false; set<uint> moditems; if (ixInv == VecWdbeVCard::CRDWDBEMOD) { refreshMod(dbswdbe, moditems); } else if (ixInv == VecWdbeVCard::CRDWDBEVEC) { refreshVec(dbswdbe, moditems); } else if (ixInv == VecWdbeVCard::CRDWDBEVIT) { refreshVit(dbswdbe, moditems); } else if (ixInv == VecWdbeVCard::CRDWDBECMD) { refreshCmd(dbswdbe, moditems); } else if (ixInv == VecWdbeVCard::CRDWDBEERR) { refreshErr(dbswdbe, moditems); } else if (ixInv == VecWdbeVCard::CRDWDBEPPH) { refreshPph(dbswdbe, moditems); } else if (ixInv == VecWdbeVCard::CRDWDBEBNK) { refreshBnk(dbswdbe, moditems); } else if (ixInv == VecWdbeVCard::CRDWDBEPIN) { refreshPin(dbswdbe, moditems); } else if (ixInv == VecWdbeVCard::CRDWDBEGEN) { refreshGen(dbswdbe, moditems); } else if (ixInv == VecWdbeVCard::CRDWDBEPRT) { refreshPrt(dbswdbe, moditems); } else if (ixInv == VecWdbeVCard::CRDWDBESIG) { refreshSig(dbswdbe, moditems); } else if (ixInv == VecWdbeVCard::CRDWDBEPRC) { refreshPrc(dbswdbe, moditems); } else if (ixInv == VecWdbeVCard::CRDWDBEFST) { refreshFst(dbswdbe, moditems); } else if (ixInv == VecWdbeVCard::CRDWDBEVAR) { refreshVar(dbswdbe, moditems); }; xchg->submitDpch(getNewDpchEng(moditems)); return retval; };
/** * Rule to detect LDIF records. A LDIF record must start with "dn:" at column 0 * and end with new line at column 0. * * */ public class LdifRecordRule implements IPredicateRule { private static char[] DN_SEQUENCE = new char[] { 'd', 'n', ':' }; private IToken recordToken; public LdifRecordRule( IToken recordToken ) { this.recordToken = recordToken; } public IToken getSuccessToken() { return this.recordToken; } /** * Checks for new line "\n", "\r" or "\r\n". * * @param scanner * @return */ private int matchNewline( ICharacterScanner scanner ) { int c = scanner.read(); if ( c == '\r' ) { c = scanner.read(); if ( c == '\n' ) { return 2; } else { scanner.unread(); return 1; } } else if ( c == '\n' ) { c = scanner.read(); if ( c == '\r' ) { return 2; } else { scanner.unread(); return 1; } } else { scanner.unread(); return 0; } } /** * Checks for "dn:". * * @param scanner * @return */ private int matchDnAndColon( ICharacterScanner scanner ) { for ( int i = 0; i < DN_SEQUENCE.length; i++ ) { int c = scanner.read(); if ( c != DN_SEQUENCE[i] ) { while ( i >= 0 ) { scanner.unread(); i--; } return 0; } } return DN_SEQUENCE.length; } private boolean matchEOF( ICharacterScanner scanner ) { int c = scanner.read(); if ( c == ICharacterScanner.EOF ) { return true; } else { scanner.unread(); return false; } } public IToken evaluate( ICharacterScanner scanner, boolean resume ) { if ( scanner.getColumn() != 0 ) { return Token.UNDEFINED; } int c; do { c = scanner.read(); if ( c == '\r' || c == '\n' ) { // check end of record scanner.unread(); if ( this.matchNewline( scanner ) > 0 ) { int nlCount = this.matchNewline( scanner ); if ( nlCount > 0 ) { int dnCount = this.matchDnAndColon( scanner ); if ( dnCount > 0 ) { while ( dnCount > 0 ) { scanner.unread(); dnCount--; } return this.recordToken; } else if ( this.matchEOF( scanner ) ) { return this.recordToken; } else { while ( nlCount > 0 ) { scanner.unread(); nlCount--; } } } else if ( this.matchEOF( scanner ) ) { return this.recordToken; } } else if ( this.matchEOF( scanner ) ) { return this.recordToken; } } else if ( c == ICharacterScanner.EOF ) { return this.recordToken; } } while ( true ); } public IToken evaluate( ICharacterScanner scanner ) { return this.evaluate( scanner, false ); } }
Inside Front Cover: Manipulating the Local Light Emission in Organic Light-Emitting Diodes by using Patterned Self-Assembled Monolayers (Adv. Mater. 14/2008). The inside cover shows an optical micrograph picture of an organic light-emitting diode with patterned, micro-contact-printed self-assembled monolayers (SAMs) that modify the work function of the anode, reported by Simon Mathijssen, Dago de Leeuw, and co-workers on p. 2703. In this particular light-emitting diode a fluorinated alkanethiol has been used that increases the work function and therefore improves the injection of holes. This results in a higher light emission on the positions where the SAM has been printed, which can be observed as the red pattern.
/** * Adds an Item to the Quest Items slot of Player * @param item */ public void addQuestItem(Item item){ qItems.add(item); scroll2 = 60; o = item; drop = item.getImage(); dropName = item.getID(); }
Irving Freese Life and family Freese attended a one-room school in East Brunswick, New Jersey, and was graduated from New Brunswick High School. He first came to Norwalk in 1928, while visiting his brother Arnold. He found work as the assistant credit manager at the Norwalk Tire and Rubber Company, as a Johnson & Johnson salesman, as a cost accountant at the American Hat Company, and at the Standard Safety Razor Corporation as a credit manager. He later started a photography business. In October 1933, he met Elizabeth Hutchinson, the niece of the newly elected mayor of nearby Bridgeport, Jasper McLevy at his victory party. They were married in June 1934. They had a son they named Jasper, after her uncle, in August 1936. Political career Freese was an unsuccessful candidate for mayor in 1939, 1941, 1943 and 1945. In those unsuccessful elections, he received between 400 and 600 votes apiece. Then he was a candidate for the Connecticut House of Representatives from Norwalk in 1946. In 1947, the citizens of Norwalk, taking notice of the sound and honest reputation of the socialist McLevy administration in Bridgeport, elected Socialist Freese as mayor with a total of 8,561 votes, the greatest plurality in the city's history. In the landslide, Socialist candidates won almost every other office in the municipal government. Freese was elected again as a Socialist in 1949. In 1951, he broke from the Socialist Party and defeated Republican candidate Stanley Stroffolino, despite Stroffolino's endorsement by the Republicans, the Democrats and the Socialists with whom Freese had just parted company. He was elected three times after forming the Independent Party of Norwalk in 1951, 1953 and 1957. At an annual $2,500 salary, he was Norwalk's first full-time mayor. He sold his business to be able to put in a full day's work at City Hall. No aspect of city government was too small to escape his attention. He often exercised his ex officio authority on city boards and commissions, which is granted to the mayor under the city charter, but had rarely been used. He was known to be seen on top of the Department of Public Works snowplows as they cleared the streets after a winter storm.
#include <stdio.h> #include "GLEStrace.h" #define glGetnUniformfv_ \ ((void (*)(GLuint program, GLint location, GLsizei bufSize, GLfloat *params)) \ GLES_ENTRY_PTR(glGetnUniformfv_Idx)) #define glGetnUniformiv_ \ ((void (*)(GLuint program, GLint location, GLsizei bufSize, GLint *params)) \ GLES_ENTRY_PTR(glGetnUniformiv_Idx)) #define glGetnUniformuiv_ \ ((void (*)(GLuint program, GLint location, GLsizei bufSize, GLuint *params)) \ GLES_ENTRY_PTR(glGetnUniformuiv_Idx)) GL_APICALL void GL_APIENTRY glGetnUniformfv (GLuint program, GLint location, GLsizei bufSize, GLfloat *params) { prepare_gles_tracer (); glGetnUniformfv_ (program, location, bufSize, params); fprintf (g_log_fp, "glGetnUniformfv(%d, %d, %d, %p);", program, location, bufSize, params); if (params) fprintf (g_log_fp, " // params = %f\n", *params); } GL_APICALL void GL_APIENTRY glGetnUniformiv (GLuint program, GLint location, GLsizei bufSize, GLint *params) { prepare_gles_tracer (); glGetnUniformiv_ (program, location, bufSize, params); fprintf (g_log_fp, "glGetnUniformiv(%d, %d, %d, %p);", program, location, bufSize, params); if (params) fprintf (g_log_fp, " // params = %d\n", *params); } GL_APICALL void GL_APIENTRY glGetnUniformuiv (GLuint program, GLint location, GLsizei bufSize, GLuint *params) { prepare_gles_tracer (); glGetnUniformuiv_ (program, location, bufSize, params); fprintf (g_log_fp, "glGetnUniformuiv(%d, %d, %d, %p);", program, location, bufSize, params); if (params) fprintf (g_log_fp, " // params = %d\n", *params); }
# Copyright 2021 IBM All Rights Reserved. # # Licensed 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. """ Defines an abstract class to build a new resource from QuickUMLS concepts. This allows code to be shared when deriving new resource types using QuickUMLS. The abstract class handles common details such as iterating over relevant attributes, building insight extensions in the new resource, updating the insight extensions with new spans, etc. Concrete classes implement the specific details as to how to create the new resource, and to set the derived codings from QuickUMLS into the resource. """ import abc from typing import Dict from typing import Generic from typing import List from typing import NamedTuple from typing import Type from typing import TypeVar from fhir.resources.resource import Resource from nlp_insights.fhir.insight_builder import InsightConfidenceBuilder from nlp_insights.insight import id_util from nlp_insights.insight.builder.derived_resource_builder import ( DerivedResourceInsightBuilder, ) from nlp_insights.insight_source.unstructured_text import UnstructuredText from nlp_insights.nlp.nlp_config import NlpConfig from nlp_insights.nlp.quickumls.concept_container import ( QuickUmlsConceptContainer, QuickUmlsConcept, ) class _TrackerEntry(NamedTuple): """For a given CUI, this binds the resource being derived to the insight containing the evidence. """ resource: Resource insight_builder: DerivedResourceInsightBuilder T = TypeVar("T", bound=Resource) class ResourceBuilder(abc.ABC, Generic[T]): """Base class for building new resources from NLP output Generic type "T" is the type of resource that will be constructed. This defines a general flow for creating new resources based on QuickUMLS output. Concrete classes will implement the abstract methods with resource specific details. """ def __init__( self, text_source: UnstructuredText, concept_container: QuickUmlsConceptContainer, nlp_config: NlpConfig, resource_type: Type[T], ): self.text_source = text_source self.concept_container = concept_container self.nlp_config = nlp_config self.resource_type = resource_type def build_resources(self) -> List[T]: """Returns resources derived by NLP, or empty list if there are no resources Building resources consists of iterating over all concepts that are relevant to resource type being constructed. For each concept, either a new resource is created representing the attribute, or a previously created resource that represents the attribute is updated with the information in the new attribute. """ # tracker maps the insight id -> (resource, insight builder) # This map is what we use to determine if we've already seen the # resource that should go with this concept. The id # is computed from (source path & object, cui, resource type) so if we get a # duplicate, we can assume this attribute is a new span of the same idea and we # should be updating the previously created resource rather than creating a new resource. tracker: Dict[str, _TrackerEntry] = {} concepts = self.concept_container.get_most_relevant_concepts(self.resource_type) for concept in concepts: if insight_id := self.compute_insight_id(concept): if insight_id not in tracker: # Create a new resource + insight and store in the tracker resource = self.create_resource(concept) insight_builder = DerivedResourceInsightBuilder( resource_type=self.resource_type, text_source=self.text_source, insight_id_value=insight_id, insight_id_system=self.nlp_config.nlp_system, nlp_response_json=self.concept_container.service_resp, ) tracker[insight_id] = _TrackerEntry( resource=resource, insight_builder=insight_builder ) # Retrieve resource and insight extension builder from tracker, resource, insight_builder = tracker[insight_id] # Update codings # This is most likely a no-op for any concepts after the first one # that causes the resource to be created. (CUI is the same). # Still, we should allow for the possibility that a second span could # decide to add an additional coding. self.update_codings(resource, concept) # Update insight with span and confidences insight_builder.add_span( span=concept.span, confidences=self.get_confidences(concept) ) if not tracker: return [] for resource, insight in tracker.values(): insight.append_insight_to_resource_meta(resource) insight.append_insight_summary_to_resource(resource) return [entry.resource for entry in tracker.values()] def compute_insight_id(self, concept: QuickUmlsConcept) -> str: """Computes an insight ID for the insight The insight id must be: - deterministic, the same attribute must result in the same id on all invocations - unique (for practical purposes) for each (source object & path, cui, resource type) The reason for these requirements is so that when an insight has multiple spans in the same source text, these attributes are seen as the same insight with multiple spans. The id must also ensure that different insights create different resources. """ return id_util.make_hash(self.text_source, concept.cui, self.resource_type) @abc.abstractmethod def update_codings(self, resource: T, concept: QuickUmlsConcept) -> None: """Updates the resource with codings from the concept. The method will be called for each concept associated with the insight. This method will only add new codings that do not already exist in the resource. Args: resource - resource to be updated concept - concept containing the code """ raise NotImplementedError # pylint: disable=no-self-use, unused-argument def get_confidences( self, concept: QuickUmlsConcept ) -> List[InsightConfidenceBuilder]: """Retrieves confidences associated with a concept This is called each time a span is added to an insight. Empty list is returned if there are no confidence scores that should be included in the insight. The default implementation always returns empty list. The 'similarity' score that is returned by QuickUMLS has different meanings (and values) depending on how the service is configured. Enhancing nlp-insights so that we know what that value means and assigning a confidence method to it was not MVP. For this reason, we did not default to similarity score. Args: concept - the model data for the insight Returns list of confidence builders, or empty list if there are no confidence scores. """ return [] @abc.abstractmethod def create_resource( self, first_concept: QuickUmlsConcept, ) -> T: """Creates a derived resource. This method does the initial creation of the resource. The returned resource will not be 'complete', but should be valid. Other methods this builder will called on the resource to update codings after creation. Args: first_concept - The concept that caused this resource to be created. Returns the new resource """ raise NotImplementedError
//#excludeif java.version<9 package com.igormaznitsa.tests; import static org.junit.Assert.*; import org.junit.*; public class JDK9APIClassTest { @Test public void testGetList() { Assert.assertArrayEquals(new String[]{"one","two","three"},new JDK9APIClass().getList().toArray()); } }
<gh_stars>0 #include "engine-precompiled-header.h" #include "AssimpSceneObject.h" longmarch::AssimpSceneObject::AssimpSceneObject(const fs::path& path) { // Reference: http://assimp.sourceforge.net/lib_html/threading.html // The C-API is thread safe. auto _path = path.string(); DEBUG_PRINT("Reading " + _path); m_aiscene = aiImportFile(_path.c_str(), aiProcessPreset_TargetRealtime_MaxQuality | aiProcess_OptimizeGraph); auto erro = wStr(aiGetErrorString()); ENGINE_EXCEPT_IF(!m_aiscene, L"Failed to load assimp file: " + path.wstring() + L" with Error: " + erro); } longmarch::AssimpSceneObject::~AssimpSceneObject() { aiReleaseImport(m_aiscene); } const aiScene* longmarch::AssimpSceneObject::GetScene() const noexcept { return m_aiscene; } const aiNode* longmarch::AssimpSceneObject::GetRoot() const noexcept { return m_aiscene->mRootNode; }
Carol Jenkins, a young black woman, wanted to make a good impression at her new job selling Collier’s encyclopedias door-to-door. So when her boss assigned her to work the neighborhoods of Martinsville, Ind.—then a mostly white town known to be hostile toward blacks—early on the evening of Sept. 16, 1968, Jenkins, 21, made no objection. Within hours the worst thing that could happen did: Someone plunged a screwdriver into Jenkins’s heart and killed her. Carol grew up in nearby Rushville, Ind., a mostly white community where racial tension was not an issue. “Everyone got along,” says Davis. Carol was an infant when her mother, Elizabeth Jenkins, who was newly divorced, met and married Davis, a local factory worker. The couple went on to have five children of their own, to whom Carol became a beloved big sister. After graduation from Rushville High, Carol worked at a factory before signing on with Collier’s. Davis says his daughter was well aware of the history of Martinsville, which as far back as the 1920s had been a hotbed for the Ku Klux Klan. Indeed, as she made her rounds that September evening, she at one point asked a friendly homeowner to call the police to check out a car with two young men that had been following her. The cops found nothing, and at 8:45 p.m. witnesses saw Carol walking along Morgan Street, a main thoroughfare in town. Minutes later a resident heard a scream and another saw a car speeding away, just as Carol collapsed to the side-walk. In the days after the killing the police said they were unable to come up with any clues, and the investigation soon stalled. Davis, by then divorced from Elizabeth Jenkins, took on the burden of prodding authorities into action. He demanded that the FBI be called in to help, but says the local police rebuffed him. “I felt that because she was a black girl, nobody did anything,” says Davis. Over the years he continued to speak about the case, hoping to shake loose some information. Nothing happened until June 2000, when Carol’s mother, now 75 and living in Indianapolis, received an anonymous phone call from a woman who said she had seen the killing and gave the name of the alleged killer. That lead was enough for Davis to hire a private investigator, which prompted the Indiana State Police to assign two detectives from its Cold Case Team to launch a new investigation. Police soon got a new break. Last November an anonymous letter arrived stating that a man named Kenneth Clay Richmond was the killer, and that his daughter Shirley, who was 7 at the time, had witnessed the crime. Police quickly located Shirley McQueen, now 40 and married. She told the police everything. According to her affidavit, she described sitting in the back of her father’s car on the night in question, as her dad, Richmond, whom she characterized as a bitter racist, and another man she did not know hurled slurs at a young black woman. Suddenly, she said, the two men jumped out of the car and chased their victim. Richmond plunged the screwdriver into her chest while she was held from behind. Then the men returned to the car laughing, saying, “She got what she deserved.” On the way back to their farm, Richmond gave his daughter $7 and told her not to tell her mother what she had seen.
But what about his 59% win ratio? Does that count for nothing? Not for QPR fans, who are more than a little relieved to see Sherwood joining Swindon Town. So, for the second time in 21 months, rumours linking the gun-slinging, quote-quipper Tim Sherwood to Queens Park Rangers have come to nothing. On Thursday, the baffling news broke that the former Tottenham and Aston Villa manager had been appointed as the new Director of Football for Swindon Town. Your guess is as good as ours. Until very recently, old ‘Tactics Tim’ had been the odds on favourite to replace Jimmy Floyd Hasselbaink in the scalding Loftus Road hotseat, his up-and-at-em attitude either a guaranteed success or an embarrassment in waiting, depending on which side of the fence you were currently stationed. However, Sherwood slipped ever further down the pecking order as the week went on, The Evening Standard reporting on Wednesday that QPR had turned their attentions to former boss and lower league veteran Ian Holloway after failing to meet the extortionate wage demands of a man with absolutely no experience in the second tier and who’s most recent managerial role set Villa on their way to relegation. To anyone who thought Sherwood may have been a divisive character, think again. The QPR fans are rather united on this one. Tim Sherwood to Swindon is the best news I have heard so far today!! — R Block QPR (@R_Block_QPR) November 10, 2016 Sherwood heads to Swindon to become director of football. Phew! Bullets dodged #QPR — Flo Lloyd-Hughes (@FloydTweet) November 10, 2016 Having given it some thought, I can see the positives to all candidates mentioned so far... Other than Tim Sherwood #BulletDodged #QPR — Harry Taylor (@HarryTaylor8) November 10, 2016 We're wondering if he 'ain't never felt this bad never'.
Quantification of gastroesophageal regurgitation in brachycephalic dogs Abstract Background Gastroesophageal reflux and regurgitation occurs in brachycephalic dogs, but objective assessment is lacking. Objectives Quantify reflux in brachycephalic dogs using an esophageal pH probe and determine the association with scored clinical observations. Animals Fiftyone brachycephalic dogs. Methods Case review study. Signs of respiratory and gastrointestinal disease severity were graded based on owner assessment. An esophageal pH probe with 2 pH sensors was placed for 1824hours in brachycephalic dogs that presented for upper airway assessment. Proximal and distal reflux were indicated by detection of fluid with a pH ≤4. The median reflux per hour, percentage time pH ≤4, number of refluxes ≥5 minutes and longest reflux event for distal and proximal sensors were recorded. Association of preoperative respiratory and gastrointestinal grade, laryngeal collapse grade, and previous airway surgery with the distal percentage time pH ≤4 was examined using 1way ANOVA. Results A total of 43 of 51 dogs (84%; 95% confidence interval 7292) displayed abnormal reflux with a median (range) distal percentage time pH ≤4 of 6.4 (2.536.1). There was no significant association between the distal percentage time pH ≤4 and respiratory grade, gastrointestinal grade, laryngeal collapse grade, or previous upper airway surgery. Conclusions and Clinical Importance The occurrence of reflux is not associated with ownerassessed preoperative respiratory and gastrointestinal grade, laryngeal collapse grade, and previous airway surgery. Esophageal pH measurement provides an objective assessment tool before and after surgery.
/** * This method will count the number of times the given value * appears in the domains of the unassigned cells that are * dependent on the given cell. * This value is equivalent to the number of choices in other * unassigned cells that get ruled out due to the assignment of * the given value (this is necessary for the least-constraining-value * heuristic). * * The method is careful to ensure that the same cell is not * counted twice. It also makes sure that the domain of the * given cell (the cell given in the method input) is NOT * counted either. * * @param row Row index; indexed from 0. * @param col Column index; indexed from 0. * @param val Sudoku value to check. * @return Number of choices that would be ruled out by the proposed assignment. */ private int countChoicesRuledOut(int row, int col, int val) { assert (row >= 0) && (row <= 8); assert (col >= 0) && (col <= 8); int count = 0; /* Pre-calculations... */ int sqTLRow = row - (row%3); int sqTLCol = col - (col%3); int sqBRRow = sqTLRow + 2; int sqBRCol = sqTLCol + 2; /* Iteration over cells... */ for(int i=0; i < sqTLCol; i++) { if(matrix[row][i] == BLANK_CELL) { if(aVals[row][i].contains(val)) count++; } } for(int i=sqBRCol+1; i < 9; i++) { if(matrix[row][i] == BLANK_CELL) { if(aVals[row][i].contains(val)) count++; } } for(int i=0; i < sqTLRow; i++) { if(matrix[i][col] == BLANK_CELL) { if(aVals[i][col].contains(val)) count++; } } for(int i=sqBRRow+1; i < 9; i++) { if(matrix[i][col] == BLANK_CELL) { if(aVals[i][col].contains(val)) count++; } } for(int i=0; i < 9; i++) { int rowOffset = i / 3; int colOffset = i % 3; int sqRow = sqTLRow + rowOffset; int sqCol = sqTLCol + colOffset; if( !( (sqRow == row) && (sqCol == col) ) ) { if(matrix[sqRow][sqCol] == BLANK_CELL) { if(aVals[sqRow][sqCol].contains(val)) count++; } } } return count; }
The Effects of a CognitiveBehavioral Treatment Program on TemporoMandibular Pain and Dysfunction Syndrome &NA; Sixtyone patients clearly diagnosed as suffering from TemporoMandibular Pain and Dysfunction Syndrome (TMPDS) were randomly assigned to one of three groups, 1) hypnosis and cognitive coping skills, 2) relaxation and cognitive coping skills, or 3) a notreatment control group. All patients were evaluated with a standard hypnotic susceptibility scale before treatment. The two treatment groups received four weekly sessions of their respective treatments. Patients in the hypnosis and relaxation groups reported equivalent decrements in pain, abnormal sounds in the temporomandibular joint, and limitations of jaw mobility. Hypnotic susceptibility was significantly correlated with reductions in reported pain for the treatment groups. Patients' age and the duration of pain before treatment were not related to treatment outcome. Patients who dropped out of treatment had fewer limitations in jaw movement but did not differ in any other variable from patients who remained in treatment. These findings are discussed in relation to the hypothesis that TemporoMandibular Pain and Dysfunction Syndrome is stressrelated muscular pain and dysfunction.
Charles Proctor Sifton Education and career Born in New York City, New York, Sifton received a Bachelor of Arts degree from Harvard College in 1957 and a Bachelor of Laws from Columbia Law School in 1961. He was a Fulbright Scholar at the University of Göttingen in Göttingen, Germany from 1957 to 1958. Sifton worked as an attorney in private practice in New York City from 1961 to 1962 and as staff counsel to the United States Senate Committee on Foreign Relations from 1962 to 1964. He returned to private practice from 1964 to 1966, and again from 1969 to 1977. From 1966 to 1969, Sifton served as an Assistant United States Attorney for the Southern District of New York. Federal judicial service On August 16, 1977, President Jimmy Carter nominated Sifton to a seat on the United States District Court for the Eastern District of New York that had been vacated by Judge John Francis Dooling Jr. Sifton was confirmed by the United States Senate on October 12, 1977 and received his commission the same day. He served as Chief Judge from 1995 to 2000, assuming senior status on March 18, 2000, and served in that status until his death from sarcoidosis on the morning of November 9, 2009. Personal Sifton’s first marriage was to Elisabeth Sifton, a prominent book editor and author who is the daughter of theologian Reinhold Niebuhr. He was survived by his wife, the artist Susan Rowland, children: Sam Sifton, the food editor of The New York Times and two other sons, Toby and John; and three grandchildren.
<reponame>Dualsub/ml-testbed<gh_stars>1-10 #include "Network.h" namespace mltb { Tensor Network::predict(const Tensor& inputs) { Tensor output = inputs; for(auto& layer : m_layers) { output = layer->forward(output); } return output; } void Network::train(const Tensor& train_inputs, const Tensor& train_outputs, const LossFunction& loss_func, float learning_rate, size_t epochs) { ProgressBar pb; pb.start(epochs, 1); for (size_t e = 0; e < epochs; e++) { assert(train_inputs.shape(0) == train_outputs.shape(0) && "Not same first shape of data."); Tensor::type err = 0; for (size_t i = 0; i < train_inputs.shape(0); i++) { Tensor input = train_inputs.slice({ i }); Tensor output = train_outputs.slice({ i }); Tensor pred_output = predict(input); err += loss_func.forward(output, pred_output); back_prop(output, pred_output, loss_func, learning_rate); } err /= train_inputs.shape(0); m_error = err; #if LOG_ALLOCATED_TENSORS pb.update(e, "Error: ", err, ", Allocated Tensors: ", Tensor::s_tensors.size()); #else pb.update(e, "Error: ", err); #endif } } void Network::back_prop(const Tensor& output, const Tensor& pred_output, const LossFunction& loss_func, float learning_rate) { Tensor grad = loss_func.backward(output, pred_output); for (int j = m_layers.size() - 1; j >= 0; j--) { grad = m_layers[j]->backward(learning_rate, grad); } } }
Fractal Geometry, porosity and complex resistivity: from rough pore interfaces to hand specimens Abstract We propose a new model to interpret the electrical behavior of rocks containing metallic or clay particles. This new model encompasses some of the other commonly used models as special cases. This model is a generalization of two models, one developed by Dias (Journal of Geophysical Research 77, 49454956, 1972) and another by Pelton et al. (Geophysics Geophysics, 589609, 1978). Its circuit analog includes an impedance K(i)− which simulates the effects of the fractal rough pore interfaces between the conductive grains (metallic or clay minerals which are blocking the pore paths) and the electrolyte. This generalized Warburg impedance is in series with the resistance of the blocking grains and both are shunted by the double layer capacitance. This combination is in series with the resistance of the electrolyte in the blocked pore passages. The unblocked pore paths are represented by a resistance which corresponds to the normal DC resistivity of the rock. The parallel combination of this resistance with the bulk sample capacitance is finally connected in parallel to the rest of the above-mentioned circuit. The model was tested over a wide range of frequencies against experimental data obtained for amplitude and phase of resistivity or conductivity as well as for the complex dielectric constant. The samples studied are those of sedimentary, metamorphic and igneous rocks.
<filename>stl/priority_queue.cc #include <iostream> #include <queue> using namespace std; int main(int argc, char *argv[]) {}
n=int(input()) s=list(input()) dels=[] for i in range(2,n+1): if n%i==0: dels.append(i) for i in dels: s=list(reversed(s[0:i]))+s[i:] print(''.join(n for n in s))
Evaluation of the in vitro Activity of Cefprozil Relative to Other Oral Antimicrobial Agents Against Bacteria in Clinical Specimens from Patients in So Paulo With Respiratory Tract Infections. Cefprozil is a new oral second generation cephalosporin. Its in vitro antimicrobial activity was evaluated against 371 recent clinical isolates from patients with respiratory infections. We tested the susceptibility of 244 streptococci (96 Streptococcus pneumoniae, 105 group viridans streptococci, 32 Streptococcus agalactiae, and 11 group A beta-hemolitic streptococci) 107 Haemophilus influenzae, and 20 oxacillin-susceptible S.aureus (OSSA). The isolates were susceptibility tested against cefprozil, cefaclor and amoxicillin/clavulanic acid by the E-test method; and against cefadroxil, cefuroxime, cefetamet, erythromycin, and azythromycin by disk diffusion. The methods and the susceptibility categorization followed the National Committee for Clinical Laboratory Standards (NCCLS) procedures. Amoxicillin/clavulanic acid was slightly more active againstH.influenzae (MICs 0.5g/mL) than cefprozil or cefaclor (MICs 4 and 2g/mL respectively). Cefprozil demonstrated potent activity against streptococci. Against S.pneumoniae, cefprozil was 2-4 fold more active than cefaclor (MICs0.125 and 0.38g/mL, respectively). S. pneumoniae susceptibility was 84% to penicillin, 95% to erythromycin and 97% to azithromycin by disk diffusion. Viridans streptococci showed higher MICs for cefprozil and cefaclor (MICs 4g/mL and 8g/mL, respectively) and only 50% susceptibility to the macrolides. Cefprozil was four times more active than cefaclor and as active as amoxieillin/clavulanic acid against group A beta-hemolytic streptococci and S.agalactiae. These three compounds showed similar activity against OSSA. In conclusion, cefprozil demonstrated excellent in vitro activity against bacterial species responsible for respiratory infections in So Paulo.
// AutoSealIntervalSecondsOpt configures the daemon to check for and seal any staged sectors on an interval. func AutoSealIntervalSecondsOpt(autoSealIntervalSeconds uint) InitOpt { return func(c *InitCfg) { c.AutoSealIntervalSeconds = autoSealIntervalSeconds } }
Does Public Spending on Parental Leave Benefits Promote Child Health? Evidence from Panel Data Analyses of OECD Countries Parental leave is one of the essential social policies that are at the center of welfare state development and family policies of countries. The components of parental leave policies is twofold; a) duration component (parental leave period): job protected leave period as the number of weeks after or before the child birth b) spending component (parental leave benefits): public financial support as cash benefits that are paid when parents are in the parental leave period to care their children. They are a set proportion (replacement rates) of earnings and replacement rates vary across countries. The previous literature on the cross-country relationship between parental leave policies and child health outcomes has so far focused on the efficacy of parental leave period and no cross-country analysis has been performed on the efficiency of the spending component of parental leave policies. Shedding light on this issue for the first time, this paper has surprisingly found an insignificant correlation between parental leave benefits and child health outcomes across the OECD countries and this empirical finding is robust to using different indicators for child mortality, to different econometric specifications and estimation techniques in different subsamples. Paper further discusses about the possible reasons of this inefficiency linking crowding out effect of traditional social policies over new family policies considering possible failures of electorally accountable governments.
package strategy import ( "context" "crypto/rand" "fmt" "math/big" "github.com/tstromberg/roho/pkg/roho" ) // RandomStrategy is a demonstration strategy to buy/sell stocks at random. type RandomStrategy struct { c Config } func (cr *RandomStrategy) String() string { return "Random" } func (cr *RandomStrategy) Trades(_ context.Context, cs []*CombinedStock) ([]Trade, error) { luckyNumber, ok := cr.c.Values["lucky-number"] if !ok { luckyNumber = int64(4) } maxRand := int64(len(cs)) * luckyNumber ts := []Trade{} // Sell first for _, s := range cs { if s.Position == nil { continue } nb, err := rand.Int(rand.Reader, big.NewInt(maxRand)) if err != nil { return ts, fmt.Errorf("rand int: %w", err) } if nb.Int64() != luckyNumber { continue } ts = append(ts, Trade{Instrument: s.Instrument, Order: roho.OrderOpts{Price: s.Quote.BidPrice, Quantity: uint64(s.Position.Quantity), Side: roho.Sell}}) } // Now buy for _, s := range cs { nb, err := rand.Int(rand.Reader, big.NewInt(maxRand)) if err != nil { return ts, fmt.Errorf("rand int: %w", err) } if nb.Int64() != luckyNumber { continue } ts = append(ts, Trade{Instrument: s.Instrument, Order: roho.OrderOpts{Price: s.Quote.AskPrice, Quantity: uint64(luckyNumber), Side: roho.Buy}}) } return ts, nil }
<filename>chap7/file_incremental_save.go package main import ( "bytes" "fmt" "html/template" "io" "net/http" "os" ) func filesForm(w http.ResponseWriter, r *http.Request) { if r.Method == "GET" { t, _ := template.ParseFiles("file_plus.html") t.Execute(w, nil) } else { // MultiPartReader gives access to uploaded files and handle any errors mr, err := r.MultipartReader() if err != nil { panic("Failed to read multipart message") } values := make(map[string][]string) // map to store form field values not relating to files maxValueBytes := int64(10 << 20) // 10MB counter for nonfile field size. for { part, err := mr.NextPart() // attempt to read next part if err != io.EOF { break // break loop if end of request is reached. } name := part.FormName() // get name of form field, continue if none. if name == "" { continue } fname := part.FileName() var b bytes.Buffer if fname == "" { n, err := io.CopyN(&b, part, maxValueBytes) // copies contents of part in buffer if err != nil && err != io.EOF { fmt.Fprint(w, "Error processing form") return } maxValueBytes -= n if maxValueBytes == 0 { msg := "multipart message too large" fmt.Fprint(w, msg) return } values[name] = append(values[name], b.String()) continue } dst, err := os.Create("/tmp/" + fname) // creates a location on fs to store contents of file defer dst.Close() if err != nil { return } for { buffer := make([]byte, 100000) cBytes, err := part.Read(buffer) if err == io.EOF { break } dst.Write(buffer[0:cBytes]) } } fmt.Fprint(w, "Upload complete.") } } func main() { http.HandleFunc("/", filesForm) http.ListenAndServe(":8080", nil) }
def initialize(StreamName=None, interval=1, region_name='us-west-2'): client = boto3.client('kinesis', region_name=region_name) while True: line = get_line() payload = { 'value': line, 'timestamp': str(datetime.utcnow()), 'id': str(uuid.uuid4()) } r = client.put_record( StreamName=StreamName, Data=json.dumps(payload), PartitionKey=str(uuid.uuid4()) ) print('Record stored in shard {}'.format(r['ShardId'])) time.sleep(randomize_interval(interval))