content
stringlengths 7
2.61M
|
---|
package com.zxq.learn.thread.comAndProv;
/**
* Created{ by zhouxqh} on 2017/10/9.
*/
public class Apple {
private String Id;
public Apple(String id) {
Id = id;
}
@Override
public String toString() {
return Id;
}
}
|
<reponame>crawlab-team/crawlab-ui
import useList from '@/layouts/list';
import {useStore} from 'vuex';
import {computed} from 'vue';
import {TABLE_COLUMN_NAME_ACTIONS} from '@/constants/table';
import {ElMessage, ElMessageBox} from 'element-plus';
import useClipboard from 'vue-clipboard3';
import {translate} from '@/utils/i18n';
import {sendEvent} from '@/admin/umeng';
// i18n
const t = translate;
const useTokenList = () => {
const ns = 'token';
const store = useStore<RootStoreState>();
// use list
const {
actionFunctions,
} = useList<Token>(ns, store);
// action functions
const {
deleteByIdConfirm,
} = actionFunctions;
// clipboard
const {toClipboard} = useClipboard();
// nav actions
const navActions = computed<ListActionGroup[]>(() => [
{
name: 'common',
children: [
{
buttonType: 'label',
label: t('views.tokens.navActions.new.label'),
tooltip: t('views.tokens.navActions.new.tooltip'),
icon: ['fa', 'plus'],
type: 'success',
onClick: async () => {
sendEvent('click_token_list_new');
const res = await ElMessageBox.prompt(
t('views.tokens.messageBox.prompt.create'),
t('common.actions.create'),
);
sendEvent('click_token_list_new_confirm');
const name = res.value;
const token = {
name,
} as Token;
await store.dispatch(`${ns}/create`, token);
await store.dispatch(`${ns}/getList`);
},
}
]
}
]);
// table columns
const tableColumns = computed<TableColumns<Token>>(() => [
{
key: 'name',
label: t('views.tokens.table.columns.name'),
icon: ['fa', 'font'],
width: '160',
hasFilter: true,
allowFilterSearch: true,
},
{
key: 'token',
label: t('views.tokens.table.columns.token'),
icon: ['fa', 'key'],
width: 'auto',
value: (row: Token) => {
if (!row._visible) {
return (() => {
const arr = [] as string[];
for (let i = 0; i < 100; i++) {
arr.push('*');
}
return arr.join('');
})();
} else {
return row.token;
}
},
},
{
key: TABLE_COLUMN_NAME_ACTIONS,
label: t('components.table.columns.actions'),
icon: ['fa', 'tools'],
width: '180',
fixed: 'right',
buttons: (row) => [
{
type: 'primary',
size: 'mini',
icon: !row._visible ? ['fa', 'eye'] : ['fa', 'eye-slash'],
tooltip: !row._visible ? t('common.actions.view') : t('common.actions.hide'),
onClick: async (row: Token) => {
row._visible = !row._visible;
row._visible ? sendEvent('click_token_list_actions_hide') : sendEvent('click_token_list_actions_show');
},
},
{
type: 'info',
size: 'mini',
icon: ['far', 'clipboard'],
tooltip: t('common.actions.copy'),
onClick: async (row: Token) => {
if (!row.token) return;
await toClipboard(row.token);
await ElMessage.success(t('common.message.success.copy'));
sendEvent('click_token_list_actions_copy');
},
},
{
type: 'danger',
size: 'mini',
icon: ['fa', 'trash-alt'],
tooltip: t('common.actions.edit'),
onClick: deleteByIdConfirm,
},
],
disableTransfer: true,
},
]);
// options
const opts = {
navActions,
tableColumns,
} as UseListOptions<Token>;
return {
...useList<Token>(ns, store, opts),
};
};
export default useTokenList;
|
. The case of an 89 year old patient is reported, in whom an aspergillus myocarditis was unexpectedly found at autopsy. Preoperatively, the patient showed no risk factors for an invasive mycosis. 5 days after uncomplicated surgery he developed septic shock due to peritonitis. After surgery and intensive care therapy the patient recovered initially. 23 days after the first operation the patient suddenly developed catecholamin-resistant myocardial failure and died. Ten days before, aspergillus spec. was found in a specimen of bronchial secretion. This finding was interpreted as colonisation and not treated.
|
<reponame>coolslow/Algorithm<filename>test/com/coolslow/topics/array/Code49GroupAnagramsTest.java
package com.coolslow.topics.array;
import com.coolslow.datastruct.utils.MyUtils;
import com.coolslow.leetcode.topics.array.Code49GroupAnagrams;
import org.junit.Test;
import java.util.List;
/**
* by MrThanksgiving
*/
public class Code49GroupAnagramsTest {
@Test
public void testSolution() {
Code49GroupAnagrams solution = new Code49GroupAnagrams();
// String[] input = {"eat", "tea", "tan", "ate", "nat", "bat"};
// String[] input = {"", "b"};
String[] input = {"tea","and","ace","ad","eat","dans"};
List<List<String>> result = solution.groupAnagrams(input);
for (List<String> l : result) {
MyUtils.printArray(l);
}
}
}
|
Bridging the pond: measuring policy positions in the United States and Europe Abstract Recent work has pioneered the use of expert surveys to estimate cross-national party positions in a common ideological space. In this paper, we report findings from an original dataset designed to evaluate bridging strategies between European and American party placements. Specifically, we compare the use of anchoring vignettes (fictional party platforms) with an alternative approach that asks comparativist scholars who live in the US (whom we call transatlantic or TA experts) to place parties and parties in their country of expertise on a series of issues scales. The results provide an optimistic assessment of the ability of TA experts to serve as valid bridges across the Atlantic. The resulting cross-comparable estimates of party positions show instances of both convergence and divergence between American and European party systems, including parallels between systems on the cross-cutting issue of international economic integration.
|
from .peak_from_chromatogram import peak_from_chromatogram
|
Human Herpes Virus-6 Following Pediatric Allogeneic Hematopoietic Stem Cell Transplantation. BACKGROUND Human herpes virus-6 (HHV-6) reactivation after hematopoietic stem cell transplantation (HSCT) is well known and has been linked with several clinical manifestations. The significance of HHV-6 viremia and related complications in this setting is still unclear. OBJECTIVE To estimate the incidence of HHV-6 reactivation and associated morbidity in children undergoing allogeneic HSCT. METHODS Blood samples obtained weekly (for cytomegalovirus surveillance) from children who underwent allogeneic HCST during the period January 2006-June 2010 were retrospectively tested for the presence of HHV-6 DNA using standard real-time polymerase chain reaction (PCR) assay. Clinical records were reviewed for correlation between viremia and clinical manifestations. RESULTS Samples from 39 children were tested. Twenty patients had viral loads above 1000 copies/ml (51%) in at least one sample. Higher viral loads were seen in patients with primary immunodeficiency and in those with cord blood transplant. Attributable symptoms were present in 12 patients (60%) concurrently with positive PCR. Clinical manifestations spontaneously resolved without treatment in most cases, concomitantly with a decrease in viral load. CONCLUSIONS HHV-6 reactivation during allogeneic HSCT is common. HHV-6 reactivation should be considered in patients with graft-vs-host disease-like rash, onset of CNS symptoms, delay in engraftment, and in patients after cord blood transplantation.
|
<filename>src/main/java/lk/gov/health/phsp/bean/AreaApplicationController.java
/*
* The MIT License
*
* Copyright 2021 buddhika.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package lk.gov.health.phsp.bean;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.ejb.EJB;
import javax.inject.Named;
import javax.enterprise.context.ApplicationScoped;
import lk.gov.health.phsp.entity.Area;
import lk.gov.health.phsp.enums.AreaType;
import lk.gov.health.phsp.facade.AreaFacade;
/**
*
* @author buddhika
*/
@Named
@ApplicationScoped
public class AreaApplicationController {
@EJB
private AreaFacade areaFacade;
private List<Area> gnAreas;
private List<Area> allAreas;
/**
* Creates a new instance of AreaApplicationController
*/
public AreaApplicationController() {
}
public List<Area> getGnAreas() {
if (gnAreas == null) {
gnAreas = getAllGnAreas();
}
return gnAreas;
}
public void setGnAreas(List<Area> gnAreas) {
this.gnAreas = gnAreas;
}
public List<Area> getAllAreas() {
if (allAreas == null) {
allAreas = fillAllAreas();
}
return allAreas;
}
private List<Area> fillAllAreas() {
String j;
Map m = new HashMap();
j = "select a "
+ " from Area a "
+ " where a.name is not null";
j += " order by a.name";
return areaFacade.findByJpql(j, m);
}
public List<Area> getAllGnAreas() {
List<Area> tas = new ArrayList<>();
for (Area a : getAllAreas()) {
if (a.getType() == AreaType.GN) {
tas.add(a);
}
}
return tas;
}
public List<Area> getAllAreas(AreaType at) {
List<Area> tas = new ArrayList<>();
for (Area a : getAllAreas()) {
if (a.getType()!=null && a.getType().equals(at)) {
tas.add(a);
}
}
return tas;
}
public List<Area> completeGnAreas(String qry) {
List<Area> tas = new ArrayList<>();
for (Area a : getGnAreas()) {
if (a.getName().toLowerCase().contains(qry.trim().toLowerCase())) {
tas.add(a);
}
}
return tas;
}
public List<Area> completeGnAreas(String qry, Area dsArea) {
List<Area> tas = new ArrayList<>();
for (Area a : getGnAreas()) {
if (a.getName().toLowerCase().contains(qry.trim().toLowerCase())) {
if (a.getParentArea().equals(dsArea)) {
tas.add(a);
}
}
}
return tas;
}
}
|
import { MyRequest } from './something/my-request';
import { SomethingService } from './something/something.service';
import { SomethingHandler } from './something/something.handler';
export const Handlers = [SomethingHandler];
export const Services = [SomethingService];
export const Utils = [MyRequest];
|
PARK15/FBXO7 is dispensable for PINK1/Parkin mitophagy in iNeurons and HeLa cell systems The protein kinase PINK1 and ubiquitin ligase Parkin promote removal of damaged mitochondria via a feed-forward mechanism involving ubiquitin (Ub) phosphorylation, Parkin activation, and ubiquitylation of mitochondrial outer membrane proteins to support recruitment of mitophagy receptors. The ubiquitin ligase substrate receptor FBXO7/PARK15 is mutated in an early-onset parkinsonian-pyramidal syndrome. Previous studies have proposed a role for FBXO7 in promoting Parkin-dependent mitophagy. Here, we systematically examine the involvement of FBXO7 in depolarization-dependent mitophagy in the well-established HeLa and induced-neurons cell systems. We find that FBXO7-/- cells have no demonstrable defect in: 1) kinetics of pUb accumulation, 2) pUb puncta on mitochondria by super-resolution imaging, 3) recruitment of Parkin and autophagy machinery to damaged mitochondria, 4) mitophagic flux, and 5) mitochondrial clearance as quantified by global proteomics. Moreover, global proteomics of neurogenesis in the absence of FBXO7 reveals no obvious alterations in mitochondria or other organelles. These results argue against a general role for FBXO7 in Parkin-dependent mitophagy and point to the need for additional studies to define how FBXO7 mutations promote parkinsonian-pyramidal syndrome. 37 Organelle quality control underlies cellular health and is often defective in disease 38 and pathological states. Arguably the best understood such quality control pathway is ligase, which marks damaged mitochondria for elimination (Narendra et al, 2008). Parkin 51 and PINK1 are both mutated in early-onset recessive forms of Parkinson's disease and 52 understanding how these enzymes work has been a major focus of the field (Ng et al, 2021; In healthy mitochondria, PINK1 is imported into the mitochondrial translocon and 55 rapidly processed for degradation Yamano & Youle, 2013). In response to 56 mitochondrial damage -such as depolarization, accumulation of mitochondrial misfolded 57 proteins, or defects in mitochondrial fusion -PINK1 is stabilized on the mitochondrial outer 117 To test if FBXO7 is a pivotal amplifier of the PINK1/Parkin pathway, we employed 118 CRISPR-Cas9-based gene editing to generated knockouts for FBXO7 in HeLa HFT/TO-119 PRKN cells and confirmed insertion of a frameshift mutation by 150 Similarly, we assessed depolarization-dependent pUb accumulation in the iNeuron 151 system. control or FBXO7 -/-ES cells were converted to day 12 iNeurons and depolarized 152 with AO in duplicate ( Figure 1C). pUb was detected by immunoblotting at 6 and 24 h and 153 was indistinguishable between WT and two independent FBXO7 -/clones ( Figure 1D). 154 Taken together, these data do not support a universal role for FBXO7 in promoting the 155 earliest step in mitophagy signalling -PINK1-dependent Ub phosphorylation -in the HeLa 207 Depolarization by AO led to the expected mitochondrial fragmentation and clustering, thus 208 causing an increase in local HSP60 signal and a right-shift in mtIntDen (Supplemental 209 Figure 4C, top panel). This shift was also observed to a similar extend in FBXO7 -/cells. 210 Thus, both control and FBXO7 -/cells robustly respond to AO-induced mitophagy. Next, we 211 tested if Parkin intensities are increasing on mitochondria on an "organelle object" level. As Figure 4C). If this response is a compensatory mechanism of the knockout cell line to 351 cope with cytotoxic insults is an intriguing idea. Last, we examined whether FBXO7 -/is 352 required for the maintenance of the mitochondrial organelle pool during differentiation. 353 Previous work has shown significant metabolic rewiring during the differentiation from hESC 354 to iNeurons, including a switch from glycolysis to oxidative phosphorylation as the cells main 355 energy source (). Since this switch is accompanied by increased 659 All details and catalogue numbers can be found in the Materials 663 Cloning and plasmid generation 668 Cell culture, generation of lentiviral stable cell lines. 674 Stable cell lines were generated using lentivirus generated from HEK293T cells. 761 Chemiluminescence and colorimetric images were acquired using a BioRad ChemiDoc MP 799 The sample was vacuum centrifuged to near dryness, and following reconstitution in 1% FA, 890 The Supplemental Data 923 Image quantification was performed in ImageJ/FiJi using custom-written batch-macros. 924 In brief, raw confocal images of mitochondrial targeted mt-mKeima XL were divided Table (Supplemental Table S9). 951 Fixed-cell microscopy -general acquisition parameters 952 Immunofluorescently labelled Hela or iNeurons (antibodies indicated in figures and figure 953 legends and details in Materials Table (Supplemental Table 9). 983 Microscopy-based mtDNA turnover measurements in HeLa and iNeurons
|
<filename>src/components/Pagination/index.ts<gh_stars>1-10
/*
Copyright (C) 2018 The Trustees of Indiana University
SPDX-License-Identifier: BSD-3-Clause
*/
export { default as Pagination } from './Pagination';
|
Profit margins are expected to climb nearly 9% this year among companies in the Standard & Poor’s 500 Index, marking an 18-year high.
The third consecutive year of the bull market will see profits increase 8.9% in 2011, which would be the highest level since 1993. That’s good news for investors, who could see higher dividends. Bloomberg reports that of 380 companies in the S&P that pay dividends, 378 are projected to maintain or increase them.
The situation is less encouraging for non-investors. Back in that banner year of 1993, the unemployment rate fell from 7.3% to 6.5%. According to the most recent figures released by the Bureau of Labor Statistics, the unemployment rate is 8.9%.
|
In the years after the funeral of the Dane's warrior King Shield Sheafson, the evil fiend Grendel rises to prowl the land. At the court of Hygelac in Geatland, a great warrior prepares to help King Hrothgar.
Radio 4 pays tribute to Seamus Heaney, Nobel Prize-winning poet, internationally recognised as one of the greatest contemporary voices who passed away earlier this month at the age of 74.
Composed towards the end of the first millennium, the Anglo-Saxon poem Beowulf is one of the great Northern epics and a classic of European literature. Seamus Heaney's translation , completed near the end of the second millennium is both true, line by line, to the original, as well as being an expression of his own creative, lyrical gift.
Here, in a recording made ten years ago, Seamus Heaney brings his vibrant powerful writing to life as he reads ten fifteen minute extracts from the narrative.
The poem is about encountering the monstrous, defeating it, and then living on, physically and psychically exposed, in that exhausted aftermath. It is not hard to draw parallels between this story and the history of the twentieth century, nor can Heaney's Beowulf fail to be read partly in the light of his Northern Irish upbringing.
But it also transcends such considerations, telling us psychological and spiritual truths that are permanent and liberating.
Produced in Salford by Susan Roberts.
Radio Drama North.
|
package com.youhaoxi.livelink.gateway.im.event;
import com.youhaoxi.livelink.gateway.im.enums.EventType;
//登录事件
public class LoginEvent extends BaseEvent{
public String sessionId;
public String getSessionId() {
return sessionId;
}
public LoginEvent setSessionId(String sessionId) {
this.sessionId = sessionId;
return this;
}
@Override
public int getEventType() {
return EventType.LOGIN.getValue();
}
}
|
Taxol (registered trademark) (i) represented by the following formula (i): ##STR2## is a diterpenoid available by extraction from the bark of the Pacific yew tree, Taxus brevifolia, and was isolated and determined in structure for the first time in 1971 by Wall, et al. (J. Am. Chem. Soc., 93, 2325, 1971). It has been reported to exhibit high efficacy against ovarian cancer and breast cancer (Ann. int. Med. 111, 273, 1989).
Formulation of Taxol into an injection however requires a special solvent, as it is a compound sparingly soluble in water. Taxol is therefore accompanied by problems in that the production of an injection is difficult and side effects may be induced by a solvent.
A great deal of work has therefore been conducted in recent years with a view to developing a water-soluble derivative of Taxol (Nicolaou, et al., Nature, 364, 464, 1993). Under the current circumstances, however, no derivatives have been found yet to be equipped with satisfactory properties.
Accordingly, an object of the present invention is to provide a novel Taxol derivative having improved water solubility and high antitumor activities.
|
<reponame>fooling/adbcj
package org.adbcj.poolx;
import org.adbcj.DbFuture;
import org.adbcj.PreparedStatement;
import org.adbcj.support.DefaultDbFuture;
/**
* @author <EMAIL>
* 13-9-10
*/
public class AbstractPoolxPreparedStatement implements PreparedStatement {
protected final PoolxConnection virtualConnection ;
protected String preparedSql;
protected volatile DbFuture<Void> closeFuture=null;
public AbstractPoolxPreparedStatement(PoolxConnection poolxConnection,String sql){
virtualConnection=poolxConnection;
preparedSql=sql;
}
@Override
public boolean isClosed() {
return closeFuture!=null;
}
@Override
public DbFuture<Void> close() {
synchronized (this){
if (closeFuture !=null){
return closeFuture;
}
closeFuture= DefaultDbFuture.completed(null);
return closeFuture;
}
}
}
|
HARRY REDKNAPP knows a good footballer when he sees one - but ask him to spot a Royal and he might struggle.
The football legend is currently appearing on ITV’s hit show I'm a Celebrity...Get Me Out of Here! and he has not been short of entertaining his fans so far.
The former Tottenham and West Ham manager has been sharing some of his best stories with his new camp-mates and one particular tale regarding Prince Harry has gone down a treat.
He recalled a time when the pair crossed paths at their physiotherapist's office when he accidentally mistook Harry as one of his former players.
As he walked past Harry, Redknapp simply said “Alright mate" and carried on reading his newspaper.
"I thought, 'I know him from somewhere, that geezer, did he used to play for me?'," he said.
He later asked someone who the man was and was told it was the Duke of Sussex.
But it appears that’s not the only time Redknapp encountered Royal family without realising it.
When chatting to his camp-mates, Redknapp revealed his chance meeting with the Queen’s granddaughter.
"And I thought her nan must have a few quid! And she told me the horse and I thought 'doesn't the Queen own that horse?'"
It was then over to his son Jamie, who made 237 league appearances for Liverpool, to break the news that he had in fact just been speaking to Princess Beatrice.
"And I said, 'Not a clue!'"
|
def __setup_pieces(self, game_pieces):
for piece in game_pieces:
row = 1 if piece.color == colors.WHITE else 8
for letter in self.letters:
square = self.squares[letter][row]
if (square.selector in piece.start_position()
and not square.occupant):
piece.position = square.selector
square.occupant = piece
break
|
<reponame>jkandcoding/QuantiTanti_1<filename>app/src/main/java/com/example/android/quantitanti/database/Expenses_tags_join_dao.java
package com.example.android.quantitanti.database;
import androidx.room.Dao;
import androidx.room.Delete;
import androidx.room.Insert;
import androidx.room.OnConflictStrategy;
import androidx.room.Query;
import androidx.room.Update;
import java.util.List;
@Dao
public interface Expenses_tags_join_dao {
@Insert
void insert(Expenses_tags_join expenses_tags_join);
@Update(onConflict = OnConflictStrategy.REPLACE)
void update(Expenses_tags_join expenses_tags_join);
@Delete
void delete(Expenses_tags_join expenses_tags_join);
// svi tagovi nekog troska -> prikaz u AddCostActivityu, kod update-anja troska
@Query("SELECT tag_id FROM expenses_tags_join WHERE expense_id = :expense_id")
List<Integer> getTagIdsForCost(int expense_id);
//when deleting tag -> checking if tag is assigned to costs
@Query("SELECT expense_id FROM expenses_tags_join WHERE tag_id = :tag_id")
List<Integer> loadExpenseIdsForTag(int tag_id);
@Query("DELETE FROM expenses_tags_join WHERE tag_id = :tag_id")
void deleteWithTagId(int tag_id);
}
|
/**
* Parses a single line from the puzzle input into a layer, with the scanner at its starting position.
*
* @param line line
* @return new layer
*/
private static Layer parseLine(String line) {
String[] parts = line.split(": ");
int depth = Integer.parseInt(parts[0]);
int range = Integer.parseInt(parts[1]);
return new Layer(depth, range, 0, ScannerDirection.FORTH);
}
|
/**
* Checks if graph is simple
* @return {@code true} if the graph is simple, {@code false} otherwise
*/
public boolean isSimple(){
if (hasSelfLoopEdges())
return false;
Set<V> covered = new HashSet<V>();
for (V v : vertices){
if (covered.contains(v))
return false;
covered.add(v);
}
return false;
}
|
/**
* Generates a fxml file that reflects the structure of the FXComponentTree.
* format of the tree of the file should match the format of the input file
* @param tree
* @throws FileNotFoundException
*/
public static void writeToFxmlFile(FXComponentTree tree, String fileName) throws FileNotFoundException{
File F = new File(fileName);
PrintWriter pw = new PrintWriter(F);
pw.println("<?xml version=\"1.0\" encoding=\"UTF-8\"?> <?import javafx.scene.control.*?> <?import java.lang.*?> <?import javafx.scene.layout.*?>");
pw.println(outputElementFXML(tree));
pw.close();
}
|
Assessment of Managerial Innovation in Company X Using Fuzzy AHP Company X is an Indonesian dairy company with a significantly large market share. The successes of its product innovation are highly linked with its managerial function, which indicates the existence of innovation in its company management. The company should understand the level of its managerial innovation and utilize its potential to produce product innovations continuously. This research aims to determine the companys level of managerial innovation to support product innovation accomplishments. The study utilizes two methods in determining managerial innovation levels. The first method is by measuring employee perception of managerial functions of the company through a survey. The second method is through direct observation of executive activities related to managerial functions using a prearranged observation protocol. The final managerial innovation score will be calculated using the Fuzzy AHP method. The study found that the companys managerial innovation level reached 57%, which is a relatively high level. The study also found that leading function is very innovative, while organization function should be improved to support better product innovations. INTRODUCTION The X company is a food & beverage company that has become Indonesia's first UHT milk industry. The product has been developed since 1975 and has evolved consistently according to Indonesian's needs. Besides UHT milk, the X company is also developing other UHT beverages. The company has produced more than 60 UHT products, which gained market both in Indonesia and foreign countries (Ultrajaya, 2014(Ultrajaya, -2018. The company's Management also consistently applied modern technology to support the packaging process, logistics, and IT (Ultrajaya, 2014(Ultrajaya, -2018. With many years of experience in the UHT industry, producing a new downstream product with higher values was also supported by new technology in packaging and business process efficiency. As a result, the X company dominated the 49,5% market in the UHT milk segment. It can be concluded that this is an innovative company because it has developed many new products that were absorbed by the market (Silitonga & Sitepu, 2018) Along with the increasing level of community welfare, demand for consumer goods also increased. This has led to the emergence of other manufacturers engaged in the beverage industry and becoming competitors for the company (Ultrajaya, 2014(Ultrajaya, -2018. This impacts the decline in the company's market share since 2014.. │ 195 Figure 1. UHT milk's market share (in %) (Ultrajaya, 2014(Ultrajaya, -2018 Compared to the level of consumption of liquid milk, Indonesia has increased the level of consumption of liquid milk. If this decline in market share continues, the company's revenue will be affected because, based on the company's public exposure, 71% of the company's income comes from UHT milk (Ultrajaya, 2017(Ultrajaya, -2019. The decline condition indicated that the company products reached maturity. If the company does not innovate, the product will reach the decline stage, where the market is no longer interested in the product dying. On the other hand, innovation to the product or process will attract consumer interest, making the company superior to other companies (Joe Tidd, 2009). Therefore, it is crucial to conduct research related to managerial innovation in the X company. By knowing the level of managerial innovation, the X company will be able to utilize its potential optimally so that its product does not reach the decline stage and remain RSF Conference Series: Business,Management,and Social Sciences,Vol.2, Assessment of Managerial Innovation in Company X using Fuzzy AHP Roland YH Silitonga, Marla Setiawati, Theodorus Gratianus 196 │ a market leader for UHT milk in Indonesia. The measurement of managerial innovation level has been presented by (Ayhan & Oztemel, 2014) in manufacturing companies. The study measured managerial innovation based on the evolution of managerial functions: planning, organizing, leading, controlling, and coordinating. Found in these five functions, the level of the managerial functions is determined using the results of the questionnaire and observations applied to the company. The result showed that the innovation score for the manufacturing company was below 50%, but it was not explained how to measure the weight of managerial functions. (Silitonga & Setiawati, 2018) has demonstrated the measurement of managerial function weights using AHP pairwise comparison. This method is easy to use in multiple criteria decisions. However, the AHP also produced wrong choices, and the results are uncertain due to observations that produce subjective data (Emrouznejad & Ho, 2018). Therefore, in this research, the Fuzzy AHP method was selected. This method is better because it reduces the uncertainty that arose in decision making with the ordinary AHP (Emrouznejad & Ho, 2018) and covered weaknesses in ordinary AHP regarding subjective criteria. The purpose of the study is to measure the managerial innovation level of the company based on the evolution of managerial functions, and the measurement of managerial function weights is proceed using Fuzzy AHP. LITERATURE REVIEW Managerial innovation is the company's ability to change and handle changes that occur in its managerial structure so that it can be in line with a company's development in the most appropriate way. To deal with these changes, managerial innovation needs to be measured by analyzing the level following the stages of managerial evolution. Managerial evolution occurs in five managerial functions: planning, organizing, leading, controlling, and coordinating. The measurement is done by giving weight to the five existing managerial functions. As explained by (Silitonga & Sitepu 2018), the greatest importance is given to the most modern managerial functions. The measurement's final value will demonstrate the potential size of the company's managerial innovation-the higher the value, the greater the company's potential for innovation. Figure 3 shows the evolution of managerial functions. Again, the value of managerial innovation will be higher if the organization's position increases to the right-the further the right position, the greater the company's potential to innovate. An organization's measurement of managerial innovation level can be measured with the method developed by Ayhan and Oztemel (Ayhan & Oztemel, 2014), where companies with great potential in innovation are companies with managerial innovation scores above 50%. This innovation score RSF Conference Series: Business, Management, and Social Sciences, Vol.2, 194-205 │ 197 is based on the level of evolution of managerial function that has been given a weighting for each of these functions. The weight for each function will be shown in Table 1. Thus, the managerial function is seen from its evolution in the company, and the value of innovation is obtained by making direct observations. Analytic Hierarchy Process (AHP) is a broadly applied multi-criteria decision-making method to determine the weights of criteria and priorities of alternatives in a structured manner based on pairwise comparison. As subjective judgments during comparison might be imprecise, fuzzy sets have been combined with AHP. This is referred to as fuzzy AHP or FAHP (Liu, Eckert, and Earl, 2020). Fuzzy AHP is a method with a fuzzy concept approach. FAHP covers the deficiencies arising from the usual AHP method that is many subjective traits problem that occurs in assessment criteria (Chan, Kai, Wang, & Xiaojun, 2013). Uncertainty is presented in order of scale. To determine FAHP degree of membership, function rules are used in a Triangular Fuzzy Number (TFN), which is arranged based on the linguistic set. METHODOLOGY The study uses questionnaires and observations to assess the managerial innovation level. The questionnaire will find the weight of each management function, while the observation will decide the level of each management function. To obtain the capability of innovation in each managerial function, the results of each observation must be included in the following equation: │ : managerial function innovation capability at -: evolution weight of managerial function at -: the sum of managerial function categories at column row. : the sum of managerial category functions at- The equation can determine the percentage of managerial innovation level: Where: : level of managerial innovation : managerial function innovation capabilities at -: managerial functions weight atfor = 1: Planning 4: Controlling 2: Organizing 5: Coordinating 3: Leading The questionnaire analysis to determine the weight of each management function is done by Fuzzy AHP. The scale of the triangular fuzzy number is shown in the table below: One element extremely strong than others (4, 9/2, 9/2) (2/9, 2/9, 1/4) Steps to solve the problem with the F -AHP method: 1. Arrange the hierarchy structure of the problem and determine the pairwise matrix comparison between criteria with a triangular fuzzy number (Table 3). 2. Determine the priority fuzzy synthesis value (Si) using the following equation:, all number of TFN from (j = 1, 2,..., m) must be add first like following equation: Invers from equation is: a. Comparison of possible degrees between fuzzy numbers A comparison is made to find the value of membership degree for each weight in each managerial function. For example, there are two triangular fuzzy numbers 1 = ( 1, 1, 1 ) and 2 = ( 2, 2, 2 ). Comparison of possibility degree 2 = ( 2, 2, 2 ) ≥ 1 = ( 1, 1, 1 ) can be defined as vector value, so the value can be obtained by comparing ( 2 ≥ 1 ) with equation below:, ℎ ℎ ( 7 ) b. If the result of the function value is greater than fuzzy, ( = 1, 2,, ) which can be defined as: Where is unfuzzy numbers. │ 201 Data was collected from 19th February 2020 until 1st March 2020. Data were collected using a questionnaire distributed to employees in several departments and by doing observation of the leaders in the company using an observation protocol. The questionnaire consists of questions that will determine critical success factors. The sampling technique used in this questionnaire is purposive sampling, and the question will use 4 -point Likert scales. The scale will reduce the bias from the respondent's psychology. Meanwhile, the observation protocol was arranged before the research started. The protocol explained about measurement dimension, scoring index and theoretical background explanation. FINDINGS AND DISCUSSION The weights of each management functions, after processing the quesionaire with Fuzzy AHP, are presented below: Based on observation, the level of innovation capability obtained for the 5 elements of the organizing function as follows: a. Product-based, process-based, customer-based, and territory-based not shown during observations. b. department Based (12,5%), shows through organization structure arranged based on the functional department. According to observation results, there is one scoring category of assessment for organizing function, so the total weight is 1 x 16 = 16. │ According to observation results, there are six scoring categories of assessment for leading function, so the total weight is 6 x 16 = 96 c. Aggregated (60%), shown through routine planning every year, yearly employee gathering, and integrated system with ERP. According to observation results, there are five scoring categories of assessment for controlling function, so the total weight is 5 x 16 = 80 Finally, after knowing the capabilities of managerial innovation and result from the questionnaire, the level of innovation can be calculated by multiplying capabilities with the weight of each innovation function. Based on the capabilities and function weights obtained, the result of the managerial innovation level of the company is 57%. It means that in general the company will be able to keep abreast of the existing managerial innovations and can innovate more to become superior compared to other similar companies. The importance of weight score for all managerial functions is 20%. This means that all functions are equally important so that there are no greater functions than other functions. Based on the above tables, 4 out of 5 managerial functions have innovative potential because the score is above 50%. The biggest score is 83,33% came from a leading function, which means this function is the most crucial thing in the company. The lowest score is the organizing function because it is below 50%. Leading is the most innovative out of all the other functions. The leading style in the company leans toward participatory and esteemed elements. Participatory element can be observed through the company's routine weekly meeting on their work targets and biweekly meetings attended by the managers. Esteemed element can be observed through monthly outbound activities. Company leadership also often invite employees to sport sessions. Other esteemed elemnt can be seen through trainings and meetings with employees via video calls. The organizing function has the lowest score, it means that this function is not supporting the innovation. Currently, the company structure is still at the department-based level because it is divided into several department functions. However, it must cover global wide monitoring, because of its export. The company should move to the next level of the evolution, into teritory based and or customer based organizational structure. CONCLUSION AND FURTHER RESEARCH The score of managerial innovation for company X is 57%. The company has innovated in planning, leadership, control, and coordination because these four managerial functions have scores above 50% and can be innovative. Meanwhile organizing function has the lowest score. Organizing function can be improved by converting the organization structure from functionbased organization to teritory-based and or customer-based organization. Further research should explore the correlation between managerial innovations dan product innovations.
|
Mast cells and histamine release in Crohn's disease. To study the role of intestinal mast cells in Crohn's disease, a sensitive glass-fiber histamine assay was conducted in conjunction with mechanical dispersion of surgical specimens of 80 macroscopically actively inflamed colons, 40 non-inflamed colons, 40 actively inflamed ileums, and 16 non-inflamed ileums from patients with Crohn's disease and 96 control subjects. A strong correlation was found between the number of mast cells and the total histamine content in the controls (r = 0.682) (p < 0.05). The number of mast cells was decreased in Crohn's disease as compared with the controls (p < 0.01). Intestinal mast cells release histamine in a dose-dependent manner after challenges with anti-IgE (1.875-240.0 U/ml). A significant difference was noted in the release by anti-IgE between actively inflamed and non-inflamed colons of patients with Crohn's disease or control subjects (p < 0.01). Mast cells in actively inflamed tissue with Crohn's disease were shown to have different roles in the pathogenesis of inflammation.
|
def match(self, ch):
if ch == self.string[self.idx]:
self.idx += 1
if self.idx == self.slen:
sys.stdout.write(self.func(self.string))
self.idx = 0
self._status = DONE
else:
self._status = STORING
return True
else:
if self.idx > 0:
sys.stdout.write(self.string[0:self.idx])
self.idx = 0
self._status = NOMATCH
return False
|
<filename>app/app.module.ts
//App module where all modules are registered and Bootstrap component is mentioned
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { ReactiveFormsModule } from '@angular/forms';
import { AppComponent } from './app.component';
import { RetrieveDetailsComponent } from './app.retrievedetails.component';
import { CheckInFormComponent } from './app.checkinform.component';
import { DisplayNavbarComponent } from './app.displaynavbar.component';
import { DisplayTimeComponent } from './app.displaytime.component';
import { routing } from './app.routes';
@NgModule({
imports: [ BrowserModule ,ReactiveFormsModule ,routing ],
declarations: [ AppComponent , DisplayNavbarComponent,DisplayTimeComponent,RetrieveDetailsComponent,CheckInFormComponent],
bootstrap: [ AppComponent ]
})
export class AppModule { }
|
1. Field of the Invention
The present invention relates to a comb intended to facilitate the creation of hairstyles, for example, hairstyles including colored or highlighted locks of hair.
2. Discussion of Background
U.S. Pat. Nos. 5,152,306 and 5,694,953 describe combs having teeth in the form of a hook, intended to grasp locks of hair in order to isolate them from the rest of the hair to facilitate treatment.
U.S. Pat. No. 5,018,542 describes a comb having teeth with some of the teeth equipped with hooks enabling locks of hair to be isolated. The gaps between adjacent teeth are all of the same size or height.
U.S. Pat. No. 6,523,547 describes a known comb incorporating teeth equipped respectively with complex hooks extending into the gaps defined between adjacent teeth so as to isolate locks of hair between the bottom of the gaps and the hooks.
With such combs, the amount of hair taken up by the hook-shaped teeth depends on the depth to which the comb is pressed into the hair, and the quantity of hair comprising each lock drawn out is liable to vary widely from one occasion to another. As a result, it can be difficult for certain hairstyles to be created by an inexperienced person.
There is also a need to be able to color or highlight locks of hair in a reproducible manner over the entire head of hair.
The present invention particularly aims to facilitate the formation of locks of hair of equal size and to improve the reproducibility of hairdressing treatments.
|
from flask import Flask, abort, render_template
from flask_sqlalchemy import SQLAlchemy
import openaq
APP = Flask(__name__)
APP.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///db.sqlite3'
DB = SQLAlchemy(APP)
def getLaData():
api = openaq.OpenAQ()
status, body = api.measurements(city='Los Angeles', parameter='pm25')
return status, body
@APP.route('/')
def index():
res = Record.query.filter(Record.value >= 10).all()
return render_template('index.html', res=res)
class Record(DB.Model):
id = DB.Column(DB.Integer, primary_key=True)
datetime = DB.Column(DB.String(25))
value = DB.Column(DB.Float, nullable=False)
def __repr__(self):
return f"< Time {self.datetime} --- Value {self.value} >"
@APP.route('/refresh')
def refresh():
"""Pull fresh data from Open AQ and replace existing data."""
DB.drop_all()
DB.create_all()
data = getLaData()
for d in data[1]['results']:
DB.session.add(Record(datetime=str(d['date']['utc']), value=d['value']))
DB.session.commit()
return 'Data refreshed!'
if __name__ == '__main__':
APP.run(debug=True)
|
<reponame>jirkadanek/quiver
/*
*
* 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.
*
*/
#include <qpid/messaging/Connection.h>
#include <qpid/messaging/Message.h>
#include <qpid/messaging/Receiver.h>
#include <qpid/messaging/Sender.h>
#include <qpid/messaging/Session.h>
#include <algorithm>
#include <atomic>
#include <chrono>
#include <iostream>
#include <map>
#include <sstream>
#include <string>
#include <thread>
#include <vector>
using namespace qpid::messaging;
using namespace qpid::types;
static const std::string LINK_OPTIONS =
"{link: {durable: False, reliability: at-least-once}}";
int64_t now() {
return std::chrono::duration_cast<std::chrono::milliseconds>
(std::chrono::system_clock::now().time_since_epoch()).count();
}
void eprint(std::string message) {
std::cerr << "quiver-arrow: error: " << message << std::endl;
}
std::vector<std::string> split(const std::string& s, char delim, int max) {
std::stringstream ss;
std::string elem;
std::vector<std::string> elems;
ss.str(s);
for (int i = 0; std::getline(ss, elem, delim); i++) {
elems.push_back(elem);
if (max != 0 && i == max) break;
}
return elems;
}
struct Client {
std::string operation;
std::string id;
std::string scheme;
std::string host;
std::string port;
std::string path;
std::string username;
std::string password;
std::chrono::seconds desired_duration;
int desired_count;
int body_size;
int credit_window;
int transaction_size;
bool durable;
int64_t start_time;
int sent = 0;
int received = 0;
std::atomic<bool> stopping {false};
void run();
void sendMessages(Session&);
void receiveMessages(Session&);
};
void Client::run() {
std::string domain = host + ":" + port;
// Qpid Messaging does not support a trust all option (SslSocket.cpp#bad_certificate only
// can only disable hostname verification but cannot be configured to ignore an unknown cert.
// Client must set QPID_SSL_CERT_DB refering to a cert-database (certutil(1)) containing the server's cert.
bool tls = scheme == "amqps";
std::ostringstream oss;
oss << "{"
<< "protocol: amqp1.0,"
<< "container_id: " << id << ","
<< "transport: " << (tls ? "ssl" : "tcp") << ","
<< "ssl_ignore_hostname_verification_failure: true"
<< "}";
std::string options = oss.str();
Connection conn(domain, options);
if (!username.empty()) {
conn.setOption("username", username);
if (!password.empty()) {
conn.setOption("password", password);
}
} else {
conn.setOption("sasl_mechanisms", "ANONYMOUS");
}
conn.open();
start_time = now();
if (desired_duration > std::chrono::seconds::zero()) {
std::thread timer([this]() {
std::this_thread::sleep_for(desired_duration);
stopping = true;
});
timer.detach();
}
try {
Session session;
if (transaction_size > 0) {
session = conn.createTransactionalSession();
} else {
session = conn.createSession();
}
if (operation == "send") {
sendMessages(session);
} else if (operation == "receive") {
receiveMessages(session);
} else {
throw std::exception();
}
if (transaction_size > 0) {
session.commit();
}
conn.close();
} catch (const ConnectionError& e) {
// Ignore error from remote close
} catch (const std::exception& e) {
conn.close();
throw;
}
}
void Client::sendMessages(Session& session) {
Sender sender = session.createSender(path + "; " + LINK_OPTIONS);
sender.setCapacity(credit_window);
std::string body(body_size, 'x');
while (!stopping) {
std::string id = std::to_string(sent + 1);
int64_t stime = now();
Message message(body);
message.setMessageId(id);
message.setProperty("SendTime", Variant(stime));
if (durable) {
message.setDurable(true);
}
sender.send(message);
sent++;
std::cout << id << "," << stime << "\n";
if (transaction_size > 0 && (sent % transaction_size) == 0) {
session.commit();
}
if (sent == desired_count) {
break;
}
}
}
void Client::receiveMessages(Session& session) {
Receiver receiver = session.createReceiver(path + "; " + LINK_OPTIONS);
receiver.setCapacity(credit_window);
Message message;
while (!stopping) {
if (receiver.getAvailable() == 0) {
continue;
}
receiver.get(message);
received++;
session.acknowledge();
std::string id = message.getMessageId();
int64_t stime = message.getProperties()["SendTime"];
int64_t rtime = now();
std::cout << id << "," << stime << "," << rtime << "\n";
if (transaction_size > 0 && (received % transaction_size) == 0) {
session.commit();
}
if (received == desired_count) {
break;
}
}
}
int main(int argc, char** argv) {
if (argc == 1) {
std::cout << "Qpid Messaging C++ XXX" << std::endl;
return 0;
}
std::map<std::string, std::string> kwargs {};
for (int i = 1; i < argc; i++) {
auto pair = split(argv[i], '=', 1);
kwargs[pair[0]] = pair.size() > 1 ? pair[1] : "";
}
std::string connection_mode = kwargs["connection-mode"];
std::string channel_mode = kwargs["channel-mode"];
std::string cert = kwargs["cert"];
std::string key = kwargs["key"];
if (connection_mode != "client") {
eprint("This impl supports client mode only");
return 1;
}
if (channel_mode != "active") {
eprint("This impl supports active mode only");
return 1;
}
if (!cert.empty() ||!key.empty()) {
eprint("This impl does not support TLS client cert");
return 1;
}
Client client;
client.operation = kwargs["operation"];
client.id = kwargs["id"];
client.scheme = kwargs["scheme"];
client.host = kwargs["host"];
client.port = kwargs["port"];
client.path = kwargs["path"];
client.username = kwargs["username"];
client.password = kwargs["password"];
client.desired_duration = std::chrono::seconds(std::stoi(kwargs["duration"]));
client.desired_count = std::stoi(kwargs["count"]);
client.body_size = std::stoi(kwargs["body-size"]);
client.credit_window = std::stoi(kwargs["credit-window"]);
client.transaction_size = std::stoi(kwargs["transaction-size"]);
client.durable = std::stoi(kwargs["durable"]);
try {
client.run();
} catch (const std::exception& e) {
eprint(e.what());
return 1;
}
return 0;
}
|
CLUCKING CHILLY: Claire and friends brave the freezing conditions.
A WELSH hen party sent temperatures soaring after their flight to the Costa del Sol was cancelled due to bad weather.
Claire Phillips, 39, plus hens Shari Cadmore, Laura Garlick, Hannah Evans and Emma Davies slipped into skimpy swimwear before posing in the icy conditions at Cardiff Airport.
The ladies were on their way to Marbella for the weekend when their flight was axed.
And they made up for the disappointment by putting on an eye-popping display in the snow.
They decided to hold the party in Cardiff before stripping off for the racy photo shoot, with pedestrians and even a bus driver stopping to take snaps.
“It was so funny,” she said. “We were out there for around 25 minutes.
“We walked up to an area with loads of snow and a bus pulled up with loads of tourists.
And the mum-of-three said that the gang are hoping to reschedule their Spanish holiday after the wedding.
Previous articleWATCH: Babbling brook turns to spectacular waterfall – but it’s NOT in Andalucia!
|
The Influence of Measurement Errors on Generalized Estimator of Population Mean This paper proposed a generalized estimator of population mean in the presence of correlated and uncorrelated measurement errors under simple random strategy. Some known estimators belong to this class of proposed estimator. Under the large sample approximation, the properties of the proposed estimator namely bias and mean squared error were obtained. Theoretical comparison was carried out on the members of the proposed class of estimators when measurement errors are correlated and when they are uncorrelated and the necessary conditions under which the proposed estimator at its optimum value is expected to be more efficient than the existing estimators of finite population mean were obtained. It was observed that correlated and uncorrelated measurement errors inflate the bias and mean squared error of the proposed estimator. The paper concluded that the proposed estimator is more efficient than usual unbiased estimator and some members of the class of proposed estimator.
|
Design of Parallel AD Acquisition Board Based on FPGA From the point of view of system development, this paper introduces a FPGA based parallel AD acquisition board and its implementation process. The board uses 24-bit 8 channels of TI to synchronize the sampling chip ADS1278 to synchronize the input signals of the 8 input signals. FPGA uses Altera's EP2AGX45F572, Nios II processor running on it as the core of data processing. Communication between CY7C68013 and PC can be done with USB Cypress chip. The full use of the Nios can be customized to make the board with the traditional microcontroller or DSP can't achieve the integration of high, strong flexibility and so on. The driver and PC application program are written in VPP, which can store and display the collected data.
|
TEHRAN – The high representative of the European Union for foreign affairs and security policy says the United States cannot impose its policies on the 28-nation bloc’s legitimate trade relations with Iran.
“We Europeans cannot accept that a foreign power – even our closest friend and ally – makes decisions over our legitimate trade with another country,” Federica Mogherini said in an interview with the European Council on Foreign Relations published on Friday.
She added that the EU is working with the rest of the international community to keep alive the landmark nuclear agreement, officially known as the Joint Comprehensive Plan of Action (JCPOA), despite the U.S. unilateral move to pull out from the deal.
The Iran nuclear deal “has so far been implemented in full, as certified by the International Atomic Energy Agency in 13 consecutive reports,” she said.
U.S. President Donald Trump withdrew his country in May from the historic Iran nuclear deal and decided to re-impose unilateral sanctions against Tehran.
Under the deal, reached between Iran and six major powers - the United States, Britain, France, Germany, Russia and China - Tehran agreed to put limits on its nuclear program in exchange for termination of economic and financial sanctions.
The U.S. administration hoped to get the other parties to the deal with Iran to likewise scrap the deal, but instead they stressed that not only would they stick to the agreement, but they would also work to sustain it in the face of increased U.S. pressure.
A report by the International Atomic Energy Agency (IAEA) said in November that Iran has continued to implement all its commitments under the 2015 nuclear deal even as the United States re-imposed fresh sanctions against Tehran.
“That is not the case: we do this to prevent a nuclear non-proliferation agreement that is working from being dismantled, and to prevent a major security crisis in the Middle East,” the senior EU diplomat pointed out.
She emphasized that the EU should guarantee that firms seeking to do legitimate business with Iran are allowed to do so.
“This is what we are working on right now: tools that will assist, protect, and reassure economic actors pursuing legitimate business with Iran. It is true that this situation has triggered a conversation on European economic sovereignty,” Mogherini said.
Iran and the 28-nation European Union have been discussing various ways to continue doing business with Iran by bypassing U.S. sanctions.
On September 24, Iran and its five partners released a joint statement announcing the setting up of a special purpose vehicle (SPV) to facilitate continued trade with Iran, bypass the U.S. financial system, and avoid any impact of America’s secondary sanctions.
Late last month, Iranian Foreign Minister Mohammad Javad Zarif said Tehran will not stand by for Europeans to fulfill their commitments under the multilateral nuclear agreement.
Zarif’s remarks came after chief of the Atomic Energy Organization of Iran Ali Akbar Salehi warned that Tehran’s patience is running out over the failure of the EU’s economic pledges to deliver any “tangible results”.
|
Why has my cat stopped using his litter box?
Trying to figure out why a cat suddenly stops using a litter box can be daunting, but the first step is a trip to the vet.
A. If nothing significantly has happened in your household or to Oscar, it’s likely a health issue that is causing him to change his bathroom habits. You should take him to the vet for a check up as soon as you can. Cats can develop kidney and urinary tract infections that need to be treated.
This is the way a cat’s brain works: He goes to the litter box to urinate, but when he does, it causes him pain. The pain, he believes, is caused by the box and reasons that if it hurts to go here, then he’ll try over there.
That’s not to say cats won’t suddenly change their habits on a whim, or even for valid reasons that we don’t recognize, but a health check is always your first step.
Often bringing another cat, pet or person into the house can upset your cat, and the cat shows his displeasure in a way guaranteed to get your attention, even if you don’t understand it.
When you have multiple cats, it’s important to have one box per cat. You can sometimes get away with fewer litter boxes, but you’ll stave off problems by letting cats have their own boxes, even though they often share them.
Cats prefer doing their business in private, so try to find a place that is out of the way, giving the cat a measure of privacy. Don’t locate the box near their food or drinking water.
It also can be tricky to find a brand of litter that your cat prefers. Some cats are put off by the aroma of scented litter, while some might not like the texture. All you can do is try a few, but don’t be too quick to make a switch. Change, especially frequent change, can be upsetting as well.
Oscar could be reacting to his litter. Companies sometimes alter their formula, and while the difference might not be noticeable to us, it could be night and day to him. If Oscar gets a clean bill of health, you might want to contact his preferred litter maker and ask if there has been a change in production.
If Oscar continues to have trouble missing the mark, try thinking like a cat. Pay attention to where he is going, then try to figure out why. Has something changed in the area around his litter box? Did he have a bad experience there? Have you been busy and neglecting frequent litter box cleanings? Is there something about the place he’s going now that would seem more attractive to him? And lastly, have you done something that he’s punishing you for?
I once considered getting a second cat to keep my then 4-year-old cat company. A friend brought over a kitten, which Andy, my cat, completely ignored. He sauntered off into the bedroom and stayed there throughout the visit.
That night, when I went to bed, I found the sheets shredded. I got the message and Andy remained an only cat.
Do you have a question about the things your pets do? Email me at [email protected].
|
package com.wxmp.threads;
import com.wxmp.core.util.HttpUtil;
import java.util.Map;
/**
* @author xunbo.xu
* @desc
* @date 18/8/27
*/
public class ThreadHttoConecCase<T> implements Runnable {
private String url;
private Map<String, Object> params;
private T result;
/**
* 构造中需要告知当前请求的访问地址 & 请求参数列表 &
* @param url
* @param params
*/
public ThreadHttoConecCase(String url, Map<String, Object> params) {
this.url = url;
this.params = params;
}
@Override
public void run() {
try {
//发起请求
System.out.println(url + " HEADER IS : " + " TODO Things ");
System.out.println(" REQ_JSON IS : ");
String resultStr = HttpUtil.doGet(url, params, false);
System.out.println("RESP_JSON IS : " + resultStr);
} catch (Exception e) {
e.printStackTrace();
}
}
}
|
Analysis of Complications in Primary Cleft Lips and Palates Surgery IntroductionA series of retrospectively recorded patients with cleft lip and palate was uniquely investigated to demonstrate and analyze the complications after cleft repairing operations in a selected Chinese population. Material and MethodsFrom January 2005 to January 2012, a selected group of 2100 patients with cleft lip and/or palate who have complete records were chosen from a large sample in the units. Complete data were retrieved, including sex, age, clinical classification, surgical modality, complications, and follow-up results. The complications were classified into 2 categories: early and long-term complications. After surgery, most patients with cleft lip remained in the hospital for 7 days and cleft palate repairs for 10 days. A standard regimen of antibiotics was administered for 3 to 5 days clinically. ResultsOf the 2100 patients, there were 1360 males and 760 females who had congenital cleft deformity with complete clinical records in the department of oral and maxillofacial surgery. The age distribution was as follows: 1600 patients in the group of 3 months to 2 years, 320 patients in the group of 2 to 10 years, 130 patients in the group of 11 to 19 years, and 50 patients in the group of older than 20 years. As to the treatment modality, cleft lips were repaired by rotation advancement method with various minor modifications or Tennison modality. The cleft palates were closed using the von Langenbeck, Veau/Wardill/Kilner, or Furlow technique. The overall complication rate was 16.8% of the patients. Of the early complications, there were 6 cases of asphyxia, 17 cases of pyrexia, 5 cases of edema of the respiratory tract, 8 cases of upper respiratory tract infection, 6 cases of bronchiolitis, 7 cases of pneumonia, 9 cases of diarrhea and vomiting, 6 cases of hemorrhage, 5 patients of odontoptosis, 11 cases of erosion of the corner of mouth, 5 cases of drowsiness, 11 cases of incision dehiscence, 9 cases of wound infection, 6 cases of palatal dehiscence/fistula, 3 cases of nostril floor breakdown, 7 cases of conjunctivitis, as well as 3 cases of mortality. The long-term complications included 30 cases of secondary lip/nasal deformity, 10 cases of dehiscence of lip, 14 cases of palatal fistula/decencies, 18 cases of hearing problem/otitis media, 21 cases of poor ventilation/snoring, 66 cases of velopharyngeal incompetence, and 58 cases of voice disorder. ConclusionsComplications after cleft surgery are unavoidable clinically. More attention should be paid to the etiologic factors to minimize the prevalence of complications. Mortality can be found in patients with cleft, which is a deadly complication. Problems of respiratory tract and hemorrhage should be emphasized and treated seriously.
|
A black kite flies near a wildfire in Northern Australia. Researchers think the birds are strategically moving burning brush on the savanna to lure out their dinner. (Bob Gosford)
Humans may not be the only ones to blame for wildfires. Researchers have preliminary evidence pointing to Australian birds spreading fires in order to force out their prey from protected grassy areas.
The brown falcon and black kite are believed to pick up smoldering pieces of brush and branches, and transport them to new locations. These birds regularly hunt at the edges of fires, but such blazes are not always positioned over food sources. By moving the fires to areas with a heavy concentration of prey, the birds create an easy opportunity to hunt frogs, lizards and snakes.
“It’s not gratuitous,” said Bob Gosford, who has collected the data. “There’s a purpose. There’s an intent to say, okay, there are several hundred of us there, we can all get a meal.”
Gosford is a lawyer who has lived in Australia’s Northern Territory for 30 years. He represents aboriginal people as they negotiate land deals with cattle farmers and other groups. He’s also a bird lover and has presented his findings at multiple conferences. He’s working with Penn State cultural geographer Mark Bonta to publish the work in a peer-reviewed journal. They’d like to co-author the work with the aboriginal community.
A brown falcon flies above the Australian savanna. (Bob Gosford)
Gosford said he has 15 accounts of Australian birds picking up burning pieces of brush and then dropping them in a new spot. His findings come from Australian firefighters, aboriginal people and literature. The evidence is anecdotal and mythical, including one sacred aboriginal ceremony — the Yabadurrwa — in which a person acting as a bird transports a flaming branch.
“We’re not going to be satisfied until we can get this on video,” Bonta said. The researchers want to crowdsource their work, and they hope people around the world will monitor birds’ behavior near fires and reach out. Bonta is in touch with a remote community in Honduras, which lives in an environment prone to wildfires. Gosford said he’s following up on a lead in West Africa.
They think this work may turn on its head the accepted wisdom that only lightning and humans ignite wildfires.
“The birds aren’t starting fires from scratch, but it’s the next best thing,” Bonta said. “Fire is supposedly so uniquely human.”
If firmed up, the findings also raise the question of how savannas were formed, the researchers said. Birds, not humans, could have been pivotal in the clearing of those spaces.
A brown falcon flies above the Australian savanna. (Bob Gosford)
Bonta suggested it’s even possible that ancient humans learned about the potential to spread fires from watching birds. Copying the behavior would have spurred human development, as humans learned to control fire and survive in colder climates.
“Forget about the opposable thumbs and the upright stance and all that; fire is the tool that really made us human,” Bonta said.
Gosford’s work is motivated by a failure to recognize aboriginal knowledge.
“There’s an immense amount of aboriginal knowledge of the birds in this country that I firmly believe that for science and land management, if there was greater recognition of it, we’d be a much better place,” he said.
|
<reponame>Chrisdanyk/gms
import { entityItemSelector } from '../../support/commands';
import {
entityTableSelector,
entityDetailsButtonSelector,
entityDetailsBackButtonSelector,
entityCreateButtonSelector,
entityCreateSaveButtonSelector,
entityCreateCancelButtonSelector,
entityEditButtonSelector,
entityDeleteButtonSelector,
entityConfirmDeleteButtonSelector,
} from '../../support/entity';
describe('Tache e2e test', () => {
const tachePageUrl = '/tache';
const tachePageUrlPattern = new RegExp('/tache(\\?.*)?$');
const username = Cypress.env('E2E_USERNAME') ?? 'admin';
const password = Cypress.env('E2E_PASSWORD') ?? '<PASSWORD>';
const tacheSample = { nom: 'Chicken b Account', prixUnitaire: 6235, disponible: false, nuid: 'bus Auvergne circuit' };
let tache: any;
before(() => {
cy.window().then(win => {
win.sessionStorage.clear();
});
cy.visit('');
cy.login(username, password);
cy.get(entityItemSelector).should('exist');
});
beforeEach(() => {
cy.intercept('GET', '/api/taches+(?*|)').as('entitiesRequest');
cy.intercept('POST', '/api/taches').as('postEntityRequest');
cy.intercept('DELETE', '/api/taches/*').as('deleteEntityRequest');
});
afterEach(() => {
if (tache) {
cy.authenticatedRequest({
method: 'DELETE',
url: `/api/taches/${tache.id}`,
}).then(() => {
tache = undefined;
});
}
});
it('Taches menu should load Taches page', () => {
cy.visit('/');
cy.clickOnEntityMenuItem('tache');
cy.wait('@entitiesRequest').then(({ response }) => {
if (response!.body.length === 0) {
cy.get(entityTableSelector).should('not.exist');
} else {
cy.get(entityTableSelector).should('exist');
}
});
cy.getEntityHeading('Tache').should('exist');
cy.url().should('match', tachePageUrlPattern);
});
describe('Tache page', () => {
describe('create button click', () => {
beforeEach(() => {
cy.visit(tachePageUrl);
cy.wait('@entitiesRequest');
});
it('should load create Tache page', () => {
cy.get(entityCreateButtonSelector).click({ force: true });
cy.url().should('match', new RegExp('/tache/new$'));
cy.getEntityCreateUpdateHeading('Tache');
cy.get(entityCreateSaveButtonSelector).should('exist');
cy.get(entityCreateCancelButtonSelector).click({ force: true });
cy.wait('@entitiesRequest').then(({ response }) => {
expect(response!.statusCode).to.equal(200);
});
cy.url().should('match', tachePageUrlPattern);
});
});
describe('with existing value', () => {
beforeEach(() => {
cy.authenticatedRequest({
method: 'POST',
url: '/api/taches',
body: tacheSample,
}).then(({ body }) => {
tache = body;
cy.intercept(
{
method: 'GET',
url: '/api/taches+(?*|)',
times: 1,
},
{
statusCode: 200,
body: [tache],
}
).as('entitiesRequestInternal');
});
cy.visit(tachePageUrl);
cy.wait('@entitiesRequestInternal');
});
it('detail button click should load details Tache page', () => {
cy.get(entityDetailsButtonSelector).first().click();
cy.getEntityDetailsHeading('tache');
cy.get(entityDetailsBackButtonSelector).click({ force: true });
cy.wait('@entitiesRequest').then(({ response }) => {
expect(response!.statusCode).to.equal(200);
});
cy.url().should('match', tachePageUrlPattern);
});
it('edit button click should load edit Tache page', () => {
cy.get(entityEditButtonSelector).first().click();
cy.getEntityCreateUpdateHeading('Tache');
cy.get(entityCreateSaveButtonSelector).should('exist');
cy.get(entityCreateCancelButtonSelector).click({ force: true });
cy.wait('@entitiesRequest').then(({ response }) => {
expect(response!.statusCode).to.equal(200);
});
cy.url().should('match', tachePageUrlPattern);
});
it('last delete button click should delete instance of Tache', () => {
cy.get(entityDeleteButtonSelector).last().click();
cy.getEntityDeleteDialogHeading('tache').should('exist');
cy.get(entityConfirmDeleteButtonSelector).click({ force: true });
cy.wait('@deleteEntityRequest').then(({ response }) => {
expect(response!.statusCode).to.equal(204);
});
cy.wait('@entitiesRequest').then(({ response }) => {
expect(response!.statusCode).to.equal(200);
});
cy.url().should('match', tachePageUrlPattern);
tache = undefined;
});
});
});
describe('new Tache page', () => {
beforeEach(() => {
cy.visit(`${tachePageUrl}`);
cy.get(entityCreateButtonSelector).click({ force: true });
cy.getEntityCreateUpdateHeading('Tache');
});
it('should create an instance of Tache', () => {
cy.get(`[data-cy="nom"]`).type('Dram').should('have.value', 'Dram');
cy.get(`[data-cy="prixUnitaire"]`).type('31271').should('have.value', '31271');
cy.get(`[data-cy="description"]`).type('transmit up').should('have.value', 'transmit up');
cy.get(`[data-cy="disponible"]`).should('not.be.checked');
cy.get(`[data-cy="disponible"]`).click().should('be.checked');
cy.get(`[data-cy="nuid"]`).type('Augustins Roumanie transmitter').should('have.value', 'Augustins Roumanie transmitter');
cy.get(entityCreateSaveButtonSelector).click();
cy.wait('@postEntityRequest').then(({ response }) => {
expect(response!.statusCode).to.equal(201);
tache = response!.body;
});
cy.wait('@entitiesRequest').then(({ response }) => {
expect(response!.statusCode).to.equal(200);
});
cy.url().should('match', tachePageUrlPattern);
});
});
});
|
View 803 Friday, December 27, 2013
Feast of St. John Apostle
“Transparency and the rule of law will be the touchstones of this presidency.”
President Barack Obama, January 31, 2009
Christians to Beirut. Alawites to the grave.
Syrian Freedom Fighters
What we have now is all we will ever have.
Conservationist motto
If you like your health plan, you can keep your health plan. Period.
Barrack Obama, famously.
Cogito ergo sum.
Descartes
Cogito cogito ergo cogito sum. Cogito,
Ambrose Bierce
Took yesterday and most of today off. I have notes on an essay on education, but someone grabbed the title and used it as a Wall Street Journal op ed page editorial today. We Pretend To Teach, and They Pretend to Learn. http://online.wsj.com/news/articles/SB10001424052702303531204579204201833906182
It is very much on target, and says much of what I wanted to say. Anyone interested in the education mess should read it.
Back about 1970 I was involved with the Council that was to draw up the Master Plan for the University of California system. The program was very structured: the University System would have a limited number of campuses, and would do all the graduate school education. There would be a limited number of undergraduates at each of those campuses, and they would be the elite applicants. Tuition would be low for state residents, and very high for out of state and foreign students. This would be the University system, and it would be for the best and the brightest. Salaries would be high for an elite faculty.
In addition, there would be the California State Colleges, which would not be permitted to award graduate degrees. They would do undergraduate education, and send their best and brightest to compete for places in the University system graduate schools. Their primary purpose was teaching, and it was on their ability to teach that faculty members would be chosen and retained: no publish or perish, because their purpose was to teach, not to do “research”. They were not to discover knowledge, but to convey it to most of the undergraduates in the state. A small number would go to the University undergraduate system, but about 90% of all undergraduates enrolled in state higher education would be in the California State Colleges. This would include colleges of education and teacher. Again the focus would not be on ‘research’ or anything else other than producing great teachers for the California schools.
Of course as soon as the Master Plan was adopted and funded, the California State Colleges began a political campaign to be turned into universities, with salaries comparable to the Universities, and graduate schools with research, and publish or perish, and all the rest of it; and instead of being teaching institutions they would become second rate copies of the Universities, with a faculty neglecting teaching in order to gather prestige in research and publication, or, perhaps, at least to look as if they were. In any event the California State Colleges became California State Universities, their commitment to actual undergraduate education was tempered to make room for the graduate schools, budgets were higher, costs were higher, and tuition, which had been designed to be very low, began to climb.
I make no doubt that something like that happened in many other states. When Roberta and I were undergraduates, tuition was low enough that you could, literally, work your way through college. In her case she did office work and she was good enough at it to earn a respectable salary as she managed to go to the University of Washington and study music, as well as get a teaching credential. I managed my first couple of years with the funds from the Korean GI Bill, then wangled undergraduate assistantships doing technical work – I built electronic stuff for Van Allen at Iowa and worked on polygraph equipment for Al Ax at the University of Washington, then later did computer programming for the NRL projects at UW under Dvorak – who had been a submarine commander in WW II, and who invented the Dvorak keyboard. We seldom saw him, but he was legendary even then. Apparently supervision of Navy Research Contracts fell under his sway because he was a USNR Captain.
My point is that we could work our way through college. The Korean GI Bill was good enough to pay state resident tuition and we could wait on tables or find other work to stay alive. Student loans were not a real option, and few graduated with debts. I managed to learn enough to get a job as an aviation psychologist and human factors engineer at Boeing, and Roberta got her music degree and teaching position in the Seattle public school system.
None of that is possible now – and from my perusal of the course catalogs of local universities, I could never have managed to learn enough to get a professional job at Boeing in four years.
The Universities pretend to teach and the students pretend to learn, the costs rise and the number qualified to do something a company might actually pay them to do goes down. And the rising salaries of the teachers and professors and deans and assistants to the Associate Deans, and all the rest continue. They also invented the ‘Post Doc” fellowship, which pays a pittance to someone who has actually earned a PhD but can’t find anything useful to do with it. Gardeners and maintenance crews get larger and are paid more. And every year the Faculty Senate pleads that the University is in danger without higher tuition. Meanwhile, grade inflation makes credentials meaningless.
Credentials are essential and expensive, and they are not worthless because you generally can’t get a job without them; but they don’t really certify that you can do anything, only that you have acquired the credential, something that you must have even to be considered for a job
And so it goes.
I note that in May of 2011 I proposed one remedy to awful schools.
You may take it as a general rule: get the worst 10% of the teachers out of a school, distributing their students to the remaining teachers, and you will improve the school, probably very dramatically. So designate one awful school as the place to send all the worst teachers. It won’t hurt that school much, because not much can. It complies with the silly laws and rules that make it impossible to fire bad, incompetent, malicious, and generally unsatisfactory teachers, and it will do some good for the other schools. Admittedly it’s a silly way to improve a school system, but it may well be the only possible way, since there appears to be no way to change the rules. http://www.jerrypournelle.com/view/2011/Q2/view674.html#Tuesday
It’s not politically possible, but it would work without firing any teachers…
If your career interacts with the military, Colonel Couvillon recommends this:
Lessons of combat http://www.strategypage.com/htmw/htlead/articles/20131227.aspx#startofcomments [enthusiastic comment deleted] Alas, as the war(s) have wound down, the bureaucrats and ‘managers’ emerge from the shadows and start issuing all manner of (CYA) safety regulations, EPA restrictions, and cost-saving measures. Additionally, those without combat experience will move to the forefront of promotion and command queues because of their sterling record of ‘education’ and accident (i.e. risk) free service. David Couvillon Colonel, U.S. Marine Corps Reserve, Retired.; Former Governor of Wasit Province, Iraq; Righter of Wrongs; Wrong most of the time; Distinguished Expert, TV remote control; Chef de Hot Dog Excellance; Avoider of Yard Work
I had intended to try to learn the Word Press editor that operates directly on the web site, since I hoped it would be easier to use than this, but alas, the learning curve is steep. This is good enough, but I’ll keep trying. I confess I preferred the FrontPage system to all this, but that is apparently no longer an option. Ah well.
Good night, and happy New Year.
Freedom is not free. Free men are not equal. Equal men are not free.
|
package models
import "errors"
type ProductStatus uint8
const (
ProductStatus_Unavailable = 0
ProductStatus_Available = 1
)
type Product struct {
Model
Name string `gorm:"size:512;not null;unique" json:"name"`
Price float64 `gorm:"type:decimal(10,2);not null;default:0.0" json:"price"`
Quantity uint16 `gorm:"default:0;unsigned" json:"quantity"`
Status ProductStatus `gorm:"char(1);default:0" json:"status"`
CategoryID uint64 `gorm:"not null" json:"category_id"`
}
var (
ErrProductEmptyName = errors.New("product.name can't be empty")
)
func (p *Product) Validate() error {
if p.Name == "" {
return ErrProductEmptyName
}
return nil
}
func (p *Product) CheckStatus() {
p.Status = ProductStatus_Unavailable
if p.Quantity > 0 {
p.Status = ProductStatus_Available
}
}
|
News items related to Multi-Flow Industries as issued by the Send2Press Newswire service on behalf of the noted news source.
HUNTINGDON VALLEY, Pa. (SEND2PRESS NEWSWIRE) — Multi-Flow Industries, a manufacturer of fountain-dispensed beverages, announced the launch of T’ei, a new fountain-dispensed iced tea brand. T’ei (pronounced ‘tay’) will compete in a beverage category that continues to post solid growth. Current Iced Tea Trends, reported by Beverage World, show 12 percent growth.
HUNTINGDON VALLEY, Pa., March 16 (SEND2PRESS NEWSWIRE) — Multi-Flow Industries, a manufacturer of fountain-dispensed beverages, announced the launch of ‘All Day Cafe,’ a shelf-stable, liquid roast Hot Coffee Bag-in-the-Box brand. ‘We’re incredibly excited about competing in the hot beverage category,’ said Mark Stephens, CEO of Multi-Flow.
|
Modeling and Optimizing of the Multi-Layer Nearest Neighbor Network for Face Image Super-Resolution In this paper, we propose a face super-resolution (FSR) method to handle the decreasing face recognition rate caused by low-quality images. To better model the input images, we build a nearest neighbor network (NNN) which consists of nodes and paths by introducing the second-layer nearest neighbors (SLNNs), where the paths of the network represent the distance between nodes. As the SLNN is trained in the high-resolution (HR) space and is exponentially supplementary to the traditional first-layer nearest neighbors (FLNNs), the neighbor inadequacy problem can be effectively solved by enriching the neighbor candidate set via NNN. Furthermore, we solve the NNN for the optimal weights of neighbors. Finally, we fuse the refined weights and neighbors for better reconstruction results. The effectiveness of this fusion strategy is validated by both quantitative and qualitative experimental results. The extensive experimental results on the public face datasets and real-world challenging low-resolution (LR) images demonstrate that the proposed method performs favorably against the state-of-the-art methods.
|
Role of drug absorption in the pharmacokinetics of therapeutic interventions for stroke Absorption is a critical component of the pharmacokinetics for solid dosage forms administered orally. Many barriers must be overcome in order for a drug molecule to reach its effect site. To effectively address each of these barriers, drugspecific properties, formulation issues, and (patho)physiological changes in the gastrointestinal tract must be considered. Firstpass metabolism in the gut and/or liver can dictate the extent to which a drug reaches the systemic circulation. Drugmetabolizing enzymes in the gut and liver are very susceptible to inhibition by other drugs, increasing the risk of drug interactions. In this paper, we will discuss absorptionrelated issues for solid dosage forms used in the management of stroke patients.
|
/**
* HTTP Pipeline policy that keeps track of each HTTP request and response that flows through the pipeline.
* Data is recorded into {@link RecordedData}.
*/
public class RecordNetworkCallPolicy implements HttpPipelinePolicy {
private static final int DEFAULT_BUFFER_LENGTH = 1024;
private final ClientLogger logger = new ClientLogger(RecordNetworkCallPolicy.class);
private final RecordedData recordedData;
/**
* Creates a policy that records network calls into {@code recordedData}.
*
* @param recordedData The record to persist network calls into.
*/
public RecordNetworkCallPolicy(RecordedData recordedData) {
Objects.requireNonNull(recordedData);
this.recordedData = recordedData;
}
@Override
public Mono<HttpResponse> process(HttpPipelineCallContext context, HttpPipelineNextPolicy next) {
final NetworkCallRecord networkCallRecord = new NetworkCallRecord();
Map<String, String> headers = new HashMap<>();
if (context.httpRequest().headers().value("Content-Type") != null) {
headers.put("Content-Type", context.httpRequest().headers().value("Content-Type"));
}
if (context.httpRequest().headers().value("x-ms-version") != null) {
headers.put("x-ms-version", context.httpRequest().headers().value("x-ms-version"));
}
if (context.httpRequest().headers().value("User-Agent") != null) {
headers.put("User-Agent", context.httpRequest().headers().value("User-Agent"));
}
networkCallRecord.headers(headers);
networkCallRecord.method(context.httpRequest().httpMethod().toString());
networkCallRecord.uri(context.httpRequest().url().toString().replaceAll("\\?$", ""));
return next.process().flatMap(httpResponse -> {
final HttpResponse bufferedResponse = httpResponse.buffer();
return extractResponseData(bufferedResponse).map(responseData -> {
networkCallRecord.response(responseData);
String body = responseData.get("Body");
// Remove pre-added header if this is a waiting or redirection
if (body != null && body.contains("<Status>InProgress</Status>")
|| Integer.parseInt(responseData.get("StatusCode")) == HttpResponseStatus.TEMPORARY_REDIRECT.code()) {
logger.info("Waiting for a response or redirection.");
} else {
recordedData.addNetworkCall(networkCallRecord);
}
return bufferedResponse;
});
});
}
private Mono<Map<String, String>> extractResponseData(final HttpResponse response) {
final Map<String, String> responseData = new HashMap<>();
responseData.put("StatusCode", Integer.toString(response.statusCode()));
boolean addedRetryAfter = false;
for (HttpHeader header : response.headers()) {
String headerValueToStore = header.value();
if (header.name().equalsIgnoreCase("retry-after")) {
headerValueToStore = "0";
addedRetryAfter = true;
}
responseData.put(header.name(), headerValueToStore);
}
if (!addedRetryAfter) {
responseData.put("retry-after", "0");
}
String contentType = response.headerValue("content-type");
if (contentType == null) {
return Mono.just(responseData);
} else if (contentType.contains("json") || response.headerValue("content-encoding") == null) {
return response.bodyAsString().switchIfEmpty(Mono.just("")).map(content -> {
responseData.put("Body", content);
return responseData;
});
} else {
return response.bodyAsByteArray().map(bytes -> {
String content;
try (GZIPInputStream gis = new GZIPInputStream(new ByteArrayInputStream(bytes));
ByteArrayOutputStream output = new ByteArrayOutputStream()) {
byte[] buffer = new byte[DEFAULT_BUFFER_LENGTH];
int position = 0;
int bytesRead = gis.read(buffer, position, buffer.length);
while (bytesRead != -1) {
output.write(buffer, 0, bytesRead);
position += bytesRead;
bytesRead = gis.read(buffer, position, buffer.length);
}
content = new String(output.toByteArray(), StandardCharsets.UTF_8);
} catch (IOException e) {
throw logger.logExceptionAsError(Exceptions.propagate(e));
}
responseData.remove("content-encoding");
responseData.put("content-length", Integer.toString(content.length()));
responseData.put("body", content);
return responseData;
});
}
}
}
|
<filename>minMVC/src/main/java/com/minsons/minmvc/FilterChain/PathResolveFilter.java
package com.minsons.minmvc.FilterChain;
import java.util.HashMap;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import com.minsons.minmvc.config.ReflactRoute;
import com.minsons.minmvc.config.Route;
/**
* 请求路径解析,处理操作
* @author ouyang
*
*/
public class PathResolveFilter implements BaseFilter {
private BaseFilter baseFilter=null;
@Override
public void execute(Object content) {
System.out.println("do path Resolve... ...");
FilterChainManager filters=(FilterChainManager)content;
HttpServletRequest request=filters.request;
String uri= request.getRequestURI();
System.out.println(uri);
Map<String,Object> map=new HashMap<>();
ReflactRoute rot=Route.getRouteReflact(uri);
if(rot!=null){
map.put("actionClass", rot.getClassObj());
map.put("method", rot.getMethodName());
}else{
map= Route.getAdaptMapByKey(uri);
}
filters.getChainObje().put("uriResovle", map);
this.baseFilter.execute(content);
}
@Override
public void setNextFilter(BaseFilter baseFilter) {
this.baseFilter=baseFilter;
}
}
|
package com.revenuemonster.payment.model;
import org.json.JSONArray;
import org.json.JSONObject;
import java.util.ArrayList;
/**
* Created by yussuf on 4/30/19.
*/
public class Transaction {
private String key;
private String id;
private String merchantKey;
private String storeKey;
Order order;
private String type;
private String transactionId;
private String platform;
private ArrayList< String > method = new ArrayList < String > ();
private String redirectUrl;
private String notifyUrl;
private String startAt;
private String endAt;
private String referenceKey;
private String status;
private String payload = null;
private String createdAt;
private String updatedAt;
public Transaction(JSONObject o) throws Exception {
try {
this.setKey(o.getString("key"));
this.setId(o.getString("id"));
this.setMerchantKey(o.getString("merchantKey"));
this.setStoreKey(o.getString("storeKey"));
this.setOrder(new Order(o.getJSONObject("order")));
this.setType(o.getString("type"));
this.setTransactionId(o.getString("transactionId"));
this.setPlatform(o.getString("platform"));
this.setMethod(o.getJSONArray("method"));
this.setRedirectUrl(o.getString("redirectUrl"));
this.setStartAt(o.getString("startAt"));
this.setEndAt(o.getString("endAt"));
this.setReferenceKey(o.getString("referenceKey"));
this.setStatus(o.getString("status"));
this.setPayload(o.getString("payload"));
this.setCreatedAt(o.getString("createdAt"));
this.setUpdatedAt(o.getString("updatedAt"));
} catch(Exception e) {
throw e;
}
}
// Getter Methods
public String getKey() {
return key;
}
public String getId() {
return id;
}
public String getMerchantKey() {
return merchantKey;
}
public String getStoreKey() {
return storeKey;
}
public Order getOrder() {
return order;
}
public String getType() {
return type;
}
public String getTransactionId() {
return transactionId;
}
public String getPlatform() {
return platform;
}
public String getRedirectUrl() {
return redirectUrl;
}
public String getNotifyUrl() {
return notifyUrl;
}
public String getStartAt() {
return startAt;
}
public String getEndAt() {
return endAt;
}
public String getReferenceKey() {
return referenceKey;
}
public String getStatus() {
return status;
}
public String getPayload() {
return payload;
}
public String getCreatedAt() {
return createdAt;
}
public String getUpdatedAt() {
return updatedAt;
}
// Setter Methods
public void setKey(String key) {
this.key = key;
}
public void setId(String id) {
this.id = id;
}
public void setMerchantKey(String merchantKey) {
this.merchantKey = merchantKey;
}
public void setStoreKey(String storeKey) {
this.storeKey = storeKey;
}
public void setOrder(Order order) {
this.order = order;
}
public void setMethod(JSONArray method) throws Exception {
try {
for (int i = 0; i < method.length(); i++) {
this.method.add(method.getString(i));
}
} catch (Exception e) {
throw e;
}
}
public void setType(String type) {
this.type = type;
}
public void setTransactionId(String transactionId) {
this.transactionId = transactionId;
}
public void setPlatform(String platform) {
this.platform = platform;
}
public void setRedirectUrl(String redirectUrl) {
this.redirectUrl = redirectUrl;
}
public void setNotifyUrl(String notifyUrl) {
this.notifyUrl = notifyUrl;
}
public void setStartAt(String startAt) {
this.startAt = startAt;
}
public void setEndAt(String endAt) {
this.endAt = endAt;
}
public void setReferenceKey(String referenceKey) {
this.referenceKey = referenceKey;
}
public void setStatus(String status) {
this.status = status;
}
public void setPayload(String payload) {
this.payload = payload;
}
public void setCreatedAt(String createdAt) {
this.createdAt = createdAt;
}
public void setUpdatedAt(String updatedAt) {
this.updatedAt = updatedAt;
}
}
|
/**
* @file IconSetting 设置
* @author Auto Generated by IconPark
*/
/* tslint:disable: max-line-length */
/* eslint-disable max-len */
import {ISvgIconProps, IconWrapper} from '../runtime';
export default IconWrapper('IconSetting', (props: ISvgIconProps) => (
'<?xml version="1.0" encoding="UTF-8"?>'
+ '<svg width="' + props.size + '" height="' + props.size + '" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg">'
+ '<rect width="48" height="48" fill="white" fill-opacity="0.01"/>'
+ '<path d="M36.686 15.171C37.9364 16.9643 38.8163 19.0352 39.2147 21.2727H44V26.7273H39.2147C38.8163 28.9648 37.9364 31.0357 36.686 32.829L40.0706 36.2137L36.2137 40.0706L32.829 36.686C31.0357 37.9364 28.9648 38.8163 26.7273 39.2147V44H21.2727V39.2147C19.0352 38.8163 16.9643 37.9364 15.171 36.686L11.7863 40.0706L7.92939 36.2137L11.314 32.829C10.0636 31.0357 9.18372 28.9648 8.78533 26.7273H4V21.2727H8.78533C9.18372 19.0352 10.0636 16.9643 11.314 15.171L7.92939 11.7863L11.7863 7.92939L15.171 11.314C16.9643 10.0636 19.0352 9.18372 21.2727 8.78533V4H26.7273V8.78533C28.9648 9.18372 31.0357 10.0636 32.829 11.314L36.2137 7.92939L40.0706 11.7863L36.686 15.171Z" fill="' + props.colors[1] + '" stroke="' + props.colors[0] + '" stroke-width="' + props.strokeWidth + '" stroke-linejoin="' + props.strokeLinejoin + '"/>'
+ '<path d="M24 29C26.7614 29 29 26.7614 29 24C29 21.2386 26.7614 19 24 19C21.2386 19 19 21.2386 19 24C19 26.7614 21.2386 29 24 29Z" fill="' + props.colors[3] + '" stroke="' + props.colors[2] + '" stroke-width="' + props.strokeWidth + '" stroke-linejoin="' + props.strokeLinejoin + '"/>'
+ '</svg>'
));
|
<reponame>RI-imaging/DryMass
import numpy as np
from drymass import threshold as thr
def test_basic():
size = 200
image = np.zeros((size, size), dtype=float)
x = np.arange(size).reshape(-1, 1)
y = np.arange(size).reshape(1, -1)
cx = 80
cy = 120
radius = 30
r = np.sqrt((x - cx)**2 + (y - cy)**2)
image[r < radius] = 1.3
assert np.all(thr.image2mask(image, 1) == (r < radius))
assert np.all(thr.image2mask(image, "dm-nuclei") == (r < radius))
def test_invert():
size = 200
image = np.zeros((size, size), dtype=float)
x = np.arange(size).reshape(-1, 1)
y = np.arange(size).reshape(1, -1)
cx = 80
cy = 120
radius = 30
r = np.sqrt((x - cx)**2 + (y - cy)**2)
image[r < radius] = 1.3
normal = thr.image2mask(image, 1)
invert = thr.image2mask(image, 1, invert=True)
assert np.all(normal == ~invert)
if __name__ == "__main__":
# Run all tests
loc = locals()
for key in list(loc.keys()):
if key.startswith("test_") and hasattr(loc[key], "__call__"):
loc[key]()
|
The cinema of World War II is gritty, glorious and seriously extensive. There were so many great war movies made during the war itself, it's a wonder anyone was available to do any actual fighting. Since then, each decade has spun its own take on this epic conflict, mining nuance from what's often depicted as a black-and-white struggle between good and evil. And from Clint Eastwood's 'Letters From Iwo Jima' to Sam Peckinpah's 'Cross of Iron', filmmakers have even crossed the divide to tell stories from the enemy's perspective.
But with so many WWII films out there, which ones are the greatest? From big-budget action epics, subtle romances, tragic dramas and starkly realistic depictions of the conflict, here are 50 of the best World War II films, as chosen by our Time Out writers and the venerable director, Quentin Tarantino.
Recommended: London and UK cinema listings, film reviews and exclusive interviews.
|
//===- FoldUtils.h - Operation Fold Utilities -------------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
// This header file declares various operation folding utilities. These
// utilities are intended to be used by passes to unify and simply their logic.
//
//===----------------------------------------------------------------------===//
#ifndef MLIR_TRANSFORMS_FOLDUTILS_H
#define MLIR_TRANSFORMS_FOLDUTILS_H
#include "mlir/IR/Builders.h"
#include "mlir/IR/Dialect.h"
#include "mlir/IR/DialectInterface.h"
#include "mlir/Interfaces/FoldInterfaces.h"
namespace mlir {
class Operation;
class Value;
//===--------------------------------------------------------------------===//
// OperationFolder
//===--------------------------------------------------------------------===//
/// A utility class for folding operations, and unifying duplicated constants
/// generated along the way.
class OperationFolder {
public:
OperationFolder(MLIRContext *ctx) : interfaces(ctx) {}
/// Tries to perform folding on the given `op`, including unifying
/// deduplicated constants. If successful, replaces `op`'s uses with
/// folded results, and returns success. `preReplaceAction` is invoked on `op`
/// before it is replaced. 'processGeneratedConstants' is invoked for any new
/// operations generated when folding. If the op was completely folded it is
/// erased. If it is just updated in place, `inPlaceUpdate` is set to true.
LogicalResult
tryToFold(Operation *op,
function_ref<void(Operation *)> processGeneratedConstants = nullptr,
function_ref<void(Operation *)> preReplaceAction = nullptr,
bool *inPlaceUpdate = nullptr);
/// Notifies that the given constant `op` should be remove from this
/// OperationFolder's internal bookkeeping.
///
/// Note: this method must be called if a constant op is to be deleted
/// externally to this OperationFolder. `op` must be a constant op.
void notifyRemoval(Operation *op);
/// Create an operation of specific op type with the given builder,
/// and immediately try to fold it. This function populates 'results' with
/// the results after folding the operation.
template <typename OpTy, typename... Args>
void create(OpBuilder &builder, SmallVectorImpl<Value> &results,
Location location, Args &&... args) {
// The op needs to be inserted only if the fold (below) fails, or the number
// of results produced by the successful folding is zero (which is treated
// as an in-place fold). Using create methods of the builder will insert the
// op, so not using it here.
OperationState state(location, OpTy::getOperationName());
OpTy::build(builder, state, std::forward<Args>(args)...);
Operation *op = Operation::create(state);
if (failed(tryToFold(builder, op, results)) || results.empty()) {
builder.insert(op);
results.assign(op->result_begin(), op->result_end());
return;
}
op->destroy();
}
/// Overload to create or fold a single result operation.
template <typename OpTy, typename... Args>
typename std::enable_if<OpTy::template hasTrait<OpTrait::OneResult>(),
Value>::type
create(OpBuilder &builder, Location location, Args &&... args) {
SmallVector<Value, 1> results;
create<OpTy>(builder, results, location, std::forward<Args>(args)...);
return results.front();
}
/// Overload to create or fold a zero result operation.
template <typename OpTy, typename... Args>
typename std::enable_if<OpTy::template hasTrait<OpTrait::ZeroResult>(),
OpTy>::type
create(OpBuilder &builder, Location location, Args &&... args) {
auto op = builder.create<OpTy>(location, std::forward<Args>(args)...);
SmallVector<Value, 0> unused;
(void)tryToFold(op.getOperation(), unused);
// Folding cannot remove a zero-result operation, so for convenience we
// continue to return it.
return op;
}
/// Clear out any constants cached inside of the folder.
void clear();
/// Get or create a constant using the given builder. On success this returns
/// the constant operation, nullptr otherwise.
Value getOrCreateConstant(OpBuilder &builder, Dialect *dialect,
Attribute value, Type type, Location loc);
private:
/// This map keeps track of uniqued constants by dialect, attribute, and type.
/// A constant operation materializes an attribute with a type. Dialects may
/// generate different constants with the same input attribute and type, so we
/// also need to track per-dialect.
using ConstantMap =
DenseMap<std::tuple<Dialect *, Attribute, Type>, Operation *>;
/// Tries to perform folding on the given `op`. If successful, populates
/// `results` with the results of the folding.
LogicalResult tryToFold(
OpBuilder &builder, Operation *op, SmallVectorImpl<Value> &results,
function_ref<void(Operation *)> processGeneratedConstants = nullptr);
/// Try to get or create a new constant entry. On success this returns the
/// constant operation, nullptr otherwise.
Operation *tryGetOrCreateConstant(ConstantMap &uniquedConstants,
Dialect *dialect, OpBuilder &builder,
Attribute value, Type type, Location loc);
/// A mapping between an insertion region and the constants that have been
/// created within it.
DenseMap<Region *, ConstantMap> foldScopes;
/// This map tracks all of the dialects that an operation is referenced by;
/// given that many dialects may generate the same constant.
DenseMap<Operation *, SmallVector<Dialect *, 2>> referencedDialects;
/// A collection of dialect folder interfaces.
DialectInterfaceCollection<DialectFoldInterface> interfaces;
};
} // namespace mlir
#endif // MLIR_TRANSFORMS_FOLDUTILS_H
|
Musa Maphongwane and Amos Mtsolongo are two of the success stories to emerge from the Branson School of Entrepreneurship in South Africa.
Their business, Gaming Zone, offers deprived children in Soweto and East Johannesburg safe access to the internet and the latest computer games technology.
The video arcades are housed in re-purposed shipping containers based at sites near schools. Up to 120 children visit every day and the short-term ambition of Gaming Zone is to have 40 sites.
After coming up with the idea in 2006, Musa and Amos' careers took off after earning a place at the Branson School.
They were taught how to keep monthly accounts, how to keep a database of customers to monitor trends, and when to invest in the business for expansion. The duo talk enthusiastically about speakers – businessmen from Virgin groups and around the world – who visited the school to give advice.
"The most important thing we learnt is that you cannot be an island," Amos (pictured) says, citing the importance of making strong business contacts.
"We wouldn't be where we are now without the school. We learnt things that we had never thought about."
Musa and Amos' project was so successful at the Branson School that it won R250,000 (£20,000) of funding to support the growth of the business.
This has been invested in upgrading their internet connection, buying the latest games, and preparing to acquire more sites.
Gaming Zone is not only proving profitable, but has had a major social impact on the areas where it has been based, which have high levels of crime. Children are able to have fun, socialise and even learn in a monitored setting after school has finished.
At one of the arcades, Musa and Amos recently held a gaming competition that offered a PlayStation 2, donated by Virgin Unite, as first prize.
|
Self-government in multi-agent systems : experiments and thought-experiments This paper reports on research in self-modifying protocol games. A selfmodifying protocol is a set of instructions, rules, or conventions, that can be changed by the systems that communicate with the help of that protocol. The concept is expected to be of great importance for the next generation of intelligent distributed computer systems, such as DPSs, and MASs. This paper tries to show by example that a self-modifying protocol leads to self-governmental behaviour in intelligent distributed computer systems. It further hints at the possible avenues future research might take, and indicates how theoretical results can be obtained.
|
export { ChartsModule } from './charts.module';
export { BarComponent } from './bar.component';
|
Comparison of least mean fourth and least mean square tracking The paper provides new results concerning the tracking performance of the least mean fourth algorithm in comparison with that of the least mean square algorithm. The analysis is done in the context of tracking a Markov plant with a white Gaussian input. The comparison is done in terms of the minimum mean square deviation attained by each algorithm over the stability range of its step-size. Gaussian, uniform, and binary distributions of the plant noise are considered. Conditions that make one algorithm outperform the other are determined. Analytical results are supported by simulations.
|
/* Test fmad2 for SPU
Copyright (C) 2006, 2007 Sony Computer Entertainment Inc.
All rights reserved.
Redistribution and use in source and binary forms,
with or without modification, are permitted provided that the
following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of the Sony Computer Entertainment Inc nor the names
of its contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
/**
*
*@@ fmad2 - multiply and add (double).
*
*@brief
* boundary test for fmad2.
*
*@pre
*
*@criteria
* if input parameters are denorm, it may not work correctly.
*
*@note
*
**/
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <float.h>
#include "simdmath.h"
#include "common-test.h"
#include "testutils.h"
int main()
{
TEST_SET_START("20060828114000MH","MH", "fmad2");
// double denorm_min = hide_double(make_double(0x0000000000000001ull));
double denorm_max = hide_double(make_double(0x000fffffffffffffull));
// double norm_min = hide_double(make_double(0x0010000000000000ull));
double norm_max = hide_double(make_double(0x7fefffffffffffffull));
double x0 = hide_double(1760.135);
double y0 = hide_double(19355.03);
double z0 = hide_double(-12351.9);
double a0 = hide_double(34055113.82905);
double x1 = hide_double(-139.035);
double y1 = hide_double(0.0);
double z1 = hide_double(-1.0);
double x2 = hide_double(nan(""));
double y2 = hide_double(-1.0);
double z2 = hide_double(-0.0);
double x3 = hide_double(1.0);
double y3 = hide_double(HUGE_VAL);
double z3 = hide_double(-1.0);
double x4 = norm_max;
double y4 = norm_max;
double z4 = hide_double(0.0);
double x5 = hide_double(100.0);
double y5 = denorm_max;
double z5 = hide_double(0.0);
double a5 = hide_double(make_double(0x0078fffffffffffeull));
vec_double2 x0_v = spu_splats(x0);
vec_double2 y0_v = spu_splats(y0);
vec_double2 z0_v = spu_splats(z0);
vec_double2 x1_v = spu_splats(x1);
vec_double2 y1_v = spu_splats(y1);
vec_double2 z1_v = spu_splats(z1);
vec_double2 x2_v = spu_splats(x2);
vec_double2 y2_v = spu_splats(y2);
vec_double2 z2_v = spu_splats(z2);
vec_double2 x3_v = spu_splats(x3);
vec_double2 y3_v = spu_splats(y3);
vec_double2 z3_v = spu_splats(z3);
vec_double2 x4_v = spu_splats(x4);
vec_double2 y4_v = spu_splats(y4);
vec_double2 z4_v = spu_splats(z4);
vec_double2 x5_v = spu_splats(x5);
vec_double2 y5_v = spu_splats(y5);
vec_double2 z5_v = spu_splats(z5);
vec_double2 a0_v = spu_splats(a0);
vec_double2 a1_v = spu_splats(z1);
vec_double2 a5_v = spu_splats(a5);
vec_double2 res_v;
TEST_START("fmad2");
res_v = fmad2(x0_v, y0_v, z0_v);
TEST_CHECK("20060828114001MH", allequal_ulps_double2( res_v, a0_v, 1 ), 0);
res_v = fmad2(y0_v, x0_v, z0_v);
TEST_CHECK("20060828114002MH", allequal_ulps_double2( res_v, a0_v, 1 ), 0);
res_v = fmad2(x1_v, y1_v, z1_v);
TEST_CHECK("20060828114003MH", allequal_ulps_double2( res_v, a1_v, 1 ), 0);
res_v = fmad2(y1_v, x1_v, z1_v);
TEST_CHECK("20060828114004MH", allequal_ulps_double2( res_v, a1_v, 1 ), 0);
res_v = fmad2(x2_v, y2_v, z2_v);
TEST_CHECK("20060828114005MH", allnan_double2( res_v ), 0);
res_v = fmad2(y2_v, x2_v, z2_v);
TEST_CHECK("20060828114006MH", allnan_double2( res_v ), 0);
res_v = fmad2(x3_v, y3_v, z3_v);
TEST_CHECK("20060828114007MH", allposinf_double2( res_v ), 0);
res_v = fmad2(y3_v, x3_v, z3_v);
TEST_CHECK("20060828114008MH", allposinf_double2( res_v ), 0);
res_v = fmad2(x4_v, y4_v, z4_v);
TEST_CHECK("20060828114009MH", allposinf_double2( res_v ), 0);
res_v = fmad2(y4_v, x4_v, z4_v);
TEST_CHECK("20060828114010MH", allposinf_double2( res_v ), 0);
res_v = fmad2(x5_v, y5_v, z5_v);
TEST_CHECK("20060828114011MH", allequal_ulps_double2( res_v, a5_v, 1 ), 0);
res_v = fmad2(y5_v, x5_v, z5_v);
TEST_CHECK("20060828114012MH", allequal_ulps_double2( res_v, a5_v, 1 ), 0);
//printf("res:%.10le, a5:%.10le\n", spu_extract(res_v, 0), spu_extract(a5_v, 0));
TEST_SET_DONE();
TEST_EXIT();
}
|
The present invention relates to printed plastic circuits and contacts and a method of forming them. More particularly, the subject of the invention relates to conductive coating compositions.
Conductive coatings are well-known in the art which are also known as conductive inks. Conductive inks have many favorable characteristics, in that the compositions may include metals such as silver, copper, lead or tin to provide electrical conductivity. The conductive inks also may include adhesives such as polymeric binders which provide for solderability and adhesive strength. Conductive inks have been used for many applications, including applying conductive traces to printed circuit boards. The prior art shows the application of conductive ink by silk screen printing onto a non-moldable insulating baseboard substances, such as FR4 or glass epoxy. The use of conductive inks to make printed circuit boards is an additive process which is much quicker, more easily performed and less expensive than the old subtractive process of covering FR4 completely in copper and then removing the copper except for the areas in which the traces are to remain. Such process is usually accomplished out-of-house by special manufacturers. The present invention using an additive process may be performed in-house by circuit manufacturers at great time and expense savings.
New plastics are known in the art which have characteristics, including high mechanical strength, durability, toughness, chemical resistance and high temperature performance. Liquid crystal polymers (LCPs) offer these characteristics, while providing the advantage of all moldable plastics. LCPs are able to withstand temperatures as high as 520.degree. fahrenheit before disintegrating. It is an object of the present invention to combine the high temperature and moldable properties of plastics such as LCP with the quick and convenient process of printing with conductive inks.
|
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See License.txt in the repository root.
package com.microsoft.tfs.client.common.ui.config;
import java.net.URI;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.swt.widgets.Shell;
import com.microsoft.alm.auth.oauth.DeviceFlowResponse;
import com.microsoft.alm.helpers.Action;
import com.microsoft.tfs.client.common.credentials.EclipseCredentialsManagerFactory;
import com.microsoft.tfs.client.common.ui.dialogs.connect.CredentialsCompleteDialog;
import com.microsoft.tfs.client.common.ui.dialogs.connect.CredentialsCompleteListener;
import com.microsoft.tfs.client.common.ui.dialogs.connect.OAuth2DeviceFlowCallbackDialog;
import com.microsoft.tfs.client.common.ui.framework.helper.ShellUtils;
import com.microsoft.tfs.client.common.ui.helpers.CredentialsHelper;
import com.microsoft.tfs.core.config.persistence.DefaultPersistenceStoreProvider;
import com.microsoft.tfs.core.credentials.CachedCredentials;
import com.microsoft.tfs.core.credentials.CredentialsManager;
import com.microsoft.tfs.core.httpclient.Credentials;
import com.microsoft.tfs.util.Check;
import com.microsoft.tfs.util.listeners.SingleListenerFacade;
public class UITransportOAuthRunnable extends UITransportAuthRunnable {
private final URI serverURI;
public UITransportOAuthRunnable(final URI serverURI) {
Check.notNull(serverURI, "serverURI"); //$NON-NLS-1$
this.serverURI = serverURI;
}
@Override
protected CredentialsCompleteDialog getCredentialsDialog() {
final Shell shell = ShellUtils.getBestParent(ShellUtils.getWorkbenchShell());
final CredentialsManager credentialsManager =
EclipseCredentialsManagerFactory.getCredentialsManager(DefaultPersistenceStoreProvider.INSTANCE);
final OAuthCredentialsDialog credentialsDialog = new OAuthCredentialsDialog(shell, serverURI);
credentialsDialog.addCredentialsCompleteListener(new CredentialsCompleteListener() {
@Override
public void credentialsComplete() {
if (credentialsDialog.getReturnCode() == IDialogConstants.OK_ID) {
credentialsManager.setCredentials(
new CachedCredentials(serverURI, credentialsDialog.getCredentials()));
}
}
});
return credentialsDialog;
}
private class OAuthCredentialsDialog extends CredentialsCompleteDialog {
private final SingleListenerFacade credentialsCompleteListeners =
new SingleListenerFacade(CredentialsCompleteListener.class);
Credentials credentials;
final Shell shell;
final Action<DeviceFlowResponse> deviceFlowCallback;
public OAuthCredentialsDialog(final Shell parentShell, final URI serverURI) {
super(parentShell);
this.shell = parentShell;
this.deviceFlowCallback = getDeviceFlowCallback(this.shell);
}
/**
* {@inheritDoc}
*/
@Override
public int open() {
credentials = CredentialsHelper.getOAuthCredentials(serverURI, null, this.deviceFlowCallback);
/*
* Save the return code and notify listeners that the UI credentials
* dialog has already completed. This will prevent the invoking
* run() method in the base class of infinite waiting for
* credentials completion.
*/
setReturnCode(credentials != null ? IDialogConstants.OK_ID : IDialogConstants.CANCEL_ID);
((CredentialsCompleteListener) credentialsCompleteListeners.getListener()).credentialsComplete();
return getReturnCode();
}
/**
* {@inheritDoc}
*/
@Override
public Shell getShell() {
return shell;
}
/**
* {@inheritDoc}
*/
@Override
public void addCredentialsCompleteListener(CredentialsCompleteListener listener) {
credentialsCompleteListeners.addListener(listener);
}
/**
* {@inheritDoc}
*/
@Override
public Credentials getCredentials() {
return credentials;
}
/**
* {@inheritDoc}
*/
@Override
protected String provideDialogTitle() {
return null;
}
private Action<DeviceFlowResponse> getDeviceFlowCallback(final Shell parentShell) {
final Action<DeviceFlowResponse> deviceFlowCallback = new Action<DeviceFlowResponse>() {
@Override
public void call(final DeviceFlowResponse response) {
final OAuth2DeviceFlowCallbackDialog callbackDialog =
new OAuth2DeviceFlowCallbackDialog(parentShell, response);
callbackDialog.open();
}
};
return deviceFlowCallback;
}
}
}
|
package com.platform.service;
import com.platform.entity.CloudClassroomGoodEntity;
import java.util.List;
import java.util.Map;
/**
* 云课堂商品关联表
Service接口
*
* @author zoubin
* @email <EMAIL>
* @date 2019-06-16 14:34:57
*/
public interface CloudClassroomGoodService {
/**
* 根据主键查询实体
*
* @param id 主键
* @return 实体
*/
CloudClassroomGoodEntity queryObject(Integer id);
/**
* 分页查询
*
* @param map 参数
* @return list
*/
List<CloudClassroomGoodEntity> queryList(Map<String, Object> map);
/**
* 分页统计总数
*
* @param map 参数
* @return 总数
*/
int queryTotal(Map<String, Object> map);
/**
* 保存实体
*
* @param cloudClassroomGood 实体
* @return 保存条数
*/
int save(CloudClassroomGoodEntity cloudClassroomGood);
/**
* 根据主键更新实体
*
* @param cloudClassroomGood 实体
* @return 更新条数
*/
int update(CloudClassroomGoodEntity cloudClassroomGood);
/**
* 根据主键删除
*
* @param id
* @return 删除条数
*/
int delete(Integer id);
/**
* 根据主键批量删除
*
* @param ids
* @return 删除条数
*/
int deleteBatch(Integer[] ids);
}
|
from .aggregate import Aggregate
from .entity import Entity
from .event import Event
from .events import Events
from .value_object import ValueObject
|
How is this even possible? I've been told by people at City Hall that the Salvation Army doesn't even own the building on Weber St. any more. It was sold to developers some time ago.
|
Bayer employees worked with Jersey Cares to volunteer at the Renaissance Institute in Jersey City.
HANOVER: Bayer Corp. employees served communities throughout New Jersey this week on the 2017 MLK Day of Service.
The company’s African American Hispanic Association -- a Bayer employee resource group -- led the effort, according to a press release from the company, which said that throughout the day, employees volunteered at three off-site service opportunities and one that took place on-site at Bayer.
In one service opportunity, Bayer employees worked on homes being built for veterans as part of a Habitat for Humanity project on Harding Avenue in Dover.
In another, Bayer employees worked with Jersey Cares to volunteer at the Renaissance Institute in Jersey City. They did general painting, worked on a tile mosaic for the school’s gymnasium, and painted college banners that will be used to adorn the school’s walls to inspire students, the release said.
In addition, Bayer employees repackaged bulk food and completed other light warehouse tasks at Interfaith Food Pantry in Morris Plains, New Jersey.
For Bayer’s on-site MLK Day of Service activity, employees assembled toiletry kits for warming stations that serve homeless citizens/clients of Babyland Family Services in Newark. They assembled the kits at Bayer’s United States headquarters in Whippany.
In total, more than 100 Bayer employees volunteered in the company’s 2017 MLK Day of Service activities and used the day as one of two annual paid days that the company provides for community service.
HANOVER: ShopRite’s Monica Hansen will host a Health and Wellness Day at ShopRite of Greater Morristown featuring community vendors and product giveaways.
Participating vendors include HealthAde Kombucha, MySuperFoods kids snacks, LoveBeets, Pure Lyft “Clean Caffeine,” Alma Baking, and Hip Chick Farms frozen products, according toa press release from ShopRite, which said that additional community health professionals, including a local chiropractor, and representatives of Maximum Health & Wellness, are expected to attend.
The event is scheduled to take place Saturday and run from 11 a.m. to 3 p.m. at the store that is located at 178 East Hanover Ave. in the Cedar Knolls section of Hanover.
|
Laplace Operators on Fractals and Related Functional Equations We give an overview over the application of functional equations, namely the classical Poincar\'e and renewal equations, to the study of the spectrum of Laplace operators on self-similar fractals. We compare the techniques used to those used in the euclidean situation. Furthermore, we use the obtained information on the spectral zeta function to define the Casimir energy of fractals. We give numerical values for this energy for the Sierpi\'nski gasket. Historical perspective Strange objects, which are poorly characterised by their topological dimension, such as the Weierstrass continuous, but nowhere differentiable function, the van Koch curve, the Sierpiski gasket (see Figure 1), the Sierpiski carpet (see Figure 4), etc., have been familiar in mathematics for a long time. Now such objects are called fractals. The word "fractal" was coined by Mandelbrot in the 1970s. His foundational treatise contains a great diversity of examples from mathematics and natural sciences. Coastlines, topographical surfaces, turbulence in fluid, and so on are just few instances from the variety of natural objects that may be described as fractals. There is no generally agreed exact definition of the word "fractal". The fractals studied in the context of analysis on fractals are all self-similar. Moreover, we deal here mainly with finitely ramified fractals, i.e., fractals that can be disconnected by removing a specific finite number of points. Initial interest in processes (analysis) on fractals came from physicists working in the theory of disordered media. It turns out that heat and wave transfer in disordered media (such as polymers, fractured and porous rocks, amorphous semiconductors, etc.) can be adequately modelled by means of fractals and random walks on them. (See the initial papers by Alexander and Orbach, Rammal and Toulouse. See also the survey by Havlin and Ben-Avraham and the book by the same authors -for an overview of the now very substantial physics literature and bibliography.) Motivated by these works, mathematicians got interested in developing the of "analysis on fractals". For instance, in order to analyse how heat diffuses in a material with fractal structure, one needs to define a "heat equation" and a "Laplacian" on a fractal. The problem contains somewhat contradictory factors. Indeed, fractals like the Sierpiski gasket, or the van Koch curve do not have any smooth structures and one cannot define differential operators on them directly. We will comment on the difference between the euclidean and the fractal situation throughout this paper. Probabilistic approach In the mid 1980s probabilists solved the problem by constructing "Brownian motion" on the Sierpiski gasket. Goldstein, Kusuoka, and a bit later Barlow and Perkins, independently took the first step in the mathematical development of the problem. Their method of construction is now called the probabilistic approach. Namely, they considered a sequence of random walks X (n) on graphs G n, which approximate the Sierpiski gasket, and showed that by taking a certain scaling factor, those random walks converge to a diffusion process on the Sierpiski gasket. In order to obtain a nontrivial limit, the time scale for each step should be the average time for the random walk on G n+1, starting from a point in G n, to arrive at a point in G n, except for the starting point. By the self-similarity and symmetry of this average time is independent of n and it is equal to the average time for the random walk on G 1, starting from a to arrive at either b or c. (Here a, b, c, are the vertices of the initial equilateral triangle G 0.) Elementary calculations show that = 5. According to the processes 2 −n X (n) () weakly converge (as n → ∞) to a non-trivial limit X t on, which is called Brownian motion on. In this approach the Laplacian is defined as an infinitesimal generator of X t. An important observation was made by Barlow and Perkins in. Let Z n = T n.0 1 be the first hit time by X (n) on G 0. Then Z n is a simple branching process. Its off-spring distribution has the generating function q(z) = E(z ) = z 2 /(4 − 3z) and, in particular, E() = q = 5. Thus, Z n is a super-critical branching process. It is known (see ) that in this case 5 −n Z n tends to a limiting random variable Z ∞. The moment generating function of this random variable f (z) = Ee −zZ∞ satisfies the functional equation which is the Poincar equation (see also Section 5 below). The Poincar equation associated with the Brownian motion turns out to be a very useful tool in the study of the detailed properties (for example, heat kernel) of the Brownian motion. Lindstrm extended the construction of the Brownian motion from the Sierpiski gasket to more general nested fractals, (which are finitely ramified self-similar fractals with strong symmetry). The Lindstrm snowflake is a typical example of a nested fractal (see Figure 2). Readers may refer to Barlow's lecture notes for a self-contained survey of the probabilistic approach. Anomalous diffusion It has been discovered in an early stage already (see ) that diffusion on fractals is anomalous, different than that in a regular space. For a regular diffusion, or (equivalently) a simple random walk in all integer dimensions d, mean-square displacement is proportional to the number of steps n: E(X n ) 2 = cn (Fick's law, 1855). On the other hand, in the case of the Sierpiski gasket E x (X n − x) 2 ≍ n 2/, where ≍ means that the ratio between the two sides is 'bounded above and below by positive constants' and = lg 5/ lg 2 is called the walk dimension. This slowing down of the diffusion is caused, roughly speaking, by the removal of large parts of the space. De Gennes was amongst the first, who realised the broad importance of anomalous diffusion and coined the suggestive term "the ant in the labyrinth", describing the meandering of a random walker in percolation clusters. Analytic approach The second approach, based on difference operators, is due to Kigami. Instead of the sequence of random walks, one can consider a sequence of discrete Laplacians on a sequence of graphs, approximating the fractal. It is possible to prove that under a proper scaling these discrete Laplacians would converge to an "well-behaved" operator with dense domain, called the Laplacian on the Sierpiski gasket. This alternative approach is usually called the analytic approach. Later it was extended by Kigami to more general class of fractals -post critically finite self-similar sets (p.c.f), which roughly correspond to finitely ramified self-similar fractals. The two approaches described above are complementary to each other. The advantage of the analytic approach is that one gets concrete and direct description of harmonic functions, Laplacians, Dirichlet forms, etc. (See also.) On the other hand, however, the probabilistic approach is better suited for the study of heat kernels. Moreover, this approach can be applied to infinitely ramified self-similar fractals, which include the Sierpiski carpet, as a typical example (cf., ). Functional equations in the analysis on fractals One important example, where the Poincar equation arises in connection with analysis on fractals, has been mentioned already at the end of Section 1.2. Further applications of functional equations in this field are related to spectral zeta function ∆ of the Sierpiski gasket and other more general fractals having spectral decimation. The phenomenon of spectral decimation was first observed and studied by Fukushima and Shima ( ) and further progress has been made by Malozemov and Teplyaev and Strichartz. The definition of spectral decimation is given in Section 4.2 (see Definition 8 below). It implies, in particular, that eigenvalues of the Laplacian ∆ on the fractal, which admits spectral decimation, can be calculated by means of a certain polynomial p(z), or rational function R(z). Hence, the spectral zeta function ∆ may be defined by means of iterations p (n) of p, or R (n) of R (see ). The above mentioned iteration process, as is well known in iteration theory, may be conveniently described by the corresponding Poincar equation: where = p > 1 (see, for example, Beardon or Milnor ). Using that, in Section 4.4, we obtain the meromorphic continuation of the zeta function ∆ into the whole complex plane on the basis of the knowledge of the asymptotic behaviour of the Poincar function in certain angular regions. The poles of the spectral zeta function are called the spectral dimensions (see ). For the physical consequences of complex dimensions of fractals -see ( ). In Section 4.5.1, we use the Poincar function for the calculation of Casimir energy on a fractal. Finally, one can expect that functional equations with rescaling naturally come about from problems, where renormalisation type arguments are used to study selfsimilarity. Furthermore, functional equations, in contrast with differential ones, do not require any smoothness of solutions; they may possess nowhere differential solutions, for example. Notes and remarks There is now a number of excellent books, lecture notes and surveys on different aspects of analysis and probability on fractals. It is next to impossible to describe all activities in this area. The objective of the present paper is different. We restrict ourselves to a brief overview of various approaches in the study of the Laplacian and its spectral properties on certain self-similar fractals, and we put much emphasis on the deep connection between the latter problem and functional equations with rescaling, and the classical Poincar equation, in particular. The Poincar equation plays a very important role in the mathematical theory of dynamical systems and in iteration theory, in particular, but is still much less known in the physics literature. Hopefully, the current presentation of this realm of problems intended for a general audience may fill this gap. We begin our presentation of the Poincar equation in Section 5 with a brief description of the general case, when the coefficients of the polynomial P and the scaling factor are complex numbers, and only afterwards turn to a detailed discussion of the real case. So far, the real case only has arisen in analysis on fractals. However, we think that the general case is interesting on its own, and, probably, will also find applications in the future. In this overview we do not or only cursorily touch the following important topics: analysis on infinitely ramified fractals such as the Sierpiki carpet. The very recent progress that has been made in proving the uniqueness of the diffusion on the Sierpiski carpets provided a unification of the different approaches to diffusion on this class of fractals. Fractals and iterated function systems Let us first recall that for any finite set of linear contractions on R d In general, the set K obtained as fixed point in is a "fractal" set (cf. ). If the matrices A i are only assumed to be contracting, finding the Hausdorff-dimension of K is a rather delicate (cf. ) problem. For this paper we will make the following additional assumptions on the family of contractions F = {F i | i = 1,..., m}: (i) the matrices A i are similitudes with factors i < 1: with the union disjoint. Assuming that the maps in F are similitudes and satisfy the open-set-condition, the Hausdorff-dimension of the compact set K given by equals the unique positive solution s = of the equation The projection map (the limit is independent of x ∈ R d ) defines a "parametrisation" of K. If {1,..., m} N is endowed with the infinite product measure given by then is a -almost sure bijection. The normalised -dimensional Hausdorff-measure on K is then given by This is the unique normalised measure satisfying (cf. ) By the above discussion the functions to define them everywhere. The set K together with the address space = {1,..., m} N and the maps F i (i = 1,..., m) defines a self-similar structure (K,, (F i ) m i=1 ). In order to allow sensible analysis on the fractal set K, we need some further properties. Especially, since we will later study diffusion processes, we need K to be connected. On the other hand, the techniques introduced later require a finite ramification property usually called post-critical finiteness (p. c. f.). ) be a self-similar structure. Then the set is called the critical set of K. The post-critical set of K is defined by where : → denotes the shift map on the address space. If P is a finite set,. This is equivalent to the finiteness of C together with the fact that all points of C are ultimately periodic. The following sequence V m of finite sets will be used in Section 3.5 to define a sequence of electrical networks giving a harmonic structure on K. For more details we refer to ) be a post-critically finite self-similar structure and P its post-critical set. Let V 0 = (P ) and define V m iteratively by The sets V n are then finite, increasing (V n ⊂ V n+1 ) and Laplace operators on compact manifolds Before we introduce the Laplace operator on certain classes of self-similar fractals, let us shortly discuss the situation in the manifold case, because this gives the motivation for the different approaches in the case of fractals. Let M be a compact Riemannian manifold with a Riemannian metric g given as a quadratic form g x on the tangent space T x M for x ∈ M. As usual, we assume that the dependence of g x on x is differentiable. Then the quadratic form g x defines an isomorphism g between the tangent space T x M and its dual T * x M (and thus on the tangent bundle T M and the cotangent bundle. Define the divergence of a vector field X as the negative formal adjoint of grad with respect to the scalar product X, Y L 2 (M ) = M g x (X, Y ) d vol(x): The Laplace operator is then defined as (cf. ) By definition this operator is self-adjoint and thus has only non-positive real eigenvalues by △ f, f L 2 = − grad f, grad f L 2 ≤ 0. Based on the above approach, a corresponding energy form ("Dirichlet form", cf. ) can be defined which lends itself to a further way of defining a Laplace operator via the relation Geometrically, the Laplace operator measures the deviation of the function f from the mean value. More precisely, let S(x, r) = {y ∈ M | d(x, y) = r} denote the ball of radius r in M (in the Riemannian metric). Then where n denotes the dimension of the manifold M and is the surface measure on S(x, r). This also motivates the definition of the Laplace operator as limit of finite difference operators where N r (x) is a finite set of points at distance r from x and w p are suitably chosen weights. Such approximations to the Laplace operator are the basis of the method of finite differences in numerical mathematics. The Laplace operator can then be used to define a diffusion on M via the heat equation △ u = ∂ t u. The solution u(t, x) of the initial value problem u(0, x) = f (x) defines a semi-group of operators P t by The semi-group property P s+t = P s P t comes from the uniqueness of the solution u and translation invariance with respect to t of the heat equation. From the heat semi-group P t the Laplace operator can be recovered as the infinitesimal generator which exists on a dense subspace of L 2 (M) under suitable continuity assumptions on the semi-group (P t ) t≥0 (cf. ). In the fractal situation none of the above approaches can be used directly to define a Laplace operator. The main reason for this is that there is no natural definition of derivative on a fractal. But the above approaches to the Laplace operator on a manifold can be used in the opposite direction: starting from a diffusion process that can be defined on fractals by approximating random walks. Then the Laplace operator can be defined as the infinitesimal generator. This is described in Sections 3.2 and 3.3. taking the limit of finite difference operators on graphs approximating the fractal gives a second possible approach to the Laplace operator, which is explained in Section 3.4. starting with a Dirichlet form E gives a third possible approach, which is presented in Section 3.5. Random walks on graphs and diffusion on fractals The first idea to define a diffusion on a fractal was to define a sequence of random walks on approximating graphs and to synchronise time so that the limiting process is non-constant and continuous. This was the first approach to the diffusion process on the Sierpiski gasket given in and later generalised to other "nested fractals" in. Because of its importance for our exposition, we will explain it in some detail in this section. We will follow the lines of definition of self-similar graphs given in and adapt it for our purposes. We consider a graph G = (V (G), E(G)) with vertices V (G) and undirected edges E(G) denoted by {x, y}. We assume throughout that G does not contain multiple edges nor loops. For C ⊂ V (G) we call ∂C the vertex boundary, which is given by the set of vertices in V (G) \ C, which are adjacent to a vertex in C. For F ⊂ V (G) we define the reduced graph G F by V (G F ) = F and {x, y} ∈ E(G F ), if x and y are in the boundary of the same component of V (G) \ F. A random walk on G is given by transition probabilities p(x, y), which are positive, if and only if {x, y} ∈ E(G). For a trajectory (Y n ) n∈N 0 of this random walk with Y 0 = x ∈ F we define stopping times recursively by Then (Y Tm ) m∈N 0 is a random walk on G F. Since the underlying graphs G and G F are isomorphic, it is natural to require that ( −1 (Y Tm )) m∈N 0 is the same stochastic process as (Y n ) n∈N 0. This requires the validity of equations for the basic transition probabilities These are usually non-linear rational equations for the transition probabilities p(x, y). The existence of solutions of these equations has been the subject of several investigations, and we refer to. The process (Y n ) n∈N 0 on G and its "shadow" (Y Tn ) n∈N 0 on G F are equal, but they are on a different time scale. The time scaling factor between these processes is given by This factor is ≥ 2 by assumption (i) on F. More precisely, the relation between the transition time on G F and the transition time on G is given by a super-critical ( > 1) branching process, which replaces an edge {(x), (y)} ∈ G F by a path in G connecting the points x and y without visiting a point in V (G) \ F (except for x and for y in the last step). In order to obtain a process on a fractal in R d, we assume further that G is embedded in R d (i.e. V (G) ⊂ R d ). The self-similarity of the graph is carried over to the embedding by assuming that there exists a > 1 (the space scaling factor) such that F = V (G F ) = V (G). The fractal limiting structure is then given by Iterating this graph decimation we obtain a sequence of (isomorphic) graphs G n = ( −n V (G), E(G)) on different scales. The random walks (Y (n) k ) k∈N 0 on G n are connected by time scales with the scaling factor. From the theory of branching processes (cf. ) it follows that the time on level n scaled by −n tends to a random variable. From this it follows that −n Y weakly tends to a (continuous time) stochastic process (X t ) t≥0 on the fractal Y G. Under the assumption that the graph G has an automorphism group acting doubly transitively on the points of the boundary of every component of G \ F (cf. ), we consider the generating function of the transition probabilities p n (x, y) = P(Y n = y | Y 0 = x), the so called Green function of the random walk which can also be seen as the resolvent (I − zP ) −1 of the transition operator P. The replacement rules connecting the random walks on the graphs G and G F result in a functional equation for the Green function z → (z) where the rational function (z) is the probability generating function of the paths Then the time scaling factor is the expected number of steps needed for the paths counted by, so we have The rational function f (z) is the probability generating function of the paths starting and ending in v 1 ∈ (V (G)) without reaching any other point in (V (G)). Equation becomes especially simple for a fixed point x of the map It was proved in that under our conditions on the set F the map can have at most one fixed point. The Koenigs function of around the fixed point z = 1 is given by This can be used to linearise this functional equation and to obtain precise analytic information about G(z | x, x) (cf. ). From this the asymptotic behaviour of the transition probabilities p n (x, x) can be derived. In many examples these transition probabilities exhibit periodic fluctuations where is a continuous, periodic, non-constant function of period 1 (cf. ). A first example of such graphs is the Sierpiski graph studied as an approximation to the fractal Sierpiski gasket. In this case we have for the probability generating function (z) = z 2 4−3z and = 5. The random walk on this graph was studied in in order to define a diffusion on a fractal set. Self similarity of the graph and the fractal have been exploited further, to give a more precise description of the random walk and the diffusion. In a precise description of the class of graphs in terms of their symmetries is given, which allow a similar construction. In this analysis was carried further to obtain results for the transition probabilities under less symmetry assumptions using multivariate generating functions. In some examples (for instance the Sierpiski graph) it occurred that the function was conjugate to a polynomial p, i.e. which allowed a study of the properties of the random walk by referring to the classical Poincar equation. Properties of the Poincar equation have been used in to study the analytic properties of the zeta function of the Laplace operator given by the diffusion on certain self-similar fractals. For more details we refer to Section 4.4. Remark 3.1 The Sierpiski carpet is a typical example of an infinitely ramified fractal. In approximations by graphs are used to define a diffusion on this fractal. By the infinite ramification, this approach is is more intricate than the procedure described here. By the very recent result on the uniqueness of Brownian motion on the Sierpiski carpet (cf. ) this yields the same process as constructed by rescaling the classical Brownian motion restricted to finite approximations of the Sierpiski carpet in Given a diffusion process (X t ) t≥0 on a fractal K we can now define a corresponding Laplace operator. At first we define a semi-group of operators A t by for functions f ∈ L 2 (K). The semi-group property of the operators comes from the Markov property of the underlying stochastic process X t. By this semi-group has an infinitesimal generator given as This limit exists on a dense subspace F of L 2 (K) and is called Laplace operator on K. This name comes from the fact that for the usual Brownian motion on a manifold this procedure yields the classical Laplace-Beltrami operator. The function u( It was observed in the early beginnings of the development of the theory of diffusion of fractals that the domain of ∆ does not contain the restriction of any non-constant differentiable function (cf. ). The Laplace operator as limit of difference operators on graphs A totally different and more direct approach to the Laplace operator on self-similar fractals has been given by Kigami in. The operator ∆ is approximated by difference operators on the approximating graphs G n. The graph Laplacians are given by as a weighted sum over the neighbours of x in G n (y ∼ x describes the neighbourhood relation in the graph G n ). In order to make this construction compliant with the approach via stochastic processes, these operators have to be rescaled appropriately. The correct rescaling is then given by the time scaling factor introduced before, namely Laplace operators via Dirichlet forms Following the exposition in we define a sequence of quadratic forms on the finite sets V m given in Definition 2. Definition 4 Let V be a finite set. Then a bilinear form E on ℓ(V ), the real functions on V is called a Dirichlet form, if the following conditions hold: holds. Definition 5 Let E be a Dirichlet form on the finite set V and let U be a proper subset of V. Then the restriction of E to U is defined as On the level of the coefficient matrices of the Dirichlet forms, the operation of restriction is given in terms of the Schur complement. Definition 6 Let (V n, E n ) n be a sequence of increasing finite sets V n and Dirichlet forms E n on V n. The sequence is called compatible, if For a compatible sequence (V n, E n ) n and a function f on K, the sequence (E n (f | Vn, f | Vn )) n is increasing by definition and thus converges to a value in . This makes the following definition natural. Then for all f ∈ D defines a Dirichlet form on K, and D is its domain. In order to make the sequence of Dirichlet forms coherent with the self-similar structure of K, we require the following self-similarity condition for E n where r i (i = 1,..., m) are positive weights and is a proportionality factor. Furthermore, the sequence of forms has to be compatible, which amounts to the equation which comes as a solution of a non-linear eigenvalue equation. This equation plays the same role in the Dirichlet form approach as the equations play for the approach via random walks. The Dirichlet form E on K is then defined as where S = {1,..., m}, r w = r w 1 r wn for w = w 1... w n and F w = F w 1 F wn. Remark 3.2 There are some additional technical problems concerning this construction of Dirichlet forms, which arise from the fact that in general the form is supported only on a proper subset of K. In sufficient conditions for the weights r i and the form E 0 are given, which ensure that the form E is supported on the whole set K. Given a Dirichlet form E together with its domain D and a measure on K, we can now define the associated Laplace operator on K by Notice that this is the same equation as in the manifold case. In the case of a self-similar fractal K as described in Section 2 the "natural" measure on K is the according Hausdorff measure H K. In this case we omit the subscript. For more information on Dirichlet forms in general and their applications to the description of diffusion processes, we refer to the monograph. For the specifics of Dirichlet forms on fractals we refer to. Spectral analysis on manifolds Let us start with a short discussion of the manifold case, which is again somehow complementary to the fractal case. As described in Section 3 the Laplace operator on a manifold M is defined via a Riemannian metric g. If M is compact with smooth (or empty) boundary (for simplicity) the Laplace operator has pure point spectrum. The eigenvalues − k are all real (by self-adjointness) and non-positive (by definition ). Denote the normalised eigenfunctions by k. Then the heat kernel can be written as This expression yields the trace of the heat kernel On the other hand, if M is closed, the asymptotic behaviour of the heat kernel for t → 0+ can be described very precisely where the functions a ℓ can be computed iteratively by solving certain second order partial differential equations (cf. ). In particular, a 0 (x, y) = 1. The values a ℓ (x, x) can be expressed in terms of the functions △ k y d(x, y) 2m y=x (cf. ). In the case of manifolds M with smooth boundary, further terms involving half integer powers of t occur the terms b ℓ encode curvature information of the boundary ∂M. For more details we refer to. Especially, this gives an asymptotic expansion of K(t) (in the case of a closed manifold) From the first order asymptotic relation K(t) ∼ vol(M)/(4t) n 2 the asymptotic behaviour of the counting function can be obtained by a Tauberian argument giving the classical Weyl asymptotic relation where B n denotes the volume of the n-dimensional unit ball. The eigenvalues of △ constitute the frequencies of the oscillations in the solutions of the wave equation △ u = u tt. This led to M. Kac's famous question "Can one hear the shape of a drum?" (cf. ). The precise order of magnitude of the error term has been determined as x n−1 2 in the case of a smooth boundary of M in. In the case of fractal boundary, this is subject of the Weyl-Berry conjecture stated in. that the modified conjecture is true for dimension n = 1; in counterexamples for dimension n > 1 are presented. In these counterexamples disconnected manifolds are considered, thus the conjecture could still hold for connected manifolds M with fractal boundary. More precise information on the eigenvalues is contained in the spectral zeta function the Dirichlet generating function of ( k ) k. The zeta function is connected to the trace of the heat-kernel by a Mellin transform The right hand side has an analytic continuation to the whole complex plane, which can be found by using the asymptotic expansion. Furthermore, (in the case of a closed manifold) the right hand side has at worst simple poles at the points s = n 2 − ℓ (with ℓ ∈ {0, 1,..., ⌊ n−1 2 ⌋ for even n and ℓ ∈ N 0 for odd n) with residues and special values (for ℓ ∈ N) △ (−ℓ) = 0 for n odd (−1) ℓ ℓ! M a ℓ (x, x) d vol(x) for n even and △ = − dim ker △ for n odd M a n/2 (x, x) d vol(x) − dim ker △ for n even (cf. ). The special value △ can be interpreted as the negative logarithm of the determinant of △. In the case of a manifold M with smooth boundary a similar reasoning gives simple poles of the zeta function at the negative half-integers − 1 2, − 3 2,... and at the points with residues depending on the functions b ℓ. In the case of a fractal, the above approach to the spectral zeta function, its analytic continuation, and its finer properties can not be used. The reason for this is that no asymptotic expansion of the heat kernel is known in the fractal case. In Section 4.5 we comment on the known upper and lower estimates for the heat kernel. On the other hand, for fractals having spectral decimation, the eigenvalues can be described very precisely. In this case they turn out to constitute a finite union of level sets of solutions of the classical Poincar functional equation. This allows then to obtain the analytic continuation of the spectral zeta function from the precise knowledge of the asymptotic behaviour of the Poincar function; the asymptotic expansion of the trace of the heat kernel can then be obtained from the poles of the zeta function, reversing the argument in. The eigenvalue counting function can then be related to the harmonic measure on the Julia set of a the polynomial governing the spectral decimation. Spectral decimation It has been first observed by Fukushima and Shima that the eigenvalues of the Laplacian on the Sierpiski gasket and its higher dimensional analogues exhibit the phenomenon of spectral decimation. Lateron, spectral decimation for more general fractals has been studied by Malozemov,Strichartz,and Teplyaev. Definition 8 (Spectral decimation) The Laplace operator on a p. c. f. self-similar fractal G admits spectral decimation, if there exists a rational function R, a finite set A and a constant > 1 such that all eigenvalues of ∆ can be written in the form where the preimages of w under n-fold iteration of R have to be chosen such that the limit exists. Furthermore, the multiplicities m (w) of the eigenvalues depend only on w and m, and the generating functions of the multiplicities are rational. The fact that all eigenvalues of ∆ are negative real implies that the Julia set of R has to be contained in the negative real axis. We will exploit this fact later. In many cases such as the higher dimensional Sierpiski gaskets, the rational function R is conjugate to a polynomial. The method for meromorphic continuation of ∆ given in Section 4.4 makes use of this assumption. Recentlty, Teplyaev showed under the same assumption that the zeta function of the Laplacian admits a meromorphic continuation to ℜs > − for some > 0 depending on properties of the Julia set of the polynomial given by spectral decimation. His method uses ideas similar to those used in for the meromorphic continuation of a Dirichlet series attached to a polynomial. Complementary to the ideas used here, Teplyaev's method carries over to rational functions R. Eigenvalue counting As in the euclidean case the eigenvalue counting function measures the number of eigenvalues less than x. In a physical context this quantity is referred to as the "integrated density of states". It turns out that N(x) in many cases does not exhibit a pure power law as in the euclidean case, but shows periodic fluctuations. One source of this periodicity phenomenon is actually spectral decimation, especially the high multiplicities of eigenvalues, as will become clear in Section 4.4. Recall the definition of harmonic measure on the Julia set of a polynomial p of degree d (cf. ): the sequence of measures converges weakly to a limiting measure, the harmonic measure on the Julia set of p. The point can be chosen arbitrarily. Assume now that the Laplace operator on the fractal K admits spectral decimation with a polynomial p. Then the relation lim n→∞ n p (−n) ({w}) ∈ B(0, x) can be translated into lim n→∞ p (n) ( −n z) = w and |z| < x. Here B(0, x) denotes the ball of radius x around 0. By general facts about polynomial iteration (cf. ), the limit exists and defines an entire function of z, the Poincar function (z). The number of eigenvalues with m = 0 in B(0, x) is the equal to The following relation can be obtained from the definition of harmonic measure (B(0, x)) ; this holds for all x small enough to ensure the existence of the inverse function −1 on B(0, x). In we could prove a relation between the asymptotic behaviour of the partial counting functions N w (x) and the harmonic measure of balls (B(0, x)). The existence of the two limits ( = log d) is equivalent. We conjectured there, that these limits can only exist, if p is either a Chebyshev polynomial or a monomial. These are the only cases of polynomials with smooth Julia sets (cf. ). Summing up the above discussion, the eigenvalue counting function can be written as Notice, that for fixed x, these sums are actually finite. In the known cases, such as the Sierpiski gasket, the growth of m (w) is stronger than d m, which implies that the terms for large m (with N w ( −m x) still positive) become dominant in this sum. This shows that multiplicity of the eigenvalues has the main influence on the asymptotic behaviour of N(x). Furthermore, this explains the presence of an oscillating factor in the asymptotic main term of N(x). We will discuss that in more detail in Section 4.4. Spectral zeta functions As in the euclidean case, the eigenvalues of the Laplace operator △ can be put into a Dirichlet generating function. This will later allow to use methods and ideas from analytic number theory to obtain more precise asymptotic information on N(x). The zeta function is again given by where all eigenvalues are counted with their multiplicity. The zeta function is related to the eigenvalue counting function by The second relation identifies △ as the Mellin transform of the counting function N(x). In the sequel we will exploit the consequences of spectral decimation. Not too surprisingly after Definition 8, iteration of polynomials will play an important role in this discussion. Furthermore, since the relation can be expressed in terms of the Poincar function f, properties of this function will be used to derive the meromorphic continuation of △ to the whole complex plane. Under the assumptions of spectral decimation, the Julia set of the polynomial p is a subset of the non-positive reals, which contains 0. By this implies that = p ≤ d 2. By equality can only occur, if p is a Chebyshev polynomial, which would correspond to spectral decimation on the unit interval (viewed as a self-similar fractal). Thus in the cases of interest, we have that = log d < 1 2. The Poincar function is then an entire function of order. In order to find the analytic continuation of △ (s) to the whole complex plane, we analyse the partial zeta functions Since w = 1 − 1 w is a function of order = log d < 1 2, it can be expressed as a Hadamard product for w = 0 we have the slightly modified expression Taking the Mellin-transform of log w, which exists for −1 < ℜs < −, we get Thus for finding the analytic continuation of,w (s) to the left of its abscissa of convergence, it suffices to find the analytic continuation of M w (s) for ℜs > −. Following slightly different lines as in, we consider the function Then we have and this function tends to 0 exponentially for z → +∞. Taking the Mellin transform we obtain Reading the fourth line of this computation shows that M w (s) has a simple pole at s = 0 with residue Furthermore, this computation shows that M w (s) is holomorphic in the half-plane ℜs > 0. Using gives the analytic continuation of,w (s) for ℜs < 0 This shows that,w (−m) = 0 for m ∈ N 0 (for s = 0 the double zero of s sin s cancels the simple pole of M w (−s)). These could be called the "trivial zeros" as in the case of the Riemann zeta function. Furthermore, we obtain The equation even lends itself to the numerical computation of values of,w (s) for ℜs < 0, as we will se in Section 4.5.2. By our assumption on spectral decimation, the generating functions of the multiplicities of the eigenvalues are rational Thus we can write the spectral zeta function of △ as Since all functions involved in the last (finite) sum are meromorphic in the whole complex plane, we have found the meromorphic continuation of △ to the whole complex plane. The functions,w (s) have only simple poles in the points s = log d + 2ki log (k ∈ Z). Furthermore, the residues of these poles do not depend on w. All other poles of △ come from the poles of the functions R w ( −s ). Since these are rational functions of −s, their poles are equally spaced on vertical lines. Summing up, △ (s) has a meromorphic continuation to the whole complex plane with poles in the points where the w,j are the poles of the rational functions R w (z) and (at most) simple poles in the points Furthermore, since the functions,w (s) are bounded for ℜs ≥ log d + and the functions R w ( −s ) are bounded along every vertical line, which contains no poles, the function △ (s) is bounded along every vertical line c + it for c > log d, which does not contain a pole of any of the functions R w ( −s ). In the case of the Sierpiski gasket and its higher dimensional analogues, the rightmost poles of △ come from the rational functions R w ( −s ). Furthermore, the relation holds, which amounts in a (still mysterious) cancellation of the poles of the functions,w in. Thus, the analytic behaviour of the function △ is mainly governed by the functions R w. This means that in this respect the effects of multiplicity prevail over the individual eigenvalues. We now investigate the asymptotic behaviour of N(x) under the assumption that m (w) grows exponentially faster than d m for some w ∈ A. This implies that the corresponding term R s ( −s ) has poles to the right of ℜs = log d. We use the classical Mellin-Perron formula (cf. ) to express N(x) in terms of △ (s) for any c such that R w ( −s ) has no poles in the half-plane ℜ(s) ≥ c. Now the line of integration can be shifted to the left to ℜ(s) = c for c > d but such that at least one of the functions R w ( −s ) has poles to the right of c. This is justified, because △ ( + it) remains bounded for |t| → ∞ and ≥ c. Then we have where we denote the real part of the poles of R w ( −s ) by d S /2 (the "spectral dimension" Especially, the limit lim x→∞ x −d S /2 N(x) does not exist. We remark here that there exists totally different approach to zeta functions of fractals due to M. Lapidus and his collaborators. In this geometric approach the volume of tubular neighbourhoods of the fractal G is analysed. The asymptotic behaviour of V G () for → 0 gives rise to the definition of a zeta function. In this geometric context the complex solutions of occur as poles of the zeta function; they are called the "complex dimensions" of the fractal G in this context. This approach is motivated by the definition of Minkowski content, which itself turned out to be too restrictive to measure (most of the) self-similar fractals. Trace of the heat kernel The diffusion semi group A t introduced in Section 3.3 can be given in terms of the heat kernel p t (x, y). As opposed to the situation in the euclidean case, the knowledge on behaviour of the heat kernel for t → 0 is by far not as precise. Kumagai proved the following lower and upper estimates of the form where d S and d w are the spectral and the walk dimension of the fractal, respectively. These dimensions are related to the Hausdorff dimension d f of the fractal via the so called Einstein relation d S d w = 2d f. In the fractal case usually d w > 2, as opposed to the euclidean case, where d w = 2, which implies d S = d f. Only recently, a conjecture by Barlow and Perkins could be proved by Kajino. Namely that for any x ∈ K the limit does not exist for a large class of self-similar fractals. This gives an indication, why obtaining more precise information on the heat kernel than the estimates and would be very difficult. Even if the precise behaviour of the heat kernel seems to be far out of reach, the trace of the heat kernel can still be analysed in some detail under the assumption of spectral decimation. The reason for this are the two relations between K(t), N(x), and △ The first expresses K(t) as the Laplace transform of N(x), the second gives △ as Mellin transform of K(t). Given the precise knowledge on the zeta function obtained in Section 4.4, we can use the Mellin inversion formula to derive asymptotic information on K(t) for t → 0. We have for c > d S 2 where integration is along the vertical line ℜs = c. We notice that the Gamma function decays exponentially along vertical lines, whereas Dirichlet series grow at most polynomially by the general theory of Dirichlet series (cf. ). Thus convergence of the integral is guaranteed. Shifting the line of integration in to ℜs = −M − 1 2 (M ∈ N) and taking the poles of the integrand into account, we obtain for t → 0 Here, H and H j are periodic continuous functions of period 1, whose Fourier coefficients are given as the residues of △ (s)(s) in the poles on the lines ℜs = d S 2 or ℜs = j respectively. By the strong decay of the Gamma function, these functions are even real analytic. The values j + 2ki/ log come as the poles of the functions R w ( −s ). This shows that there are only finitely many j. Since M can be made arbitrarily large, the error term decays faster than any positive power of t for t → 0. The existence of complex poles of the zeta function thus implies the presence of periodically oscillating terms in the asymptotic behaviour of the trace of the heat kernel for t → 0. This implies that the limit lim t→0 t d S /2 p t (x, x) does not exist on a set of positive measure for x in accordance with the above mentioned result by N. Kajino. The consequences of the presence of complex poles of the zeta function to properties of the heat kernel, the density of states, and the partition function as well as the physical implications of the resulting fluctuating behaviour in these quantities have been discussed in. Casimir energy on fractals As an application of the spectral zeta function and its properties we compute the Casimir energy of a fractal. We follow the lines of the exposition in and refer to this book for further details. Consider the differential operator P = − ∂ 2 ∂ 2 + △ on (R/ 1 Z) G. As usual the parameter = 1/kT. The zeta function of the operator P is then given by Using the theta function relation n∈Z e − 4 2 n 2 we obtain The derivative P can be interpreted as − log det P, the logarithm of the (regularised) determinant of P. For the rescaled operator P/ 2 we have which vanishes in the case of the Sierpiski gasket, because △ does not have a pole at − 1 2. Furthermore, we get The integral and the summation over n can be evaluated explicitly, which finally gives The case of the Sierpiski gasket and other self-similar fractal shows an important contrast to the manifold case, where the zeta function (generically) has a pole at − 1 2 (see Section 4.1). In the manifold case the value △ (− 1 2 ) has to be replaced by the finite part of △ (s) at s = − 1 2, the function minus the principal part at the polar singularity (cf. ). Now the energy of the system is given by Letting → ∞, which is equivalent to letting temperature tend to 0, gives the Casimir energy for fractals, whose zeta function has no pole at − 1 2. Numerical computations We will now describe the numerical computation of the values,w (−1/2), which are needed for the computation of △ (−1/2) in the case of the Sierpiski gasket. This fractal admits spectral decimation with the polynomial p(x) = x(x + 5) (cf. ). The corresponding Poincar function is then given by the unique holomorphic solution of the equation We use the expression for △ (s) for Dirichlet boundary conditions derived in [69, Combining this with and inserting s = − 1 2 gives From the general information on the asymptotic behaviour of Poincar functions derived in we obtain estimates of the form for positive constants C 1 and C 2, = log 5 2 and valid for x ≥ x 0. Such estimates can be proved easily by first showing the estimate for an interval of the form and then extending it by using the functional equation. For instance, we used C 1 = 1, C 2 = 1.08, and x 0 = 10. Then the functions log w (x) tend to 0 like exp(−C 2 x ) for x → ∞. Given a precision goal > 0, we choose T so large that Then the improper integrals in can be replaced by T 0. The functions w (x) can be computed to high precision by using the power series representation of (x) for |x| ≤ 1 and the functional equation to obtain (x) = p (k+1) ((x/5 k+1 )) for 5 k < |x| ≤ 5 k+1. This allows the computation of the remaining finite integrals up to precision. We obtained E D Cas = 0.5474693544... for the Casimir energy of the two-dimensional Sierpiski gasket with Dirichlet boundary conditions. Similarly, we have for Neumann boundary conditions (cf. ) This gives by the same numerical estimates as before E N Cas = 2.134394089264... for the Casimir energy two-dimensional Sierpiski gasket with Neumann boundary conditions. Self-similarity and the renewal equation Let K be a post-critically finite self similar fractal with self-similar structure (K,, (F i ) m i=1 ) with contraction ratios i and Hausdorff-dimension. Let K be equipped with a Dirichlet form with parameters r i and as described in Section 3.5. Denote by N D (x) and N N (x) the eigenvalue counting functions for the Laplace operator under Dirichlet and Neumann boundary conditions, respectively. Then the following crucial fact was observed in where i are the contraction ratios introduced in Section 2, is the Hausdorff dimension of K, and the r i are the weights used for the construction of the Dirichlet form E in Section 3.5. Furthermore, the inequalities we end up with the equation where g(x) is defined as the difference between the left hand side and the sum on the right hand side, and remains bounded by. A similar equation holds for N N (x). Equation can be transformed into the classical renewal equation occurring in probability theory (cf. ). The asymptotic behaviour of the solutions of this equation is described by the following theorem (stated as in ). Theorem 4.1 ("Renewal Theorem") Let t * > 0 and f be a measurable function on R such that f (t) = 0 for t < t *. If f satisfies the renewal equation where 1,..., N are positive real numbers, p j > 0 for j = 1,..., N and N j=1 p j = 1. Assume that u is non-negative and directly Riemann integrable on R with u(t) = 0 for t < t *. Then the following conclusions hold: (i) arithmetic (or lattice) case: if the group generated by the j is discrete (i.e. there exist a T > 0 and integers m j with greatest common divisor 1 such that j = T m j ; all the ratios i / j are then rational), then lim t→∞ |f (t) − G(t)| = 0, where the T -periodic function G is given by (ii) non-arithmetic (non-lattice) case: if the group generated by the j is dense in R (i.e. at least one of the ratios i / j is irrational), then Corollary 4.1 Let f be a solution of the equation where 0 < i < 1 and g is a bounded function. Let d S be the unique positive solution of the equation then the following assertions hold: (i) arithmetic (or lattice) case: if the group generated by the values log j is discrete, generated by T > 0, then for a periodic function G of period T. (ii) non-arithmetic (or non-lattice) case: if the group generated by the values log j is dense, then The corollary is an immediate consequence of the Theorem by setting f (e t ) = e d S t/2 F (t) and applying the Theorem to F and g(e t )e −d S t/2. Summing up, we have the following theorem. with similitudes F i and all the unions assumed to be disjoint. Remark 4.2 Very recently, N. Kajino could extend this approach to non-p. c. f. fractals such as the Sierpiski carpets. He observed that in order to have an inequality of the form it suffices to have the corresponding self-similarity property of the underlying Dirichlet form. This self-similarity together with symmetries characterises the Dirichlet form on the Sierpiski carpet uniquely, as was shown in 5. Exploiting self-similarity Decimation invariance and equations with rescaling As has been described in Section 3.2, diffusion processes on decimation invariant finitely ramified fractals, belonging to a certain class, may be defined as limits of discrete simple symmetric nearest-neighbour random walks on the associated approximating graphs. The analysis is based on a renormalisation type argument, involving self-similarity and decimation invariance. Consider, for example, the Sierpiski gasket. It can be approximated by "Sierpiski lattice" graphs G n. Let X (n) t be a simple random walk on G n. Then, according to Goldstein and Kusuoka, =⇒ X t as n → ∞, where X t is a diffusion process on. ( Here, =⇒ means convergence in distribution and is the integer part function.) X t is a Markov process with continuous sample paths (in fact, a Feller process), which is itself invariant under the rescaling x → 2x, t → 5t. Functional equations in the theory of branching processes Iterative functional equations, and the Poincar equation. in particular, occur also in the context of branching processes (cf. ). Here a probability generating function p n z n encodes the offspring distribution, where p n ≥ 0 is the probability that an individual has n offsprings in the next generation (note that q = 1). The growth rate = q determines whether the population is increasing ( > 1) or dying out ( ≤ 1). In the first case the branching process is called super-critical. The probability generating function q (n) (z) (n-th iterate of q) encodes the distribution of the size X n of the n-th generation under the offspring distribution q. In the case of a super-critical branching process it is known that the random variables −n X n tend to a limiting random variable X ∞. The moment generating function of this random variable f (z) = Ee −zX∞ satisfies the functional equation (cf. ) which is yet another example of the Poincar equation. If q(z) = 1 P (1/z), where P is polynomial, then coincides with. In general, such a reduction to is possible, when q is conjugate to a polynomial by a Mbius transformation. Historical remarks on the Poincar equation In his seminal papers. H. Poincar has studied the equation where R(z) is a rational function and ∈ C. He proved that, if R = 0, R =, and || > 1, then there exists a meromorphic or entire solution of. After Poincar, is called the Poincar equation and solutions of are called the Poincae functions. The next important step was made by Valiron, who investigated the case, where R(z) = P (z) is a polynomial, i.e. and obtained conditions for the existence of an entire solution f (z). Furthermore, he derived the following asymptotic formula for M(r) = max |z|≤r |f (z)|: Here Q(z) is a 1-periodic function bounded between two positive constants, = ln m ln || and m = deg P (z). Various aspects of the Poincare functions have been studied in the papers. Applications: diffusion on fractals In addition to, in applications (see Sections 4.4 and 4.5 above, in particular ) it is important to know asymptotics of entire solutions f (z) in certain angular regions and even on specific rays re i of the complex plane. In the following section we present some recent results in this direction ( ). Note, that in the aforementioned applications ( diffusion on fractals ) scaling factor is real and, also, polynomial P (z) has real coefficients. Nevertheless, we prefer to start our exposition in section 5.5 below from the general case and turn to the real case afterwards. We think that, these general facts on the Poincar equation are interesting in their own, and hope that, maybe, they will also find applications in the future. Asymptotics along spirals and asymptotics along rays Here we intend to describe further results of Valiron's type. We start our presentation from some of our recent results. It turns out that asymptotic behaviour of the Poincae functions heavily depends on the arithmetic nature of arg, where is the scaling factor in. Denote arg = 2. The following statement is true, for irrational ( ) : Theorem 5.1 If arg = 2 and is irrational, then f (z) is unbounded along any ray. Moreover, if we denote (z) = ln |f (z)| (where main branch of logarithm is taken) then there exists a sequence r n → ∞, such that the limit lim n→∞ (r n e i ) r n = L exists and L > 0. As far as we know this phenomenon has not been mentioned in the literature before. On the other hand, if is rational (and, in particular, if = 0, i.e. is real) f (z) may be bounded on some rays and even in whole sectors. Nevertheless, for rational, the limit still exists under some additional assumptions. Denote = t/s and suppose that t, s are relatively prime. Put q = s (note that 1 < q ∈ R). The following result is true for rational and, in particular, for real ( ): Theorem 5.2 Suppose that either || > m 2 or s > 2. Then f (z) is unbounded on any ray, and one can find a geometric progression r n = q n r 0, (r 0 > 0), for which the limit exists and L > 0. The above results are based on the following theorem on asymptotics of f (z) along spirals (geometric progressions) of the form z n = n z 0, where z 0 = r 0 e i 0 ∈ C will be specified below. Remark 5.1 Here we deal mainly with the asymptotics of entire solutions of However some statements are valid for arbitrary solutions of. In particular, for validity and no assumptions on the smoothness are needed. Asymptotics and dynamics in the real case. Properties of the Julia set Further refinements are possible when > 1 is real and P (z) = p m z m +... + p 1 z + p 0 is a polynomial with real coefficients. Without loss of generality we can assume also that: f = P = 0; P = > 1 and f = 1 For reader convenience, we recall now some basic notions from the iteration theory and complex dynamics. To make things shorter, we give here definitions which slightly differ from standard ones, but are equivalent to them in the polynomial case. That will suffice our needs, in what follows. We will especially need the component of ∞ of Fatou set F (P ) given by The filled Julia set is given by Now, according to one can define the Julia set J (p), as ∂K(P ) = ∂F ∞ (P ) = J (P ). In the case of polynomials this can be used as an equivalent definition of the Julia set. Let f (z) be an entire solution of. In contrast with the previous section (where asymptotics of |f (z)| is studied) here we collect some results on the asymptotics of the solution f (z) itself (in some angular regions of the complex plane). Our presentation is based on ( ). holds uniformly for z ∈ W −, where Q is a periodic holomorphic function of period 1 on the strip {w ∈ C | |ℑw| < log }. The real part of z Q( log z log ) is bounded between two positive constants; Q takes real values on the real axis. Remark 5.2 Notice that the condition on the Fatou component F ∞ is used in the proof of this theorem to ensure that f (z) tends to infinity in the angular region W. Therefore, this condition could be replaced by lim z→∞ f (z) = ∞ for | arg z| <. Yet a stronger result can be derived under the additional assumption that the Julia set J (P ) of polynomial P (z) is real (see Corollary 5.1, below). Remark 5.3 The latter assumption on the reality of J (P ) looks artificial at the first glance, but, in fact is typical in applications, related to the diffusion on fractals. The rough explanation of the latter fact is the following: The zeros of the solution f (z) for are eigenvalues of the infinitesimal generator of the diffusion, i.e. the "Laplacian on the fractal". The latter operator is self-adjoint, and its eigenvalues are real. Therefore zeros of f (z) are real and, finally, this implies that Julia set of polynomial P (z) should be real. This motivates our special interest for Poincar equations with polynomial P (z), having real Julia set. Corollary 5.1 ( ) Assume that P is a real polynomial such that J (P ) is real and all coefficients p i (i ≥ 2) of P are non-negative. Then J (P ) ⊂ R − ∪{0} and therefore for z → ∞ and | arg z| <. Here Q is a periodic function of period 1 holomorphic in the strip given by |ℑw| < log. Furthermore, for every > 0 the real part of z Q( log z log ) is bounded between two positive constants for | arg z| ≤ −. If P (z) is a quadratic polynomial ( a case, arising in numerous applications) it is possible to give an exact criterion for reality of J (P ): It would be interesting to find some constructive conditions for reality of J (P ) in terms of coefficients of P (at least for polynomial of small order in the beginning). Note also, that in the above Lemma |P | = a|| and m = deg P (z) = 2. Therefore can be rewritten in the form: It turns out that the necessity part of latter criterion (in the form ) is valid for general polynomial P, with real Julia set J (P ). Namely, the following result of Pommerenke-Levin-Eremenko-Yoccoz type (on inequalities for multipliers ) is true: Theorem 5.5 ( ) Let P be a polynomial of degree m > 1 with real Julia set J (P ). Then for any fixed point of P with min J (P ) < < max J (P ) we have |P ()| ≥ m. Furthermore, |P (min J (P ))| ≥ m 2 and |P (max J (P ))| ≥ m 2. Equality in one of these inequalities implies that P is linearly conjugate to the Chebyshev polynomial T m of degree m. Remark 5.4 This theorem can be compared to where inequalities (of the opposite direction ) for the multipliers of P with connected Julia sets were derived. In the foregoing we dealt mainly with the asymptotics of solutions for the polynomial Poincar equation, only. The study of the asymptotic behaviour of meromorphic solutions of the general Poincar equation where R(z) is rational function (rather than polynomial P (z)) still, to large extent, remains an open challenge.
|
package user
import (
"context"
"encoding/json"
"github.com/caos/zitadel/internal/eventstore"
"time"
"github.com/caos/zitadel/internal/crypto"
"github.com/caos/zitadel/internal/domain"
"github.com/caos/zitadel/internal/errors"
"github.com/caos/zitadel/internal/eventstore/repository"
)
const (
passwordEventPrefix = humanEventPrefix + "password."
HumanPasswordChangedType = passwordEventPrefix + "changed"
HumanPasswordCodeAddedType = passwordEventPrefix + "code.added"
HumanPasswordCodeSentType = passwordEventPrefix + "code.sent"
HumanPasswordCheckSucceededType = passwordEventPrefix + "check.succeeded"
HumanPasswordCheckFailedType = passwordEventPrefix + "check.failed"
)
type HumanPasswordChangedEvent struct {
eventstore.BaseEvent `json:"-"`
Secret *crypto.CryptoValue `json:"secret,omitempty"`
ChangeRequired bool `json:"changeRequired"`
UserAgentID string `json:"userAgentID,omitempty"`
}
func (e *HumanPasswordChangedEvent) Data() interface{} {
return e
}
func (e *HumanPasswordChangedEvent) UniqueConstraints() []*eventstore.EventUniqueConstraint {
return nil
}
func NewHumanPasswordChangedEvent(
ctx context.Context,
aggregate *eventstore.Aggregate,
secret *crypto.CryptoValue,
changeRequired bool,
userAgentID string,
) *HumanPasswordChangedEvent {
return &HumanPasswordChangedEvent{
BaseEvent: *eventstore.NewBaseEventForPush(
ctx,
aggregate,
HumanPasswordChangedType,
),
Secret: secret,
ChangeRequired: changeRequired,
UserAgentID: userAgentID,
}
}
func HumanPasswordChangedEventMapper(event *repository.Event) (eventstore.EventReader, error) {
humanAdded := &HumanPasswordChangedEvent{
BaseEvent: *eventstore.BaseEventFromRepo(event),
}
err := json.Unmarshal(event.Data, humanAdded)
if err != nil {
return nil, errors.ThrowInternal(err, "USER-4M0sd", "unable to unmarshal human password changed")
}
return humanAdded, nil
}
type HumanPasswordCodeAddedEvent struct {
eventstore.BaseEvent `json:"-"`
Code *crypto.CryptoValue `json:"code,omitempty"`
Expiry time.Duration `json:"expiry,omitempty"`
NotificationType domain.NotificationType `json:"notificationType,omitempty"`
}
func (e *HumanPasswordCodeAddedEvent) Data() interface{} {
return e
}
func (e *HumanPasswordCodeAddedEvent) UniqueConstraints() []*eventstore.EventUniqueConstraint {
return nil
}
func NewHumanPasswordCodeAddedEvent(
ctx context.Context,
aggregate *eventstore.Aggregate,
code *crypto.CryptoValue,
expiry time.Duration,
notificationType domain.NotificationType,
) *HumanPasswordCodeAddedEvent {
return &HumanPasswordCodeAddedEvent{
BaseEvent: *eventstore.NewBaseEventForPush(
ctx,
aggregate,
HumanPasswordCodeAddedType,
),
Code: code,
Expiry: expiry,
NotificationType: notificationType,
}
}
func HumanPasswordCodeAddedEventMapper(event *repository.Event) (eventstore.EventReader, error) {
humanAdded := &HumanPasswordCodeAddedEvent{
BaseEvent: *eventstore.BaseEventFromRepo(event),
}
err := json.Unmarshal(event.Data, humanAdded)
if err != nil {
return nil, errors.ThrowInternal(err, "USER-Ms90d", "unable to unmarshal human password code added")
}
return humanAdded, nil
}
type HumanPasswordCodeSentEvent struct {
eventstore.BaseEvent `json:"-"`
}
func (e *HumanPasswordCodeSentEvent) Data() interface{} {
return nil
}
func (e *HumanPasswordCodeSentEvent) UniqueConstraints() []*eventstore.EventUniqueConstraint {
return nil
}
func NewHumanPasswordCodeSentEvent(ctx context.Context, aggregate *eventstore.Aggregate) *HumanPasswordCodeSentEvent {
return &HumanPasswordCodeSentEvent{
BaseEvent: *eventstore.NewBaseEventForPush(
ctx,
aggregate,
HumanPasswordCodeSentType,
),
}
}
func HumanPasswordCodeSentEventMapper(event *repository.Event) (eventstore.EventReader, error) {
return &HumanPasswordCodeSentEvent{
BaseEvent: *eventstore.BaseEventFromRepo(event),
}, nil
}
type HumanPasswordCheckSucceededEvent struct {
eventstore.BaseEvent `json:"-"`
*AuthRequestInfo
}
func (e *HumanPasswordCheckSucceededEvent) Data() interface{} {
return e
}
func (e *HumanPasswordCheckSucceededEvent) UniqueConstraints() []*eventstore.EventUniqueConstraint {
return nil
}
func NewHumanPasswordCheckSucceededEvent(
ctx context.Context,
aggregate *eventstore.Aggregate,
info *AuthRequestInfo,
) *HumanPasswordCheckSucceededEvent {
return &HumanPasswordCheckSucceededEvent{
BaseEvent: *eventstore.NewBaseEventForPush(
ctx,
aggregate,
HumanPasswordCheckSucceededType,
),
AuthRequestInfo: info,
}
}
func HumanPasswordCheckSucceededEventMapper(event *repository.Event) (eventstore.EventReader, error) {
humanAdded := &HumanPasswordCheckSucceededEvent{
BaseEvent: *eventstore.BaseEventFromRepo(event),
}
err := json.Unmarshal(event.Data, humanAdded)
if err != nil {
return nil, errors.ThrowInternal(err, "USER-5M9sd", "unable to unmarshal human password check succeeded")
}
return humanAdded, nil
}
type HumanPasswordCheckFailedEvent struct {
eventstore.BaseEvent `json:"-"`
*AuthRequestInfo
}
func (e *HumanPasswordCheckFailedEvent) Data() interface{} {
return e
}
func (e *HumanPasswordCheckFailedEvent) UniqueConstraints() []*eventstore.EventUniqueConstraint {
return nil
}
func NewHumanPasswordCheckFailedEvent(
ctx context.Context,
aggregate *eventstore.Aggregate,
info *AuthRequestInfo,
) *HumanPasswordCheckFailedEvent {
return &HumanPasswordCheckFailedEvent{
BaseEvent: *eventstore.NewBaseEventForPush(
ctx,
aggregate,
HumanPasswordCheckFailedType,
),
AuthRequestInfo: info,
}
}
func HumanPasswordCheckFailedEventMapper(event *repository.Event) (eventstore.EventReader, error) {
humanAdded := &HumanPasswordCheckFailedEvent{
BaseEvent: *eventstore.BaseEventFromRepo(event),
}
err := json.Unmarshal(event.Data, humanAdded)
if err != nil {
return nil, errors.ThrowInternal(err, "USER-4m9fs", "unable to unmarshal human password check failed")
}
return humanAdded, nil
}
|
Teacher Qualifications and Middle School Student Achievement This research examines whether teacher licensure test scores and other teacher qualifications affect middle school student achievement. The results are based on longitudinal student-level data from Los Angeles. The achievement analysis uses a value-added approach that adjusts for both student and teacher fixed effects. The results show little relationship between traditional measures of teacher quality (e.g., experience and education level) and student achievement in reading or math. Similarly, licensure test scores in general aptitude, subject-matter knowledge, and reading pedagogy had no significant effects on student achievement. Teachers with elementary school credentials had slightly better success in the classroom than did teachers with secondary school credentials.
|
// NewLoggerErrorMock returns a mock for loggerError
func NewLoggerErrorMock(t minimock.Tester) *LoggerErrorMock {
m := &LoggerErrorMock{t: t}
if controller, ok := t.(minimock.MockController); ok {
controller.RegisterMocker(m)
}
m.ErrorMock = mLoggerErrorMockError{mock: m}
m.ErrorMock.callArgs = []*LoggerErrorMockErrorParams{}
return m
}
|
import { VirtualCode } from '../build-code/VirtualCode';
declare type ReconcileOptions = {
actualCode: string;
virtualCode: VirtualCode;
};
export declare class CodeReconciler {
_virtualCode: VirtualCode;
_insertNewLines({ actualCode, virtualCode }: ReconcileOptions): string;
_updateLastLine({ actualCode, virtualCode }: ReconcileOptions): string;
hasChanges(virtualCode: VirtualCode): boolean;
reconcile({ actualCode, virtualCode }: ReconcileOptions): string;
update(virtualCode: VirtualCode): void;
}
export {};
|
There will be no BlackBerry Live event in 2014 as the company streamlines resources into smaller events.
The company announced that it will not be hosting its annual BlackBerry Live event next year in an effort to "best meet our goals with BlackBerry events."
BlackBerry Live has been held since 2002. In place of the larger event, the company has promised to host a series of smaller events that focus on business, developer, and partner audiences.
It has been a difficult year for BlackBerry, with the company announcing larger than expected losses in the third-quarter of 2013. At US$4.4 billion, this was significantly higher than the company's second-quarter losses of US$965 million. A part of these losses can be attributed to the decline in handset sales during Q3, down to 1.9 million from 3.7 million in Q2.
Presumably in an effort to turn around the company's fortunes, BlackBerry also announced last week a five-year manufacturing and development contract with Foxconn to produce handsets.
|
Comparative analysis of short and long GPR pulses for landmine detection Ground Penetrating Radar (GPR) is one of the most popular subsurface sensing devices. It has a wide range of applications such as landmine detection, archeological investigations, road condition survey and so on. Hardware and software requirements of the GPR system are strongly dependent on type of applications. Principally, lower frequencies provide deeper penetration and low resolution, but higher frequencies are able to detect shallow objects with high resolution. As a fundamental design criterion, there is a trade-off between penetration depth and vertical resolution. In impulse radar, pulse duration (frequency related) is a key parameter because it affects the system detection performance. Specially, optimization of the pulse duration is a challenging problem for landmine detection because the GPR performance has been strongly affected from mine types, varying terrain and environmental conditions. In this work, two GPR systems with pulse durations of 650 ps and 870 ps are compared for evaluation of their detection performance. The pulses are tested with extensive data sets collected from different soil types by using surrogate mines and other objects. Receiver Operating Characteristic (ROC) curves of the system is also calculated. It seems that the 650 ps pulse duration gives better performance than the 870 ps pulse duration for the shallow landmine detection.
|
#pragma once
#include "OpenGL.h"
#include "Resource.h"
class RenderTextureMSAA : public Resource
{
public:
public:
RenderTextureMSAA();
~RenderTextureMSAA();
bool Create(uint width, uint height, int MSAA_level);
void Bind();
void Unbind();
void Render();
void ChangeMSAALevel(int MSAA_level);
void Destroy();
uint GetTextureID() const;
int GetMaxMSAALevel() const;
int GetCurrentMSAALevel() const;
void Save(Data& data) const;
bool Load(Data& data);
void CreateMeta() const;
void LoadToMemory();
void UnloadFromMemory();
uint GetWidth() const;
uint GetHeight() const;
uint GetFrameBufferID() const;
private:
uint fbo_id;
uint fbo_msaa_id;
uint texture_id;
uint rbo_id;
uint rbo_color_id;
uint rbo_depth_id;
uint width;
uint height;
int max_msaa_samples;
int current_msaa_samples;
};
|
/**
* Creates a sidebar spacer that will create a horizontally 7 pixel indentation.<P>
*/
public static JPanel
createSidebar()
{
JPanel spanel = new JPanel();
spanel.setName("Spacer");
spanel.setMinimumSize(new Dimension(7, 0));
spanel.setMaximumSize(new Dimension(7, Integer.MAX_VALUE));
spanel.setPreferredSize(new Dimension(7, 0));
return spanel;
}
|
/**
* Tests setting an exception behavior for the mock. The behavior of the test class should not have been invoked.
*/
@Test
public void testRaises() {
mockObject.raises(new ThreadDeath()).testMethod();
boolean exception = false;
try {
mockObject.getMock().testMethod();
} catch (ThreadDeath e) {
exception = true;
}
assertTrue(exception);
assertLenientEquals(0, TestClass.invocationCount);
}
|
"""
Buatlah program untuk mengurutkan daftar nama orang. Diinputkan 5 buah nama
orang. Outputkan nama-nama tersebut terurut secara leksikografis (terurut seperti di
kamus).
"""
def merge_sort_str(list_awal):
if len(list_awal) == 1:
return
tengah = len(list_awal) // 2
list_kiri = list_awal[:tengah]
list_kanan = list_awal[tengah:]
# Split and merge sort
merge_sort_str(list_kiri)
merge_sort_str(list_kanan)
# Merge
i = 0 # iterator untuk list_kiri
j = 0 # iterator untuk list_kanan
k = 0 # iterator untuk list_awal
l = 0 # iterator untuk char dalam list/string
while i < len(list_kiri) and j < len(list_kanan):
# Jika ada string dengan huruf yang sama
# cari indeks sampai hurufnya berbeda
while (l < (len(list_kiri[i]) - 1) and
l < (len(list_kanan[j]) - 1) and
list_kiri[i][l] == list_kanan[j][l]):
l += 1
# Jika ternyata masih sama juga, string yang memiliki
# panjang lebih pendek akan memiliki kedudukan yang lebih tinggi
# if list_kiri[i][l] == list_kanan[j][l]:
# if len(list_kiri[i]) < len(list_kanan[j]):
# list_awal[k] = list_kiri[i]
# i += 1
# else:
# list_awal[k] = list_kanan[j]
# j += 1
# k += 1
# l = 0
# continue
if ((list_kiri[i][l] == list_kanan[j][l] and
len(list_kiri[i]) < len(list_kanan[j])) or
list_kiri[i][l] < list_kanan[j][l]):
list_awal[k] = list_kiri[i]
i += 1
else:
list_awal[k] = list_kanan[j]
j += 1
k += 1
l = 0 # Set balik l ke 0
# Sisanya
while i < len(list_kiri):
list_awal[k] = list_kiri[i]
i += 1
k += 1
while j < len(list_kanan):
list_awal[k] = list_kanan[j]
j += 1
k += 1
nama_str_list = []
for i in range(5):
nama_str_list.append(input())
merge_sort_str(nama_str_list)
for nama in nama_str_list:
print(nama)
|
Risk Factors for Prolonged Opioid Use Following Total Hip Arthroplasty and Total Knee Arthroplasty: A Narrative Review of Recent Literature. OBJECTIVE To provide pharmacists and other health care professionals with the knowledge required to minimize the risk of prolonged opioid use following total hip arthroplasty (THA) and total knee arthroplasty (TKA). DATA SOURCES A literature search of PubMed and Embase was performed, and included the search terms: (opioid OR opiate OR opium) AND (risk factor OR predict*) AND (arthroplasty OR replacement) NOT shoulder. STUDY SELECTION AND DATA EXTRACTION Randomized control trials, cohort studies (both prospective and retrospective), systematic reviews, and meta-analyses were included if risk ratios (RRs) or odds ratios (ORs) were reported and published within the last 5 years. DATA SYNTHESIS ]Twenty studies met inclusion criteria, including 2 meta-analyses and 2 prospective studies. There were several risk factors that overlapped between studies and presented clinically significant risks for prolonged opioid use following THA and TKA surgery. Of these, age < 65 (RRs: 1.15-9.36), preoperative opioid use (RRs: 1.09-7.81), larger quantities of opioids prescribed at discharge (RRs: 1.26-8.81), and TKA surgery (RRs: 1.73-6.07) were the most significant. Several risk factors were recently described, including migraines (RRs: 1.14-5.11) and fibromyalgia (RRs: 1.1-2.3) that may be of interest for further research. RELEVANCE TO PATIENT CARE AND CLINICAL PRACTICE This review presents a discussion of the factors associated with prolonged opioid use following THA and TKA surgeries, which are among the most common orthopedic surgeries. CONCLUSIONS Prescribers should carefully consider patient-specific factors when prescribing opioids as there are several factors, including age, surgery type, and medical conditions that can predispose patients to prolonged opioid use.
|
<filename>Window.cpp
#include "Window.h"
using namespace Window;
SDLWindow::SDLWindow()
{
LOG_INFO("Initializing SDL2:\n");
if (SDL_Init(SDL_INIT_VIDEO) != 0)
{
LOG_ERROR("SDL_Init Failed\n", SDL_GetError(), "\n");
}
LOG_INFO("Setting up OpenGL context\n");
SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_CORE);
SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
// OpenGL Version 3.3 Core
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 3);
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 3);
// RGBA8888 + Depth24 Framebuffer
SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 8);
SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 8);
SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, 8);
SDL_GL_SetAttribute(SDL_GL_ALPHA_SIZE, 8);
SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 24);
// 4x MSAA Anti-Aliasing
SDL_GL_SetAttribute(SDL_GL_MULTISAMPLEBUFFERS, 1);
SDL_GL_SetAttribute(SDL_GL_MULTISAMPLESAMPLES, 4);
LOG_INFO("Creating a window\n");
window = SDL_CreateWindow
(
"Rachit's Engine", SDL_WINDOWPOS_UNDEFINED,
SDL_WINDOWPOS_UNDEFINED, DIMENSIONS.x, DIMENSIONS.y, SDL_WINDOW_FLAGS
);
if (window == nullptr)
{
LOG_ERROR("SDL_CreateWindow Failed\n", SDL_GetError(), "\n");
}
// For sanity, raise window
SDL_RaiseWindow(window);
SDL_ShowCursor(SDL_FALSE);
SDL_SetRelativeMouseMode(SDL_TRUE);
g_Keys = SDL_GetKeyboardState(nullptr);
// Basically useless GLContext
// You don't get more than GL 1.1 for compatibilty reasons (Windows YOU SUCK)
glContext = SDL_GL_CreateContext(window);
if (glContext == nullptr)
{
LOG_ERROR("SDL_GL_CreateContext Failed\n", SDL_GetError(), "\n");
}
if (SDL_GL_MakeCurrent(window, glContext) != 0)
{
LOG_ERROR("SDL_GL_MakeCurrent Failed\n", SDL_GetError(), "\n");
}
// Initialize the REAL OpenGL context
// Due to a bug in glew, set it to experimental mode
glewExperimental = GL_TRUE;
if (glewInit() != GLEW_OK)
{
LOG_ERROR("glewInit Failed\n");
}
IMGUI_CHECKVERSION();
ImGui::CreateContext();
UNUSED ImGuiIO& io = ImGui::GetIO();
ImGui::StyleColorsDark();
ImGui_ImplSDL2_InitForOpenGL(window, glContext);
ImGui_ImplOpenGL3_Init("#version 330 core");
Files::SetResourceDirectory("../res/");
InitGL();
}
bool SDLWindow::PollEvents()
{
while (SDL_PollEvent(&event))
{
ImGui_ImplSDL2_ProcessEvent(&event);
switch (event.type)
{
case SDL_QUIT:
return true;
case SDL_KEYDOWN:
switch (event.key.keysym.scancode)
{
case SDL_SCANCODE_F1:
if (isInputCaptured)
{
SDL_SetRelativeMouseMode(SDL_FALSE);
isInputCaptured = !isInputCaptured;
}
else
{
SDL_SetRelativeMouseMode(SDL_TRUE);
isInputCaptured = !isInputCaptured;
}
break;
default:
break;
}
break;
case SDL_MOUSEWHEEL:
Inputs::SetMouseScroll(glm::ivec2(event.wheel.x, event.wheel.y));
g_ToZoomCamera = true;
break;
case SDL_MOUSEMOTION:
Inputs::SetMousePos(glm::ivec2(event.motion.xrel, event.motion.yrel));
g_ToMoveCamera = true;
break;
default:
break;
}
}
return false;
}
void SDLWindow::InitGL()
{
glViewport(0, 0, DIMENSIONS.x, DIMENSIONS.y);
glEnable(GL_MULTISAMPLE);
glEnable(GL_DEPTH_TEST);
glEnable(GL_CULL_FACE);
glCullFace(GL_BACK);
}
SDLWindow::~SDLWindow()
{
LOG_INFO("Quiting SDL2\n");
ImGui_ImplOpenGL3_Shutdown();
ImGui_ImplSDL2_Shutdown();
ImGui::DestroyContext();
SDL_GL_DeleteContext(glContext);
SDL_DestroyWindow(window);
SDL_Quit();
}
|
<reponame>zhoub/dldt<filename>inference-engine/src/inference_engine/ie_data.cpp
// Copyright (C) 2018-2019 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//
#include "ie_layers.h"
#include "ie_data.h"
#include "blob_factory.hpp"
#include <memory>
#include <string>
#include <map>
using namespace InferenceEngine;
Blob::Ptr Blob::CreateFromData(const DataPtr &data) {
return CreateBlobFromData(data);
}
IE_SUPPRESS_DEPRECATED_START
Data::Data(const std::string &name, Precision _precision, Layout layout): precision(_precision), layout(layout),
name(name), userObject({0}),
tensorDesc(_precision, layout) {}
Data::Data(const std::string &name, const SizeVector &a_dims, Precision _precision, Layout layout)
: precision(_precision), layout(layout), dims(a_dims), name(name), userObject({0}),
tensorDesc(_precision, a_dims, layout) {
SizeVector tensorDims = a_dims;
std::reverse(tensorDims.begin(), tensorDims.end());
tensorDesc = TensorDesc(_precision, tensorDims, layout);
}
Data::Data(const std::string &name, const TensorDesc &desc): tensorDesc(desc), precision(desc.getPrecision()),
layout(desc.getLayout()), dims(desc.getDims()),
name(name), userObject({0}) {
std::reverse(dims.begin(), dims.end());
}
Data::Data(const Data & data) :
precision(data.precision),
layout(data.layout),
dims(data.dims),
creatorLayer(data.creatorLayer),
name(data.name),
inputTo(data.inputTo),
userObject(data.userObject),
tensorDesc(data.tensorDesc) {
}
Data::~Data() {
}
Data & Data::operator = (const Data & data) {
if (this != &data) {
precision = data.precision;
layout = data.layout;
dims = data.dims;
creatorLayer = data.creatorLayer;
name = data.name;
inputTo = data.inputTo;
userObject = data.userObject;
tensorDesc = data.tensorDesc;
}
return *this;
}
const Precision& Data::getPrecision() const {
if (precision)
return precision;
return tensorDesc.getPrecision();
}
const TensorDesc& Data::getTensorDesc() const {
if ((tensorDesc.getDims().size() == 0 && tensorDesc.getDims() != dims) ||
(tensorDesc.getLayout() == Layout::ANY && layout != Layout::ANY) ||
(!tensorDesc.getPrecision() && precision)) {
THROW_IE_EXCEPTION << "Tensor descriptor is empty!";
}
if (precision && tensorDesc.getPrecision() != precision) {
tensorDesc.setPrecision(precision);
}
return tensorDesc;
}
bool Data::isInitialized() const {
return !dims.empty() || !tensorDesc.getDims().empty() || layout == SCALAR;
}
void Data::setDims(const SizeVector &a_dims) {
dims = a_dims;
std::reverse(dims.begin(), dims.end());
tensorDesc.setDims(a_dims);
}
void Data::setBatchSize(size_t batch_size) {
if (dims.empty()) {
dims = tensorDesc.getDims();
std::reverse(dims.begin(), dims.end());
}
if (dims.empty())
return;
dims.at(dims.size() - 1) = batch_size;
SizeVector normalDims = dims;
std::reverse(normalDims.begin(), normalDims.end());
tensorDesc.setDims(normalDims);
}
void Data::setLayout(Layout layout) {
tensorDesc.setLayout(layout);
this->layout = layout;
}
void Data::reshape(const SizeVector &a_dims, Layout a_layout) {
dims = a_dims;
layout = a_layout;
std::reverse(dims.begin(), dims.end());
tensorDesc.reshape(a_dims, layout);
}
CNNLayerWeakPtr &Data::getCreatorLayer() {
return creatorLayer;
}
const std::string &Data::getName() const {
return name;
}
void Data::setName(const std::string& newName) {
name = newName;
}
std::map<std::string, CNNLayerPtr> &Data::getInputTo() {
return inputTo;
}
const UserValue& Data::getUserObject() const {
return userObject;
}
Layout Data::getLayout() const {
if (tensorDesc.getLayout() == Layout::ANY && layout != Layout::ANY)
return layout;
return tensorDesc.getLayout();
}
void Data::setPrecision(const Precision & precision) {
this->precision = precision;
tensorDesc.setPrecision(precision);
}
IE_SUPPRESS_DEPRECATED_END
const SizeVector& Data::getDims() const {
return tensorDesc.getDims();
}
|
Incidence and Risk Factors of Neurological Deficits of Surgical Correction for Scoliosis: Analysis of 1373 Cases at One Chinese Institution Study Design. A retrospective study. Objective. To investigate the incidence of neurologic deficits after scoliosis correction at 1 institution and identify the risk factors for such deficits in scoliosis correction. Summary of Background Data. Neurologic deficit is one of the risks of surgical correction of scoliosis. Reports of the incidence of the neurologic deficits involving a large number of cases at 1 institution are rare. Methods. Statistical analysis of the neurologic deficits was performed in 1373 scoliosis cases treated at 1 institution by etiologies in light of the patients' sex, age, sagittal profile, surgical approach, Cobb's angle, and the type of surgery. Results. The total incidence of neurologic deficits was 1.89% and that of serious and mild ones was 0.51% and 1.38%, respectively. The total incidence of neurologic deficits were 1.06% in adolescent idiopathic scoliosis patients and 2.89% in congenital scoliosis (CS) patients, 3.32% in scoliosis patients with hyperkyphosis (>40°) and 1.38% in those without hyperkyphosis, 3.43% for combined procedures and 1.24% for single posterior procedures, 3.69% in patients with Cobb's angle more than 90° and 1.45% in those with an angle less than 90°, 1.68% with primary surgery and 5.97% with revision surgery, the difference between them was significant (P < 0.05). In adolescent idiopathic scoliosis patients, the incidence were 3.85% for combined procedures and 0.64% for posterior procedure, 0.82% with primary surgery and 8.33% with revision surgery, 4.17% with hyperkyphosis and 0.61% without hyperkyphosis, the difference between them was significant (P < 0.05). The incidence of CS patients with Cobb's angle more or less than 90° were 7.23% and 1.68% and the difference was significant (P < 0.05). Conclusion. In surgical correction of scoliosis, the risk factors for neurologic deficits include CS, scoliosis with hyperkyphosis, scoliosis correction by combined procedures, scoliosis with a Cobb's angle more than 90°, and a revision surgery.
|
<reponame>SilasDerProfi/termine-granger
import { Injectable } from "@angular/core";
import { Subject } from "rxjs";
import { Task } from "../data/task";
@Injectable({
providedIn: "root",
})
export class GlobalTaskUpdateService {
private taskSubject = new Subject<Task>();
publish(task: Task) {
this.taskSubject.next(task);
}
getObservable(): Subject<Task> {
return this.taskSubject;
}
}
|
package io.github.cloudadc;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.nio.file.StandardOpenOption;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Stream;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class Main implements CommandLineRunner {
static final String VS_DEL = "tmsh delete ltm virtual REPLACE_VS";
static final String VS_CRE_TCP = "tmsh create ltm virtual REPLACE_VS_NAME destination REPLACE_VS_IP:any ip-protocol tcp rules { REPLACE_VLAN_tcp.tcl } source-address-translation { type automap } ";
static final String VS_CRE_UDP = "tmsh create ltm virtual REPLACE_VS_NAME destination REPLACE_VS_IP:any ip-protocol udp rules { REPLACE_VLAN_udp.tcl } source-address-translation { type automap }";
static final String VS_CRE_HTTP = "tmsh create ltm virtual REPLACE_VS_NAME destination REPLACE_VS_DESTINATION ip-protocol tcp rules { REPLACE_VLAN_http.tcl } profiles add { http} source-address-translation { type automap }";
static final String VS_CRE_NET_TCP = "tmsh create ltm virtual REPLACE_VS_NAME destination REPLACE_VS_IP:any mask 255.255.255.0 ip-protocol tcp rules { REPLACE_VLAN_tcp.tcl } source-address-translation { type automap } ";
static final String VS_CRE_NET_UDP = "tmsh create ltm virtual REPLACE_VS_NAME destination REPLACE_VS_IP:any mask 255.255.255.0 ip-protocol udp rules { REPLACE_VLAN_udp.tcl } source-address-translation { type automap }";
static final String VS_CRE_NET_HTTP = "tmsh create ltm virtual REPLACE_VS_NAME destination REPLACE_VS_DESTINATION mask 255.255.255.0 ip-protocol tcp rules { REPLACE_VLAN_http.tcl } profiles add { http} source-address-translation { type automap }";
static final String VLAN_CRE = "tmsh create net vlan REPLACE_VLAN_NAME tag REPLACE_TAG interfaces add { REPLACE_INTERFACE { tagged } }";
static final String VLAN_SELF_IP_CRE = "tmsh create net self REPLACE_SELF_IP address REPLACE_SELF_IP/24 vlan REPLACE_VLAN_NAME allow-service default";
static final String POOL_CRE = "tmsh create ltm pool REPLACE_VLAN_risk_pool members add { REPLACE_RISK_IP:any { address REPLACE_RISK_IP } }";
public static void main(String[] args) {
// args = new String[] {
// "--ips", "10.36.222.0/24",
// "--self", "10.36.222.120",
// "--vlan", "vlan_222",
// "--netface", "1.3",
// "--vlanTag", "222",
// "--isForwardHighRisk", "true",
// "--highRiskIps", "10.36.222.135"};
SpringApplication.run(Main.class, args);
}
@Override
public void run(String... args) throws Exception {
String ips = null;
String vlan = null;
String selfIP = null;
String netface = null;
String vlanTag = null;
boolean isForwardHighRisk = false;
String highRiskIps = null;
for(int i = 0 ; i < args.length ; i++) {
if(args[i].equals("--ips")) {
ips = args[++i];
} else if(args[i].equals("--self")) {
selfIP = args[++i];
} else if(args[i].equals("--vlan")) {
vlan = args[++i];
} else if(args[i].equals("--isForwardHighRisk")) {
isForwardHighRisk = Boolean.valueOf(args[++i]);
} else if(args[i].equals("--netface")) {
netface = args[++i];
} else if(args[i].equals("--highRiskIps")) {
highRiskIps = args[++i];
} else if(args[i].equals("--vlanTag")) {
vlanTag = args[++i];
}
}
if(null == ips || null == vlan || null == netface || null == selfIP || vlanTag == null) {
StringBuffer sb = new StringBuffer();
sb.append("Invalid args").append("\n");
sb.append("Run with: --ips [IP List]").append("\n");
sb.append(" --self [Self IP]").append("\n");
sb.append(" --vlan [Vlan name]").append("\n");
sb.append(" --netface [1.0/2.0/3.0]").append("\n");
sb.append(" --vlanTag [vlan tag id]").append("\n");
sb.append(" --isForwardHighRisk [true/false]").append("\n");
sb.append(" --highRiskIps [High Risk forward IP]").append("\n");
throw new IllegalArgumentException(sb.toString());
}
String vlan_self_sh = vlan + "_self.sh";
String vlan_honeypot_sh = vlan + "_honeypot.sh";
String vlan_highriskpool_sh = vlan + "_highriskpool.sh";
Files.deleteIfExists(Paths.get(vlan_self_sh));
Files.deleteIfExists(Paths.get(vlan_honeypot_sh));
Files.deleteIfExists(Paths.get(vlan_highriskpool_sh));
Files.createFile(Paths.get(vlan_self_sh));
Files.createFile(Paths.get(vlan_honeypot_sh));
Files.createFile(Paths.get(vlan_highriskpool_sh));
String vlanStr = VLAN_CRE.replaceAll("REPLACE_VLAN_NAME", vlan);
vlanStr = vlanStr.replaceAll("REPLACE_TAG", vlanTag);
vlanStr = vlanStr.replaceAll("REPLACE_INTERFACE", netface);
Files.write(Paths.get(vlan_self_sh), vlanStr.getBytes(), StandardOpenOption.APPEND);
Files.write(Paths.get(vlan_self_sh), "\n".getBytes(), StandardOpenOption.APPEND);
String selfStr = VLAN_SELF_IP_CRE.replaceAll("REPLACE_SELF_IP", selfIP);
selfStr = selfStr.replaceAll("REPLACE_VLAN_NAME", vlan);
Files.write(Paths.get(vlan_self_sh), selfStr.getBytes(), StandardOpenOption.APPEND);
Files.write(Paths.get(vlan_self_sh), "\n".getBytes(), StandardOpenOption.APPEND);
System.out.println(" Generated " + vlan_self_sh);
if(isForwardHighRisk && highRiskIps != null) {
String poolStr = POOL_CRE.replaceAll("REPLACE_VLAN", vlan);
poolStr = poolStr.replaceAll("REPLACE_RISK_IP", highRiskIps);
Files.write(Paths.get(vlan_highriskpool_sh), poolStr.getBytes(), StandardOpenOption.APPEND);
System.out.println(" Generated " + vlan_highriskpool_sh);
}
final IPEntity entity = format(vlan, ips);
entity.getIps().forEach(ip -> {
String rule_tcp_name = entity.getVlan() + "_" + ip + "_tcp";
String rule_udp_name = entity.getVlan() + "_" + ip + "_udp";
String rule_http_80_name = entity.getVlan() + "_" + ip + "_80_http";
String rule_http_8080_name = entity.getVlan() + "_" + ip + "_8080_http";
rule_tcp_name = rule_tcp_name.replaceAll("/", "_");
rule_udp_name = rule_udp_name.replaceAll("/", "_");
rule_http_80_name = rule_http_80_name.replaceAll("/", "_");
rule_http_8080_name = rule_http_8080_name.replaceAll("/", "_");
String vs_cre_tcp = VS_CRE_TCP.replaceAll("REPLACE_VS_NAME", rule_tcp_name);
vs_cre_tcp = vs_cre_tcp.replaceAll("REPLACE_VS_IP", ip);
vs_cre_tcp = vs_cre_tcp.replaceAll("REPLACE_VLAN", entity.getVlan());
String vs_cre_udp = VS_CRE_UDP.replaceAll("REPLACE_VS_NAME", rule_udp_name);
vs_cre_udp = vs_cre_udp.replace("REPLACE_VS_IP", ip);
vs_cre_udp = vs_cre_udp.replaceAll("REPLACE_VLAN", entity.getVlan());
String vs_cre_http_80 = VS_CRE_HTTP.replaceAll("REPLACE_VS_NAME", rule_http_80_name);
vs_cre_http_80 = vs_cre_http_80.replace("REPLACE_VS_DESTINATION", ip + ":80");
vs_cre_http_80 = vs_cre_http_80.replaceAll("REPLACE_VLAN", entity.getVlan());
String vs_cre_http_8080 = VS_CRE_HTTP.replaceAll("REPLACE_VS_NAME", rule_http_8080_name);
vs_cre_http_8080 = vs_cre_http_8080.replace("REPLACE_VS_DESTINATION", ip + ":8080");
vs_cre_http_8080 = vs_cre_http_8080.replaceAll("REPLACE_VLAN", entity.getVlan());
if(entity.isCNet()) {
vs_cre_tcp = VS_CRE_NET_TCP.replaceAll("REPLACE_VS_NAME", rule_tcp_name);
vs_cre_tcp = vs_cre_tcp.replaceAll("REPLACE_VS_IP", ip);
vs_cre_tcp = vs_cre_tcp.replaceAll("REPLACE_VLAN", entity.getVlan());
vs_cre_udp = VS_CRE_NET_UDP.replaceAll("REPLACE_VS_NAME", rule_udp_name);
vs_cre_udp = vs_cre_udp.replace("REPLACE_VS_IP", ip);
vs_cre_udp = vs_cre_udp.replaceAll("REPLACE_VLAN", entity.getVlan());
vs_cre_http_80 = VS_CRE_NET_HTTP.replaceAll("REPLACE_VS_NAME", rule_http_80_name);
vs_cre_http_80 = vs_cre_http_80.replace("REPLACE_VS_DESTINATION", ip + ":80");
vs_cre_http_80 = vs_cre_http_80.replaceAll("REPLACE_VLAN", entity.getVlan());
vs_cre_http_8080 = VS_CRE_NET_HTTP.replaceAll("REPLACE_VS_NAME", rule_http_8080_name);
vs_cre_http_8080 = vs_cre_http_8080.replace("REPLACE_VS_DESTINATION", ip + ":8080");
vs_cre_http_8080 = vs_cre_http_8080.replaceAll("REPLACE_VLAN", entity.getVlan());
}
try {
Files.write(Paths.get(vlan_honeypot_sh), vs_cre_tcp.getBytes(), StandardOpenOption.APPEND);
Files.write(Paths.get(vlan_honeypot_sh), "\n".getBytes(), StandardOpenOption.APPEND);
Files.write(Paths.get(vlan_honeypot_sh), vs_cre_udp.getBytes(), StandardOpenOption.APPEND);
Files.write(Paths.get(vlan_honeypot_sh), "\n".getBytes(), StandardOpenOption.APPEND);
Files.write(Paths.get(vlan_honeypot_sh), vs_cre_http_80.getBytes(), StandardOpenOption.APPEND);
Files.write(Paths.get(vlan_honeypot_sh), "\n".getBytes(), StandardOpenOption.APPEND);
Files.write(Paths.get(vlan_honeypot_sh), vs_cre_http_8080.getBytes(), StandardOpenOption.APPEND);
Files.write(Paths.get(vlan_honeypot_sh), "\n".getBytes(), StandardOpenOption.APPEND);
} catch (IOException e) {
e.printStackTrace();
}
});
System.out.println(" Generated " + vlan_honeypot_sh);
}
private IPEntity format(String vlan, String line) {
String ips = line.trim();
if(ips.endsWith("/24")) {
IPEntity entity = new IPEntity();
entity.setVlan(vlan);
entity.setCNet(true);
List<String> iplist = new ArrayList<>();
iplist.add(ips.substring(0, ips.length() - 3));
entity.setIps(iplist);
return entity;
} else {
String[] arrOfIps = ips.split("\\.");
String ipPre = arrOfIps[0] + "." + arrOfIps[1] + "." + arrOfIps[2] + ".";
String subIps = arrOfIps[3];
String[] arrOfSubIps = subIps.split("\\|");
List<String> iplist = new ArrayList<>();
for(String arr : arrOfSubIps) {
iplist.add(ipPre + arr);
}
IPEntity entity = new IPEntity();
entity.setIps(iplist);
entity.setVlan(vlan);
return entity;
}
}
protected void test(String[] args) throws IOException {
String ipsmap = null;
String selpipmap = null;
String placeHolder = null;
for(int i = 0 ; i < args.length ; i++) {
if(args[i].equals("--ips") || args[i].equals("-i")) {
ipsmap = args[++i];
} else if(args[i].equals("--self") || args[i].equals("-s")) {
selpipmap = args[++i];
} else if(args[i].equals("--placeHolder")) {
placeHolder = args[++i];
}
}
if(ipsmap != null && Files.exists(Paths.get(ipsmap))) {
Map<String, List<String>> map = new HashMap<>();
try (Stream<String> stream = Files.lines(Paths.get(ipsmap))) {
stream.forEach(line -> {
String[] arrOfStr = line.split(" ");
String vs = arrOfStr[1].trim();
String ips = arrOfStr[0].trim();
String[] arrOfIps = ips.split("\\.");
String ipPre = arrOfIps[0] + "." + arrOfIps[1] + "." + arrOfIps[2] + ".";
String subIps = arrOfIps[3];
String[] arrOfSubIps = subIps.split("\\|");
List<String> iplist = map.get(vs);
if(null == iplist) {
iplist = new ArrayList<>();
}
for(String arr : arrOfSubIps) {
iplist.add(ipPre + arr);
}
map.put(vs, iplist);
});
}
Files.deleteIfExists(Paths.get("tmsh.create.sh"));
Files.deleteIfExists(Paths.get("tmsh.delete.sh"));
Files.createFile(Paths.get("tmsh.create.sh"));
Files.createFile(Paths.get("tmsh.delete.sh"));
map.keySet().forEach(vs -> {
for (int i = 0 ; i < map.get(vs).size() ; i ++) {
String rule_tcp_name = vs + "_" + map.get(vs).get(i) + "_tcp";
String rule_udp_name = vs + "_" + map.get(vs).get(i) + "_udp";
String rule_http_80_name = vs + "_" + map.get(vs).get(i) + "_80_http";
String rule_http_8080_name = vs + "_" + map.get(vs).get(i) + "_8080_http";
rule_tcp_name = rule_tcp_name.replaceAll("/", "_");
rule_udp_name = rule_udp_name.replaceAll("/", "_");
rule_http_80_name = rule_http_80_name.replaceAll("/", "_");
rule_http_8080_name = rule_http_8080_name.replaceAll("/", "_");
String vs_del_tcp = VS_DEL.replaceAll("REPLACE_VS", rule_tcp_name);
String vs_del_udp = VS_DEL.replaceAll("REPLACE_VS", rule_udp_name);
String vs_del_http_80 = VS_DEL.replaceAll("REPLACE_VS", rule_http_80_name);
String vs_del_http_8080 = VS_DEL.replaceAll("REPLACE_VS", rule_http_8080_name);
String vs_cre_tcp = VS_CRE_TCP.replaceAll("REPLACE_VS_NAME", rule_tcp_name);
vs_cre_tcp = vs_cre_tcp.replaceAll("REPLACE_VS_IP", map.get(vs).get(i));
String vs_cre_udp = VS_CRE_UDP.replaceAll("REPLACE_VS_NAME", rule_udp_name);
vs_cre_udp = vs_cre_udp.replace("REPLACE_VS_IP", map.get(vs).get(i));
String vs_cre_http_80 = VS_CRE_HTTP.replaceAll("REPLACE_VS_NAME", rule_http_80_name);
vs_cre_http_80 = vs_cre_http_80.replace("REPLACE_VS_DESTINATION", map.get(vs).get(i) + ":80");
String vs_cre_http_8080 = VS_CRE_HTTP.replaceAll("REPLACE_VS_NAME", rule_http_8080_name);
vs_cre_http_8080 = vs_cre_http_8080.replace("REPLACE_VS_DESTINATION", map.get(vs).get(i) + ":8080");
try {
Files.write(Paths.get("tmsh.create.sh"), vs_cre_tcp.getBytes(), StandardOpenOption.APPEND);
Files.write(Paths.get("tmsh.create.sh"), "\n".getBytes(), StandardOpenOption.APPEND);
Files.write(Paths.get("tmsh.create.sh"), vs_cre_udp.getBytes(), StandardOpenOption.APPEND);
Files.write(Paths.get("tmsh.create.sh"), "\n".getBytes(), StandardOpenOption.APPEND);
Files.write(Paths.get("tmsh.create.sh"), vs_cre_http_80.getBytes(), StandardOpenOption.APPEND);
Files.write(Paths.get("tmsh.create.sh"), "\n".getBytes(), StandardOpenOption.APPEND);
Files.write(Paths.get("tmsh.create.sh"), vs_cre_http_8080.getBytes(), StandardOpenOption.APPEND);
Files.write(Paths.get("tmsh.create.sh"), "\n".getBytes(), StandardOpenOption.APPEND);
Files.write(Paths.get("tmsh.delete.sh"), vs_del_tcp.getBytes(), StandardOpenOption.APPEND);
Files.write(Paths.get("tmsh.delete.sh"), "\n".getBytes(), StandardOpenOption.APPEND);
Files.write(Paths.get("tmsh.delete.sh"), vs_del_udp.getBytes(), StandardOpenOption.APPEND);
Files.write(Paths.get("tmsh.delete.sh"), "\n".getBytes(), StandardOpenOption.APPEND);
Files.write(Paths.get("tmsh.delete.sh"), vs_del_http_80.getBytes(), StandardOpenOption.APPEND);
Files.write(Paths.get("tmsh.delete.sh"), "\n".getBytes(), StandardOpenOption.APPEND);
Files.write(Paths.get("tmsh.delete.sh"), vs_del_http_8080.getBytes(), StandardOpenOption.APPEND);
Files.write(Paths.get("tmsh.delete.sh"), "\n".getBytes(), StandardOpenOption.APPEND);
} catch (IOException e) {
e.printStackTrace();
}
}
});
System.out.println("Generated bash 'tmsh.create.sh'");
System.out.println("Generated bash 'tmsh.delete.sh'");
} else {
throw new IllegalArgumentException("The '--ips' or '-i' argument should point to a file that contains ips and vs name mapping");
}
if(selpipmap != null && Files.exists(Paths.get(selpipmap))) {
Map<String, List<NetInterFace>> map = new HashMap<>();
try (Stream<String> stream = Files.lines(Paths.get(selpipmap))) {
stream.forEach(line -> {
String[] arrOfStr = line.split(" ");
NetInterFace net = new NetInterFace(arrOfStr[0], arrOfStr[1], arrOfStr[2], arrOfStr[3]);
List<NetInterFace> list = map.get(net.getVlan());
if (list == null) {
list = new ArrayList<>();
map.put(net.getVlan(), list);
}
list.add(net);
});
}
Files.deleteIfExists(Paths.get("self.create.sh"));
Files.deleteIfExists(Paths.get("self.delete.sh"));
Files.createFile(Paths.get("self.create.sh"));
map.keySet().forEach(vlan -> {
List<NetInterFace> list = map.get(vlan);
if(list.size() > 1) {
String vlanStr = VLAN_CRE.replaceAll("REPLACE_VLAN_NAME", list.get(0).getVlan());
vlanStr = vlanStr.replaceAll("REPLACE_TAG", list.get(0).getTag());
vlanStr = vlanStr.replaceAll("REPLACE_INTERFACE", list.get(0).getInter());
try {
Files.write(Paths.get("self.create.sh"), vlanStr.getBytes(), StandardOpenOption.APPEND);
Files.write(Paths.get("self.create.sh"), "\n".getBytes(), StandardOpenOption.APPEND);
for(int i = 0 ; i < list.size() ; i ++) {
String selfStr = VLAN_SELF_IP_CRE.replaceAll("REPLACE_SELF_IP", list.get(i).getIp());
selfStr = selfStr.replaceAll("REPLACE_VLAN_NAME", list.get(i).getVlan());
Files.write(Paths.get("self.create.sh"), selfStr.getBytes(), StandardOpenOption.APPEND);
Files.write(Paths.get("self.create.sh"), "\n".getBytes(), StandardOpenOption.APPEND);
}
} catch (IOException e) {
e.printStackTrace();
}
//TODO need fix the multiple item
} else {
String vlanStr = VLAN_CRE.replaceAll("REPLACE_VLAN_NAME", list.get(0).getVlan());
vlanStr = vlanStr.replaceAll("REPLACE_TAG", list.get(0).getTag());
vlanStr = vlanStr.replaceAll("REPLACE_INTERFACE", list.get(0).getInter());
String selfStr = VLAN_SELF_IP_CRE.replaceAll("REPLACE_SELF_IP", list.get(0).getIp());
selfStr = selfStr.replaceAll("REPLACE_VLAN_NAME", list.get(0).getVlan());
try {
Files.write(Paths.get("self.create.sh"), vlanStr.getBytes(), StandardOpenOption.APPEND);
Files.write(Paths.get("self.create.sh"), "\n".getBytes(), StandardOpenOption.APPEND);
Files.write(Paths.get("self.create.sh"), selfStr.getBytes(), StandardOpenOption.APPEND);
Files.write(Paths.get("self.create.sh"), "\n".getBytes(), StandardOpenOption.APPEND);
} catch (IOException e) {
e.printStackTrace();
}
}
});
System.out.println("Generated bash 'self.create.sh'");
}
}
}
|
<gh_stars>0
#include <stdio.h>
#include "NUC1xx.h"
#include "Driver\DrvSYS.h"
#include "Driver\DrvGPIO.h"
#include "NUC1xx-LB_002\LCD_Driver.h"
int main(void)
{
UNLOCKREG();
DrvSYS_Open(48000000);
LOCKREG();
Initial_panel();
clr_all_panel();
print_lcd(0, "Welcome to MSRIT ");
}
|
FBGs temperature sensor for electrosurgical knife subject to high voltage and high-frequency current Fiber Bragg grating (FBG) based sensors are widely used in very diverse fields ranging from health structural monitoring in civil and aerospace areas to more recent medical applications in the field of diagnosis in different specialities such as cardiology and biomechanics, among others. Their intrinsic properties of strain and temperature sensitivity and their ease of use make FBGs high potential sensors for research purpose. The proposed study aims to evaluate and assess the temperature increase due to heating at the tip of an electrosurgical knife subject to current at high voltage and high frequency in different conditions and verify the feasibility of using FBGs as temperature sensor in this application. For this purpose, an electrosurgical knife composed of a metal conductor and a plastic shaft on top of which 3 FBGs are placed is used. The latter ones are situated and fixed on the circumference of the shaft equally distributed at 120° from each other. To avoid strain interference in the measurements of the shift in Bragg wavelength, the metal conductor is kept fixed. After calibrating the FBGs, different experiments are conducted where the knife is used to heat a specific biological material using a high voltage generator and a thermal camera for measurements verification. The tests showed promising results which demonstrate that FBGs are easy to calibrate in temperature and robust to measure variation of temperature in the surrounding of an electrosurgical knife.
|
Breaking News Emails Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.
Sep. 20, 2016, 12:21 PM GMT / Updated Sep. 20, 2016, 12:21 PM GMT By Chuck Todd, Mark Murray and Carrie Dann
First Read is a morning briefing from Meet the Press and the NBC Political Unit on the day's most important political stories and why they matter.
Clinton is outspending Trump over the airwaves by a 5-to-1 margin
Hillary Clinton and her allies continue to dominate Donald Trump and pro-Trump outside groups in the 2016 advertising race. According to ad-spending data from NBC partner Advertising Analytics, Clinton’s campaign has spent $96.4 million in ads in the general election, versus $17.3 million for Trump’s campaign. That’s more than a 5-to-1 advantage for Clinton. And then when you factor in outside groups, it’s $156.6 million for Team Clinton, and $33.6 million for Team Trump. That’s almost a 5-to-1 advantage. Here are the numbers through this week:
Clinton camp: $96.4 million
Pro-Clinton outside groups: $60.2 million
Total Team Clinton: $156.6 million
Trump camp: $17.3 million
Pro-Trump outside groups: $16.3 million
Total Team Trump: $33.6 million
Clinton extends her lead over Trump, per NBC|SurveyMonkey poll
In the latest NBC|SurveyMonkey online weekly tracking poll (conducted Sep. 12-18), Clinton leads Trump by five points among likely voters, 50%-45% -- the first time the poll has measured likely voters. Among registered voters, it’s Clinton 49%, Trump 43%, which is a slight uptick from Clinton’s 48%-44% lead last week. In a four-way race among likely voters, it’s Clinton 45%, Trump 40%, Gary Johnson 10%, and Jill Stein 4%.
Two very different reactions to the acts of terrorism in New York and New Jersey
As NBC’s Leigh Ann Caldwell writes, Hillary Clinton and Donald Trump couldn’t have reacted more differently to the weekend’s explosions in New York and New Jersey. “Trump promoted the idea of racial profiling to catch suspected offenders. On Fox News Trump praised the police, calling them "amazing," but said they are ‘afraid to do anything’ about terrorists ‘because they don't want to be accused of profiling.’ ‘You know in Israel, they profile. They've done an unbelievable job,’ he added. ‘Do we really have a choice? They're trying to be so politically correct in our country and this is only going to get worse.’” More: “Clinton, meanwhile, said the exact opposite, that law enforcement must work with the Muslim community. She also said that ‘it is crucial’ that law enforcement and Muslim-Americans must work on building a trusting relationship. She also said in a press conference Monday morning that state and local law enforcement must have ‘resources, the training and intelligence they need to effectively prevent and respond’ to attacks.”
Trump: Suspected bomber should be treated as an enemy combatant
Campaigning in Florida yesterday, Trump argued that the suspected bomber, who was wounded in a gunfight with police, shouldn’t receive the same rights as other suspected/alleged criminals. “Today, we have caught this evil thug who planted the bombs. Thank you, law enforcement. Thank you, police. Great. But the bad part: Now we will give him amazing hospitalization. He will be taken care of by some of the best doctors in the world. He will be given a fully modern and updated hospital room. And he'll probably even have room service, knowing the way our country is. And on top of all of that, he will be represented by an outstanding lawyer. His case will go through the various court systems for years and in the end, people will forget and his punishment will not be what it once would have been. What a sad situation.”
Washington Post fact-checks Trump tying the suspected bomber to America’s immigration system
“Based on the information we have so far, the suspect in the bombings was an American who became radicalized. He came to the U.S. at a young age with his family, and became a naturalized U.S. citizen,” the Washington Post says. “It’s unconfirmed yet how Rahami entered the United States — whether he gained refugee status, asylum-seeker status, or received some type of visa. This points to radicalization of those living legally in the U.S., which is a different matter than what Trump talked about in response to the bombings on Monday.”
Skittles responds to Trump’s son: “Refugees are people”
“Candy maker Skittles was left sour Monday after being pulled into the mire of the 2016 presidential race by Donald Trump Jr.,” per NBC News. “The Republican presidential nominee's son tweeted an image Monday that used the popular rainbow-colored candy to make a policy argument against admitting refugees into the United States. ‘If I had a bowl of skittles and I told you just three would kill you. Would you take a handful,’ the image read. Trump added his own commentary on the message, tweeting, ‘This image says it all. Let's end the politically correct agenda that doesn't put America first. #trump2016.’ Skittles parent company Wrigley Americas distanced itself from the tweet with a terse response opposing Trump Jr.'s premise. ‘Skittles are candy. Refugees are people. We don't feel it's an appropriate analogy,’ Vice President of Corporate Affairs Denise Young said in the statement. ‘We will respectfully refrain from further commentary as anything we say could be misinterpreted as marketing.’”
Report: Bush 41 to vote for Clinton (according to a Kennedy)
Politico writes that former President George H.W. Bush told Kathleen Kennedy Townsend, Maryland’s former lieutenant governor and daughter to the late Robert Kennedy, that he will be voting for Hillary Clinton. “On Monday, Townsend posted a picture on her Facebook page shaking hands next to the former president and this caption: ‘The President told me he’s voting for Hillary!!; In a telephone interview, Townsend said she met with the former president in Maine earlier today, where she said he made his preference known that he was voting for a Democrat.” But Bush 41’s office isn’t confirming yet. “Those reporting how @GeorgeHWBush will vote this year, it's not clear anyone was there to verify KKT. Still checking, keep your powder dry,” tweeted spokesman Jim McGrath.
On the trail
Donald Trump campaigns in North Carolina, holding rallies in High Point at noon ET and Kenansville at 5:00 pm ET… And Mike Pence stumps in Virginia.
Countdown to first presidential debate: 6 days
Countdown to VP debate: 14 days
Countdown to second presidential debate: 19 days
Countdown to third presidential debate: 29 days
Countdown to Election Day: 49 days
|
Anheuser-Busch InBev, the brewery behind Budweiser, is to cut 1,400 jobs in the US - 6% of its American workforce - to help it save $1.5bn (£1bn) a year.
Three-quarters of the cuts will be made at Anheuser's headquarters in St Louis, and will go beyond plans that the company announced this summer to streamline costs before it agreed to a takeover by Belgium-based brewer InBev. The firm said the job losses will help it cope with a "challenging economy." Most of the cuts will happen by the end of the year.
Anheuser-Busch provides half of the beer drunk in the US, but the company has not managed to expand globally as fast as the Belgian-Brazilian hybrid InBev, which owns hundreds of local brands but few big names. Beer sales in both the US and Europe are slowly declining.
InBev wrapped up its $52bn takeover of Anheuser-Busch last month. Anheuser had 8,600 salaried workers this summer, and had planned to reduce that by 10-15%, mostly by offering 1,000 employees voluntary early retirement. That plan was meant to save the brewer $1bn a year.
The latest cuts mean the brewer will lose a quarter of the workers it had at the start of 2008. More than 250 unfilled jobs will be cut, along with 415 contractor positions. Around a quarter of job cuts will be in field and brewery locations, it said.
"To keep the business strong and competitive, this is a necessary but difficult move for the company," said Anheuser-Busch president David A Peacock.
Workers who form part of a trade union at the company's 12 North American breweries will not be affected. InBev pledged not to close any of the breweries as long as it was not forced to pay any extra taxes.
The redundancies will cost the company $197m, mostly in severance payments and pension benefits.
InBev is known for tight cost control since its formation in a 2004 merger between Brazil's AmBev and Belgium's Interbrew. The Brazilian management team who headed the company had a sharp focus on costs which was said to have come as a shock to the European business
|
CLARK — Municipalities that have been honoring police by by painting the center of their main streets with blue lines have hit a do-not-cross line set up by the feds.
Last month, the U.S. Department of Transportation's Federal Highway Administration declared this show of support unsafe because blue lines are meant for marking handicap parking spaces.
"It just made me chuckle that this is what we're worried about in a time when police need our support every day," said Clark Mayor Sal Bonaccorso, who called into Bill Spadea's morning show Friday on New Jersey 101.5.
Clark painted a blue line in September along Westfield Avenue in front of the municipal building and public library.
"When we put the line in, the township was tickled about it," Bonaccorso said. "I just thought that this was hysterical."
An official at the Federal Highway Administration's Office of Transportation Operation cited the Manual on Uniform Traffic Control Devices (MUTCD) for Streets and Highways after Somerset County Engineer Matthew D. Loper wrote the agency in October asking about the practice of painting blue stripes on roadways to support law enforcement.
According to the manual, double lines need to be separated "by a discernible space," and that space "must represent a lack of other markings."
As a result, the federal letter says, "filling in the gap in a double line, either partially or fully, does not comply with the provisions of the MUTCD."
While there are some exceptions, blue is not one of them. According to the manual, the only allowable usage of blue paint on roadways is to differentiate spots for people with disabilities.
"The use of blue lines as part of centerline markings does not comply with the provisions of the MUTCD," the letter says.
It is not clear what the consequences may be for towns that choose to ignore the regulations, but the letter already is putting an end to plans for blue stripes around the state.
Clark Township was one of several to paint a 'Thin Blue Line' to support law enforcement: Courtesy of Clark Township
Union County Department of Engineering Director Joseph A. Graziano Sr. sent a letter to police chiefs in his county alerting them to the regulation.
"With this email I am asking that you have your Municipality remove any colored lines that have been installed between the double yellow or adjacent to a single yellow," he said.
Spadea, who devotes time on his Friday shows to support law enforcement during his weekly #BlueFriday segments, said the regulation was "outrageous."
"I want to see how they can justify there is a safety issue with the blue line," he said. "That is absolutely over-the-top outrageous."
The federal letter said the agency appreciates "the impact of expressing support for law enforcement and value their contributions to society," but that there "are many appropriate and fitting ways to recognize service to the public that do not involve the modification of a traffic control device, which can put the road user at risk due to misinterpretation of it's meaning."
State Department of Transportation spokesman Steve Schapiro said Friday that this was not Trenton's call — it's up to federal authorities.
"NJDOT follows the rules set forth in the federal Manual on Uniform Traffic Control Devices pertaining to any road signals, such as signs and pavement markings," he said Friday.
Contact reporter Adam Hochron at 609-359-5326 or [email protected]
|
<gh_stars>10-100
package flaxbeard.cyberware.client.gui;
import javax.annotation.Nullable;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
import net.minecraftforge.items.IItemHandler;
import net.minecraftforge.items.SlotItemHandler;
import flaxbeard.cyberware.api.CyberwareAPI;
import flaxbeard.cyberware.api.item.ICyberware.EnumSlot;
import flaxbeard.cyberware.common.block.tile.TileEntitySurgery;
import flaxbeard.cyberware.common.lib.LibConstants;
public class ContainerSurgery extends Container
{
public class SlotSurgery extends SlotItemHandler
{
public final int savedXPosition;
public final int savedYPosition;
public final EnumSlot slot;
private final int index;
private IItemHandler playerItems;
public SlotSurgery(IItemHandler itemHandler, IItemHandler playerItems, int index, int xPosition, int yPosition, EnumSlot slot)
{
super(itemHandler, index, xPosition, yPosition);
savedXPosition = xPosition;
savedYPosition = yPosition;
this.slot = slot;
this.index = index;
this.playerItems = playerItems;
}
public ItemStack getPlayerStack()
{
return playerItems.getStackInSlot(slotNumber);
}
public boolean slotDiscarded()
{
return surgery.discardSlots[slotNumber];
}
public void setDiscarded(boolean dis)
{
surgery.discardSlots[slotNumber] = dis;
surgery.updateEssential(slot);
surgery.updateEssence();
}
@Override
public boolean canTakeStack(EntityPlayer playerIn)
{
return surgery.canDisableItem(getStack(), slot, index % LibConstants.WARE_PER_SLOT);
}
@Override
public void onSlotChanged()
{
surgery.updateEssence();
surgery.markDirty();
}
@Override
public void putStack(ItemStack stack)
{
if (isItemValid(stack))
{
surgery.disableDependants(getPlayerStack(), slot, index % LibConstants.WARE_PER_SLOT);
super.putStack(stack);
}
surgery.markDirty();
surgery.updateEssential(slot);
surgery.updateEssence();
}
@Override
public void onPickupFromSlot(EntityPlayer playerIn, ItemStack stack)
{
super.onPickupFromSlot(playerIn, stack);
surgery.markDirty();
surgery.updateEssential(slot);
surgery.updateEssence();
}
@Override
public boolean isItemValid(@Nullable ItemStack stack)
{
//System.out.println(surgery.canDisableItem(getPlayerStack(), slot, index % LibConstants.WARE_PER_SLOT));
ItemStack playerStack = getPlayerStack();
//if (stack != null && playerStack != null && stack.getit) return false;
if (getPlayerStack() != null && !surgery.canDisableItem(playerStack, slot, index % LibConstants.WARE_PER_SLOT)) return false;
if (!(stack != null && stack.getItem() != null && CyberwareAPI.isCyberware(stack) && CyberwareAPI.getCyberware(stack).getSlot(stack) == this.slot)) return false;
if (CyberwareAPI.areCyberwareStacksEqual(stack, playerStack))
{
int stackSize = CyberwareAPI.getCyberware(stack).installedStackSize(stack);
if (playerStack.stackSize == stackSize) return false;
}
return !doesItemConflict(stack) && areRequirementsFulfilled(stack);
}
public boolean doesItemConflict(@Nullable ItemStack stack)
{
return surgery.doesItemConflict(stack, slot, index % LibConstants.WARE_PER_SLOT);
}
public boolean areRequirementsFulfilled(@Nullable ItemStack stack)
{
return surgery.areRequirementsFulfilled(stack, slot, index % LibConstants.WARE_PER_SLOT);
}
@Override
public int getItemStackLimit(ItemStack stack)
{
if (stack == null || !(CyberwareAPI.isCyberware(stack)))
{
return 1;
}
ItemStack playerStack = getPlayerStack();
int stackSize = CyberwareAPI.getCyberware(stack).installedStackSize(stack);
if (CyberwareAPI.areCyberwareStacksEqual(playerStack, stack))
{
return stackSize - playerStack.stackSize;
}
return stackSize;
}
}
private final TileEntitySurgery surgery;
public GuiSurgery gui;
public ContainerSurgery(InventoryPlayer playerInventory, TileEntitySurgery surgery)
{
this.surgery = surgery;
int row = 0;
int c = 0;
for (EnumSlot slot : EnumSlot.values())
{
for (int n = 0; n < 8; n++)
{
this.addSlotToContainer(new SlotSurgery(surgery.slots, surgery.slotsPlayer, c, 9 + 20 * n, 109, slot));
c++;
}
for (int n = 0; n < LibConstants.WARE_PER_SLOT - 8; n++)
{
this.addSlotToContainer(new SlotSurgery(surgery.slots, surgery.slotsPlayer, c, Integer.MIN_VALUE, Integer.MIN_VALUE, slot));
c++;
}
row++;
}
for (int l = 0; l < 3; ++l)
{
for (int j1 = 0; j1 < 9; ++j1)
{
this.addSlotToContainer(new Slot(playerInventory, j1 + l * 9 + 9, 8 + j1 * 18, 103 + l * 18 + 37));
}
}
for (int i1 = 0; i1 < 9; ++i1)
{
this.addSlotToContainer(new Slot(playerInventory, i1, 8 + i1 * 18, 161 + 37));
}
}
@Override
public boolean canInteractWith(EntityPlayer playerIn)
{
return surgery.isUseableByPlayer(playerIn);
}
@Nullable
public ItemStack transferStackInSlot(EntityPlayer playerIn, int index)
{
ItemStack itemstack = null;
Slot slot = (Slot)this.inventorySlots.get(index);
if (slot != null && slot.getHasStack())
{
ItemStack itemstack1 = slot.getStack();
itemstack = itemstack1.copy();
if (!(slot instanceof SlotSurgery))
{
if (index >= 3 && index < 30)
{
if (!this.mergeItemStack(itemstack1, 30, 39, false))
{
return null;
}
}
else if (index >= 30 && index < 39 && !this.mergeItemStack(itemstack1, 3, 30, false))
{
return null;
}
}
if (itemstack1.stackSize == 0)
{
slot.putStack((ItemStack)null);
}
else
{
slot.onSlotChanged();
}
if (itemstack1.stackSize == itemstack.stackSize)
{
return null;
}
slot.onPickupFromSlot(playerIn, itemstack1);
}
return itemstack;
}
}
|
Intelligent Charge Rate Optimization of PHEVs Incorporating Driver Satisfaction and Grid Constraints In this paper, an optimization model is developed to find a plug-in hybrid electric vehicle (PHEV) optimum charging rate profile that dynamically varies throughout the day. From the grid point of view, the model takes into account the constraints of maximum demand and charging facilities, while from the drivers point of view, waiting and charging time restrictions are considered. The novelty of this paper lies in maximizing the energy delivered to PHEVs in a region equipped with smart grid technology by intelligently alternating charging rates during the day while incorporating both driver satisfaction constraints as well as grid limitations. Using the proposed optimization model, two cases with optimized charging rates are studied and compared with constant charging levels. Furthermore, quantitative results from the perspective of both power grid contribution and driver satisfaction are presented and discussed in detail for each case.
|
On Dirac's conjecture for Hamiltonian systems with first- and second-class constraints. It is shown for a wide class of systems in the framework of the total Hamiltonian procedure that all first-class constraints generate canonical transformations connecting physically equivalent states. It occurs whenever the constraints arising in the Dirac algorithm are effective when considered in the functional form as they appear in the consistency conditions. The property of hereditary separation between first- and second-class constraints also follows from the above condition. General Poisson-brackets relations among constraints in the representation used here are also obtained. The sources of anomalies in the hereditary property reported in the literature are identified.
|
TRIPOLI, Feb 6 (Reuters) - The chairman of Libya’s sovereign wealth fund, Ali Mahmoud Hassan Mohamed, was detained on Wednesday for an investigation into alleged “corruption and exploitation of (his) position,” an official in the attorney general’s office said.
Mohamed had been appointed by the U.N.-backed government in Tripoli.
The official said Mohamed was being interrogated, declining further comment. Mohamed could not be reached for comment.
|
<reponame>DirectXceriD/gridgain
/*
* GridGain Community Edition Licensing
* Copyright 2019 GridGain Systems, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License") modified with Commons Clause
* Restriction; 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.
*
* Commons Clause Restriction
*
* The Software is provided to you by the Licensor under the License, as defined below, subject to
* the following condition.
*
* Without limiting other conditions in the License, the grant of rights under the License will not
* include, and the License does not grant to you, the right to Sell the Software.
* For purposes of the foregoing, “Sell” means practicing any or all of the rights granted to you
* under the License to provide to third parties, for a fee or other consideration (including without
* limitation fees for hosting or consulting/ support services related to the Software), a product or
* service whose value derives, entirely or substantially, from the functionality of the Software.
* Any license notice or attribution required by the License must also include this Commons Clause
* License Condition notice.
*
* For purposes of the clause above, the “Licensor” is Copyright 2019 GridGain Systems, Inc.,
* the “License” is the Apache License, Version 2.0, and the Software is the GridGain Community
* Edition software provided with this notice.
*/
package org.apache.ignite.examples.sql;
import java.util.List;
import org.apache.ignite.Ignite;
import org.apache.ignite.IgniteCache;
import org.apache.ignite.Ignition;
import org.apache.ignite.cache.query.SqlFieldsQuery;
import org.apache.ignite.configuration.CacheConfiguration;
import org.apache.ignite.examples.ExampleNodeStartup;
/**
* Example to showcase DDL capabilities of Ignite's SQL engine.
* <p>
* Remote nodes could be started from command line as follows:
* {@code 'ignite.{sh|bat} examples/config/example-ignite.xml'}.
* <p>
* Alternatively you can run {@link ExampleNodeStartup} in either same or another JVM.
*/
public class SqlDdlExample {
/** Dummy cache name. */
private static final String DUMMY_CACHE_NAME = "dummy_cache";
/**
* Executes example.
*
* @param args Command line arguments, none required.
* @throws Exception If example execution failed.
*/
@SuppressWarnings({"unused", "ThrowFromFinallyBlock"})
public static void main(String[] args) throws Exception {
try (Ignite ignite = Ignition.start("examples/config/example-ignite.xml")) {
print("Cache query DDL example started.");
// Create dummy cache to act as an entry point for SQL queries (new SQL API which do not require this
// will appear in future versions, JDBC and ODBC drivers do not require it already).
CacheConfiguration<?, ?> cacheCfg = new CacheConfiguration<>(DUMMY_CACHE_NAME).setSqlSchema("PUBLIC");
try (
IgniteCache<?, ?> cache = ignite.getOrCreateCache(cacheCfg)
) {
// Create reference City table based on REPLICATED template.
cache.query(new SqlFieldsQuery(
"CREATE TABLE city (id LONG PRIMARY KEY, name VARCHAR) WITH \"template=replicated\"")).getAll();
// Create table based on PARTITIONED template with one backup.
cache.query(new SqlFieldsQuery(
"CREATE TABLE person (id LONG, name VARCHAR, city_id LONG, PRIMARY KEY (id, city_id)) " +
"WITH \"backups=1, affinity_key=city_id\"")).getAll();
// Create an index.
cache.query(new SqlFieldsQuery("CREATE INDEX on Person (city_id)")).getAll();
print("Created database objects.");
SqlFieldsQuery qry = new SqlFieldsQuery("INSERT INTO city (id, name) VALUES (?, ?)");
cache.query(qry.setArgs(1L, "Forest Hill")).getAll();
cache.query(qry.setArgs(2L, "Denver")).getAll();
cache.query(qry.setArgs(3L, "St. Petersburg")).getAll();
qry = new SqlFieldsQuery("INSERT INTO person (id, name, city_id) values (?, ?, ?)");
cache.query(qry.setArgs(1L, "<NAME>", 3L)).getAll();
cache.query(qry.setArgs(2L, "<NAME>", 2L)).getAll();
cache.query(qry.setArgs(3L, "<NAME>", 1L)).getAll();
cache.query(qry.setArgs(4L, "<NAME>", 2L)).getAll();
print("Populated data.");
List<List<?>> res = cache.query(new SqlFieldsQuery(
"SELECT p.name, c.name FROM Person p INNER JOIN City c on c.id = p.city_id")).getAll();
print("Query results:");
for (Object next : res)
System.out.println(">>> " + next);
cache.query(new SqlFieldsQuery("drop table Person")).getAll();
cache.query(new SqlFieldsQuery("drop table City")).getAll();
print("Dropped database objects.");
}
finally {
// Distributed cache can be removed from cluster only by #destroyCache() call.
ignite.destroyCache(DUMMY_CACHE_NAME);
}
print("Cache query DDL example finished.");
}
}
/**
* Prints message.
*
* @param msg Message to print before all objects are printed.
*/
private static void print(String msg) {
System.out.println();
System.out.println(">>> " + msg);
}
}
|
// returns JSON string of JSON - used to send to network
string BlockChain::toJSON() {
json j;
j["length"] = this->blockchain.size();
for (int i = 0; i < this->blockchain.size(); i++){
j["data"][this->blockchain[i]->getIndex()] = this->blockchain[i]->toJSON();
}
return j.dump(3);
}
|
Two goals by the league’s top scorer, Christian Ramirez, led the Minnesota United over the visiting Ottawa Fury 2-1 Saturday evening.
Ramirez scored his first goal in the fourth minute of the match and that tally proved to be the only score of the first half.
But in the second half Sinisa Ubiparipovic replied for Ottawa. The tie lasted until a controversial penalty was awarded to Minnesota in the 60th minute and Ramirez didn’t miss when he was given the shot.
The Fury pressed during the rest of the match bu they could score.
Saturday’s performance by Ottawa was much better than their embarrassing performance in Carolina last week, but it still is another loss. So far in the Fall season, the Fury have but one tie. Their overall record is 3-2-8.
Ottawa was dealt a blow before the match began as captain Richie Ryan was injured during the warm-up forcing him out of the line-up. Mauro Eustaquio, who had just three minutes of playing time all season, made his first career NASL start. Goalkeeper Romuald Peiser also made his first start since joining the club in the mid-season break.
Minnesota United took the lead four minutes in as right-back Kevin Venegas made a quick run down the right side receiving a well-timed through ball that he passed to Ramirez who tapped home his eighth of the season. After the early goal, Peiser made several key saves to keep the Fury close at the end of the half.
To start the second half the Fury came out with determination. Sinisa Ubiparipovic led the charge and in the 50th minute he scored on a give-and-go with Carl Haworth. The goal was the first of the Fall Season ending a drought of 500 minutes of play dating back to their final game of the Spring campaign.
Ottawa continued to press but in the 60th minute Minnesota midfielder Juliano Vincentini made a clever run through the midfield and was judged to have been brought down by Drew Beckie just inside the 18-yard box. Ramirez calmly scored his second of the game and league-leading 9th of the season.
Next up: the Fury play Fort Lauderdale on Aug. 9 at TD Place.
|
We often take for granted the snow on the ground, but ski resorts are not in a position to do the same. Snow is essential to their operation and success. With the ever unpredictable weather received in winter, which includes thaws, rain and worse, ski resorts need to "weather-proof" their operation as much as possible. One way to accomplish this is through snowmaking.
Snowmaking allows a mountain to offer great ski conditions from the beginning to the end of a season, stepping in when nature presents issues, or helping touch up the ski slopes.
In this video, made in collaboration with Calabogie Peaks, we take you "Behind the Scenes" and discover how snowmaking is accomplished and how the impressive technology works, in this guided tour with the resort's President, Paul Murphy and Brian Bunch, Mountain Operations Manager.
|
TERT's role in colorectal carcinogenesis Telomerase reverse transcriptase (TERT) is one of the main functional subunits of the telomerase enzyme, which functions to increase telomere length. Studies have suggested that TERT may be important to the etiology of colorectal cancer. In this study we evaluate seven TERT SNPs in 1555 incident colon cancer cases and 1956 matched controls and in 754 incident rectal cancer cases and 959 matched controls. We observed that two TERT SNPs were associated with colon cancer. TERT rs2736118 was associated with increased risk of colon cancer (OR=1.31, 95% CI 1.02, 1.69) and TERTCLPTM1L rs2853668 was inversely associated with colon cancer (OR=0.71, 95% CI 0.55, 0.92). TERTCLPTM1L rs2853668 also was inversely associated with rectal cancer (OR 0.62, 95% CI 0.43, 0.90). BMI interacted significantly with three TERT SNPs to alter risk of colon cancer. Those with the variant allele and who were obese had the greatest risk of colon cancer. TERTCLPTM1L rs2853668 interacted significantly with aspirin/NSAID use, where those with the AA genotype had a much lower risk of colon cancer when using aspirin/NSAIDs than those with the other genotypes. Several TERT SNPs were uniquely associated with CIMP+ and MSI tumors. These data confirm earlier reports of the association between TERTCLPTM1L and colon and rectal cancer. Our detection of a significant interaction with BMI for multiple TERT SNPs and unique associations with CIMP+ tumors enhance our understanding of TERT's role in colon carcinogenesis. © 2012 Wiley Periodicals, Inc.
|
Adult-onset psychosis and clinical genetics: a case of Phelan-McDermid syndrome. The patient is a 38-year-old woman previously diagnosed with cerebral palsy, major depressive disorder with psychotic features, general anxiety disorder, and schizophrenia with catatonia. She has a history of developmental delay, hypotonia, and seizure-like activity since childhood. Although she has moderate mental retardation (IQ: 51) she is verbal, friendly, and completed high school (special education). General functioning, mood, and behavior were stable into adulthood until her first psychiatric hospitalization at age 32. She began having behavioral regression and decline in skills including bathing, dressing, and feeding. For periods of weeks she became nonverbal, confused, detached, and incontinent. She would often stare at her hands, at times shaking or screaming, and refuse to eat.
|
package net.minecraft.client.particle;
import com.mojang.blaze3d.vertex.IVertexBuilder;
import net.minecraft.client.renderer.ActiveRenderInfo;
import net.minecraft.client.world.ClientWorld;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.vector.Quaternion;
import net.minecraft.util.math.vector.Vector3d;
import net.minecraft.util.math.vector.Vector3f;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
@OnlyIn(Dist.CLIENT)
public abstract class TexturedParticle extends Particle {
protected float quadSize = 0.1F * (this.random.nextFloat() * 0.5F + 0.5F) * 2.0F;
protected TexturedParticle(ClientWorld p_i232423_1_, double p_i232423_2_, double p_i232423_4_, double p_i232423_6_) {
super(p_i232423_1_, p_i232423_2_, p_i232423_4_, p_i232423_6_);
}
protected TexturedParticle(ClientWorld p_i232424_1_, double p_i232424_2_, double p_i232424_4_, double p_i232424_6_, double p_i232424_8_, double p_i232424_10_, double p_i232424_12_) {
super(p_i232424_1_, p_i232424_2_, p_i232424_4_, p_i232424_6_, p_i232424_8_, p_i232424_10_, p_i232424_12_);
}
public void render(IVertexBuilder p_225606_1_, ActiveRenderInfo p_225606_2_, float p_225606_3_) {
Vector3d vector3d = p_225606_2_.getPosition();
float f = (float)(MathHelper.lerp((double)p_225606_3_, this.xo, this.x) - vector3d.x());
float f1 = (float)(MathHelper.lerp((double)p_225606_3_, this.yo, this.y) - vector3d.y());
float f2 = (float)(MathHelper.lerp((double)p_225606_3_, this.zo, this.z) - vector3d.z());
Quaternion quaternion;
if (this.roll == 0.0F) {
quaternion = p_225606_2_.rotation();
} else {
quaternion = new Quaternion(p_225606_2_.rotation());
float f3 = MathHelper.lerp(p_225606_3_, this.oRoll, this.roll);
quaternion.mul(Vector3f.ZP.rotation(f3));
}
Vector3f vector3f1 = new Vector3f(-1.0F, -1.0F, 0.0F);
vector3f1.transform(quaternion);
Vector3f[] avector3f = new Vector3f[]{new Vector3f(-1.0F, -1.0F, 0.0F), new Vector3f(-1.0F, 1.0F, 0.0F), new Vector3f(1.0F, 1.0F, 0.0F), new Vector3f(1.0F, -1.0F, 0.0F)};
float f4 = this.getQuadSize(p_225606_3_);
for(int i = 0; i < 4; ++i) {
Vector3f vector3f = avector3f[i];
vector3f.transform(quaternion);
vector3f.mul(f4);
vector3f.add(f, f1, f2);
}
float f7 = this.getU0();
float f8 = this.getU1();
float f5 = this.getV0();
float f6 = this.getV1();
int j = this.getLightColor(p_225606_3_);
p_225606_1_.vertex((double)avector3f[0].x(), (double)avector3f[0].y(), (double)avector3f[0].z()).uv(f8, f6).color(this.rCol, this.gCol, this.bCol, this.alpha).uv2(j).endVertex();
p_225606_1_.vertex((double)avector3f[1].x(), (double)avector3f[1].y(), (double)avector3f[1].z()).uv(f8, f5).color(this.rCol, this.gCol, this.bCol, this.alpha).uv2(j).endVertex();
p_225606_1_.vertex((double)avector3f[2].x(), (double)avector3f[2].y(), (double)avector3f[2].z()).uv(f7, f5).color(this.rCol, this.gCol, this.bCol, this.alpha).uv2(j).endVertex();
p_225606_1_.vertex((double)avector3f[3].x(), (double)avector3f[3].y(), (double)avector3f[3].z()).uv(f7, f6).color(this.rCol, this.gCol, this.bCol, this.alpha).uv2(j).endVertex();
}
public float getQuadSize(float p_217561_1_) {
return this.quadSize;
}
public Particle scale(float p_70541_1_) {
this.quadSize *= p_70541_1_;
return super.scale(p_70541_1_);
}
protected abstract float getU0();
protected abstract float getU1();
protected abstract float getV0();
protected abstract float getV1();
}
|
<reponame>BantorSchwanzVor/plotscanner-leak
package net.minecraftforge.client.model.pipeline;
import net.minecraft.client.renderer.vertex.VertexFormat;
import net.minecraft.util.EnumFacing;
public interface IVertexConsumer {
VertexFormat getVertexFormat();
void setQuadTint(int paramInt);
void setQuadOrientation(EnumFacing paramEnumFacing);
void setQuadColored();
void put(int paramInt, float... paramVarArgs);
}
/* Location: C:\Users\BSV\AppData\Local\Temp\Rar$DRa6216.20396\Preview\Preview.jar!\net\minecraftforge\client\model\pipeline\IVertexConsumer.class
* Java compiler version: 8 (52.0)
* JD-Core Version: 1.1.3
*/
|
// Given a map of string->[]byte and a string, figure out if the string is present as a key in the map
func hasb(m map[string][]byte, e string) bool {
if _, ok := m[e]; ok {
return true
}
return false
}
|
<gh_stars>0
#include "Flipper.h"
#include "SceneMain.h"
Flipper::Flipper(std::string name, std::string tag, Application* _app,PhysBody* base, bool isRight,uint key, uint key2) : GameObject(name, tag, _app)
{
this->key = key;
this->key2 = key2;
SDL_RendererFlip flip;
SDL_Rect rect;
iPoint anchorA, anchorB, angle;
// Init valor
if(isRight)
{
this->isRight = 1;
flip = SDL_FLIP_HORIZONTAL;
rect = { 355,775,96,18 };
anchorA = { 48,0 };
anchorB = { 405,774 };
angle = { -30,25 };
}
else
{
this->isRight = -1;
flip = SDL_FLIP_NONE;
rect = { 235,775,96,18 };
anchorA = { -48,0 };
anchorB = { 185,774 };
angle = { -25,30 };
}
// RenderObject
renderObjects[0].texture = _app->textures->Load("Assets/Images/Game/Flipper.png");
renderObjects[0].scale = 0.75f;
renderObjects[0].layer = 1;
renderObjects[0].orderInLayer = 1.0f;
renderObjects[0].flip = flip;
// PhysBody
pBody = _app->physics->CreateRectangle(rect.x, rect.y, rect.w, rect.h);
pBody->gameObject = this;
// Joint
b2RevoluteJointDef revoluteDef;
revoluteDef.bodyA = pBody->body;
revoluteDef.bodyB = base->body;
revoluteDef.collideConnected = false;
//revoluteDef.Initialize(revoluteDef.bodyA, revoluteDef.bodyB, b2Vec2(PIXELS_TO_METER(486), PIXELS_TO_METER(509)));
revoluteDef.localAnchorA.Set(PIXELS_TO_METER(anchorA.x), PIXELS_TO_METER(anchorA.y));
revoluteDef.localAnchorB.Set(PIXELS_TO_METER(anchorB.x), PIXELS_TO_METER(anchorB.y));
revoluteDef.referenceAngle = 0 * DEGTORAD;
revoluteDef.lowerAngle = angle.x * DEGTORAD;
revoluteDef.upperAngle = angle.y * DEGTORAD;
revoluteDef.enableLimit = true;
joint2 = (b2RevoluteJoint*)_app->physics->world->CreateJoint(&revoluteDef);
}
void Flipper::Update()
{
if (_app->input->GetKey(key) == KEY_REPEAT || _app->input->GetKey(key2) == KEY_REPEAT)
{
pBody->body->SetAngularVelocity(1000 * DEGTORAD * isRight);
}
if (_app->input->GetKey(key) == KEY_UP || _app->input->GetKey(key2) == KEY_UP)
{
pBody->body->SetAngularVelocity(-1000 * DEGTORAD* isRight);
}
}
void Flipper::OnCollision(PhysBody* col)
{
//printf("Col Flliper");
}
|
n = int(input())
cnt = 0
cur_cnt = 1
for i in range(n, 0, -1):
cnt += min(cur_cnt, i)
cur_cnt += 1
print(cnt)
|
def hamilton_path_len(graph, selector=min):
return int(round(selector([hamilton_path_from_start_len(start, graph, selector) for start in graph])))
|
<gh_stars>0
#include <Mirror\ECS\Systems\SpriteRenderer.hpp>
#include <glm.hpp>
#include <gtc/matrix_transform.hpp>
void Mirror::ECS::System::SpriteRenderer::Init(const float _baseSpriteScale)
{
baseSpriteScale = _baseSpriteScale;
//make blank texture
uint8_t color = 0xffffffff;
Glfix_Texture_CreateInfo info{};
info.type = Glfix_TextureType_2D;
info.height = 1;
info.width = 1;
info.mipMapLevel = 0;
info.internalFormate = Glfix_Formate_RGBA8;
info.pixelDatatype = Glfix_Formate_UByte;
info.externalFormate = Glfix_Formate_RGBA;
info.extraData = &color;
blankTexture = Glfix_Texture_Create(&info);
//set up shader
const char* vertexSource = "#version 330 core\nlayout(location = 0) in vec2 position;\nlayout(location = 1) in vec2 texCords;\nout vec2 TexCoords;\nuniform mat4 PVM;\nvoid main()\n{\nTexCoords = texCords;\ngl_Position = PVM * vec4(position, 0.0f, 1.0);\n}\n";
const char* fragSource = "#version 330 core\nin vec2 TexCoords;\nout vec4 fragColor;\nuniform sampler2D sprite;uniform vec4 color;\nvoid main()\n{\nfragColor = color * texture(sprite, TexCoords);\n}";
quadShader = Glfix_Shader_CreateVertexSource(vertexSource, fragSource, nullptr);
//set up vertex buffer
float vertices[] = {
// pos // tex
0.0f, 1.0f, 0.0f, 1.0f,
1.0f, 0.0f, 1.0f, 0.0f,
0.0f, 0.0f, 0.0f, 0.0f,
0.0f, 1.0f, 0.0f, 1.0f,
1.0f, 1.0f, 1.0f, 1.0f,
1.0f, 0.0f, 1.0f, 0.0f
};
quadVertexBuffer = Glfix_VertexBuffer_CreateStatic(vertices, sizeof(vertices));
Glfix_VertexLayout_Element elements[2] = { Glfix_LayoutType_Float2, Glfix_LayoutType_Float2 }; //Glfix_LayoutType_Float3, Glfix_LayoutType_Float2 };
bool normalize[2] = { false, false};
Glfix_VertexLayout_Layout layout;
layout.elements = elements;
layout.normalize = normalize;
layout.elementCount = 2;
Glfix_VertexBuffer_Layout(quadVertexBuffer, &layout);
}
void Mirror::ECS::System::SpriteRenderer::Shutdown()
{
//clean up single quad data
if (quadShader)
Glfix_Shader_Destroy(quadShader);
if (quadVertexBuffer)
Glfix_VertexBuffer_Destroy(quadVertexBuffer);
}
static bool spriteRendererErrorWarning = false;
void Mirror::ECS::System::SpriteRenderer::SingleSpriteRender(SmokCore::ECS::Comp::Camera& cam, SmokCore::ECS::Comp::Transform& camTrans,
ECS::Comp::Sprite& entitySprite, SmokCore::ECS::Comp::Transform& entityTrans, Glfix_Texture* texture)
{
//check errors
if (!quadShader || !quadVertexBuffer)
return;
if (!spriteRendererErrorWarning && !cam.isActive)
{
printf("Mirror Error: Sprite Renderer || the Camera comp is turned off, turn it on to use \"SingleSpriteRender\".\n");
spriteRendererErrorWarning = true;
return;
}
if (!spriteRendererErrorWarning && !entitySprite.isActive)
{
printf("Mirror Error: Sprite Renderer || the Sprite comp is turned off, turn it on to use \"SingleSpriteRender\".\n");
spriteRendererErrorWarning = true;
return;
}
//binds data
Glfix_Shader_Bind(quadShader);
Glfix_VertexBuffer_Bind(quadVertexBuffer);
//if texture was NULL use the blank one
Glfix_Texture_Bind((texture != nullptr ? texture : blankTexture), 0);
//sets camera
glm::mat4 projection = glm::ortho(cam.viewWidthMin, cam.viewWidth,
cam.viewHeight, cam.viewHeightMin, cam.nearFieldClipping, cam.farFieldClipping);
glm::mat4 camPos = glm::mat4(1.0f);
camPos = glm::translate(glm::mat4(1.0f), Smok_Math_TypePun(camTrans.position, glm::vec3)) *
glm::rotate(glm::mat4(1.0f), camTrans.rotation.x, glm::vec3(0.0f, 0.0f, 1.0f));
//positions sprite
glm::mat4 model = glm::mat4(1.0f);
model = glm::translate(model, Smok_Math_TypePun(entityTrans.position, glm::vec3)) * //position
//rotation
glm::translate(model, glm::vec3(0.5f * entityTrans.scale.x, entityTrans.scale.y, 0.0f)) *// move origin of rotation to center of quad
glm::rotate(model, glm::radians(entityTrans.rotation.x), glm::vec3(0.0f, 0.0f, 1.0f)) *//then rotate
glm::translate(model, glm::vec3(-0.5f * entityTrans.scale.x, -0.5f * entityTrans.scale.y, 0.0f)) * // move origin back
//scale
glm::scale(model, { entityTrans.scale.x * baseSpriteScale, entityTrans.scale.y * baseSpriteScale, 1.0f });
//pass uniforms
Glfix_Shader_SetMat4(quadShader, "PVM", false, &(projection * model)[0][0]);
Glfix_Shader_SetInt(quadShader, "sprite", 0);
Glfix_Shader_SetFloat4(quadShader, "color", entitySprite.color.r, entitySprite.color.g, entitySprite.color.b, entitySprite.color.a);
//render
Glfix_VertexBuffer_Draw(Glfix_DrawType_Triangles, 0, quadVertexBuffer->size);
}
void Mirror::ECS::System::SpriteRenderer::SingleSpriteRender(SmokCore::ECS::Comp::Camera& cam, SmokCore::ECS::Comp::Transform& camTrans,
ECS::Comp::Sprite& entitySprite, SmokCore::ECS::Comp::Transform& entityTrans, const float baseSpriteScaleOverride, Glfix_Texture* texture)
{
//check errors
if (!quadShader || !quadVertexBuffer)
return;
if (!spriteRendererErrorWarning && !cam.isActive)
{
printf("Mirror Error: Sprite Renderer || the Camera comp is turned off, turn it on to use \"SingleSpriteRender\".\n");
spriteRendererErrorWarning = true;
return;
}
if (!spriteRendererErrorWarning && !entitySprite.isActive)
{
printf("Mirror Error: Sprite Renderer || the Sprite comp is turned off, turn it on to use \"SingleSpriteRender\".\n");
spriteRendererErrorWarning = true;
return;
}
//binds data
Glfix_Shader_Bind(quadShader);
Glfix_VertexBuffer_Bind(quadVertexBuffer);
//if texture was NULL use the blank one
Glfix_Texture_Bind((texture != nullptr ? texture : blankTexture), 0);
//sets camera
glm::mat4 projection = glm::ortho(cam.viewWidthMin, cam.viewWidth,
cam.viewHeight, cam.viewHeightMin, cam.nearFieldClipping, cam.farFieldClipping);
glm::mat4 camPos = glm::mat4(1.0f);
camPos = glm::translate(glm::mat4(1.0f), Smok_Math_TypePun(camTrans.position, glm::vec3)) *
glm::rotate(glm::mat4(1.0f), camTrans.rotation.x, glm::vec3(0.0f, 0.0f, 1.0f));
//positions sprite
glm::mat4 model = glm::mat4(1.0f);
model = glm::translate(model, Smok_Math_TypePun(entityTrans.position, glm::vec3)) * //position
//rotation
glm::translate(model, glm::vec3(0.5f * entityTrans.scale.x , entityTrans.scale.y, 0.0f)) * // move origin of rotation to center of quad
glm::rotate(model, glm::radians(entityTrans.rotation.x), glm::vec3(0.0f, 0.0f, 1.0f)) * // then rotate
glm::translate(model, glm::vec3(-0.5f * entityTrans.scale.x, -0.5f * entityTrans.scale.y, 0.0f)) * // move origin back
//scale
glm::scale(model, { entityTrans.scale.x * baseSpriteScaleOverride, entityTrans.scale.y * baseSpriteScaleOverride, 1.0f });
//pass uniforms
Glfix_Shader_SetMat4(quadShader, "PVM", false, &(projection * model)[0][0]);
Glfix_Shader_SetInt(quadShader, "sprite", 0);
Glfix_Shader_SetFloat4(quadShader, "color", entitySprite.color.r, entitySprite.color.g, entitySprite.color.b, entitySprite.color.a);
//render
Glfix_VertexBuffer_Draw(Glfix_DrawType_Triangles, 0, quadVertexBuffer->size);
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.