content
stringlengths
7
2.61M
Sara*, a married woman in her 40s, goes to bed every night feeling rejected by her husband. "He never initiates , he never puts his arms around me," she told me in our first session. "When I reach out to him he's always tired and not in the mood. It feels awful." People in stable, long-term and marriages often feel rejected by their partner at one time or another. While many such experiences are mild, when they recur over long periods of time, they can be extremely painful. Indeed, being repeatedly rejected by your partner can damage your and psychological —and endanger the entire relationship. Rejections Involving Intimacy and Sex While the bathroom and kitchen may be the most "dangerous" rooms in the house in terms of physical injury, most of our emotional injuries happen in the bedroom. When your partner rebuffs your advances; avoids your attempts at intimacy; turns away when you try to kiss him or her; is reluctant to have date nights; goes to bed significantly before or after you do; falls asleep on the couch or in the kids’ room; drinks too much during a romantic dinner and crawls into bed without you; or claims exhaustion when you’re finally alone, or on a vacation—you are going to feel rejected and it's going to hurt. One reason even small rejections sting is that our brain is wired to respond to rejection similarly to the way it responds to physical pain. (See 10 Surprising Facts about Rejection.) Rejections from your partner have an even greater impact as they come from the person who knows you best, who sees you most fully (or is supposed to), and who is supposed to love you for who you truly are. Therefore, his or her rejections feel like a much more substantial statement about your desirability and character, and can have a devastating impact on your self-esteem and . Over time, of course, such rejections are extremely damaging to the relationship as a whole. In order to protect themselves from further hurt, a rejected spouse or partner is likely to become emotionally withdrawn, distant, and disengaged. (See Are You Married but Lonely?) They are also likely to develop feelings of and resentment toward the partner, and in some cases, become depressed. How to Address Rejection in Your Relationship Some people feel hesitant to discuss feeling rejected with their partner. Others might have tried discussing their feelings but since the problem has persisted, feel reluctant to do so again. Indeed, once your self-esteem sustains a certain amount of damage through repeated rejections, you are likely to feel too vulnerable to risk initiating another talk, either because you doing so will only confirm your partner's lack of and leave you feeling even more devastated—or because you worry it will start a major fight. However, staying silent and tolerating or accommodating the situation will not make you feel better; instead, the rejections will only continue to wear away at your self-esteem and . Despite how risky it might feel, bringing up the topic, as clearly and as assertively as possible (which is difficult but doable), is the only way to begin a dialogue about change and make your partner aware of the emotional damage his or her behavior is causing. These guidelines may help: Tell your partner you need to talk and decide on a time you can have an uninterrupted conversation (not while you’re getting ready for work in the morning). Once you have their full , present the facts as clearly and non-judgmentally as you can (“We haven’t had sex in six months, despite the few times I’ve tried to initiate it,” or, “You used to hold my hand and put your arm around me and you no longer do.”). Some people might be very aware of their behavior, but others might not. Give your spouse the benefit of the doubt and see how they respond before assuming they’ve been aware of their behavior and indifferent to the damage it has caused. State the emotional impact their rejections have on you using "I statements" (“It makes me feel extremely unattractive and undesirable,” “I feel hurt and my self-esteem has taken a real hit,” or, “It makes me feel insecure, angry, and resentful.”). Here again, it is important to give your partner space to respond; while some may be aware of the impact of their behavior, others might not be. State a clear request for change (“It isn’t fair to me and I don’t want to keep feeling like this,” “We’ve spoken about this before, you make some efforts but they don’t last. I need you to take this very seriously,” or, “I want us to discuss this honestly and find solutions together.”). If your partner gets defensive or is reluctant to change, ask them to explain how they see things, what suggestions they have for making things better, or whether there are things they are upset about that are motivating their behavior. Discuss specific steps you both can take to improve the situation. Do not assume all the changes have to come from your partner; they might have feelings of their own that are underlying their avoidance of sex and intimacy. Try to agree on one small step you can both take right away to signal your intention to work on this issue. Request a periodic check-in to make sure any efforts or changes are maintained (“I want us to check in on this every few weeks to make sure things have improved,” or, “I would like you to take the initiative to check in with me so I know you care about whether I’m feeling better about this.”). * names have been changed Check out my app for healing rejection and heartache: Dr. Heartbreak View my short TED Talk about Psychological Health here. For more about how to heal the wounds of rejection and how to repair damage to self-esteem, check out my book, Emotional First Aid: Healing Rejection, Guilt, Failure and Other Everyday Hurts (Plume, 2014). Join my mailing list Check out my website at guywinch.com and follow me on Twitter @GuyWinch Copyright 2014 Guy Winch
<gh_stars>0 # Generated by Django 2.0 on 2019-10-03 11:50 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('post', '0003_auto_20191003_1705'), ] operations = [ migrations.AddField( model_name='posts', name='modifiedAt', field=models.DateTimeField(null=True), ), ]
Sparsity and cosparsity for audio declipping: a flexible non-convex approach This work investigates the empirical performance of the sparse synthesis versus sparse analysis regularization for the ill-posed inverse problem of audio declipping. We develop a versatile non-convex heuristics which can be readily used with both data models. Based on this algorithm, we report that, in most cases, the two models perform almost similarly in terms of signal enhancement. However, the analysis version is shown to be amenable for real time audio processing, when certain analysis operators are considered. Both versions outperform state-of-the-art methods in the field, especially for the severely saturated signals. Introduction Clipping, or magnitude saturation, is a well-known problem in signal processing, from audio to image processing and digital communications. The focus of this work is audio declipping, to restore clipped audio signals. Audio signals become saturated usually during acquisition, reproduction or A/D conversion. The perceptual manifestation of clipped audio depends on the level of clipping degradation and the audio content. In case of mild to moderate clipping, the listener may notice occasional "clicks and pops" during playback. When clipping becomes severe, the audio content is usually perceived as if it was contaminated with a high level of additive noise, which may be explained by the introduction of a large number of harmonics caused by the discontinuities in the degraded signal. In addition to audible artifacts, some recent studies have shown that clipping has a negative impact on Automatic Speech Recognition (ASR) performance. In the following text, a sampled audio signal is represented by the vector x ∈ R n and its clipped version is denoted by y ∈ R n. The latter can be easily deduced from x through the following nonlinear observation model, called hard clipping: While idealized, this clipping model is a convenient approximation allowing to clearly distinguish the clipped parts of a signal by identifying the samples having the highest absolute magnitude. Indices corresponding to "reliable" samples of y (not affected by clipping) are indexed by r, while + c and − c index the clipped samples with positive and negative magnitude, respectively. Our goal is to estimate the original signal x from its clipped version y, i.e. to "declip" the signal y. Ideally, the estimated signalx should satisfy natural magnitude constraints in order to be consistent with the clipped observations. Thus, we seek an estimatex which fulfills the following criteria: where the matrices M r, Mc and M + c are restriction operators. These are simply row-reduced identity matrices used to extract the vector elements indexed by the sets r, + c and − c, respectively. We write the constraints asx ∈ (y). Obviously, consistency alone is not sufficient to ensure uniqueness ofx, thus one needs to further regularize the inverse problem. The declipping inverse problem is amenable to several regularization approaches proposed in the literature, such as based on linear prediction, minimization of the energy of high order derivatives, psychoacoustics, sparsity and cosparsity (where we introduced a simplified version of the analysis-based algorithm presented in this paper). The last two priors, briefly explained in the next section, enable some state-of-the-art methods in clipping restoration. In this paper we empirically compare the performance of the two priors, by means of a declipping algorithm which is easily adaptable to both cases. Our findings are that the sparsity-based version of the algorithm marginally outperforms the cosparsity-based one, but this fact may be attributed to the choice of the stopping criterion. On the other hand, for a class of analysis operators, the cosparsity-based algorithm has very low complexity per iteration, which makes it suitable for real-time audio processing. The sparse synthesis and sparse analysis data models It is well-known that the energy of audio signals is often concentrated either in a small number of frequency components, or in short temporal bursts, i.e. they are (approximately) time-frequency sparse. The traditional sparse synthesis viewpoint on this property is that audio signals are well approximated by linearly combining few columns of a dictionary matrix D ∈ C nd, d ≥ n such as a Gabor dictionary, i.e. x ≈ Dz, where z ∈ C d is sparse. A less explored alternative is the cosparse analysis perspective asserting that Ax is approximately sparse, with A ∈ C pn, p ≥ n and analysis operator. The two data models are different, unless p = n and A = D −1. Finding the sparsest (in the sense of synthesis or analysis) vector x satisfying constraints such as is in general intractable, but convex or greedy heuristics provide efficient algorithms with certain performance guarantees. Algorithms Some empirical evidence suggests that standard ℓ 1 convex relaxation does not perform well for sparse synthesis regularization of the declipping inverse problem. Therefore, we developed an algorithmic framework based on nonconvex heuristics, that can be straightforwardly parametrized for use in both the synthesis and the analysis setting. To allow for possible real-time implementation, the algorithms operate on individual blocks (chunks) of audio data, which is subsequently resynthesized by means of the overlap-add scheme. The heuristics should approximate the solution of the following synthesisand analysis-regularized inverse problems 1 : The indicator function 1 (y) of the constraint set (y) forces the estimate x to satisfy. The additional penalty 1 ℓ2≤ is a coupling functional. Its role is to enable the end-user to explicitly bound the distance between the estimate and its sparse approximation. These are difficult optimization problems: besides inherited NP-hardness, the two problems are also non-convex and non-smooth. We can represent and in an equivalent form, using the indicator function on the cardinality of z and an integer-valued unknown k: where F c (x, z) is the appropriate coupling functional. For a fixed k, problem can be seen as a variant of the regressor selection problem, which is (locally) solvable by the Alternating Direction Method of Multipliers (ADMM) : Analysis version The operator H k (v) performs hard thresholding, i.e. sets all but k highest in magnitude components of v to zero. Unlike the standard regressor selection algorithm, for which the ADMM multiplier needs to be appropriately chosen to avoid divergence, the above formulation is independent of its value. In practice, it is difficult to guess the optimal value of k beforehand. An adaptive estimation strategy is to periodically increase k (starting from some small value), perform several runs of for a given k and repeat the procedure until the constraint embodied by F c is satisfied. This corresponds to sparsity relaxation: as k gets larger, the estimated z becomes less sparse. The proposed algorithm, dubbed SParse Audio DEclipper (SPADE), comes in two flavors. The pseudocodes for the synthesis version ("S-SPADE ") and for the analysis version ("A-SPADE ") are given in Algorithm 1 and Algorithm 2. if i mod r = 0 then 10: k ← k + s 11: end if 12: go to 2 13: end if 14: returnx = D (i) if i mod r = 0 then 10: k ← k + s 11: end if 12: go to 2 13: end if 14: returnx =x (i) The relaxation rate and the relaxation stepsize are controlled by the integervalued parameters r > 0 and s > 0, while the parameter > 0 is the stopping threshold. Lemma 1 The SPADE algorithms terminate in no more than i = ⌈dr/s + 1⌉ iterations. Proof. Once k ≥ d, the hard thresholding operation H k becomes an identity mapping. Then, the minimizer of the constrained least squares step 3 is (i−1) (respectively,x (i−1) ) and the distance measure in the step 4 is equal to u (i−1) 2. But, in the subsequent iteration, u (i−1) = 0 and the algorithm terminates. This bound is quite pessimistic: in practice, we observed that the algorithm terminates much sooner, which suggest that there might be a sharper upper bound on the iteration count. Computational aspects The general form of the SPADE algorithms does not impose restrictions on the choice of the dictionary nor the analysis operator. From a practical perspective, however, it is important that the complexity per iteration is kept low. The dominant cost of SPADE is in the evaluation of the linearly constrained least squares minimizer step, whose computational complexity can be generally high. Fortunately, for some choices of D and A this cost is dramatically reduced. Namely, if the matrix A H forms a tight frame (A H A = I), it is easy to show that the step 3 of A-SPADE reduces to 2 : The projection P () is straightforward and corresponds to component-wise mappings, thus the per iteration cost of the algorithm is reduced to the cost of evaluating matrix-vector products. On the other hand, for S-SPADE this simplification is not possible and the constrained minimization in step 3 needs to be computed iteratively. However, by exploiting the tight frame property of D = A H and the Woodbury matrix identity, one can build an efficient algorithm that solves this optimization problem with low complexity. Finally, the computational cost can be further reduced if the matrix-vector products with D and A can be computed with less than quadratic cost. Some transforms that support both tight frame property and fast product computation are also favorable in our audio (co)sparse context. Such well-known transforms are Discrete Fourier Transform, (Modified) Discrete Cosine Transform, (Modified) Discrete Sine Transform and Discrete Wavelet Transform, for instance. Experiments The experiments are aimed to highlight differences in signal enhancement performance between S-SPADE and A-SPADE, and implicitly, the sparse and cosparse data models. It is noteworthy that in the formally equivalent setting (A = D −1 ), the two algorithms become identical. As a sanity-check, we include this setting in the experiments. The relaxation parameters are set to r = 1 and s = 1, and the stopping threshold is = 0.1. In addition to SPADE algorithms, we also include Consistent IHT and social sparsity declipping algorithm as representatives of state-of-the-art. The latter two algorithms use the sparse synthesis data model for regularizing the declipping inverse problem. Consistent IHT is a low-complexity algorithm based on famous Iterative Hard Thresholding for Compressed Sensing, while the social sparsity declipper is based on a structured sparsity prior. As mentioned before, this work is not aimed towards investigating the appropriateness of various time-frequency transforms in the context of audio recovery, which is why we choose traditional Short Time Fourier Transform (STFT) for all experiments. We use sliding square-rooted Hamming window of size 1024 samples with 75% overlap. The redundancy level of the involved frames (corresponding to per-chunk inverse DFT for the dictionary and forward DFT for the analysis operator) is 1 (no redundancy), 2 and 4. The social sparsity declipper, based on Gabor dictionary, requires batch processing of the whole signal. We adjusted the temporal shift, the window and the number of frequency bins in accordance with previously mentioned STFT settings 3. For a measure of performance, we use a simple difference between signal-to-distortion ratios of clipped (SDR y ) and processed (SDRx) signals:, SDRx = 20 log 10 Hence, only the samples corresponding to clipped indices are taken into account. Concerning SPADE, this choice makes no difference, since the remainder of the estimatex perfectly fits the observations y. However, it may favor the other two algorithms that do not share this feature. Audio examples consist of 10 music excerpts taken from RWC database, which significantly differ in tonal and vocal content. The excerpts are of approximately similar duration (∼ 10s), and are sampled at 16kHz with 16bit encoding. The inputs are generated by artificially clipping the audio excerpts at five levels, ranging from severe (SDR y = 1dB) towards mild (SDR y = 10dB). According to the results presented in figure 1, the SPADE algorithms yield highest improvement in SDR among the four considered approaches. As assumed, S-SPADE and A-SPADE achieve similar results in a non-redundant setting, but when the overcomplete frames are considered, the synthesis version performs somewhat better. Interestingly, the overall best results for the analysis version are obtained for the twice-redundant frame, while the performance slightly drops for the redundancy four. This is probably due to the absolute choice of the parameter, and suggests that in the analysis setting, this value should be replaced by a relative threshold instead. In the non-redundant case, declipping by A-SPADE and Consistent IHT took (on the average) 3min and 7min, respectively, while the other two algorithms were much slower 4 (on the order of hours). Conclusion We presented a novel algorithm for non-convex regularization of the declipping inverse problem. The algorithm is flexible in terms that it can easily accommodate sparse (S-SPADE) or cosparse (A-SPADE) prior, and as such has been used to compare the recovery performance of the two data models. The empirical results are slightly in favor of the sparse synthesis data model. However, the analysis version does not fall far behind, which makes it attractive for practical applications. Indeed, due to the natural way of imposing clipping consistency constraints, it can be implemented in an extremely efficient way, even allowing for a real-time signal processing. Benchmark on real audio data demonstrates that both versions outperform considered state-of-the-art algorithms in the field. Future work will be dedicated to theoretical analysis of the algorithm, with emphasis on convergence. A possible extension is envisioned by introducing structured (co)sparsity priors in the presented algorithmic framework.
<reponame>weijie88/spider_files ''' 当遇到动态cookie的时候 那么我们直接定位写死的cookie的时候 那么就不会 进入到藏书架 假设 全书网是一个动态cookie 那么解决方案: 1 获取登陆cookie 2 把cookie给藏书家 动态获取cookie的使用步骤: 1 import http.cookiejar 2 cookie = http.cookiejar.CookieJar() 3 handler 4 opener 5 open ''' import urllib.request import urllib.parse import http.cookiejar post_url = 'http://www.quanshuwang.com/login.php?do=submit' headers={ 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36' } data = { 'username': 'action', 'password': '<PASSWORD>', 'action': 'login', } data = urllib.parse.urlencode(data).encode('gbk') request = urllib.request.Request(url=post_url,headers=headers,data=data) cookie = http.cookiejar.CookieJar() #hangler opener open handler = urllib.request.HTTPCookieProcessor(cookie) opener = urllib.request.build_opener(handler) response = opener.open(request) #如果说opener中包含了登陆的cookie 那么我再次通过opener。open(藏书家) #是不是就可以访问藏书家了呢 get_url = 'http://www.quanshuwang.com/modules/article/bookcase.php' headers = { 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36', } request1 = urllib.request.Request(url=get_url,headers=headers) response1 = opener.open(request1) print(response1.read().decode('gbk'))
import { SyntaxRoot } from "./syntax_root" import { GreenElement, greenToChildren, greenToTextLen } from "./green" import { LazyNode, lazyNodeGetOrInit, lazyNodeFromSeed } from "./lazy_node" import { TextUnit } from "./types" import { exhaust } from "./util"; import { SyntaxKind } from "./syntax_kind"; /** * 具象構文木の子ノードから見た親ノードの情報 */ interface ParentData { /** 親ノード */ parentNode: SyntaxNode, /** 親ノードがテキスト上で占める範囲の開始位置 */ startOffset: TextUnit, /** 親ノードの何番目の子ノードであるか */ indexInParent: number, } /** * 具象構文木のノード * * Green ツリーのノード (親ノードを参照していない、ソースコードにおける範囲は相対的な大きさしか知らない) をラップしたもの。 * これは親ノードとの関係や、元のソースコードにおける絶対的な範囲を持つ */ export interface SyntaxNode { root: SyntaxRoot, parentData: ParentData | null, green: GreenElement, children: LazyNode[], } const NO_PARENT = null const parentToStartOffset = (parent: ParentData | null) => parent ? parent.startOffset : 0 const syntaxNodeNew = (root: SyntaxRoot, parent: ParentData | null, green: GreenElement): SyntaxNode => { let startOffset = parentToStartOffset(parent) const greenChildren = greenToChildren(green) const children: LazyNode[] = [] for (let i = 0; i < greenChildren.length; i++) { const g = greenChildren[i] const offset = startOffset startOffset += greenToTextLen(g) if (g.type === "token") { continue } if (g.type === "node") { children.push(lazyNodeFromSeed(offset, i)) continue } throw exhaust(g) } return { root, parentData: parent, children, green, } } export const syntaxNodeNewRoot = (root: SyntaxRoot, green: GreenElement): SyntaxNode => syntaxNodeNew(root, NO_PARENT, green) const syntaxNodeNewChild = (parentData: ParentData, green: GreenElement): SyntaxNode => syntaxNodeNew(parentData.parentNode.root, parentData, green) export const syntaxNodeFromGreenTree = (green: GreenElement): SyntaxNode => { const root: SyntaxRoot = { type: "root" } const lazyNode = lazyNodeFromSeed(0, 0) const syntaxNode = lazyNodeGetOrInit(lazyNode, () => syntaxNodeNewRoot(root, green)) return syntaxNode } export const syntaxNodeToKind = (node: SyntaxNode): SyntaxKind => node.green.kind /** * 具象構文木の子ノードのリストを生成する。 * * 具象構文木は構築が遅延されているので、子ノードはこの関数を初めて呼んだときに生成される。 */ export const syntaxNodeToChildren = (node: SyntaxNode): SyntaxNode[] => { const greenChildren = greenToChildren(node.green) const childNodeCount = node.children.length const childNodes: SyntaxNode[] = [] for (let i = 0; i < childNodeCount; i++) { const childNode = lazyNodeGetOrInit(node.children[i], (startOffset, greenIndex) => { const parentData: ParentData = { startOffset, parentNode: node, indexInParent: i, } return syntaxNodeNewChild(parentData, greenChildren[greenIndex]) }) childNodes.push(childNode) } return childNodes }
Performance Analysis of Data Compression Algorithms for Energy Efficient Wireless Sensor Networks Wireless Sensor Networks (WSN), is an intensive area of research which is often used for monitoring, sensing and tracking various environmental conditions. It consists of a number of sensor nodes that are powered with fixed low powered batteries. These batteries cannot be changed often as most of the WSN will be in remote areas. Life time of WSN mainly depends on the energy consumed by the sensor nodes. In order to prolong the networks life time, the energy consumption has to be reduced. Different energy saving schemes has been proposed over the years. Data compression is one among the proposed schemes that can scale down the amount of data transferred between nodes and results in energy saving. In this paper, an attempt is made to analyze the performances of three different data compression algorithms viz. Light Weight Temporal Compression (LTC), Piecewise Linear Approximation with Minimum Number of Line Segments (PLAMLIS) and Univariate Least Absolute Selection and Shrinkage Operator (ULASSO). These algorithms are tested on standard univariate datasets and evaluated using assessment metrics like Mean Square Error (MSE), compression ratio and energy consumption. The results show that the ULASSO algorithm outperforms other algorithms in all three metrics and contributes more towards energy consumption
# This should be run in the docker from __future__ import print_function from cufacesearch.indexer.hbase_indexer_minimal import HBaseIndexerMinimal import sys start_row = '0' * 40 # Change that hbim = HBaseIndexerMinimal('../conf/generated/conf_extraction_lfw_local_dlib.json') #hbim.get_updates_from_date() nb_face = 0 nb_image = 0 prev_row = '~' curr_row = start_row #print(curr_row) file_names = [] sha1s = [] #print('Scanning', end='', flush=True) sys.stdout.write('Scanning') sys.stdout.flush() while prev_row != curr_row+'~': prev_row = curr_row #if prev_row != start_row: prev_row += '~' #print(prev_row) #print('.', end='', flush=True) sys.stdout.write('.') sys.stdout.flush() for row in hbim.scan_from_row(hbim.table_sha1infos_name, row_start=prev_row, columns=['ext', 'info']): nb_image += 1 file_names.append(row[1]["info:img_path"]) for k in row[1]: if k.startswith("ext:dlib_feat_dlib_face") and not k.endswith("updateid") and not k.endswith("processed"): nb_face += 1 curr_row = row[0] #print('\n', flush=True) sys.stdout.write('\n') sys.stdout.flush() ufn = list(set(file_names)) print(nb_image, ufn[0], len(file_names), len(ufn), nb_face) # url = data['info:s3_url'] # for key in data: # if key.startswith('face:'): # face_bbox = key.split('face:dlib_feat_dlib_face_')[-1].split('_') # feat_b64 = np.frombuffer(base64.b64decode(data[key]), dtype=np.float32) # print feat_b64.shape, feat_b64 # show_bbox_from_URL(url, map(int, face_bbox), close_after=1)
/** * convert an unsigned long to a String * * @param li unsigned int * @return equivilent long value */ static public String unsignedLongToString(long li) { if (li >= 0) return Long.toString(li); byte[] val = new byte[8]; for (int i = 0; i < 8; i++) { val[7 - i] = (byte) ((li) & 0xFF); li = li >>> 8; } BigInteger biggy = new BigInteger(1, val); return biggy.toString(); }
PROSPECTS FOR REFORM OF MEDICAL COVERAGE IN MOROCCO For equal access to health care and to allow citizens greater access to the health system, Law 65-00 relating to Basic Health Insurance (BHI) was created in Morocco in 2005. The development of this law marks the starting point for all optimized actions with measurable objectives in the health sector. Even if this law has evolved gradually to try to generalize medical coverage, but it currently remains obsolete, because fifteen years after its implementation, it has not allowed the universalization of medical coverage to all citizens. However, further reform is called for. Government, institutions and society are under increasing pressure to ensure further reform. The constraints of implementing solid governance, financing, equal access to healthcare services are challenges to be taken up in order to reform the regulations relating to medical coverage in Morocco.
/******************************************************************************* * Copyright 2016-2020 Intel Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. *******************************************************************************/ #include "dnnl_types.h" #include "common/c_types_map.hpp" #include "common/dnnl_thread.hpp" #include "common/type_helpers.hpp" #include "common/utils.hpp" #include "cpu/gemm_convolution.hpp" #include "cpu/ref_eltwise.hpp" namespace dnnl { namespace impl { namespace cpu { using namespace dnnl::impl::status; using namespace dnnl::impl::memory_tracking::names; using namespace dnnl::impl::utils; namespace { struct im_pos_t { im_pos_t() : n {0}, g {0}, od {0}, sp {0}, ic {0}, oc {0} {} int n, g, od, sp, ic, oc; bool do_im2col(const im_pos_t &prev) const { return true && (n != prev.n || g != prev.g || od != prev.od || sp != prev.sp || ic != prev.ic); } }; } // namespace status_t gemm_convolution_fwd_t::execute_forward_nspc( const exec_ctx_t &ctx) const { auto src_base = CTX_IN_MEM(const data_t *, DNNL_ARG_SRC); auto wei_base = CTX_IN_MEM(const data_t *, DNNL_ARG_WEIGHTS); auto bia_base = CTX_IN_MEM(const data_t *, DNNL_ARG_BIAS); auto dst_base = CTX_OUT_MEM(data_t *, DNNL_ARG_DST); auto scratchpad = ctx.get_scratchpad_grantor(); const conv_gemm_conf_t &jcp = pd()->jcp_; status_t st = status::success; parallel(jcp.nthr, [&](const int ithr, const int nthr) { status_t st_thr = execute_forward_thr_nspc( ithr, nthr, src_base, wei_base, bia_base, dst_base, scratchpad); if (st_thr != status::success) st = st_thr; }); return st; } status_t gemm_convolution_fwd_t::execute_forward_thr_nspc(const int ithr, const int nthr, const data_t *src_base, const data_t *wei_base, const data_t *bia_base, data_t *dst_base, const memory_tracking::grantor_t &scratchpad) const { const conv_gemm_conf_t &jcp = pd()->jcp_; // Src Format: mb-spatial-groups-input_channels const size_t src_mb_stride = static_cast<size_t>(jcp.id) * jcp.ih * jcp.iw * jcp.ngroups * jcp.ic; const size_t src_g_stride = jcp.ic; // Wei Format: spatial-input_channels-groups-output_channels const size_t wei_g_stride = pd()->with_groups() ? jcp.oc : 0; // Dst Format: mb-spatial-groups-output_channels const size_t dst_mb_stride = static_cast<size_t>(jcp.od) * jcp.oh * jcp.ow * jcp.ngroups * jcp.oc; const size_t dst_g_stride = jcp.oc; const size_t dst_os_stride = jcp.ngroups * jcp.oc; data_t *__restrict col = scratchpad.get<data_t>(key_conv_gemm_col) + (ptrdiff_t)ithr * jcp.im2col_sz; data_t *__restrict imtr = scratchpad.get<data_t>(key_conv_gemm_imtr) + (ptrdiff_t)ithr * jcp.is * jcp.ic; int g {0}, n {0}, ohb {0}, owb {0}; size_t start = 0, end = 0; const bool is_problem_3d = pd()->ndims() == 5; assert(IMPLICATION(is_problem_3d, jcp.oh_block == jcp.oh && jcp.ow_block == jcp.ow && jcp.ic_block == jcp.ic)); assert(IMPLICATION(jcp.ow_block != jcp.ow, jcp.oh_block == 1)); const int nb_oh = div_up(jcp.oh, jcp.oh_block); const int nb_ow = div_up(jcp.ow, jcp.ow_block); // threads share work across mini-batch, groups, and blocked width/height const size_t work_amount = static_cast<size_t>(jcp.mb) * jcp.ngroups * nb_oh * nb_ow; balance211(work_amount, nthr, ithr, start, end); nd_iterator_init(start, n, jcp.mb, g, jcp.ngroups, ohb, nb_oh, owb, nb_ow); if (jcp.im2col_sz && is_problem_3d) { // jit_gemm_convolution_utils::im2col_dt_3d() requires external // data initialization by zeroes PRAGMA_OMP_SIMD() for (ptrdiff_t i = 0; i < jcp.im2col_sz; i++) col[i] = 0.0f; } for (size_t iwork = start; iwork < end; ++iwork) { int oh = ohb * jcp.oh_block; int ow = owb * jcp.ow_block; const data_t *__restrict src = src_base + n * src_mb_stride + g * src_g_stride; const data_t *__restrict wei = wei_base + g * wei_g_stride; const int h_step = nstl::min(jcp.oh_block, jcp.oh - oh); const int w_step = nstl::min(jcp.ow_block, jcp.ow - ow); if (jcp.im2col_sz && is_problem_3d) { jit_gemm_convolution_utils::transpose_dt(jcp, src, imtr); } for (int od = 0; od < jcp.od; od++) { data_t *__restrict dst = dst_base + n * dst_mb_stride + g * dst_g_stride + ((od * jcp.oh + oh) * jcp.ow + ow) * dst_os_stride; if (jcp.im2col_sz) { if (is_problem_3d) jit_gemm_convolution_utils::im2col_dt_3d<data_t, data_t>( jcp, imtr, col, od); else jit_gemm_convolution_utils::im2col_dt<data_t, data_t>( jcp, src, imtr, col, oh, h_step, ow, w_step); } const dim_t M = jcp.oc; const dim_t K = jcp.ks * jcp.ic; const dim_t N = h_step * w_step; const dim_t LDA = M * jcp.ngroups; const dim_t LDB = jcp.im2col_sz ? N : K * jcp.ngroups; const dim_t LDC = M * jcp.ngroups; const char *BT = jcp.im2col_sz ? "T" : "N"; const data_t onef = 1.f; const float beta = this->beta_; const data_t *__restrict src_od = src + od * jcp.oh * jcp.ow * jcp.ngroups * jcp.ic; status_t st = extended_sgemm("N", BT, &M, &N, &K, &onef, wei, &LDA, jcp.im2col_sz ? col : (data_t *)src_od, &LDB, &beta, dst, &LDC); if (st != status::success) return st; if (jcp.with_bias || eltwise_) { parallel(0, [&](int ithr, int nthr) { size_t start, end; balance211((size_t)N * jcp.oc, nthr, ithr, start, end); const size_t first_oc = start % jcp.oc; const size_t last_oc = (end - 1) % jcp.oc; const size_t first_os = start / jcp.oc; const size_t last_os = (end - 1) / jcp.oc; for (size_t os = first_os; os <= last_os; ++os) { const size_t start_oc = (os == first_os) ? first_oc : 0; const size_t end_oc = (os == last_os) ? last_oc : jcp.oc - 1; const data_t *__restrict bia_arr = bia_base + g * jcp.oc; data_t *__restrict dst_arr = dst + os * dst_os_stride; if (jcp.with_bias) { PRAGMA_OMP_SIMD() for (size_t oc = start_oc; oc <= end_oc; oc++) { dst_arr[oc] += bia_arr[oc]; } } // fast branch for ReLU case if (eltwise_ && eltwise_->alg_ == alg_kind::eltwise_relu) { const auto alpha = eltwise_->alpha_; const auto scale = eltwise_->scale_; PRAGMA_OMP_SIMD() for (size_t oc = start_oc; oc <= end_oc; oc++) { if (dst_arr[oc] < 0) dst_arr[oc] *= alpha; dst_arr[oc] *= scale; } } else if (eltwise_) { for (size_t oc = start_oc; oc <= end_oc; oc++) { dst_arr[oc] = eltwise_->compute_scalar(dst_arr[oc]); } } } }); } } nd_iterator_step(n, jcp.mb, g, jcp.ngroups, ohb, nb_oh, owb, nb_ow); } return status::success; } status_t gemm_convolution_fwd_t::execute_forward_ncsp( const exec_ctx_t &ctx) const { auto src = CTX_IN_MEM(const data_t *, DNNL_ARG_SRC); auto weights = CTX_IN_MEM(const data_t *, DNNL_ARG_WEIGHTS); auto bias = CTX_IN_MEM(const data_t *, DNNL_ARG_BIAS); auto dst = CTX_OUT_MEM(data_t *, DNNL_ARG_DST); auto col = ctx.get_scratchpad_grantor().get<data_t>(key_conv_gemm_col); const conv_gemm_conf_t &jcp = this->pd()->jcp_; const size_t src_step = jcp.ic * jcp.ih * jcp.iw * jcp.id; const size_t weights_oc_size = jcp.ic * jcp.ks; const size_t weights_g_size = weights_oc_size * jcp.oc; const bool is_problem_3d = pd()->ndims() == 5; assert(IMPLICATION( is_problem_3d, jcp.os_block == jcp.os && jcp.ic_block == jcp.ic)); status_t st = status::success; parallel(jcp.nthr, [&](const int ithr, const int nthr) { data_t *_col = col + (ptrdiff_t)ithr * jcp.im2col_sz; // non-blocked jit_gemm_convolution_utils::im2col_3d() requires // external data initialization by zeroes const bool outer_padding = jcp.os_nb_block == 1; if (outer_padding && is_problem_3d) { for (ptrdiff_t i = 0; i < jcp.im2col_sz; i++) _col[i] = (data_t)0; } auto inner_ker = [&](int spatial, const im_pos_t &curr, im_pos_t &prev, im_pos_t &step, const im_pos_t &end) { const data_t *_src = src + (curr.n * jcp.ngroups + curr.g) * src_step; step.oc = nstl::min( jcp.oc_block, nstl::min(jcp.oc, end.oc) - curr.oc); step.sp = nstl::min(jcp.os_block, nstl::min(jcp.os - curr.sp, end.sp - spatial)); step.ic = nstl::min( jcp.ic_block, nstl::min(jcp.ic, end.ic) - curr.ic); bool do_im2col = curr.do_im2col(prev); prev = curr; if (jcp.im2col_sz && do_im2col) { if (!is_problem_3d) jit_gemm_convolution_utils::im2col<float>(jcp, _src, _col, curr.sp, step.sp, curr.ic, step.ic); else jit_gemm_convolution_utils::im2col_3d<float>( jcp, _src, _col, curr.od, 0, jcp.os); } const data_t one = 1.0; const dim_t M = jcp.os * jcp.od; const size_t dst_step = jcp.oc * M; const dim_t m = step.sp; const dim_t LDA = jcp.im2col_sz ? m : M; data_t *_dst = dst + (curr.n * jcp.ngroups + curr.g) * dst_step + curr.oc * M + curr.od * jcp.os + curr.sp; const dim_t K = step.ic * jcp.ks; const dim_t LDB = jcp.ic * jcp.ks; const dim_t N = step.oc; // TODO: what if this->beta_ != 0 && != 1 ? const float beta = (curr.ic == 0) ? this->beta_ : one; const float *_source = jcp.im2col_sz ? _col : _src + curr.ic * M + curr.od * jcp.os + curr.sp; const data_t *_weights = weights + curr.g * weights_g_size + curr.oc * weights_oc_size + curr.ic * jcp.ks; status_t st = extended_sgemm("N", "N", &m, &N, &K, &one, _source, &LDA, _weights, &LDB, &beta, _dst, &M); if (st != status::success) return st; if (curr.ic == jcp.ic - step.ic) { // TODO: for "outer threading" we have parallel section within // outermost "parallel". It is not good. Consider to use // "parallel" here with number of threads passed as parameter const int oc_start = curr.g * jcp.oc + curr.oc; if (eltwise_) { // fast branch for ReLU case if (eltwise_->alg_ == alg_kind::eltwise_relu) { parallel_nd(step.oc, [&](const int oc) { data_t b = jcp.with_bias ? bias[oc_start + oc] : 0; data_t *d_ = _dst + oc * M; PRAGMA_OMP_SIMD() for (int oS = 0; oS < m; ++oS) { d_[oS] += b; if (d_[oS] < 0) d_[oS] *= eltwise_->alpha_; d_[oS] *= eltwise_->scale_; } }); } else { parallel_nd(step.oc, [&](const int oc) { data_t b = jcp.with_bias ? bias[oc_start + oc] : 0; data_t *d_ = _dst + oc * M; PRAGMA_OMP_SIMD() for (int oS = 0; oS < m; ++oS) { d_[oS] += b; d_[oS] = eltwise_->compute_scalar(d_[oS]); } }); } } else if (jcp.with_bias) { parallel_nd(step.oc, [&](const int oc) { data_t b = bias[oc_start + oc]; data_t *d_ = _dst + oc * M; PRAGMA_OMP_SIMD() for (int oS = 0; oS < m; ++oS) { d_[oS] += b; } }); } } return status::success; }; im_pos_t start, end; end.ic = jcp.ic; if (!is_problem_3d) { const int sp_work = jcp.mb * jcp.ngroups * jcp.od * jcp.os; balance2D(nthr, ithr, sp_work, start.sp, end.sp, jcp.oc, start.oc, end.oc, jcp.nthr_oc); } else { const int sp_work = jcp.mb * jcp.ngroups * jcp.od; balance2D(nthr, ithr, sp_work, start.sp, end.sp, jcp.oc, start.oc, end.oc, jcp.nthr_oc); start.sp *= jcp.os; end.sp *= jcp.os; } im_pos_t curr, prev, step; prev.n = prev.g = prev.od = prev.sp = prev.ic = -1; step.oc = jcp.oc_block; step.sp = jcp.os_block; step.ic = jcp.ic_block; if (jcp.loop_order == gemm_loop_rlb) for (curr.ic = 0; curr.ic < jcp.ic; curr.ic += step.ic) for (int spatial = start.sp; spatial < end.sp; spatial += step.sp) { nd_iterator_init(spatial, curr.n, jcp.mb, curr.g, jcp.ngroups, curr.od, jcp.od, curr.sp, jcp.os); for (curr.oc = start.oc; curr.oc < end.oc; curr.oc += step.oc) { status_t st_thr = inner_ker(spatial, curr, prev, step, end); if (st_thr != status::success) { st = st_thr; return; } } } else if (jcp.loop_order == gemm_loop_lrb) for (int spatial = start.sp; spatial < end.sp; spatial += step.sp) { nd_iterator_init(spatial, curr.n, jcp.mb, curr.g, jcp.ngroups, curr.od, jcp.od, curr.sp, jcp.os); for (curr.ic = 0; curr.ic < jcp.ic; curr.ic += step.ic) for (curr.oc = start.oc; curr.oc < end.oc; curr.oc += step.oc) { status_t st_thr = inner_ker(spatial, curr, prev, step, end); if (st_thr != status::success) { st = st_thr; return; } } } else st = status::unimplemented; }); return st; } status_t gemm_convolution_bwd_data_t::execute_backward_data_nspc( const exec_ctx_t &ctx) const { auto diff_dst_base = CTX_IN_MEM(const data_t *, DNNL_ARG_DIFF_DST); auto wei_base = CTX_IN_MEM(const data_t *, DNNL_ARG_WEIGHTS); auto bia_base = CTX_IN_MEM(const data_t *, DNNL_ARG_BIAS); auto diff_src_base = CTX_OUT_MEM(data_t *, DNNL_ARG_DIFF_SRC); auto scratchpad = ctx.get_scratchpad_grantor(); const conv_gemm_conf_t &jcp = pd()->jcp_; status_t st = status::success; parallel(jcp.nthr, [&](const int ithr, const int nthr) { status_t st_thr = execute_backward_data_thr_nspc(ithr, nthr, diff_dst_base, wei_base, bia_base, diff_src_base, scratchpad); if (st_thr != status::success) st = st_thr; }); return st; } status_t gemm_convolution_bwd_data_t::execute_backward_data_thr_nspc( const int ithr, const int nthr, const data_t *diff_dst_base, const data_t *wei_base, const data_t *bia_base, data_t *diff_src_base, const memory_tracking::grantor_t &scratchpad) const { const conv_gemm_conf_t &jcp = pd()->jcp_; // Diff_dst Format: mb-spatial-groups-output_channels const size_t diff_dst_mb_stride = static_cast<size_t>(jcp.od) * jcp.oh * jcp.ow * jcp.ngroups * jcp.oc; const size_t diff_dst_g_stride = jcp.oc; // Wei Format: spatial-input_channels-groups-output_channels const size_t wei_g_stride = pd()->with_groups() ? jcp.oc : 0; // Diff_src Format: mb-spatial-groups-input_channels const size_t diff_src_mb_stride = static_cast<size_t>(jcp.id) * jcp.ih * jcp.iw * jcp.ngroups * jcp.ic; const size_t diff_src_g_stride = jcp.ic; const size_t diff_src_os_stride = jcp.ngroups * jcp.ic; // threads share work across mini-batch and groups const size_t work_amount = jcp.ngroups * jcp.mb; data_t *__restrict col = scratchpad.get<data_t>(key_conv_gemm_col) + (ptrdiff_t)ithr * jcp.im2col_sz; const bool acc_needed = jcp.ngroups > 1; data_t *__restrict acc = acc_needed ? scratchpad.get<data_t>(key_conv_gemm_acc) + (ptrdiff_t)ithr * jcp.is * jcp.id * jcp.ic : nullptr; int n {0}, g {0}; size_t start = 0, end = 0; balance211(work_amount, nthr, ithr, start, end); nd_iterator_init(start, n, jcp.mb, g, jcp.ngroups); for (size_t iwork = start; iwork < end; ++iwork) { const data_t *__restrict diff_dst = diff_dst_base + n * diff_dst_mb_stride + g * diff_dst_g_stride; const data_t *__restrict wei = wei_base + g * wei_g_stride; data_t *__restrict diff_src = diff_src_base + n * diff_src_mb_stride + g * diff_src_g_stride; const dim_t M = jcp.ks * jcp.ic; const dim_t N = jcp.os * jcp.od; const dim_t K = jcp.oc; const data_t onef = 1.0f, zerof = 0.0f; const dim_t LD = K * jcp.ngroups; status_t st = extended_sgemm("T", "N", &M, &N, &K, &onef, wei, &LD, diff_dst, &LD, &zerof, jcp.im2col_sz ? col : (acc_needed ? acc : diff_src), &M); if (st != status::success) return st; if (jcp.im2col_sz) jit_gemm_convolution_utils::col2im_dt<data_t>( jcp, col, (acc_needed ? acc : diff_src)); if (acc_needed) { parallel_nd(static_cast<size_t>(jcp.is) * jcp.id, [&](size_t is) { data_t *__restrict diff_src_arr = diff_src + is * diff_src_os_stride; const data_t *__restrict acc_arr = acc + is * jcp.ic; PRAGMA_OMP_SIMD() for (int ic = 0; ic < jcp.ic; ic++) { diff_src_arr[ic] = acc_arr[ic]; } }); } nd_iterator_step(n, jcp.mb, g, jcp.ngroups); } return status::success; } status_t gemm_convolution_bwd_data_t::execute_backward_data_ncsp( const exec_ctx_t &ctx) const { auto diff_dst = CTX_IN_MEM(const data_t *, DNNL_ARG_DIFF_DST); auto weights = CTX_IN_MEM(const data_t *, DNNL_ARG_WEIGHTS); auto diff_src = CTX_OUT_MEM(data_t *, DNNL_ARG_DIFF_SRC); auto col = ctx.get_scratchpad_grantor().get<data_t>(key_conv_gemm_col); const conv_gemm_conf_t &jcp = this->pd()->jcp_; const dim_t M = jcp.os * jcp.od; const size_t src_step = (size_t)jcp.ic * jcp.ih * jcp.iw * jcp.id; const size_t dst_step = (size_t)jcp.oc * M; const size_t weights_g_size = (size_t)jcp.ic * jcp.oc * jcp.ks; const dim_t m = jcp.os; const dim_t K = jcp.oc; const dim_t N = jcp.ic * jcp.ks; const dim_t LDC = jcp.im2col_sz ? m : M; const size_t work_amount = (size_t)jcp.ngroups * jcp.mb; const bool is_problem_3d = pd()->ndims() == 5; status_t st = status::success; parallel(jcp.nthr, [&](const int ithr, const int nthr) { data_t *_col = col + (ptrdiff_t)ithr * jcp.im2col_sz; int g {0}, n {0}; size_t start = 0, end = 0; balance211(work_amount, nthr, ithr, start, end); nd_iterator_init(start, g, jcp.ngroups, n, jcp.mb); for (size_t iwork = start; iwork < end; ++iwork) { data_t *_diff_src = diff_src + (n * jcp.ngroups + g) * src_step; if (is_problem_3d && jcp.im2col_sz > 0) { // jit_gemm_convolution_utils::col2im_3d() assumes that the // accumulator is initialized by zeroes for (size_t i = 0; i < src_step; i++) _diff_src[i] = (data_t)0; } const data_t *_weights = weights + g * weights_g_size; for (int od = 0; od < jcp.od; ++od) { const data_t *_diff_dst = diff_dst + (n * jcp.ngroups + g) * dst_step + od * m; const data_t zero = 0.0, one = 1.0; status_t st_thr = extended_sgemm("N", "T", &m, &N, &K, &one, _diff_dst, &M, _weights, &N, &zero, jcp.im2col_sz ? _col : _diff_src + od * m, &LDC); if (st_thr != status::success) { st = st_thr; return; } if (jcp.im2col_sz) { if (!is_problem_3d) jit_gemm_convolution_utils::col2im( jcp, _col, _diff_src); else jit_gemm_convolution_utils::col2im_3d( jcp, _col, _diff_src, od); } } nd_iterator_step(g, jcp.ngroups, n, jcp.mb); } }); return st; } status_t gemm_convolution_bwd_weights_t::execute_backward_weights_nspc( const exec_ctx_t &ctx) const { auto diff_dst = CTX_IN_MEM(const data_t *, DNNL_ARG_DIFF_DST); auto src = CTX_IN_MEM(const data_t *, DNNL_ARG_SRC); auto diff_weights = CTX_OUT_MEM(data_t *, DNNL_ARG_DIFF_WEIGHTS); auto diff_bias = CTX_OUT_MEM(data_t *, DNNL_ARG_DIFF_BIAS); auto col = ctx.get_scratchpad_grantor().get<data_t>(key_conv_gemm_col); const conv_gemm_conf_t &jcp = pd()->jcp_; auto wei_reduction = ctx.get_scratchpad_grantor().get<data_t>(key_conv_wei_reduction); const dim_t K = jcp.os * static_cast<size_t>(jcp.od); const size_t src_step = static_cast<size_t>(jcp.ic) * jcp.ih * jcp.iw * jcp.id; const size_t dst_step = jcp.oc * K; const size_t weights_g_size = jcp.oc; const dim_t k = jcp.os; const dim_t M = jcp.oc; const dim_t N = static_cast<dim_t>(jcp.ic) * jcp.ks; const dim_t LDB = jcp.ngroups * jcp.oc; const dim_t LDA = jcp.im2col_sz ? jcp.oh * jcp.ow : jcp.ngroups * jcp.ic; const bool is_problem_3d = pd()->ndims() == 5; status_t st = status::success; parallel(jcp.nthr, [&](const int ithr, const int nthr) { int ithr_g, nthr_g, ithr_mb, nthr_mb; size_t g_start {0}, g_end {0}, mb_start {0}, mb_end {0}; const int mb_for_balance = jcp.need_wei_reduction ? jcp.mb : 1; jit_gemm_convolution_utils::bwd_weights_balance(ithr, nthr, jcp.ngroups, mb_for_balance, ithr_g, nthr_g, ithr_mb, nthr_mb); assert(IMPLICATION(!jcp.need_wei_reduction, nthr_mb == 1)); const int need_reduction = nthr_mb != 1; const dim_t LDC = need_reduction ? jcp.oc : jcp.ngroups * jcp.oc; data_t *__restrict imtr = ctx.get_scratchpad_grantor().get<data_t>(key_conv_gemm_imtr) + (ptrdiff_t)ithr * jcp.id * jcp.ic * jcp.is; if (ithr_g != -1 && ithr_mb != -1) { balance211((size_t)jcp.ngroups, nthr_g, ithr_g, g_start, g_end); balance211((size_t)jcp.mb, nthr_mb, ithr_mb, mb_start, mb_end); assert(IMPLICATION((g_end - g_start) > 1, need_reduction == 0)); data_t *_col = col + (ptrdiff_t)ithr * jcp.im2col_sz; if (is_problem_3d) { // jit_gemm_convolution_utils::im2col_3d() requires external // data initialization by zeroes PRAGMA_OMP_SIMD() for (ptrdiff_t i = 0; i < jcp.im2col_sz; i++) _col[i] = 0.0f; } data_t *weights_reduce_base = wei_reduction + ithr_g * nthr_mb * weights_g_size * jcp.ks * jcp.ic; data_t *weights_reduce = weights_reduce_base + ithr_mb * weights_g_size * jcp.ks * jcp.ic; for (size_t g = g_start; g < g_end; ++g) { data_t *_diff_weights = need_reduction ? weights_reduce : diff_weights + g * weights_g_size; for (size_t mb = mb_start; mb < mb_end; ++mb) { const data_t *_src = src + mb * jcp.ngroups * src_step + g * jcp.ic; if (jcp.im2col_sz && is_problem_3d) jit_gemm_convolution_utils::transpose_dt( jcp, _src, imtr); for (int od = 0; od < jcp.od; ++od) { const data_t *_diff_dst = diff_dst + mb * jcp.ngroups * dst_step + od * k * jcp.ngroups * jcp.oc + g * jcp.oc; if (jcp.im2col_sz) { if (is_problem_3d) jit_gemm_convolution_utils::im2col_dt_3d<data_t, data_t>(jcp, imtr, _col, od); else jit_gemm_convolution_utils::im2col_dt<data_t, data_t>(jcp, _src, imtr, _col, 0, jcp.oh, 0, jcp.ow); } const data_t zero = 0.0f, one = 1.0f; status_t st_thr = extended_sgemm("N", jcp.im2col_sz ? "N" : "T", &M, &N, &k, &one, _diff_dst, &LDB, jcp.im2col_sz ? _col : _src + od * k * jcp.ngroups * jcp.ic, &LDA, mb == mb_start && od == 0 ? &zero : &one, _diff_weights, &LDC); if (st_thr != status::success) { st = st_thr; return; } } } } if (need_reduction && dnnl_thr_syncable()) { dnnl_thr_barrier(); jit_gemm_convolution_utils::bwd_weights_reduction_par_nspc( ithr_mb, nthr_mb, g_start, g_end, jcp, weights_reduce_base, diff_weights); } } else { if (need_reduction && dnnl_thr_syncable()) dnnl_thr_barrier(); } }); if (jcp.need_wei_reduction && !dnnl_thr_syncable()) { parallel(jcp.nthr, [&](const int ithr, const int nthr) { int ithr_g, nthr_g, ithr_mb, nthr_mb; size_t g_start {0}, g_end {0}; size_t mb_start {0}, mb_end {0}; const int mb_for_balance = jcp.need_wei_reduction ? jcp.mb : 1; jit_gemm_convolution_utils::bwd_weights_balance(ithr, nthr, jcp.ngroups, mb_for_balance, ithr_g, nthr_g, ithr_mb, nthr_mb); assert(IMPLICATION(!jcp.need_wei_reduction, nthr_mb == 1)); const int need_reduction = nthr_mb != 1; if (need_reduction && ithr_g != -1 && ithr_mb != -1) { balance211((size_t)jcp.ngroups, nthr_g, ithr_g, g_start, g_end); balance211((size_t)jcp.mb, nthr_mb, ithr_mb, mb_start, mb_end); assert(IMPLICATION((g_end - g_start) > 1, need_reduction == 0)); data_t *weights_reduce_base = wei_reduction + ithr_g * nthr_mb * weights_g_size * jcp.ic * jcp.ks; jit_gemm_convolution_utils::bwd_weights_reduction_par_nspc( ithr_mb, nthr_mb, g_start, g_end, jcp, weights_reduce_base, diff_weights); } }); } if (jcp.with_bias) { parallel_nd(jcp.ngroups, jcp.oc, [&](int g, int oc) { data_t db = 0; const size_t offset_base = g * jcp.oc + oc; for_(int mb = 0; mb < jcp.mb; ++mb) for_(int od = 0; od < jcp.od; ++od) for (int oh = 0; oh < jcp.oh; ++oh) { const data_t *__restrict diff_dst_arr = diff_dst + offset_base + ((static_cast<size_t>(mb) * jcp.od + od) * jcp.oh + oh) * jcp.ow * jcp.ngroups * jcp.oc; const int width_stride = jcp.ngroups * jcp.oc; PRAGMA_OMP_SIMD(reduction(+ : db)) for (int ow = 0; ow < jcp.ow; ++ow) { db += diff_dst_arr[ow * width_stride]; } } diff_bias[g * jcp.oc + oc] = db; }); } return st; } status_t gemm_convolution_bwd_weights_t::execute_backward_weights_ncsp( const exec_ctx_t &ctx) const { auto diff_dst = CTX_IN_MEM(const data_t *, DNNL_ARG_DIFF_DST); auto src = CTX_IN_MEM(const data_t *, DNNL_ARG_SRC); auto diff_weights = CTX_OUT_MEM(data_t *, DNNL_ARG_DIFF_WEIGHTS); auto diff_bias = CTX_OUT_MEM(data_t *, DNNL_ARG_DIFF_BIAS); auto col = ctx.get_scratchpad_grantor().get<data_t>(key_conv_gemm_col); auto wei_reduction = ctx.get_scratchpad_grantor().get<data_t>(key_conv_wei_reduction); const conv_gemm_conf_t &jcp = this->pd()->jcp_; const dim_t K = jcp.os * jcp.od; const size_t src_step = jcp.ic * jcp.ih * jcp.iw * jcp.id; const size_t dst_step = jcp.oc * K; const size_t weights_g_size = jcp.ic * jcp.oc * jcp.ks; const dim_t k = jcp.os_block; const dim_t N = jcp.oc; const dim_t M = jcp.ic * jcp.ks; const bool is_problem_3d = pd()->ndims() == 5; status_t st = status::success; parallel(jcp.nthr, [&](const int ithr, const int nthr) { int ithr_g, nthr_g, ithr_mb, nthr_mb; size_t g_start {0}, g_end {0}, mb_start {0}, mb_end {0}; const int mb_for_balance = jcp.need_wei_reduction ? jcp.mb : 1; jit_gemm_convolution_utils::bwd_weights_balance(ithr, nthr, jcp.ngroups, mb_for_balance, ithr_g, nthr_g, ithr_mb, nthr_mb); assert(IMPLICATION(!jcp.need_wei_reduction, nthr_mb == 1)); const int need_reduction = nthr_mb != 1; if (ithr_g != -1 && ithr_mb != -1) { balance211((size_t)jcp.ngroups, nthr_g, ithr_g, g_start, g_end); balance211((size_t)jcp.mb, nthr_mb, ithr_mb, mb_start, mb_end); assert(IMPLICATION((g_end - g_start) > 1, need_reduction == 0)); data_t *_col = col + (ptrdiff_t)ithr * jcp.im2col_sz; // non-blocked jit_gemm_convolution_utils::im2col_3d() requires // external data initialization by zeroes const bool outer_padding = jcp.os_nb_block == 1; if (outer_padding && is_problem_3d) { for (ptrdiff_t i = 0; i < jcp.im2col_sz; i++) _col[i] = (data_t)0; } data_t *weights_reduce_base = wei_reduction + ithr_g * nthr_mb * weights_g_size; data_t *weights_reduce = weights_reduce_base + ithr_mb * weights_g_size; for (size_t g = g_start; g < g_end; ++g) { data_t *_diff_weights = need_reduction ? weights_reduce : (diff_weights + g * weights_g_size); for (size_t mb = mb_start; mb < mb_end; ++mb) { const data_t *_src = src + (mb * jcp.ngroups + g) * src_step; for_(int od = 0; od < jcp.od; ++od) for (int os_nb = 0; os_nb < jcp.os_nb_block; ++os_nb) { auto out_off = os_nb * k + od * jcp.os; const dim_t os_block = nstl::min( (dim_t)jcp.os_block, jcp.os - os_nb * k); const data_t *_diff_dst = diff_dst + (mb * jcp.ngroups + g) * dst_step + out_off; if (jcp.im2col_sz) { if (!is_problem_3d) jit_gemm_convolution_utils::im2col<float>(jcp, _src, _col, os_nb * jcp.os_block, os_block, 0, jcp.ic); else jit_gemm_convolution_utils::im2col_3d<float>( jcp, _src, _col, od, os_nb * jcp.os_block, os_block); } const dim_t LDA = jcp.im2col_sz ? os_block : K; const data_t zero = 0.0, one = 1.0; status_t st_thr = extended_sgemm("T", "N", &M, &N, &os_block, &one, jcp.im2col_sz ? _col : _src + out_off, &LDA, _diff_dst, &K, mb == mb_start && os_nb == 0 && od == 0 ? &zero : &one, _diff_weights, &M); if (st_thr != status::success) { st = st_thr; return; } } } } if (need_reduction && dnnl_thr_syncable()) { dnnl_thr_barrier(); data_t *weights_base = diff_weights + g_start * weights_g_size; jit_gemm_convolution_utils::bwd_weights_reduction_par_ncsp( ithr_mb, nthr_mb, jcp, weights_reduce_base, weights_base); } } else { if (need_reduction && dnnl_thr_syncable()) dnnl_thr_barrier(); } }); if (st != status::success) return st; if (jcp.need_wei_reduction && !dnnl_thr_syncable()) { parallel(jcp.nthr, [&](const int ithr, const int nthr) { int ithr_g, nthr_g, ithr_mb, nthr_mb; size_t g_start {0}, g_end {0}; const int mb_for_balance = jcp.need_wei_reduction ? jcp.mb : 1; jit_gemm_convolution_utils::bwd_weights_balance(ithr, nthr, jcp.ngroups, mb_for_balance, ithr_g, nthr_g, ithr_mb, nthr_mb); assert(IMPLICATION(!jcp.need_wei_reduction, nthr_mb == 1)); const int need_reduction = nthr_mb != 1; if (need_reduction && ithr_g != -1 && ithr_mb != -1) { balance211((size_t)jcp.ngroups, nthr_g, ithr_g, g_start, g_end); assert(IMPLICATION((g_end - g_start) > 1, need_reduction == 0)); data_t *weights_reduce_base = wei_reduction + ithr_g * nthr_mb * weights_g_size; data_t *weights_base = diff_weights + g_start * weights_g_size; jit_gemm_convolution_utils::bwd_weights_reduction_par_ncsp( ithr_mb, nthr_mb, jcp, weights_reduce_base, weights_base); } }); } if (jcp.with_bias) { parallel_nd(jcp.ngroups, jcp.oc, [&](int g, int oc) { data_t db = 0; size_t offset_ = (size_t)g * dst_step + (size_t)oc * K; for (int mb = 0; mb < jcp.mb; ++mb) { size_t offset = offset_ + (size_t)mb * jcp.ngroups * dst_step; for_(int od = 0; od < jcp.od; ++od) for (int oh = 0; oh < jcp.oh; ++oh) PRAGMA_OMP_SIMD(reduction(+ : db)) for (int ow = 0; ow < jcp.ow; ++ow) { db += diff_dst[offset]; offset++; } } diff_bias[g * jcp.oc + oc] = db; }); } return st; } } // namespace cpu } // namespace impl } // namespace dnnl
// // Generated by class-dump 3.5 (64 bit). // // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by <NAME>. // #import "NSObject.h" #import "NSCopying.h" @class NSString; @interface SDTraceItem : NSObject <NSCopying> { double _startTime; long long _identifier; double _duration; NSString *_label; NSObject *_data; NSString *_string; } + (void)appendDescription:(id)arg1 prefix:(id)arg2 toString:(id)arg3; + (id)stringFromReferenceDate:(double)arg1; @property(retain, nonatomic) NSString *string; // @synthesize string=_string; @property(retain, nonatomic) NSObject *data; // @synthesize data=_data; @property(retain, nonatomic) NSString *label; // @synthesize label=_label; @property(nonatomic) double duration; // @synthesize duration=_duration; @property(nonatomic) long long identifier; // @synthesize identifier=_identifier; @property(nonatomic) double startTime; // @synthesize startTime=_startTime; - (void).cxx_destruct; - (id)description; - (id)copyWithZone:(struct _NSZone *)arg1; @end
Active and Dynamic Self-Regulation of Learning Processes It is generally assumed that learning is internalization of externally available knowledge and occurs under the active control of one internal source of self-regulation: executive self-regulation. This article argues that these assumptions undermine the creative and multisource nature of learning, limit its domain to incremental learning of facts and definitions, and are largely responsible for achievement and motivational problems children experience in schools. The article defines learning as creative reconceptualization of internal knowledge and proposes two different sources of internal self-regulation: one to regulate largely the sequential aspect of learning and another to coordinate its simultaneous aspect. To extend the domain of learning beyond incremental memorization of facts, both sources of internal self-regulation must be the target of cognitive and metacognitive instruction and research.
Safe screening tests for LASSO based on firmly non-expansiveness This paper focusses on safe screening techniques for the LASSO problem. We derive a new sphere test, coined RFNE, exploiting the firmly non-expansiveness of projection operators. Our test generalizes some methods of the literature but, unlike the latter, exploits approximated primal-dual solutions of the LASSO problem while remaining safe and effective. Our simulation results show that the proposed RFNE test outperforms the best methodology of the state of the art, namely the GAP test derived by Fercoq et al.
Carotenoid profiling and biosynthetic gene expression in flesh and peel of wild-type and hp-1 tomato fruit under UV-B depletion. Although light is recognized as one of the main factors influencing fruit carotenogenesis, the specific role of UV-B radiation has been poorly investigated. The present work is addressed to assess the molecular events underlying carotenoid accumulation in presence or absence of ultraviolet-B (UV-B) light in tomato fruits of wild-type and high pigment-1 (hp-1), a mutant characterized by exaggerated photoresponsiveness and increased fruit pigmentation. Gene expression analyses indicated that in wild-type fruits UV-B radiation mainly negatively affects the carotenoid biosynthetic genes encoding enzymes downstream of lycopene both in flesh and peel, suggesting that the down-regulation of genes CrtL-b and CrtL-e and the subsequent accumulation of lycopene during tomato ripening are determined at least in part by UV-B light. In contrast to wild-type, UV-B depletion did not greatly affect carotenoid accumulation in hp-1 and generally determined minor differences in gene expression between control and UV-B-depleted conditions.
package discovery import ( "context" v1 "github.com/solo-io/supergloo/pkg/api/v1" ) type MeshDiscoveryPlugins []MeshDiscovery type MeshDiscovery interface { DiscoverMeshes(ctx context.Context, snapshot *v1.DiscoverySnapshot) (v1.MeshList, error) }
import unittest import pytest from concepts import formats from conftest import TEST_OUTPUT @pytest.mark.parametrize('name, expected', [ ('table', formats.Table), ('cxt', formats.Cxt), ('csv', formats.Csv), ('wiki-table', formats.WikiTable), ]) def test_getitem(name, expected): assert formats.Format[name] is expected is formats.Format[name.upper()] def test_getitem_invalid(): with pytest.raises(KeyError): formats.Format['spam'] @pytest.mark.parametrize('filename, expected', [ ('spam.TXT', 'table'), ('spam.cxt', 'cxt'), ('spam.spam.csv', 'csv') ]) def test_infer_format(filename, expected): assert formats.Format.infer_format(filename) == expected def test_infer_format_invalid(): with pytest.raises(ValueError, match=r'filename suffix'): formats.Format.infer_format('spam.spam') class LoadsDumps: def test_loads(self): try: args = self.format.loads(self.result) except NotImplementedError: pass else: self.assertSequenceEqual(args.objects, self.objects) self.assertSequenceEqual(args.properties, self.properties) self.assertSequenceEqual(args.bools, self.bools) def test_dumps(self): result = self.format.dumps(self.objects, self.properties, self.bools) self.assertEqual(result, self.result) def test_dump_load(self, outdir=TEST_OUTPUT): extension = getattr(self.format, 'extension', '.txt') filepath = (outdir / self.__class__.__name__).with_suffix(extension) self.format.dump(str(filepath), self.objects, self.properties, self.bools, encoding=self.encoding) try: args = self.format.load(filepath, encoding=self.encoding) except NotImplementedError: pass else: self.assertSequenceEqual(args.objects, self.objects) self.assertSequenceEqual(args.properties, self.properties) self.assertSequenceEqual(args.bools, self.bools) class Ascii(LoadsDumps): objects = ('Cheddar', 'Limburger') properties = ('in_stock', 'sold_out') bools = [(False, True), (False, True)] encoding = None class Unicode(LoadsDumps): objects = ('M\xf8\xf8se', 'Llama') properties = ('majestic', 'bites') bools = [(True, True), (False, False)] encoding = 'utf-8' class TestCxtAscii(unittest.TestCase, Ascii): format = formats.Cxt result = '''\ B 2 2 Cheddar Limburger in_stock sold_out .X .X ''' class TextCxtUnicode(unittest.TestCase, Unicode): format = formats.Cxt result = '''\ B 2 2 Møøse Llama majestic bites XX .. ''' class TestTableAscii(unittest.TestCase, Ascii): format = formats.Table result = '''\ |in_stock|sold_out| Cheddar | |X | Limburger| |X |''' class TestTableUnicode(unittest.TestCase, Unicode): format = formats.Table result = '''\ |majestic|bites| Møøse|X |X | Llama| | |''' class TestCsvAscii(unittest.TestCase, Ascii): format = formats.Csv result = '''\ ,in_stock,sold_out\r Cheddar,,X\r Limburger,,X\r ''' class TestCsvUnicode(unittest.TestCase, Unicode): format = formats.Csv result = '''\ ,majestic,bites\r Møøse,X,X\r Llama,,\r ''' @pytest.mark.parametrize('source, kwargs', [ ('''\ cheese,in_stock,sold_out\r Cheddar,0,1\r Limburger,0,1\r ''', {}), ('''\ cheese,in_stock,sold_out\r Cheddar,,X\r Limburger,,X\r ''', {})]) def test_csv_loads_auto_as_int(source, kwargs): args = formats.Csv.loads(source, **kwargs) assert args.objects == ['Cheddar', 'Limburger'] assert args.properties == ['in_stock', 'sold_out'] assert args.bools == [(False, True), (False, True)] @pytest.mark.parametrize('source, expected, match', [ ('''\ cheese,in_stock,sold_out\r Cheddar,0,\r Limburger,0,1\r ''', ValueError, r"first row: \['Cheddar', '0', ''\]"), ('''\ cheese,in_stock,sold_out\r Cheddar,0,1\r Limburger,X,1\r ''', KeyError, r'X')]) def test_csv_loads_auto_as_int_invalid(source, expected, match): with pytest.raises(expected, match=match): result = formats.Csv.loads(source) class TestWikitableAscii(unittest.TestCase, Ascii): format = formats.WikiTable result = '''\ {| class="featuresystem" ! !in_stock!!sold_out |- !Cheddar | ||X |- !Limburger | ||X |}''' class TestWikitableUnicode(unittest.TestCase, Unicode): format = formats.WikiTable result = '''\ {| class="featuresystem" ! !majestic!!bites |- !Møøse |X ||X |- !Llama | || |}''' class TestPythonLiteral(unittest.TestCase, Ascii): format = formats.PythonLiteral result = '''\ { 'objects': ( 'Cheddar', 'Limburger', ), 'properties': ( 'in_stock', 'sold_out', ), 'context': [ (1,), (1,), ], }''' class TestFimi(unittest.TestCase, Ascii): format = formats.Fimi result = '''\ 1 1 ''' @pytest.mark.parametrize('frmat, label, kwargs, expected', [ ('table', None, {}, '''\ |+1|-1|+2|-2|+3|-3|+sg|+pl|-sg|-pl| 1sg|X | | |X | |X |X | | |X | 1pl|X | | |X | |X | |X |X | | 2sg| |X |X | | |X |X | | |X | 2pl| |X |X | | |X | |X |X | | 3sg| |X | |X |X | |X | | |X | 3pl| |X | |X |X | | |X |X | | '''), ('cxt', None, {}, '''\ B 6 10 1sg 1pl 2sg 2pl 3sg 3pl +1 -1 +2 -2 +3 -3 +sg +pl -sg -pl X..X.XX..X X..X.X.XX. .XX..XX..X .XX..X.XX. .X.XX.X..X .X.XX..XX. '''), ('python-literal', 'literal', {}, '''\ { 'objects': ( '1sg', '1pl', '2sg', '2pl', '3sg', '3pl', ), 'properties': ( '+1', '-1', '+2', '-2', '+3', '-3', '+sg', '+pl', '-sg', '-pl', ), 'context': [ (0, 3, 5, 6, 9), (0, 3, 5, 7, 8), (1, 2, 5, 6, 9), (1, 2, 5, 7, 8), (1, 3, 4, 6, 9), (1, 3, 4, 7, 8), ], } '''), ('csv', 'str', {'bools_as_int': False}, '''\ ,+1,-1,+2,-2,+3,-3,+sg,+pl,-sg,-pl 1sg,X,,,X,,X,X,,,X 1pl,X,,,X,,X,,X,X, 2sg,,X,X,,,X,X,,,X 2pl,,X,X,,,X,,X,X, 3sg,,X,,X,X,,X,,,X 3pl,,X,,X,X,,,X,X, '''), ('csv', 'int', {'bools_as_int': True}, '''\ ,+1,-1,+2,-2,+3,-3,+sg,+pl,-sg,-pl 1sg,1,0,0,1,0,1,1,0,0,1 1pl,1,0,0,1,0,1,0,1,1,0 2sg,0,1,1,0,0,1,1,0,0,1 2pl,0,1,1,0,0,1,0,1,1,0 3sg,0,1,0,1,1,0,1,0,0,1 3pl,0,1,0,1,1,0,0,1,1,0 '''), ('fimi', None, {}, '''\ 0 3 5 6 9 0 3 5 7 8 1 2 5 6 9 1 2 5 7 8 1 3 4 6 9 1 3 4 7 8 '''), ('wiki-table', 'wiki-table', {}, '''\ {| class="featuresystem" ! !+1!!-1!!+2!!-2!!+3!!-3!!+sg!!+pl!!-sg!!-pl |- !1sg |X || || ||X || ||X ||X || || ||X |- !1pl |X || || ||X || ||X || ||X ||X || |- !2sg | ||X ||X || || ||X ||X || || ||X |- !2pl | ||X ||X || || ||X || ||X ||X || |- !3sg | ||X || ||X ||X || ||X || || ||X |- !3pl | ||X || ||X ||X || || ||X ||X || |} ''')]) def test_write_example(test_output, context, frmat, label, kwargs, expected): Format = formats.Format[frmat] flag = f'-{label}' if label else '' suffix = getattr(Format, 'suffix', '.txt') target = test_output / f'example{flag}{suffix}' result = write_format(target, context.objects, context.properties, context.bools, Format=Format, **kwargs) assert result == expected try: _ = Format.load(target, encoding=Format.encoding, **kwargs) except NotImplementedError: pytest.skip('not implemented') def write_format(target, objects, properties, bools, *, Format, **kwargs): Format.dump(str(target), objects, properties, bools, encoding=Format.encoding, **kwargs) assert target.exists() assert target.stat().st_size result = target.read_text(encoding=Format.encoding) return result @pytest.mark.parametrize('extents, label, expected', [ (False, 'intents', '''\ 0 1 2 3 4 5 6 7 8 9 0 3 5 6 9 0 3 5 7 8 1 2 5 6 9 1 2 5 7 8 1 3 4 6 9 1 3 4 7 8 0 3 5 5 6 9 3 6 9 5 7 8 3 7 8 1 2 5 1 6 9 1 7 8 1 3 4 6 9 7 8 5 3 1 '''), (True, 'extents', '''\ 0 1 2 3 4 5 0 1 0 2 0 4 1 3 1 5 2 3 2 4 3 5 4 5 0 2 4 1 3 5 0 1 2 3 0 1 4 5 2 3 4 5 0 1 2 3 4 5 ''')]) def test_write_example_concepts_dat(test_output, context, extents, label, expected): context = context.copy() Format = formats.Format['fimi'] target = test_output / f'example-{label}.dat' iterconcepts = ((c._extent, c._intent) for c in context.lattice) formats.write_concepts_dat(target, iterconcepts, extents=extents) assert target.exists() assert target.stat().st_size result = target.read_text(encoding=Format.encoding) assert result == expected
def _request_token(self): response = self._post_token_request() self._parse_server_response(response)
Febrile neutropenia during acute myeloid leukemia therapy: Single institution experience from a developing country. e18000 Background: Febrile neutropenia poses a major challenge during treatment of acute myeloid leukaemia (AML). METHODS Episodes of febrile neutropenia in 104 consecutive patients of AML admitted to the medical oncology ward between May 2001 and December 2006 were studied. There were 62 males and 42 females, median age 28 years (2-61 years). RESULTS 402 febrile episodes including 363 episodes of febrile neutropenia (180 in induction, 183 in consolidation) and 39 non-neutropenic episodes (18 in induction, 21 in consolidation) occurred. Clinical, microbiological and radiological foci could be detected in 51.1%, 22.2 %, and 31.1% episodes of febrile neutropenia during induction and 31.1%, 19.1% and 12.7% episodes during consolidation. Rates of documented infections during induction and consolidation were 74% and 52%. Respiratory (39.2%) and ear, nose, and throat ( 23.9%) were the commonest clinical sites during induction. Respiratory (21%) and central line infections (19.2%) were commonest during consolidation. Gram negative infections predominated (Pseudomonas aeruginosa, Klebsiella pneumoniae: major isolates). 32.5% of microbiologically proven infections during induction and 14.2% during consolidation were polymicrobial. Bronchopneumonia was the commonest radiological focus. There were 60 episodes of fungal infections (47 in induction, 13 in consolidation). There were: 1 definite: mucormycosis, 3 probable (1 case each: Candida krusei, Candida tropicalis in blood, 1 chronic disseminated hepatosplenic candidiasis), and 56 possible infections. Halo sign was seen in 18, sinusitis with bone erosion in 7. Infections accounted for 85% of the 20 deaths (induction: 18). Fungal infections and bronchopneumonia were major causes of mortality (p = 0.001). 3/4 enterococcal bacteremias were associated with mortality (p = 0.001). 6 cases of tuberculosis (5 pneumonias with necrotic mediastinal nodes, 1 Pott's spine) and 3 cases of malaria (1 cerebral malaria) were also detected. CONCLUSIONS Induction was associated with greater morbidity and mortality. Prompt and proper institution of antibiotics and antifungals besides considering alternative diagnosis peculiar to the region (e.g. tuberculosis, malaria) may aid in better management. No significant financial relationships to disclose.
Last week, the NFL announced a six-game reduction to the original ten-game suspension announced for Dallas Cowboys defensive end Greg Hardy last April. In the process, there seems to be some overreaction by some. I’ll start off by offering the standard disclaimer: I do not support violence against women, children or anybody else. True self-defense might be one thing, but similar cases involving NFL players don’t generally fall into that latter category, right? Having said that, it always takes two to tango. And sometimes the facts surrounding any type of domestic dispute are difficult, if not impossible, to establish. Such is the case with Hardy. Consider these over-the-top comments from Comcast Sports New England writer Gary Tanguay: In the name of humanity, how can the NFL reduce — by more than half! — the suspension of a man who, according to police reports, slammed his ex-girlfriend on pile of automatic weapons that were spread across a bed? The only reason he avoided jail time was because the victim didn’t show up in court. Tanguay also adds that he wanted to “throw up in my mouth,” as though there’s some other place that he could vomit. Now, here’s a clear example of somebody writing from a completely emotional standpoint, as opposed to actually gathering facts. There’s nothing wrong with doing this, but it’s not a major credibility builder. Tanguay failed to realize a few things, starting with the fact that this case wasn’t dropped simply because alleged victim Nicole Holder failed to show up for the trial. No, Holder didn’t fail to show up because of car trouble or something. On the contrary, she completely vanished following a reported financial settlement reached with Hardy, possibly illustrating where the priorities actually were. Further, the prosecution in this case had concerns about inconsistencies in Holder’s original testimony that it felt might not fly in court very well, thus leaving questions about what actually happened during the evening in question. Tanguay, NFL commissioner Roger Goodell and others probably should have read this before reacting or saying what they did. Dallas Morning News columnist Tim Cowlishaw is on record this week stating that Goodell acted inappropriately in his original suspension of Hardy, possibly on purpose. I can’t agree more. See, this is not like the Ray Rice incident, where a man in an elevator is clearly seen knocking his then-fiancee out cold. There’s no question what happened here. We just can’t say the same about the Hardy case, because all accusations came from a person that allegedly chose money over justice. Terry O’Neill is the director of the National Organization for Women and she recently offered the following to ESPN columnist Tani Ganguli: What’s very very sad is that nothing has come out of the NFL that indicates a real commitment to ending the violence-against-women problem that they have in the NFL. The only thing that comes out of the leadership of the NFL is the owner of the Dallas Cowboys is thrilled to have a talented athlete on the field and says nothing about the victim of the domestic violence. I think that it’s very sad to me. It’s pushing football way down the wrong path. Well, I think we know enough about the victim in this case. As far as the NFL going down the wrong path, this could be true. However, it’s a mega-billion dollar industry that simply isn’t in the business of creating upstanding citizens – sorry to say that but it’s the simple truth. If domestic violence is to truly to be eliminated, it won’t have a thing to do with the NFL or any other sports or entertainment entity, period. This project begins with society, in general. So long as there’s this kind of money flying around professional football, expect for these incidents, either true or false, to continue.
<filename>Python/textbook_track/chapter11/ba11b.py<gh_stars>0 # Implement DecodingIdealSpectrum import itertools as it import operator import sys from collections import Counter, defaultdict from textbook_track.resources.utils import read_amino_acid_mass_table class Graph: def __init__(self, spectrum, inverse_mass_table): self._spectrum = spectrum self._adjacency_list = self._build_spectrum_graph(inverse_mass_table) def _build_spectrum_graph(self, inverse_mass_table): adjacency_list = defaultdict(list) for ix, node1 in enumerate(self._spectrum): for node2 in self._spectrum[ix+1:]: weight_difference = node2 - node1 if (label := inverse_mass_table.get(weight_difference)) is not None: adjacency_list[node1].append((node2, label)) return dict(adjacency_list) def find_all_paths_to_sink(self, v, sink): if v == sink: return {(v,)} paths = set() neighbours = self._adjacency_list.get(v, []) for w, _ in neighbours: paths_from_w_to_sink = self.find_all_paths_to_sink(w, sink) for path in paths_from_w_to_sink: extended_path = (v,) + path paths.add(extended_path) return paths def convert_to_intlist(line): return [int(elem) for elem in line.split()] def reverse_mass_table_mapping(mass_table): return {mass: amino_acid for amino_acid, mass in mass_table.items()} def verify_spectrum(spectrum): if (zero_mass := 0) not in spectrum: spectrum.append(zero_mass) return sorted(spectrum) def calc_peptide_prefix_masses(peptide_masses): return list(it.accumulate(peptide_masses, operator.add, initial=0)) def calc_ideal_spectrum(peptide): prefix_masses = calc_peptide_prefix_masses(peptide) suffix_masses = calc_peptide_prefix_masses(peptide[::-1]) return Counter(prefix_masses + suffix_masses[1:-1]) def calc_peptide_spelled_by_path(path): peptide_masses = [] for mass1, mass2 in zip(path, path[1:]): mass = mass2 - mass1 peptide_masses.append(mass) return peptide_masses def find_peptide_corresponding_to_spectrum(paths, spectrum, inverse_mass_table): spectrum = Counter(spectrum) for path in paths: peptide_masses = calc_peptide_spelled_by_path(path) ideal_spectrum = calc_ideal_spectrum(peptide_masses) if ideal_spectrum == spectrum: return ''.join(map(inverse_mass_table.get, peptide_masses)) return None def decode_an_ideal_spectrum(spectrum, mass_table): spectrum = verify_spectrum(spectrum) inverse_mapping = reverse_mass_table_mapping(mass_table) graph = Graph(spectrum, inverse_mapping) sink = max(spectrum) paths = graph.find_all_paths_to_sink(0, sink) return find_peptide_corresponding_to_spectrum(paths, spectrum, inverse_mapping) def main(): reader = sys.stdin spectrum = convert_to_intlist(next(reader)) mass_table = read_amino_acid_mass_table() result = decode_an_ideal_spectrum(spectrum, mass_table) print(result) if __name__ == '__main__': main()
IP-MLI: An Independency of Learning Materials from Platforms in a Mobile Learning using Intelligent Method Attempting to deliver a monolithic mobile learning system is too inflexible in view of the heterogeneous mixture of hardware and services available and the desirability of facility blended approaches to learning delivery, and how to build learning materials to run on all platforms. This paper proposes a framework of mobile learning system using an intelligent method (IP-MLI). A fuzzy matching method is used to find suitable learning material design. It will provide a best matching for each specific platform type for each learner. The main contribution of the proposed method is to use software layer to insulate learning materials from device-specific features. Consequently, many versions of learning materials can be designed to work on many platform types.
/* * return the host_ix for existing entries in the * ignore ip table, otherwise returns zero meaning * the ip addr in question is not white listed */ int sqlite_is_host_ignored(int ip_addr_ix, const char *db_loc) { int ret; ret = 0; char cwd[SQL_CMD_MAX/2]; char DB_LOCATION[SQL_CMD_MAX+1]; if (db_loc) { snprintf (DB_LOCATION, SQL_CMD_MAX, "%s", db_loc); } else { if (getcwd(cwd, sizeof(cwd)) == NULL) { return 1; } else { snprintf (DB_LOCATION, SQL_CMD_MAX, "%s%s", cwd, DB_PATH); } } sqlite3 *db; sqlite3_stmt *stmt; int rc; char sql[SQL_CMD_MAX]; rc = sqlite3_open(DB_LOCATION, &db); if (rc != SQLITE_OK) { syslog(LOG_INFO | LOG_LOCAL6, "ERROR opening SQLite DB '%s' from function [sqlite_is_host_ignored]: %s", DB_LOCATION, sqlite3_errmsg(db)); return -1; } snprintf (sql, SQL_CMD_MAX, "SELECT host_ix FROM %s WHERE host_ix = ?1", IGNORE_IP_LIST_TABLE); sqlite3_prepare_v2(db, sql, strlen(sql), &stmt, NULL); sqlite3_bind_int(stmt, 1, ip_addr_ix); while ( (rc = sqlite3_step(stmt)) == SQLITE_ROW) { ret = sqlite3_column_int(stmt, 0); } sqlite3_finalize(stmt); sqlite3_close(db); return ret; }
/* * Copyright (c) 2020, 2022 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package io.helidon.build.licensing.model; import java.util.ArrayList; import java.util.List; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlElementWrapper; import javax.xml.bind.annotation.XmlRootElement; /** * Attribution document. */ @XmlRootElement(name = "attribution-document") @XmlAccessorType(XmlAccessType.FIELD) public class AttributionDocument { @XmlElementWrapper(name = "dependencies") @XmlElement(name = "dependency") private List<AttributionDependency> dependencies = new ArrayList<>(); @XmlElementWrapper(name = "licenses") @XmlElement(name = "license") private List<AttributionLicense> licenses = new ArrayList<>(); @Override public String toString() { return "AttributionDocument{" + "dependencies=" + dependencies + "}"; } /** * Set dependencies. * * @param dependencies list of dependencies to add. */ public void setDependencies(List<AttributionDependency> dependencies) { this.dependencies = dependencies; } /** * Set licenses. * * @param licenses set list of licenses to add. */ public void setLicenses(List<AttributionLicense> licenses) { this.licenses = licenses; } /** * Get Dependencies. * * @return Dependencies */ public List<AttributionDependency> getDependencies() { return dependencies; } /** * Add one dependency. * * @param dependency add a single dependency. */ @SuppressWarnings("unused") public void addDependency(AttributionDependency dependency) { this.dependencies.add(dependency); } /** * Get licenses. * * @return licenses */ public List<AttributionLicense> getLicenses() { return licenses; } /** * Add one license. * * @param license license to add. */ public void addLicense(AttributionLicense license) { this.licenses.add(license); } }
<reponame>GraphScope/gs-algos /* * Copyright 2021 Alibaba Group Holding Limited. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.alibaba.graphscope.example.property.sssp; import com.alibaba.fastjson.JSONObject; import com.alibaba.graphscope.context.ContextDataType; import com.alibaba.graphscope.context.LabeledVertexPropertyContext; import com.alibaba.graphscope.context.PropertyDefaultContextBase; import com.alibaba.graphscope.ds.GSVertexArray; import com.alibaba.graphscope.ds.VertexRange; import com.alibaba.graphscope.ds.VertexSet; import com.alibaba.graphscope.fragment.ArrowFragment; import com.alibaba.graphscope.parallel.PropertyMessageManager; import com.alibaba.graphscope.utils.FFITypeFactoryhelper; import java.util.ArrayList; import java.util.List; import java.util.Objects; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** * An implementation of {@link com.alibaba.graphscope.context.LabeledVertexPropertyContext}. By * calling addColumn, you can create a vertex data vector, and label it with a <em>property</em>. */ public class PropertySSSPVertexPropertyContext extends LabeledVertexPropertyContext<Long> implements PropertyDefaultContextBase<Long> { private static Logger logger = LoggerFactory.getLogger(PropertySSSPVertexPropertyContext.class.getName()); public List<VertexSet> curModified; public List<VertexSet> nextModified; public List<GSVertexArray<Double>> partialResults; public List<Long> distColumnIndices; public long sourceOid; /** * Init the context by created inner context and create data structures holding runtime data. * * @param fragment fragment bound to this context. * @param messageManager manage messages. * @param jsonObject contains the user-defined parameters in json manner. */ @Override public void init( ArrowFragment<Long> fragment, PropertyMessageManager messageManager, JSONObject jsonObject) { // must be called createFFIContext(fragment); logger.info("params size " + jsonObject.size() + ", " + jsonObject.toJSONString()); int labelNum = fragment.vertexLabelNum(); curModified = new ArrayList<>(labelNum); nextModified = new ArrayList<>(labelNum); partialResults = new ArrayList<>(labelNum); distColumnIndices = new ArrayList<>(labelNum); for (int i = 0; i < labelNum; ++i) { VertexRange<Long> vertices = fragment.vertices(i); curModified.add(new VertexSet(vertices)); nextModified.add(new VertexSet(vertices)); partialResults.add(FFITypeFactoryhelper.newGSVertexArray(Double.class)); partialResults.get(i).init(fragment.vertices(i), Double.MAX_VALUE); distColumnIndices.add(addColumn(i, "dist_" + i, ContextDataType.kDouble)); logger.info( "range " + partialResults.get(i).GetVertexRange().begin().GetValue() + ", " + partialResults.get(i).GetVertexRange().end().GetValue()); } sourceOid = jsonObject.getLong("src"); if (Objects.isNull(sourceOid)) { logger.error("source Oid not set in parameter."); return; } } }
<reponame>centrify/Hydra<gh_stars>0 package com.github.codegerm.hydra.handler; import java.io.File; import java.util.List; import org.apache.commons.lang3.StringUtils; import org.apache.flume.Context; import org.apache.flume.channel.ChannelProcessor; import org.keedio.flume.source.HibernateContext; import org.keedio.flume.source.HibernateReader; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.github.codegerm.hydra.source.SqlSourceUtil; import com.github.codegerm.hydra.writer.AvroJsonWriter; import com.github.codegerm.hydra.writer.AvroRecordUtil; import com.github.codegerm.hydra.writer.RecordWriter; public class HibernateHandler extends AbstractHandler { protected HibernateContext jdbcContext; private RecordWriter recordWriter; private HibernateReader hibernateReader; private static final String DEFAULT_STATUS_DIRECTORY = "flume/jdbcSource/status"; private static final String COLUMN_TO_SELECT_KEY = "columns.to.select"; private static final Logger LOG = LoggerFactory.getLogger(HibernateHandler.class); private int pageSize; private static final int DEFAULT_PAGESIZE = 500; private String contextTable; private boolean pagedMode; public HibernateHandler(String snapshotId, Context context, ChannelProcessor processor, String modelId, String table, String entitySchema) { super(snapshotId, context, processor, modelId, table, entitySchema); contextTable = table; } @Override public void configure() { LOG.getName(); LOG.info("Reading and processing configuration values for source " + LOG.getName()); String basePath = context.getString(SqlSourceUtil.STATUS_BASE_DIR_KEY, DEFAULT_STATUS_DIRECTORY); pagedMode = context.getBoolean(SqlSourceUtil.PAGED_MODE, true); pageSize = context.getInteger(SqlSourceUtil.PAGESIZE_KEY, DEFAULT_PAGESIZE); String statusPath = basePath + File.separator + snapshotId + File.separator + table; File status_path_dir = new File(statusPath); if (!status_path_dir.exists()) status_path_dir.mkdirs(); context.put(SqlSourceUtil.STATUS_DIRECTORY_KEY, statusPath); context.put(SqlSourceUtil.TABLE_KEY, table); List<String> columns = AvroRecordUtil.getEntityFields(entitySchema); String columnToSelect = StringUtils.join(columns, ","); context.put(COLUMN_TO_SELECT_KEY, columnToSelect); /* Initialize configuration parameters */ jdbcContext = new HibernateContext(context, LOG.getName()); /* Establish connection with database */ hibernateReader = new HibernateReader(jdbcContext); hibernateReader.establishSession(); LOG.info("Query to use: " + jdbcContext.buildQuery()); /* Instantiate the CSV Writer */ //csvWriter = new CsvWriter(processor, ',', entitySchema); recordWriter = new AvroJsonWriter(processor, snapshotId, modelId, entitySchema); } public void close() { try { hibernateReader.closeSession(); recordWriter.close(); } catch (Exception e) { LOG.warn("Error CSVWriter object ", e); } finally { } } @Override public Boolean handle() { try { long currentTime = System.currentTimeMillis(); if(pagedMode){ int count = hibernateReader.getTableSize(); LOG.info("Table [" + contextTable + "] size: [" + count + "]" ); int pageNum = (int) (Math.ceil(count / pageSize)); for(int i = 0; i<=pageNum; i++){ LOG.info("Execute paged query of table [" + contextTable + "] from: " +i*pageSize + " to " + (i*pageSize+pageSize)); List<List<Object>> result = hibernateReader.executePagedQuery(i*pageSize, pageSize); LOG.debug(result.toString()); writeResult(result); } } else { List<List<Object>> result = hibernateReader.executeQuery(); LOG.debug(result.toString()); writeResult(result); } long endTime = System.currentTimeMillis(); long timeSpent = (endTime-currentTime)/1000; LOG.info("procesing table: ["+ contextTable + "] takes: [" + timeSpent + "] seconds"); } catch (Exception e) { LOG.error("Error procesing row", e); return false; } finally { close(); } return true; } private void writeResult(List<List<Object>> result) { try { if (!result.isEmpty()) { recordWriter.writeAll(result); recordWriter.flush(); jdbcContext.updateStatusFile(); } } catch (Exception e) { throw e; } } public String getTableName(){ return contextTable; } }
Drug-induced bile duct injury: new agents, new mechanisms Purpose of review Drug-induced bile duct injury can be caused by a long list of agents. In most cases, damage is because of T-cell-mediated idiosyncratic reactions. Recently, a number of new agents, including not only drugs but also herbal supplements, have been incriminated and new mechanisms of bile duct injury have emerged. This review will focus on these new data. Recent findings New members of drug families already known to be responsible for bile duct injury have been incriminated. New players have been identified, such as herbal supplements, like kratom, and recreational drugs, such as ketamine used outside the medical setting. Anticytokine monoclonal antibodies are rarely involved. In contrast, antineoplastic treatments are of growing concern, especially immune checkpoint inhibitors, which induce immune-related adverse effects because of the excessive stimulation of the immune system and its lack of regulation. Summary Two patterns of bile duct injury are recognized. Drug-induced small-duct cholangiopathies target the smaller bile ducts; acute injuries eventually progress to chronic disease in the form of the vanishing bile duct syndrome. Drug-induced sclerosing cholangitis target large bile ducts, with a protracted chronic course; the onset of symptoms may be delayed after drug discontinuation; potentially severe, life-threatening complications can occur.
# RUN: %PYTHON %s 2>&1 | FileCheck %s # This file contains small benchmarks with reasonably-sized problem/tiling sizes # and codegen options. from ..core.experts import * from ..core.harness import * from ..core.transforms import * from ..core.utils import * from ..contraction.definitions import EinsumProblem from typing import List base_fun_name = 'copy_1d_on_tensors' op_name = 'linalg.generic' ################################################################################ ### Compilation strategies. ################################################################################ # Before bufferization, the IR only has a tensor.extract_slice / # tensor.insert_slice pair. # Bufferization then properly introduces linalg.copy ops. # We want to make more these `linalg.copy` more efficient. # In the case of a single copy benchmark it is the one true thing to optimize. def all_experts(fun_name: str): return [ # Note: `\` char at the end of next line prevents formatter reflows, keep it. e.print_ir(after_all=False, at_begin=False, llvm=False) for e in [ \ Tile(fun_name=fun_name, op_name=op_name, tile_sizes=[16]) .then(Bufferize()) .then(Vectorize(fun_name=fun_name, op_name='linalg.copy')) .then(LowerVectors()) .then(LowerToLLVM()) ] ] ################################################################################ ### Problem instantiations. ################################################################################ keys = ['n'] copy_1D_perf_search_list = [ [200 * 16], # sweet spot for prefetchers [112 * 112 * 32], # approx. depthwise_conv_2d size ] # CHECK-NOT: FAILURE def main(): n_iters = 10000 for problem_sizes in copy_1D_perf_search_list: fun_name = base_fun_name + '_offset_0' + \ '_sizes' + ''.join('_' + str(sz) for sz in problem_sizes) test_harness(lambda s, t: EinsumProblem('n->n', 0), [[np.float32] * 2], test_sizes(keys, [problem_sizes]), all_experts(fun_name), n_iters=n_iters, function_name=fun_name, dump_ir_to_file='/tmp/abc.mlir', dump_obj_to_file='/tmp/abc.o') if __name__ == '__main__': main()
1Analysis of patients who derived exceptional benefit from rucaparib maintenance treatment for high-grade ovarian cancer in the phase 3 ARIEL3 study the pandemic (before march 2020), and the second diagnosed during pandemic-associated restrictions period. Both groups were compared according to FIGO (International Federation of Gynaecology and Obstetrics) staging and presence of symptoms (hydrothorax and ascites). Statistical analysis was performed with logistic regression analysis. Statistical significance level was set at 0,05. Result(s)* Before the pandemic, 47 patients were admitted with a median age of 61. During the pandemic, there were 30 newly diagnosed patients with a median age of 59. In both groups the most common type of cancer was high grade serous adenocarcinoma (61,7% and 60,0%, respectively). Patients with an advanced OC (FIGO stage III and IV) accounted for 57,4% in the pre-pandemic group, while in the second group patients with advanced cancer accounted for 66,7%. Although the percentage was higher in the second group, the logistic regression analysis did not confirm the impact of pandemic on more frequent occurrence of FIGO III (p=0,17) and IV (p=0,81) diagnosis. Ascites was found in 29,8% of patients before and 30% during pandemic. Hydrothorax was observed in 14,9% of patients in the first group and 26,7% in the second one. Logistic regression analysis revealed no influence of pandemic on percentage of symptomatic patients (p=0,91 for ascites and p=0,18 for hydrothorax). Conclusion* The number of newly diagnosed OC patients was lower during the pandemic than in the preceding year. Without regard to healthcare availability, OC remains the disease which is diagnosed in the advanced stage.
Cortical Spectral Activity and Connectivity during Active and Viewed Arm and Leg Movement Active and viewed limb movement activate many similar neural pathways, however, to date most comparison studies have focused on subjects making small, discrete movements of the hands and feet. The purpose of this study was to determine if high-density electroencephalography (EEG) could detect differences in cortical activity and connectivity during active and viewed rhythmic arm and leg movements in humans. Our primary hypothesis was that we would detect similar but weaker electrocortical spectral fluctuations and effective connectivity fluctuations during viewed limb exercise compared to active limb exercise due to the similarities in neural recruitment. A secondary hypothesis was that we would record stronger cortical spectral fluctuations for arm exercise compared to leg exercise, because rhythmic arm exercise would be more dependent on supraspinal control than rhythmic leg exercise. We recorded EEG data while ten young healthy subjects exercised on a recumbent stepper with: both arms and legs, just legs, and just arms. Subjects also viewed video playback of themselves or another individual performing the same exercises. We performed independent component analysis, dipole fitting, spectral analysis, and effective connectivity analysis on the data. Cortical areas comprising the premotor and supplementary motor cortex, the anterior cingulate, the posterior cingulate, and the parietal cortex exhibited significant spectral fluctuations during rhythmic limb exercise. These fluctuations tended to be greater for the arms exercise conditions than for the legs only exercise condition, which suggests that human rhythmic arm movements are under stronger cortical control than rhythmic leg movements. We did not find consistent spectral fluctuations in these areas during the viewed conditions, but effective connectivity fluctuated at harmonics of the exercise frequency during both active and viewed rhythmic limb exercise. The right premotor and supplementary motor cortex drove the network. These results suggest that a similarly interconnected neural network is in operation during active and viewed human rhythmic limb movement. INTRODUCTION An interesting feature of human neurophysiology is that active movement and viewed movement recruit many of the same neural structures. "Mirror neurons, " which fire in response to both active and viewed movements were first discovered in monkeys (Di ). Since then, a slew of neuroimaging studies have confirmed that a similar neural mechanism exists in humans. Electroencephalography (EEG) studies have demonstrated desynchronization in the human motor cortex during both active and viewed movement ((Cochin et al.,, 1999;;). Studies with functional magnetic resonance imaging (fMRI) have found overlapping cortical activation during active and viewed movement (;;;). Humans regularly coordinate arm and leg movements during locomotion or locomotion-like movements. Despite the substantial literature on viewed motion, most studies comparing neural activity during active and viewed movements focus on isolated hand or foot movements, rather than full-body rhythmic limb movement. Human full-body rhythmic limb movement likely involves a distribution of cortical and spinal control, which may make viewed rhythmic arm and leg movements substantially different from viewed hand or foot movements. In quadrupedal animals, the coordination of rhythmic limb behaviors relies heavily on collections of oscillatory neurons in the spinal cord, known as central pattern generators (Brown, 1914;Grillner, 1975;;Marder and Calabrese, 1996;Duysens and van de Crommert, 1998;;). In humans, the evidence suggests that rhythmic limb movements are under both spinal and cortical control. Functional near infrared spectroscopy studies (;), transcranial magnetic stimulation studies ((Petersen et al.,, 2003, and electroencephalography (EEG) studies ;) have shown cortical activation during human steady-state walking. There is also indirect evidence for central pattern generators in humans. This evidence includes primitive stepping-like motions in infants (), rhythmic lower limb contractions in a patient with a complete spinal cord injury when the limbs are moved through the motion of gait (Wernig and Phys, 1992;), and vibration-induced air stepping in healthy subjects (). Because humans likely share features of quadrupedal neural control but have adapted to become predominantly bipedal, there may be differences in the relative contributions of cortical and spinal control during rhythmic movement involving the arms and legs. One way to examine cortical control is to use effective connectivity to find the causal relationship between brain regions. Positron emission tomography (;) and fMRI (;;) are frequently used to study effective connectivity. However, these modalities require participants to remain stationary and therefore cannot examine brain connectivity during unconstrained full-body motion. Another approach for studying real-world activities is to use high-density EEG, independent component analysis (ICA), and source localization techniques (;;). Although this EEG approach does not have the spatial resolution of fMRI connectivity studies, it does provide excellent temporal resolution with spatial resolution of around a few centimeters. Lau and colleagues combined high-density EEG, ICA, and source localization with Granger causality to show FIGURE 1 | Experimental setup. Subjects moved to the pace of visual cues with both their arms and legs, their legs only, and their arms only. A video camera to the left on the subject's head recorded videos of the subject exercising, as viewed in the mirror, for the three active conditions. For the viewed conditions, we removed the mirror, and projected life-size video playbacks of the subject or another individual exercising. The subjects remained seated in the stepping device during the viewed conditions. We recorded EEG during all conditions. that sensorimotor cortical connectivity was greater for standing compared to walking (). Using a similar approach may provide additional insight into brain function as it relates to active and viewed movement. The purpose of this study was to quantify the differences in cortical spectral fluctuations and effective connectivity during active and viewed full-body rhythmic limb movements. Our overall hypothesis was that we would be able to detect similar but weaker electrocortical spectral fluctuations and effective connectivity during viewed limb movement compared to active limb movement due to the similarities in neural recruitment. We tested different combinations of arm and leg movements (arms and legs, legs only, and arms only), because we hypothesized that active rhythmic leg-only movements would show little spectral fluctuations based on evidence that suggests that rhythmic leg movements likely use more spinal control ((Sakamoto et al.,, 2014. Additionally, some have suggested that the mirror neuron system is highly involved in human social interaction (;). Therefore, humans may have differences in cortical activity when viewing themselves compared to viewing someone else perform a movement. If there are indeed differences in electrocortical spectral fluctuations for different combinations of active arms and legs movements or viewing perspective, we hypothesized that there would also be similar relative differences in effective connectivity for viewing those arm and leg movements. To test these hypotheses, we had subjects perform different combinations of arm and leg rhythmic movements on a recumbent stepper while we videotaped them. The subjects later viewed video playback of themselves and another individual performing the movements. We recorded scalp EEG data for all conditions. Subjects and Experimental Setup Ten healthy adults (mean age 25.6 ± 4.4, 5 females) with no history of neurological disease or musculoskeletal injuries participated in this study. All participants signed a consent form approved by the University of Michigan Institutional Review Board. We used a customized recumbent stepping machine (TRS 4000, NuStep, Ann Arbor, MI) with an adjustable level of resistance and an isokinetic motor (Huang and Ferris, 2009). The stepping machine combined features of a stair stepper and a recumbent bicycle. The handles and pedals were coupled so that the left handle and right pedal move together. Before data collection, we fitted the subjects with a 256-channel EEG cap (Biosemi ActiveTwo, Amsterdam, Netherlands). We digitized the position of each electrode relative to the subject's head using a digitizer (Zebris, Germany). All electrode offsets were <20 mV. We recorded EEG data at 512 Hz for all conditions. Subjects initially practiced stepping on the device at a range of resistances. We let the subjects choose the resistance at a level that they deemed challenging but not uncomfortable. We secured a Velcro strap around the subject's midsection to minimize torso movement and strapped the subject's feet to the pedals (they remained strapped to the pedals for the two active leg conditions). We placed the EEG amplifier on a platform directly behind the subject and draped the electrode leads over a bar (Figure 1). Directly in front of the subject, we placed a large mirror (79 168 cm). A screen above the mirror displayed visual cues that set the pace of the movement. We mounted a video camera at the subject's eye level, ∼6 inches to the left of the head, pointed at the mirror. This allowed us to record videos of the subject exercising from the subject's viewpoint. We used a FIGURE 2 | Electrocortical clusters. Clusters containing electrocortical sources from at least 5 of 10 subjects. Yellow is left premotor and supplementary motor cortex, purple is middle premotor, and supplementary motor cortex, green is right premotor and supplementary motor cortex, red is right anterior cingulate, white is middle anterior cingulate, blue is middle posterior cingulate, and pink is middle parietal cortex. From left to right, the top three images show the independent component dipoles for each cluster from a coronal, horizontal, and sagittal perspective, respectively. The bottom three images show the centroid locations for each cluster from the same three perspectives. FIGURE 3 | Motor cortex ERSPs. Event-related spectral perturbation (ERSP) plots showing change in spectral power during rhythmic arm and leg movement in the right, middle, and left premotor and supplementary motor cortex. From left to right, subjects moved with their arms only, both their arms and legs, their legs only, and viewed video playback of themselves moving with just their arms. Each row represents a cortical area, and each column represents a condition. For all plots, red represents a power increase from baseline, and blue represents a power decrease from baseline. We set non-significant differences to 0 dB (green). All ERSPs start and end with the same limb fully extended. The figure outlines on the x axis indicate the phase of movement, and the written labels indicate when each limb was extending. Note: for the arms and legs condition, the left leg and right arm extended together, and vice versa. mirror in front of the subjects so that the view for all conditions was similar and followed a common practice in gait rehabilitation (Behrman and Harkema, 2000). Data Collection The subjects performed rhythmic arm and leg movement on the device (active conditions) and then sat quietly and viewed video playbacks of themselves and another individual performing the same movements (viewed conditions). During the active conditions, we also recorded position data based on the motor position signal of the recumbent stepper. The maximum motor position signal corresponded to the right pedal being fully extended. We synchronized the data streams using a square wave of constant frequency sent simultaneously to all recording systems. The subjects moved on the device in three different ways in the following order: with both their arms and their legs, with their legs only, and with their arms only. During the legs only condition, the subjects moved with their hands folded comfortably in their lap. During the arms only condition, the subjects moved with their feet resting on the floor, or on foot rests for shorter subjects. The visual cues paced the subjects to move at 70 arm or leg extensions per minute. The cues consisted of a pair of squares at opposite sides of a central fixation point. The squares shaded from white to black at a fixed rate (1.16 Hz) and were 180 out of phase with each other. The subjects kept their eyes on the fixation point and moved so that the corresponding limb was fully-extended when the left or right square turned black. For the combined arms and legs condition, legs were given precedent, and the subjects moved so that the corresponding leg was fully extended when a square turned black. The subjects were allowed to practice exercising in synchrony with the cues as needed. We recorded a 5-min video of the subject exercising, as seen in the mirror, during each active condition. During the viewed conditions, we removed the mirror that had been in front of a video projection screen (84 165 cm; Figure 1). On the screen, we then played a total of seven 5-min Frontiers in Neuroscience | www.frontiersin.org FIGURE 4 | Cingulate cortex ERSPs. Event-related spectral perturbation (ERSP) plots showing change in spectral power during rhythmic upper and lower limb movement in the right anterior cingulate, the middle anterior cingulate, the middle posterior cingulate, and the middle parietal cortex. From left to right, subjects moved with their arms only, both their arms and legs, their legs only, and viewed video playback of themselves moving with just their arms. Each row represents a cortical area, and each column represents a condition. For all plots, red represents a power increase from baseline, and blue represents a power decrease from baseline. We set non-significant differences to 0 dB (green). All ERSPs start and end with the same limb fully extended. The figure outlines on the x axis indicate the phase of movement, and the written labels indicate when each limb was extending. Note: for the arms and legs condition, the left leg and right arm extended together, and vice versa. videos to the subject in a randomized order. The videos were: playback of the subject exercising with both their arms and legs, playback of the subject exercising with their legs only, playback of the subject exercising with their arms only, prerecorded videos of another individual exercising in the three ways described above, a control video of the recumbent stepper moving on its own, with no one seated in it. The video playback was adjusted to be life-size. During the viewed conditions, we gave the subjects a fixation point on the center of the screen, roughly at the center of the torso of the individual in the video, to prevent large eye movements during viewing. Data Processing We post-processed the EEG signals using custom scripts in EEGLAB (Delorme and Makeig, 2004). First, we merged the EEG recordings into a single dataset and high-pass filtered above 1 Hz to remove drift. We rejected channels exhibiting substantial artifact based on the methods of Gwin et al.. These rejection guidelines did not reject enough channels to ensure good convergence of our ICA algorithm, therefore we altered the cutoffs slightly to reject an average of 140 channels per subject and re-referenced the remaining channels to a common average reference. Next, we rejected EEG time windows with high artifact across all channels based on visual inspection. To these cleaned datasets we applied infomax (Bell and Sejnowski, 1995) independent component analysis (ICA) as implemented on GPU by CUDAICA (). This parsed the data into spatially fixed, temporally independent component (IC) signals (). The EEGLAB DIPFIT function (Oostenveld and Oostendorp, 2002) modeled each IC as an equivalent current dipole within a boundary element head model based on the MNI brain (Montreal Neurological Institute, MNI, Quebec). ICs with FIGURE 5 | General network connectivity. Schematic of the cortical network active during active and viewed movement. Arrows between cortical areas indicate suprathreshold connectivities for at least half (5/10) of the conditions. a best-fit equivalent current dipole that accounted for <85% of the variance seen at the scalp were excluded from further analysis. We clustered the remaining ICs from all 10 subjects using a k-means clustering algorithm on vectors describing similarities in dipole location, scalp topography, and spectra. If clusters contained ICs from five or fewer subjects or if their location and/or average scalp map were indicative of eye movement or muscle activity (a,b), we excluded them from further analysis. For each electrocortical cluster and condition, we created an event-locked plot of spectral power fluctuation (Makeig, 1993;). Our data epochs began at full extension for one arm or leg (active or viewed) and ended at subsequent full extension for the same arm or leg. For each epoch, we computed single trial spectrograms. To ensure that each extension event occurred at the same latency in every trial, we linearly warped each single trial spectrogram. We averaged these spectrograms over trials for each IC and over ICs for each cluster. For each cluster and condition, we subtracted the average log spectrum across all time points from the log spectrum for each individual time point, to easily visualize spectral changes from baseline. These plots of spectral fluctuation are called event-related spectral perturbation (ERSP) plots. Bootstrapping methods available in EEGLAB (Delorme and Makeig, 2004) determined regions of significant difference from baseline for the ERSP plots (p < 0.05). To quantify the spectral differences between the active conditions, we computed grand mean log power spectra for each exercise condition (arms only, arms and legs, legs only) for each independent component cluster. For each cluster, we used Wilcoxon rank sum tests in MATLAB for each frequency band of interest (frequency resolution = 0.026 Hz) to evaluate significant mean power differences between pairs of conditions (p < 0.05). Connectivity Analysis We also performed effective connectivity analysis on the epochs of data described above. Using the EEGLAB-compatible SIFT toolbox (), we created a custom data analysis pipeline. The preprocessing pipeline involved first downsampling the data to 128 Hz and piecewise linearly detrending using a 330 ms window every 82.5 ms. Next, we used the Hannan-Quinn, Swartz Baysian, and Akaike Information Criteria to determine the appropriate model order within a 200 ms sliding windows every 54.7 ms. A Vieira-Morf lattice algorithm available in SIFT fit the multivariate autoregressive (MVAR) model. Examining the eigen-values of the MVAR coefficient matrix allowed us to determine if the model was stable. We checked the whiteness of the model by multiple measures including the Ljung-Box test, the Box-Pierce test, the McLeod-Li test, and the Autocorrelation Function (ACF) test. The smallest model order that lead to stability and whiteness was the desired outcome. A model order between 1 and 3 satisfied these criteria for our data for all subjects and all conditions. With these MVAR models, we calculated connectivity and connectivity direction using directed transfer function (Kaminski and Blinowska, 1991). Directed transfer function is generally robust to both noise and indirect connections. To test the significance of the connectivity fluctuations, we used bootstrap significance testing with 200 resamples. Furthermore, we wished to determine which cluster pairs and conditions had the greatest effective connectivity. We found the maximum connectivity value for each cluster pair at each condition. We determined which cluster pair/condition combinations had maximum connectivity values at least a standard deviation greater than the mean for all cluster pair/condition combinations. These cluster pair/condition combinations are referred to as having "supratheshold connectivity." We also wanted to quantify the rate at which the average connectivity in the cortical network changed over time. For each condition, we took fast Fourier transform of the connectivity values across time for each frequency. Because our measure of interest was the relative power at different frequencies, we used a zero-padded window of 128 samples, and took the magnitude of the FFT-value to determine the power spectrum for each frequency value from 0 to 18 Hz. We then took the mean of the resultant power spectrum over frequencies and component pairs to get an overall measure of the frequencies at which connectivity fluctuated for each condition. EEG Results There were seven clusters of electrocortical sources that had at least five subjects represented (Figure 2). Three clusters were located in the right, left, and middle premotor and Right premotor and supplementary motor cortex Spectral comparisons for the three exercise conditions. A = Arms, L = Legs, and AL = Arms and Legs. Only pairs of conditions that had significantly different spectra for particular frequency bands (p < 0.05), as determined by Wilcoxon rank sum tests, are shown. Some spectral fluctuations also occurred during the viewed conditions in all brain areas, but they were generally smaller in magnitude or confined to the gamma band ( Figure 5). Overall, these spectral fluctuations were not very similar for the exercise and viewed conditions. supplementary motor area (Brodmann Area 6; Figure 3). There were also clusters in the right anterior cingulate (Brodmann area 32), the middle anterior cingulate (Brodmann Area 24), the middle posterior cingulate (Brodmann area 31), and the middle parietal lobe (Brodmann area 7; Figure 4). For a complete breakdown of functional areas and ICs, see Table 1. In the premotor and supplementary motor cortex, spectral fluctuations occurred during the active conditions in the theta (4-8 Hz), alpha (8-13 Hz), beta (13-30 Hz), and gamma (30 Hz and above) bands (Figure 3). In the middle premotor and supplementary motor area, all active conditions elicited bilateral activity. Theta and low alpha band desynchronization occurred during approximately the middle 50% of the extension phase for either arm in the arms only condition, for either leg in the legs only condition, and for either arm-leg pair in the arms and legs condition. In the right and left premotor and supplementary motor cortex, these alpha and theta spectral power fluctuations showed some lateralization. Prominent desynchronization occurred in right premotor and supplementary motor cortex during approximately the middle 50% of the extension phase when the left leg was extending in both the arms and legs condition and the legs only condition. Prominent desynchronization occurred in left premotor and supplementary motor cortex during approximately the middle 50% of the extension phase when the left arm was extending in the arms only condition and when the right leg was extending in the legs only condition. In nearly all brain areas and frequency bands, when the Wilcoxon rank sum tests revealed significant differences in spectral power between active conditions, the legs condition had significantly less spectral power ( Table 2). There were some similar spectral fluctuations during the self viewed arms condition, particularly in the middle premotor and supplementary motor cortex in the theta and low alpha band. However, overall, we did not detect robust or consistent fluctuations across similar pairs of conditions (i.e., arms vs. arms viewed). For the spectral fluctuation plots for all the viewed conditions, see Supplementary Figure 1. In the cingulate and parietal areas, spectral fluctuations occurred during active movement in the theta (4-8 Hz), alpha (8-13 Hz), beta (13-30 Hz), and gamma (30 Hz and above) bands (Figure 4). These fluctuations were much greater for both active arms conditions than for the active legs condition. In the majority of areas, theta and low alpha band desynchronization occurred during approximately the middle 50% of the extension phase when either arm was extending in the arms only condition and when either arm-leg pair was extending in the arms and legs condition. Theta and low alpha synchronization occurred at the transition points for the two active arms conditions. Again, we did not detect highly similar spectral fluctuations for the active arms and self viewed arms conditions. For the spectral fluctuation plots for all the viewed conditions, see Supplementary Figure 1. For spectral power comparisons between the active conditions broken down by frequency band, see Table 2. FIGURE 6 | Connectivity active arms. Diagram showing directed transfer function connectivity values between pairs of cortical areas while the subject performed ACTIVE rhythmic movement using only the ARMS. Each individual plot starts and ends with the right arm fully extended. The numbers on the x-axis indicate the % of the movement cycle. We set non-significant differences to 0 (blue). Connectivity Results For all conditions, pairs of cortical areas exhibited suprathreshold connectivity values (maximum connectivity values more than a standard deviation greater than the mean). Examining the connectivity patterns across all conditions (Table 3), a general picture of a movement-related neural network emerges. During every active and viewed movement condition, suprathreshold connectivity occurred between the middle anterior cingulate and the right premotor and supplementary motor cortex. For the majority of conditions, suprathreshold connectivity also occurred between several cortical areas (the middle premotor and supplementary motor cortex, the left premotor and supplementary motor cortex, and the middle posterior cingulate) and the right premotor and supplementary motor cortex, between the right premotor and supplementary motor cortex and the middle posterior cingulate, and between the right anterior cingulate and the middle posterior cingulate (Figure 5). There were also some differences between the conditions. The most suprathreshold connectivity values between pairs of cortical areas occurred during the self-viewed movement conditions (25 pairs). The least suprathreshold connectivity values between pairs of cortical areas occurred during the active movement conditions (15 pairs). The number of cortical pairs exhibiting suprathreshold connectivity was intermediate for the otherviewed movement conditions (18 pairs). See Table 3 for all cortical pairs exhibiting suprathreshold connectivity for each condition. Connectivity grids showing the strength of directed transfer function connectivity for all frequencies and time points within a stride revealed that significant connectivity fluctuations occurred Frontiers in Neuroscience | www.frontiersin.org between many cortical areas for all active and viewed conditions (Figures 6-9). For connectivity grids for all the additional viewed conditions, see Supplementary Figures 2-7. The fast Fourier transform analysis showed that the connectivity strengths in our cortical network fluctuated at a predictable rate for both the active movement and the viewed movement conditions. Connectivity fluctuated rapidly, with the greatest peaks occurring below 3 Hz for all conditions. Peaks occurred at the harmonics of the movement frequency for both the active movement and the viewed movement conditions. For all conditions, a peak in connectivity fluctuation occurred at 0.5, 1, 1.5, and 2 times the movement frequency (1.17 Hz). Of particular interest is the fact that the peaks in connectivity fluctuation occurred at precisely the same frequencies for the active movement and the viewed movement conditions (Figure 10). DISCUSSION A widely distributed cortical network exhibits fluctuations in spectral power and effective connectivity during active and viewed rhythmic limb movements. This network includes the premotor and supplementary motor cortex, the anterior and posterior cingulate, and the parietal cortex. In the cingulate areas and the parietal cortex, the spectral fluctuations were significantly smaller or nearly absent during the legs only movement condition compared to either arm movement condition. This evidence suggests that rhythmic arm movements induce more cortical spectral activity than rhythmic leg movements. Consistent spectral fluctuations were not evident during the viewed conditions. However, effective connectivity analysis revealed that the strength and direction of information flow was similar between the active and viewed movement conditions. FIGURE 8 | Connectivity active legs. Diagram showing directed transfer function connectivity values between pairs of cortical areas while the subject performed ACTIVE rhythmic movement using only the LEGS. Each individual plot starts and ends with the left leg fully extended. The numbers on the x-axis indicate the % of the movement cycle. We set non-significant differences to 0 (blue). There was no strong difference in effective connectivity between the self viewed and other viewed movement conditions. For all the active and viewed conditions, the right premotor and supplementary motor cortex drove the network. In the premotor and supplementary motor areas, spectral power fluctuations occurred most prominently during active rhythmic movements and less so during viewed movements. We found that the premotor and supplementary motor areas exhibited theta and alpha desynchronization when the contralateral limb was extending and synchronization when the limbs were switching directions. The presence of desynchronization may reflect increased cortical activation for movement production or sensorimotor processing (Pfurtscheller and Klimesch, 1991;;Pfurtscheller and Lopes Da Silva, 1999). The presence of synchronization at the transition points may reflect recruitment of the muscles needed to transition from flexion to extension (). There were some similar spectral shifts during the viewed conditions. However, they were generally smaller, as in the middle premotor and supplementary motor area during the self viewed arm condition, but for the most part they were absent. This differs from previous EEG studies where spectral fluctuations were evident during viewed movement ((Cochin et al.,, 1999;;). The spectral fluctuations seen during the active conditions in the motor cortex occurred primarily at lower frequencies than have been reported by previous studies of human walking ;;Nathan and Contreras-Vidal, 2016). During walking, there are many neural FIGURE 9 | Connectivity viewed arms self. Diagram showing directed transfer function connectivity values between pairs of cortical areas while the subjects VIEWED a video of themselves exercising with only the ARMS. Each individual plot starts and ends with the viewed right arm fully extended. The numbers on the x-axis indicate the % of the movement cycle. We set non-significant differences to 0 (blue). demands that are not present during a recumbent stepping task. The brain must coordinate foot placement, track the trajectories of all four limbs in space, and maintain balance. Comparatively, there is no balance component involved in recumbent stepping, and, for the most part, the limbs follow prescribed trajectories. The increased sensory, proprioceptive, and balance information processed by the brain during walking may account for much of the high frequency fluctuations seen in previous studies of human walking ;). Spectral fluctuations also occurred during the active conditions in the cingulate areas and the parietal area. Similar to the premotor and supplementary motor areas, theta and alpha desynchronization occurred when the contralateral limb was extending, and synchronization occurred when the limbs were switching directions. Interestingly the spectral fluctuations in these areas were mainly apparent when the subjects moved their arms, and were much smaller or completely absent when the subjects moved just their legs. Past research has suggested that rhythmic leg movement is more tightly coupled to spinal neural centers than rhythmic arm movement. During arm and leg cycling in humans, leg cadence variability is less affected by changes in arm cycling cadence than vice versa (). An instantaneous change in arm cycling cadence has little effect on leg cycling cadence, but the converse is not true (). Our present findings support the notion that the legs are more tightly coupled than the arms to spinal neural networks and thus needs less descending input from areas such as the cingulate and parietal lobe, at least for a rhythmic, continuous task like recumbent stepping. The anterior cingulate area is primarily involved in error detection FIGURE 10 | Fast Fourier transform results. Fast Fourier transform of the average connectivity over time across all IC pairs. The left column shows the values for the three active movement conditions, the middle column shows the values for the three self-viewed movement conditions, the right column shows the values for the four other-viewed movement conditions. The dotted lines show the subjects' stepping frequency and the second harmonic of that frequency. and correction (;O';). Past studies have found anterior cingulate spectral power fluctuations around foot placement during walking, when there is a priority on monitoring potential errors that will affect gait stability. The legs exercise task had no active foot placement as the foot was always on the pedal, suggesting little need for cingulate error monitoring. Cyclic arm motion also had continuous effector-handle contact, but it is not similar to any normal locomotor task and thus could have been more closely monitored by the anterior cingulate. The middle parietal cortex is known to be involved in visuospatial processing (). There are few occasions in everyday life when humans move the arms rhythmically without also moving the legs. Given the novelty of moving the arms rhythmically on their own, greater visuospatial processing may be required. In our study, the right premotor and supplementary motor cortex was the central hub of information flow. It is wellestablished that the right hemisphere is the more spatially oriented of the two hemispheres. The strongest evidence of this comes from patients who have suffered strokes on the right side of the brain. Hemineglect, or failure to perceive the contralesional side of the world, is typically more pronounced in patients with right hemisphere strokes than similar left hemisphere strokes (;). This suggests that the right hemisphere is centrally involved in constructing our perception of the space around us. Furthermore, the right hemisphere may control shifts in attention while viewing a scene. Studies with fMRI have reported right-lateralized ventral fronto-parietal activity during shifts in visual attention (;). Seven of the ten conditions in this study involved a predominantly visual task with frequent shifts in attention from the left to right side of the viewed scene and vice versa. All of this may have accounted for the right hemisphere's prominent role in coordinating the communication of the interacting brain areas. The results from our fast Fourier transform analysis of the connectivity data highlight similarities in the neural processing of the active movement and viewed movement conditions. The fluctuations in overall connectivity occurred at frequencies related to the movement. Specifically these fluctuations were prominent at 0.5, 1, 1.5, and 2 times the movement frequency. This observation strongly supports the relevance of connectivity analysis for providing insight into the true brain activity during the conditions. The prominent frequencies for greater connectivity fluctuations were similar for both active movement and viewed movement. There has been considerable recent debate about the possibility of motion artifact corrupting EEG signals during human movement (;). There was very little head movement during the active stepping condition, but virtually no head movement during the viewed conditions. The fast Fourier transform analysis of the connectivity found very similar outcomes for all the conditions. The similarity between conditions indicates that the communication within the cortical network was related to the pace of the active or viewed movement. In addition, the most recent papers on head motion artifact in EEG during locomotion strongly suggest that standard processing methods remove the vast majority of motion artifact Nathan and Contreras-Vidal, 2016). One of the limitations of our study was that subjects exercised at a self-reported challenging resistance level. As a result, we can only state that exercise with arms at a self-selected resistance elicits more cortical activity than exercise with legs at a selfselected resistance. Because we did not normalize absolute effort or force levels across participants and across conditions, we cannot report how these variables affected neural activity. Different amounts of resistance alter Blood Oxygenation Level Dependent (BOLD) signal in functional magnetic resonance imaging studies (), but the same does not appear true with EEG spectral power. A previous study from our laboratory found no differences in event related spectral power fluctuations across a four-fold change in effort level for lower limb exercise. Two other studies using scalp EEG during exercise have also found either no differences in sensorimotor cortical activity over a four-fold range of effort (Dal ) or only a change in the gamma band of sensorimotor cortex activation over a four-fold range of effort (). There are two published cycling studies that show EEG spectral power increases with cycling mechanical power output (;), but data from both of the studies actually show very little change with pedaling power. There is not a proportional change in EEG spectral power with cycling mechanical power in either study. Most of the measures show no change with cycling mechanical power. The authors increased cycling mechanical power across time in the experimental protocol, and late in the experiment did find at least one condition with high mechanical power output that had higher EEG spectral power than previous conditions. However, given that fatigue during cycling increases EEG spectral power (), it seems more likely that the data from Brummer et al. and Schneider et al. can be explained best by fatigue rather than cycling mechanical power output. Our experimental paradigm randomized the order of conditions and used only comfortable levels of resistance that were not likely to promote fatigue. There were several other limitations to our study. A second limitation was that we gave the subjects a fixation point during the viewed conditions, preventing them from freely scanning the scene as in past studies of motor observation. This gaze constraint may have limited the spectral fluctuations normally associated with viewed motion ((Cochin et al.,, 1999;;). Third, a visual cue was used to control pace in the active conditions, but there were no visual cues presented during the viewed condition. In the active conditions, cue following may have imposed additional cognitive load that was not present in the viewed condition, and this could have led to greater spectral activity in the active conditions. Fourth, in the viewed stepper condition, we identified supra-threshold connectivity that was similar to the three viewed motion conditions. We believe that the participants may have spontaneously engaged in motor imagery during this viewed condition. All participants had stepped on the recumbent stepper prior to viewing the control video of the recumbent stepper moving on its own. Given that motor imagery activates similar neural structures and pathways as motor execution (;), this could explain the unexpected result. Finally, contrary to our expectations, we did not find significant neural activity in the premotor cortex. There are many reasons why it may be absent. The spatial resolution of EEG is limited to a few centimeters. Furthermore, there is significant variation in neural anatomy between individuals, and in this study we used an average template brain to localize cortical sources rather than using personalized MRIs. It is possible that some of the cortical activity localized to the supplementary motor cortex could have come from the adjacent primary motor cortex. Future studies using subject-specific MRIs to provide finer resolution of motor cortical activity may find activity in the primary motor cortex. Despite these limitations, the results of this study add new information to our understanding of human motor control and motor observation. This is among the first studies to report on spectral fluctuations in human cortex during actual and observed full-body motion. There is substantial interest in observed motion in the rehabilitation community. It has been suggested that action observation could improve motor rehabilitation in patients with chronic stroke, Parkinson's disease, or cerebral palsy. In adults with upper-limb impairment following a stroke, significant improvements in functionality were seen after 18 consecutive days of action observation therapy (). In children with cerebral palsy, a similar duration of action observation therapy increased spontaneous use of the affected hand (). Given the potential therapeutic benefits of viewed movement, knowledge of the differences in cortical connectivity during active and viewed movement could provide insight for rehabilitation after a brain injury. It might also suggest potential rehabilitation targets accessible through transcranial magnetic stimulation. The results of our spectral analysis suggest that rhythmic arm movements are under greater descending cortical control, especially by the cingulate and parietal areas, than rhythmic leg movement. Furthermore, effective connectivity in a cortical network that is driven by the right premotor and supplementary motor cortex fluctuates at harmonics of the movement frequency during both active and viewed movement. These results suggest that a similarly interconnected neural network is in operation during both active and viewed movement. They illustrate that effective connectivity analysis can provide insight into brain network activity beyond what can be gained from traditional spectral analysis. AUTHOR CONTRIBUTIONS JK, HH, KS, and DF designed the experiment. JK and HH carried out the experimental procedures. JK and KS performed the data analysis. JK, HH, KS, and DF wrote and edited the manuscript.
package Call_function_from_Java; import static All_Exception_Handling.Extension_FunctionKt.lastChar; public class Extension_Function_call_from_Java { public static void main(String[] args){ char c = lastChar("SEXO-BEAT"); System.out.println(c); } }
Multi-resolution based sensitivity analysis of complex non-linear circuits This study addresses the sensitivity analysis of non-linear circuits in their transient and periodic behaviour. The circuits here considered are built of connections of N-ports with frequency-dependent parameters whose input and output quantities are expanded in the wavelet domain. The use of wavelet instead of the Fourier analysis allows a significant increase in the sparsity of the matrices with a comparable accuracy and convergence rate. In addition, by using the proper wavelet basis, it is possible to analyse both the steady state and the transient behaviour. The adjoint system method is used to obtain the sensitivities of the response of the circuit with respect to the design parameters. The multiport connection is described in terms of scattering parameters and the hierarchical approach is extended to the adjoint system. Computational aspects are discussed and examples of application of the proposed technique are reported. The results are compared with those obtained by the use of other techniques.
//6, 19 - 6, 22 package p; class A { void f(String bar) { String x = bar; } }
Effect of human growth hormone on adrenal androgens in children with growth hormone deficiency. The effect of human growth hormone (hGH) on adrenal androgen secretion was assessed in 7 patients (5 males, 2 females) with GH deficiency but normal ACTH-cortisol function. Patients ranged in age from 9 5/12 to 14 8/12 years (median 12 years). Plasma concentrations of dehydroepiandrosterone-sulfate (DHEA-S) and urinary excretion of 17-ketosteroids (17-KS) and free cortisol were determined before, during short-term (2 U/day X 3) and after long-term (6 months) treatment with hGH. No significant change was noted in the plasma concentration or urinary excretion of steroids during the short-term administration of hGH. Despite a significant increase in growth velocity during 6 months of hGH therapy (8.2 vs. 4.5 cm/year, p less than 0.01), the plasma concentrations of DHEA-S and the urinary 17-KS and free cortisol levels were unchanged. These results fail to substantiate a role for hGH in the physiologic control of adrenal androgen secretion. Thus, the low plasma levels of adrenal androgens sometimes seen in GH-deficient patients are not due to the absence of GH per se.
Ford Kansas City Assembly Plant Current The 4,700,000-square-foot (440,000 m²) on 1,270 acres (5.1 km²) facility employs approximately 7,000 people. In addition to the main final assembly plant, KCAP also includes a stamping plant for the Ford Transit, a separate body shop and a separate paint shop for the Ford F-150. Plant tours were discontinued on September 12, 2001. In December 2010 Ford announced it was moving the Ford Escape and Ford Escape Hybrid to the Louisville Assembly Plant, which underwent $600 million in renovations. The move stirred fears that it could result in the loss of half the jobs at the 3,700-person plant. Missouri had been anticipating changes at the plant. In 2010 it passed the Missouri Manufacturing Jobs Act providing tax incentives for companies that invest in plants in the state by allowing them to keep employee withholding taxes. While the bill would benefit all industrial businesses it was specifically targeting the plant and was introduced by Jerry Nolte, whose district includes the plant. Ford could save $150 million over 10 years if it invests in the plant. The bill had been the subject of a filibuster by United States Senate candidate Chuck Purgason who objected to the favoritism extended to Ford and read aloud sections of Allan W. Eckert's The Frontiersman into the record. A day after the announcement of the move of the Escape, Ford said a yet to be announced line would replace the Escape. In 2011, Ford said it would spend $1.1 billion on additions and upgrades, including a new stamping plant. In 2012, it was announced that the plant would be the North American lead production site for the new Ford Transit, which replaced the now discontinued Ford E-Series vans. Products Kansas City Assembly Plant opened in 1951 for military production. Converted to auto assembly in 1956, it began production as a civilian vehicle assembly plant in 1957. Since then, KCAP has built the following vehicles;
from pyautofinance.common.testers.tester import Tester from pyautofinance.common.metrics.engine_metrics import TotalGrossProfit from pyautofinance.common.results.test_results_collection import TestResultsCollection from pyautofinance.common.simulators.walk_forward_simulator import WalkForwardSimulator from pyautofinance.common.results.test_result import TestResult class WalkForwardTester(Tester): def __init__(self, periods=1, metric_to_consider=TotalGrossProfit, test_percent=20, anchored=False): self.periods = periods self.metric_to_consider = metric_to_consider self.test_percent = test_percent self.anchored = anchored def test(self, engine): walk_forward_simulator = WalkForwardSimulator(self.periods, self.metric_to_consider, self.test_percent, self.anchored) result = walk_forward_simulator.simulate(engine) train_results = [res[0] for res in result] test_results = [res[1] for res in result] train_metrics = [engine_result[0].metrics for engine_result in train_results] train_test_results = [TestResult(*metrics.values()) for metrics in train_metrics] test_metrics = [engine_result[0].metrics for engine_result in test_results] test_test_results = [TestResult(*metrics.values()) for metrics in test_metrics] return TestResultsCollection(*train_test_results, *test_test_results)
/** * Tests for <code>ServerSocketFactory</code> class constructors and methods. */ @TestTargetClass(ServerSocketFactory.class) public class ServerSocketFactoryTest extends TestCase { /** * @tests javax.net.SocketFactory#SocketFactory() */ @TestTargetNew( level = TestLevel.COMPLETE, notes = "", method = "ServerSocketFactory", args = {} ) public void test_Constructor() { try { ServerSocketFactory sf = new MyServerSocketFactory(); } catch (Exception e) { fail("Unexpected exception " + e.toString()); } } /** * @tests javax.net.ServerSocketFactory#createServerSocket() */ @TestTargetNew( level = TestLevel.SUFFICIENT, notes = "IOException checking missed", method = "createServerSocket", args = {} ) public final void test_createServerSocket_01() { ServerSocketFactory sf = ServerSocketFactory.getDefault(); try { ServerSocket ss = sf.createServerSocket(); assertNotNull(ss); } catch (SocketException e) { } catch (Exception e) { fail(e.toString()); } } /** * @tests javax.net.ServerSocketFactory#createServerSocket(int port) */ @TestTargetNew( level = TestLevel.COMPLETE, notes = "", method = "createServerSocket", args = {int.class} ) public final void test_createServerSocket_02() { ServerSocketFactory sf = ServerSocketFactory.getDefault(); int portNumber = Support_PortManager.getNextPort(); try { ServerSocket ss = sf.createServerSocket(portNumber); assertNotNull(ss); } catch (Exception ex) { fail("Unexpected exception: " + ex); } try { sf.createServerSocket(portNumber); fail("IOException wasn't thrown"); } catch (IOException ioe) { //expected } catch (Exception ex) { fail(ex + " was thrown instead of IOException"); } try { sf.createServerSocket(-1); fail("IllegalArgumentException wasn't thrown"); } catch (IllegalArgumentException ioe) { //expected } catch (Exception ex) { fail(ex + " was thrown instead of IllegalArgumentException"); } } /** * @tests javax.net.ServerSocketFactory#createServerSocket(int port, int backlog) */ @TestTargetNew( level = TestLevel.COMPLETE, notes = "", method = "createServerSocket", args = {int.class, int.class} ) public final void test_createServerSocket_03() { ServerSocketFactory sf = ServerSocketFactory.getDefault(); int portNumber = Support_PortManager.getNextPort(); try { ServerSocket ss = sf.createServerSocket(portNumber, 0); assertNotNull(ss); } catch (Exception ex) { fail("Unexpected exception: " + ex); } try { sf.createServerSocket(portNumber, 0); fail("IOException wasn't thrown"); } catch (IOException ioe) { //expected } catch (Exception ex) { fail(ex + " was thrown instead of IOException"); } try { sf.createServerSocket(65536, 0); fail("IllegalArgumentException wasn't thrown"); } catch (IllegalArgumentException ioe) { //expected } catch (Exception ex) { fail(ex + " was thrown instead of IllegalArgumentException"); } } /** * @tests javax.net.ServerSocketFactory#createServerSocket(int port, int backlog, InetAddress ifAddress) */ @TestTargetNew( level = TestLevel.COMPLETE, notes = "", method = "createServerSocket", args = {int.class, int.class, InetAddress.class} ) public final void test_createServerSocket_04() { ServerSocketFactory sf = ServerSocketFactory.getDefault(); int portNumber = Support_PortManager.getNextPort(); try { ServerSocket ss = sf.createServerSocket(portNumber, 0, InetAddress.getLocalHost()); assertNotNull(ss); } catch (Exception ex) { fail("Unexpected exception: " + ex); } try { sf.createServerSocket(portNumber, 0, InetAddress.getLocalHost()); fail("IOException wasn't thrown"); } catch (IOException ioe) { //expected } catch (Exception ex) { fail(ex + " was thrown instead of IOException"); } try { sf.createServerSocket(Integer.MAX_VALUE, 0, InetAddress.getLocalHost()); fail("IllegalArgumentException wasn't thrown"); } catch (IllegalArgumentException ioe) { //expected } catch (Exception ex) { fail(ex + " was thrown instead of IllegalArgumentException"); } } /** * @tests javax.net.ServerSocketFactory#getDefault() */ @TestTargetNew( level = TestLevel.COMPLETE, notes = "", method = "getDefault", args = {} ) public final void test_getDefault() { ServerSocketFactory sf = ServerSocketFactory.getDefault(); ServerSocket s; try { s = sf.createServerSocket(0); s.close(); } catch (IOException e) { } try { s = sf.createServerSocket(0, 50); s.close(); } catch (IOException e) { } try { s = sf.createServerSocket(0, 50, InetAddress.getLocalHost()); s.close(); } catch (IOException e) { } } }
import { Component } from '@angular/core'; import { ListingPage } from '../listing/listing'; import { ProfilePage } from '../profile/profile'; import { NotificationsPage } from '../notifications/notifications'; import { SettingsPage } from "../settings/settings"; import { List1Page } from "../list-1/list-1"; import { CartPage } from "../cart/cart"; @Component({ selector: 'tabs-navigation', templateUrl: 'tabs-navigation.html' }) export class TabsNavigationPage { tab1Root: any; tab2Root: any; tab3Root: any; tab4Root: any; tab5Root: any; constructor() { this.tab1Root = ListingPage; this.tab2Root = List1Page; this.tab3Root = NotificationsPage; this.tab4Root = SettingsPage; this.tab5Root = CartPage; } }
By Vernon Felton Photos by Hoshi Yoshida Frank Schneider is a hard, hard man. This, apparently, explains why the former World Cup DH racer decided to race Megavalanche's Masters Challenger Class on a hardtail—a singlespeed hardtail—and won. Schneider also finished second, overall, in the Mega Challenger Cup. Apparently it's not enough to compete in one of the toughest marathon downhill races known to man. Nope, he had to do it with the cycling equivalent of both hands tied behind his back. Oh, and he started the race from back in third row, which meant he needed to pass 40 riders to take that lead position. Damn. By the time "Schneidi" got to the end of the glacier section (just in case you forgot, the race begins atop a glacier and, in its initial minutes, consists of people in full face helmets crashing and skidding at dangerously high speeds across the ice) he'd already passed 30 competitors. Schneider then picked off the remaining ten on the high-speed, technical singletrack sections and, yes, he did it with one effing gear. Schneider was riding a Nicolai hardtail, equipped with a Gates Carbondrive belt. It's the set up he generally rocks, so clearly the whole belt-drive thing works for him. I'd say something at this point about how we tested this same belt-drive system and found it quite rugged, but anything we have to say on the subject seems sort of puny and insignificant at this point in the narrative. So, uh, yeah, there you have it. The video clip below isn't of Schneider humbling racers on state-of-the-art, six-inch travel bikes—it's just really fast and phenomenal trail riding footage, but it's well worth clicking. Enjoy.
<filename>Jx3Full/Source/Source/base/base/Include/Engine/KG_CpuTicker.h ////////////////////////////////////////////////////////////////////////////////////// // // FileName : KG_CpuTicker.h // Version : 1.0 // Creater : <NAME> // Date : 2005/8/4 10:17:00 // Comment : // ////////////////////////////////////////////////////////////////////////////////////// #ifndef KG_CPUTICKER_H #define KG_CPUTICKER_H #define KG_USE_CPUTICKER //#undef KG_USE_CPUTICKER #include <assert.h> #include <stdio.h> #include <string.h> #include <vector> using namespace std; #ifdef KG_USE_CPUTICKER #include "KGLog.h" #ifdef WIN32 __declspec(naked) inline void __fastcall GetCPUTicker(unsigned long long *pullTicker) { //__asm push ecx __asm push ebx __asm push ecx // Save pTicker __asm xor eax, eax //__asm _emit 0x0f // cpuid - serialise the processor //__asm _emit 0xa2 __asm _emit 0x0f // rdtsc __asm _emit 0x31 __asm pop ecx // Get pTicker __asm mov [ecx + 4], edx __asm mov [ecx], eax __asm pop ebx __asm ret //__asm pop ecx } #else // WIN32 inline void GetCPUTicker(unsigned long long *pullTicker) { unsigned long long ullCPUTick = 0; __asm__ __volatile__("rdtsc" : "=A" (ullCPUTick) : ); *pullTicker = ullCPUTick; } #endif class KG_CpuTicker { public: int Push(const char cszFunction[], int nLine); int Pop(unsigned uTimeoutTicker, const char cszFunction[], int nLine); KG_CpuTicker() { m_CpuTickerDataVector.reserve(128); } ~KG_CpuTicker() { assert(m_CpuTickerDataVector.empty()); } private: typedef struct KG_CpuTickerData { unsigned long long ullCpuTicker; char szFunction[256]; int nLine; } KG_CpuTickerData; typedef vector<KG_CpuTickerData> KG_CpuTickerDataVector; KG_CpuTickerDataVector m_CpuTickerDataVector; }; inline int KG_CpuTicker::Push(const char cszFunction[], int nLine) { KG_CpuTickerData CpuTickerData; CpuTickerData.nLine = nLine; strncpy(CpuTickerData.szFunction, cszFunction, sizeof(CpuTickerData.szFunction)); CpuTickerData.szFunction[sizeof(CpuTickerData.szFunction) - 1] = '\0'; m_CpuTickerDataVector.push_back(CpuTickerData); GetCPUTicker(&(m_CpuTickerDataVector.back().ullCpuTicker)); KGLogPrintf( KGLOG_DEBUG, "[%s]:%d, start tickers = %I64d", cszFunction, nLine, m_CpuTickerDataVector.back().ullCpuTicker ); GetCPUTicker(&(m_CpuTickerDataVector.back().ullCpuTicker)); return true; } inline int KG_CpuTicker::Pop(unsigned uTimeoutTicker, const char cszFunction[], int nLine) { unsigned long long ullCpuTicker = 0; GetCPUTicker(&ullCpuTicker); ullCpuTicker -= m_CpuTickerDataVector.back().ullCpuTicker; if (ullCpuTicker > uTimeoutTicker) { KGLogPrintf( KGLOG_DEBUG, "[%s]:%d->[%s]:%d timeout, tickers = %I64d", m_CpuTickerDataVector.back().szFunction, m_CpuTickerDataVector.back().nLine, cszFunction, nLine, ullCpuTicker ); } m_CpuTickerDataVector.pop_back(); return true; } #else // KG_USE_CPUTICKER class KG_CpuTicker { public: int Push(const char cszFunction[], int nLine) { } int Pop(unsigned uTimeoutTicker, const char cszFunction[], int nLine) { } }; #endif // KG_USE_CPUTICKER #endif // KG_CPUTICKER_H
The amendment put forward by Oliver Letwin, a lawmaker from Prime Minister Theresa May's Conservatives, changes the rules of parliament on Wednesday in order to provide time for so-called indicative votes on Brexit options. [LONDON] British lawmakers on Monday voted to wrest control of the Brexit process to try to find a majority for an alternative way forward that would break the parliamentary deadlock. Lawmakers voted by 329 to 302 to accept the amendment. The motion will be voted on shortly and also needs to be passed.
/** * Encrypts a plaintext using the AES peripheral. * * This function uses `sca_call_and_sleep()` from the sca library to put Ibex to * sleep in order to minimize noise during captures. The plaintext must be * `kAesKeySize` bytes long. * * @param plaintext Plaintext. * @param plaintext_len Length of the plaintext. * @return Result of the operation. */ static void aes_serial_encrypt(const uint8_t *plaintext, size_t plaintext_len) { bool ready = false; do { SS_CHECK_DIF_OK(dif_aes_get_status(&aes, kDifAesStatusInputReady, &ready)); } while (!ready); dif_aes_data_t data; SS_CHECK(plaintext_len <= sizeof(data.data)); memcpy(data.data, plaintext, plaintext_len); SS_CHECK_DIF_OK(dif_aes_load_data(&aes, data)); sca_call_and_sleep(aes_manual_trigger, kIbexAesSleepCycles); }
package com.rockhoppertech.music.fx.cmn.musicxml; /* * #%L * Rocky Music FX * %% * Copyright (C) 1996 - 2014 Rockhopper Technologies * %% * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * #L% */ import java.io.FileOutputStream; import java.io.IOException; import java.io.OutputStream; import java.text.SimpleDateFormat; import java.util.Date; import java.util.Locale; import java.util.NavigableMap; import javax.xml.stream.XMLEventFactory; import javax.xml.stream.XMLEventWriter; import javax.xml.stream.XMLOutputFactory; import javax.xml.stream.XMLStreamException; import javax.xml.stream.events.Characters; import javax.xml.stream.events.EndElement; import javax.xml.stream.events.StartDocument; import javax.xml.stream.events.StartElement; import javax.xml.stream.events.XMLEvent; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.rockhoppertech.music.fx.cmn.Measure; import com.rockhoppertech.music.midi.js.Instrument; import com.rockhoppertech.music.midi.js.KeySignature; import com.rockhoppertech.music.midi.js.MIDINote; import com.rockhoppertech.music.midi.js.MIDITrack; import com.rockhoppertech.music.midi.js.MIDITrackBuilder; import com.rockhoppertech.music.midi.js.Score; import com.rockhoppertech.music.midi.js.TimeSignature; /** * Uses Stax to emit MusicXML for a MIDITrack. * * @author <a href="http://genedelisa.com/"><NAME></a> * */ public class ScoreToMusicXML { private static final Logger logger = LoggerFactory .getLogger(ScoreToMusicXML.class); public static void main(String[] args) { Score score = new Score(); score.setKeySignatureAtBeat(1d, KeySignature.CMAJOR); score.setTimeSignatureAtBeat(1d, 4, 4); MIDITrack track = MIDITrackBuilder.create() .name("some track") .description("this is the description") .noteString("c d Ef cs3 f#5 e f g") .durations(1d, 1.5, .5) .instrument(Instrument.TRUMPET) .sequential() .build(); // track.addTimeSignatureAtBeat(1d, new TimeSignature(4, 4)); // track.addKeySignatureAtBeat(1d, KeySignature.EFMAJOR); score.add(track); track = MIDITrackBuilder.create() .name("another track") .description("this is the description") .noteString("c3 e g") .durations(1d, 1.5, .5) .instrument(Instrument.TUBA) .sequential() .build(); score.add(track); try { OutputStream os = new FileOutputStream("testmusicxml-score.xml"); emitXML(score, os, "Grand Opus", "Giacomo"); } catch (IOException | XMLStreamException e) { e.printStackTrace(); } } static String dtd = "<!DOCTYPE score-partwise PUBLIC \"-//Recordare//DTD MusicXML 3.0 Partwise//EN\" \"http://www.musicxml.org/dtds/partwise.dtd\">"; private static int resolution = 256; public static void emitXML(Score score, OutputStream out, String workTitle, String composer) throws IOException, XMLStreamException { resolution = score.getResolution(); XMLOutputFactory outputFactory = XMLOutputFactory.newInstance(); XMLEventWriter writer = outputFactory.createXMLEventWriter(out); XMLEventFactory eventFactory = XMLEventFactory.newInstance(); // DTD dtddec = eventFactory.createDTD(dtd); // writer.add(eventFactory.createDTD(dtd)); // writer.add(createNewLine(eventFactory)); StartDocument startDocument = eventFactory.createStartDocument(); writer.add(startDocument); StartElement scoreElement = eventFactory.createStartElement("", "", "score-partwise"); writer.add(scoreElement); writer.add(eventFactory.createAttribute("version", "3.0")); writer.add(createNewLine(eventFactory)); writer.add(eventFactory.createStartElement("", "", "work")); writer.add(createNewLine(eventFactory)); createNode(eventFactory, writer, "work-title", workTitle); writer.add(eventFactory.createEndElement("", "", "work")); writer.add(createNewLine(eventFactory)); // Indentification writer.add(eventFactory.createStartElement("", "", "identification")); writer.add(createNewLine(eventFactory)); writer.add(eventFactory.createStartElement("", "", "miscellaneous")); writer.add(createNewLine(eventFactory)); // createNode( // eventFactory, // writer, // "miscellaneous-field", // score.getDescription(), // "name", // "description"); writer.add(eventFactory.createEndElement("", "", "miscellaneous")); writer.add(createNewLine(eventFactory)); createNode(eventFactory, writer, "creator", composer, "type", "composer"); SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd"); Date d = new Date(); writer.add(eventFactory.createStartElement("", "", "encoding")); writer.add(createNewLine(eventFactory)); createNode(eventFactory, writer, "encoding-date", df.format(d)); createNode(eventFactory, writer, "software", "Rockhopper Music"); createNode(eventFactory, writer, "encoder", "Gene"); writer.add(eventFactory.createEndElement("", "", "encoding")); writer.add(createNewLine(eventFactory)); writer.add(eventFactory.createEndElement("", "", "identification")); writer.add(createNewLine(eventFactory)); // / end Indentification writer.add(eventFactory.createStartElement("", "", "part-list")); int partnum = 1; writer.add(createNewLine(eventFactory)); for (MIDITrack track : score) { String partID = "P" + partnum++; writer.add(eventFactory.createStartElement("", "", "score-part")); writer.add(eventFactory.createAttribute("id", partID)); writer.add(createNewLine(eventFactory)); writer.add(eventFactory.createStartElement("", "", "part-name")); writer.add(eventFactory.createCharacters(track.getName())); writer.add(eventFactory.createEndElement("", "", "part-name")); writer.add(createNewLine(eventFactory)); // <part-name-display> // <display-text>some track</display-text> // </part-name-display> writer.add(eventFactory.createStartElement( "", "", "part-name-display")); writer.add(createNewLine(eventFactory)); createNode(eventFactory, writer, "display-text", track.getName()); writer.add(eventFactory.createEndElement( "", "", "part-name-display")); writer.add(createNewLine(eventFactory)); // <score-instrument id="P1-I1"> // <instrument-name> </instrument-name> // <virtual-instrument> // <virtual-library>General MIDI</virtual-library> // <virtual-name>Bright Piano</virtual-name> // </virtual-instrument> // </score-instrument> writer.add(eventFactory.createStartElement( "", "", "score-instrument")); writer.add(eventFactory.createAttribute("id", partID +"-I1")); writer.add(createNewLine(eventFactory)); createNode(eventFactory, writer, "instrument-name", track .getInstrument().getName()); writer.add(createNewLine(eventFactory)); writer.add(eventFactory .createStartElement("", "", "virtual-instrument")); writer.add(createNewLine(eventFactory)); createNode(eventFactory, writer, "virtual-library", "General MIDI"); createNode(eventFactory, writer, "virtual-name", track .getInstrument() .getName()); writer.add(eventFactory.createEndElement( "", "", "virtual-instrument")); writer.add(createNewLine(eventFactory)); writer.add(eventFactory .createEndElement("", "", "score-instrument")); writer.add(createNewLine(eventFactory)); // writer.add(eventFactory.createEndElement("", "", "score-part")); writer.add(createNewLine(eventFactory)); } writer.add(eventFactory.createEndElement("", "", "part-list")); writer.add(createNewLine(eventFactory)); partnum = 1; for (MIDITrack track : score) { emitXML(track, out, "P" + partnum++, outputFactory, writer, eventFactory); } writer.add(eventFactory.createEndElement("", "", "score-partwise")); writer.add(createNewLine(eventFactory)); writer.add(eventFactory.createEndDocument()); writer.flush(); writer.close(); } /** * Write a track to a stream as MusicXML. * * @param track * the {@code MIDITrack} * @param out * the output stream to write to * @param workTitle * @param composer * @throws IOException * oops * @throws XMLStreamException * oops */ public static void emitXML(MIDITrack track, OutputStream out, String partID, XMLOutputFactory outputFactory, XMLEventWriter writer, XMLEventFactory eventFactory ) throws IOException, XMLStreamException { // XMLOutputFactory outputFactory = XMLOutputFactory.newInstance(); //XMLEventWriter writer = outputFactory.createXMLEventWriter(out); //XMLEventFactory eventFactory = XMLEventFactory.newInstance(); writer.add(eventFactory.createStartElement("", "", "part")); writer.add(eventFactory.createAttribute("id", partID)); writer.add(createNewLine(eventFactory)); int divisions = resolution; NavigableMap<Double, Measure> measures = Measure.createMeasures(track); int measureNumber = 1; System.out.println("n mesures: " + measures.size()); KeySignature ks = track.getKeySignatureAtBeat(1d); TimeSignature ts = track.getTimeSignatureAtBeat(1d); for (Measure m : measures.values()) { logger.debug("measure {}", m); writer.add(eventFactory.createStartElement("", "", "measure")); writer.add(eventFactory.createAttribute("number", "" + measureNumber++)); writer.add(createNewLine(eventFactory)); writer.add(eventFactory.createStartElement("", "", "attributes")); createNode(eventFactory, writer, "divisions", "" + divisions); // TODO add the ks and ts only if different from the previous ks or // ts // KeySignature mks = m.getKeySignatureAtBeat(1d); // TimeSignature mts = m.getTimeSignature(); KeySignature mks = null; TimeSignature mts = null; // first time through (it's already been incremented) if (measureNumber == 2) { // always add the ts and ks mks = ks; mts = ts; if (mks != null) { writer.add(eventFactory.createStartElement("", "", "key")); createNode(eventFactory, writer, "fifths", "" + mks.getSf()); writer.add(eventFactory.createEndElement("", "", "key")); writer.add(createNewLine(eventFactory)); } if (mts != null) { writer.add(eventFactory.createStartElement("", "", "time")); createNode( eventFactory, writer, "beats", "" + mts.getNumerator()); createNode( eventFactory, writer, "beat-type", "" + mts.getDenominator()); writer.add(eventFactory.createEndElement("", "", "time")); writer.add(createNewLine(eventFactory)); } } else { mks = m.getKeySignatureAtBeat(m.getStartBeat()); mts = m.getTimeSignature(); logger.debug("mks is {}", mks); // if the current ks is different from the previous ks, add the // new one if (mks != null) { if (!mks.equals(ks)) { writer.add(eventFactory.createStartElement( "", "", "key")); createNode( eventFactory, writer, "fifths", "" + mks.getSf()); writer.add(eventFactory.createEndElement("", "", "key")); writer.add(createNewLine(eventFactory)); } } // if the current ts is different from the previous ts, add the // new one if (mts != null) { if (!mts.equals(ts)) { writer.add(eventFactory.createStartElement( "", "", "time")); createNode( eventFactory, writer, "beats", "" + mts.getNumerator()); createNode( eventFactory, writer, "beat-type", "" + mts.getDenominator()); writer.add(eventFactory .createEndElement("", "", "time")); writer.add(createNewLine(eventFactory)); } } } // <clef> <sign>G</sign> <line>2</line> </clef> writer.add(eventFactory.createEndElement("", "", "attributes")); writer.add(createNewLine(eventFactory)); for (MIDINote n : m.getMIDITrack()) { writer.add(eventFactory.createStartElement("", "", "note")); writer.add(createNewLine(eventFactory)); writer.add(eventFactory.createStartElement("", "", "pitch")); writer.add(createNewLine(eventFactory)); String ps = n.getPitch().getPreferredSpelling(); // preferred spelling includes the octave. get rid of it ps = ps.substring(0, ps.length() - 1); String step = ps.substring(0, 1).toUpperCase(Locale.ENGLISH); createNode(eventFactory, writer, "step", step); if (ps.endsWith("b")) { createNode(eventFactory, writer, "alter", "-1"); } // f can mean flat or pitch step if (ps.endsWith("f") && ps.length() > 1) { createNode(eventFactory, writer, "alter", "-1"); } if (ps.endsWith("s") || ps.endsWith("#")) { createNode(eventFactory, writer, "alter", "1"); } // bloody musicxml makes middle c in oct 4. int oct = (n.getMidiNumber() - 12) / 12; createNode(eventFactory, writer, "octave", "" + oct); writer.add(eventFactory.createEndElement("", "", "pitch")); writer.add(createNewLine(eventFactory)); writer.add(eventFactory.createStartElement("", "", "duration")); writer.add(eventFactory.createCharacters("" + divisions * n.getDuration())); writer.add(eventFactory.createEndElement("", "", "duration")); writer.add(createNewLine(eventFactory)); writer.add(eventFactory.createEndElement("", "", "note")); writer.add(createNewLine(eventFactory)); writer.add(createNewLine(eventFactory)); } writer.add(eventFactory.createEndElement("", "", "measure")); writer.add(createNewLine(eventFactory)); writer.add(createNewLine(eventFactory)); } writer.add(eventFactory.createEndElement("", "", "part")); } public static XMLEvent createNewLine(XMLEventFactory eventFactory) { return eventFactory.createDTD("\n"); } public static XMLEvent createTab(XMLEventFactory eventFactory) { return eventFactory.createDTD("\t"); } private static void createNode(XMLEventFactory eventFactory, XMLEventWriter writer, String name, String value) throws XMLStreamException { StartElement sElement = eventFactory.createStartElement("", "", name); writer.add(createTab(eventFactory)); writer.add(sElement); Characters characters = eventFactory.createCharacters(value); writer.add(characters); EndElement eElement = eventFactory.createEndElement("", "", name); writer.add(eElement); writer.add(createNewLine(eventFactory)); } private static void createNode(XMLEventFactory eventFactory, XMLEventWriter writer, String name, String value, String aName, String aValue) throws XMLStreamException { StartElement sElement = eventFactory.createStartElement("", "", name); writer.add(createTab(eventFactory)); writer.add(sElement); writer.add(eventFactory.createAttribute(aName, aValue)); Characters characters = eventFactory.createCharacters(value); writer.add(characters); EndElement eElement = eventFactory.createEndElement("", "", name); writer.add(eElement); writer.add(createNewLine(eventFactory)); } }
Temporal habitat variability and the maintenance of sex in host populations of the pea aphid The evolutionary maintenance of sex, despite competition from asexual reproduction, has long intrigued the evolutionary biologists owing to its numerous apparent short-term costs. In aphids, winter climate is expected to determine the maintenance of sexual lineages in the high latitude zones owing to their exclusive ability to produce frost-resistant eggs. However, diverse reproductive modes may coexist at a local scale where climatic influence is counteracted by microgeographical factors. In this study, we tested the influence of local habitat characteristics on regional coexistence of reproductive modes in the pea aphid, Acyrthosiphon pisum. In the laboratory, the induction of sexual morph production of many pea aphid genotypes from the local fields of annual (pea and faba bean) and perennial (alfalfa and red clover) crops in Western France indicated that A. pisum lineages from annual crops had a significantly higher investment in sexual reproduction than A. pisum lineages from the perennial hosts. We propose that temporal habitat variability exerts a selective pressure to maintain the sexual reproduction in A. pisum. The ecological and evolutionary consequences of the association between the mode of reproduction and the host population on gene flow restriction and on ecological specialization are discussed.
A read only memory (PROM) consists of an array of semiconductor devices (diodes, bipolar or field-effect transistors) which interconnect to store an array of binary data (ones or zeros). A ROM basically consists of a memory array of programmed data and a decoder to select the data located at a desired address in the memory array. Three basic types of ROMs are mask-programmable ROMs, erasable programmable ROMs (EPROMs) and field-programmable ROMs (PROMs). The data array is permanently stored in a mask-programmable ROM, at the time of manufacture, by selectively including or omitting the switching elements at the row-column intersections in the memory array. This requires a special mask used during fabrication of the integrated circuit which is expensive and feasible only when a large quantity of the same data array is required. EPROMs use a special charge-storage mechanism to enable or disable the switching elements in the memory array. In this case, appropriate voltage pulses to store electrical charges at the memory array locations is provided. The data stored in this manner is generally permanent until it is erased using ultraviolet light allowing it to once again be programmed. PROMs (being the focus of the present invention) are typically manufactured with all switching elements present in the array, with the connection at each row-column intersection being made by means of a fusible link. In order to store data in the PROM, these fusible links are selectively blown using appropriate voltage pulses supplied by a PROM programmer. Once the links are blown, the data is permanently stored in the memory array. Copending application, Ser. No. 760,026, by Tyler A. Lowrey and Ruojia Lee, discloses a one-sided TEOS spacer constructed on digitlines that provides one time programming of the data memory array using an anti-fuse element. The one-sided TEOS spacer digitline concept, taught in application Ser. No. 760,026, is further developed in the present invention.
(Reuters) - Nothing replaces face-to-face contact for building strong client relationships, but that is not always possible in today’s global world, says Harvard Business Review. “When it comes to creating and sustaining client relationships there’s no substitute for face-to-face contact. But with people doing business globally, that’s not always possible. To build loyalty when you can’t pop in for a visit, try these two things. 1. Use between-time to check in via e-mail. Use spare time to send clients quick notes saying hello, forwarding an article, or asking about a conference they planned to attend. Even executives with overflowing inboxes usually appreciate the gesture-especially if you don’t ask for a response. - Today’s management tip was adapted from “Keeping Your Clients Loyal, From Wherever You Are” by Dorie Clark.
Implementing Net Metering Policies in Latin America and the Caribbean: Design, Incentives and Best Practices Net Metering (NM) policies have been widely used as a mechanism to allow the inclusion of distributed generation (DG) resources in the energy system, especially the adoption of solar photovoltaic systems by small consumers like households and small business. The core design of NM permits consumers connected to the utility grid to offset consumption by inputting self-generation surplus into the network. The regulatory and policy framework is key to determine the economics of DG (investment costs and benefits), and as a consequence to determining the adoption potential. In Latin America and Caribbean, 16 countries adopted some kind of NM regulation and policy; however, it varies across countries. We analyze the heterogeneity of the NM models in LAC, the key variables that need to be considered to apply NM regulations and policy, and how it generates economic incentives.
/** * @brief * Insert data into a multimap. * * @param multimap A multimap. * @param key Key used to store the data. * @param data Data to insert. * * @return An iterator that points to the inserted pair. * * This function inserts a (key, value) pair into the multimap @em multimap. * The same key may be inserted with different data values. */ cx_multimap_iterator cx_multimap_insert(cx_multimap *multimap, cxcptr key, cxcptr data) { return cx_tree_insert_equal(multimap, key, data); }
JERUSALEM (Reuters) - Arabic television station Al Jazeera said on Thursday a July broadcast in honor of a Lebanese prisoner freed by Israel violated its code of ethics. Israel said on Wednesday it would no longer assist the Qatar-based network because of the July 19 birthday party broadcast for Samir Qantar, who spent 29 years in an Israeli jail for a 1979 attack in which five Israelis were killed. The network said in a statement that its editorial board concluded that the broadcast “violated Al Jazeera’s Code of Ethics”. The network said it “regards these violations as very serious and will assess what action is necessary”. The Al Jazeera show featured Qantar using a scimitar, a traditional Arab sword, to slice a cake with his picture on it. The broadcast included a fireworks display and Arabic music. Qantar was among five Lebanese guerrillas freed last month as part of a prisoner swap between Israel and Hezbollah. Daniel Seaman, the head of Israel’s Government Press Office, said he was encouraged by Al Jazeera’s decision to conduct an internal review but said his office would await the outcome before deciding whether to change policy. “This is a fundamental question as to where Al Jazeera stands. Does it stand with the extremists or is it a professional media organization?” Seaman said. “We are not looking for an apology ... but for a serious investigation which will be brought to our attention in a professional way,” he said. The Government Press Office said on Wednesday that it would no longer expedite Al Jazeera’s applications for entry visas and work permits necessary to obtain press credentials in Israel. Israeli officials have often accused Al Jazeera, which has bureaux in Jerusalem and the Palestinian territories, of biased reporting of the Israeli-Palestinian conflict, a charge the network has denied.
Sweat chloride measurement with a highly sensitive electrode. To the Editor: Cystic fibrosis (CF) is a genetic disease caused by mutations of the cystic fibrosis transmembrane conductance regulator (CFTR) gene that encodes a cAMP-regulated epithelial chloride channel. In the presence of typical symptoms, sweat chloride concentration () of more than 60 mmol/L is diagnostic for CF. Measurement of sweat after iontophoresis of pilocarpine is the standard method of detection, but as yet, no apparatus has been approved in Japan. In addition, expert personnel are required to conduct the standard procedure as described by Gibson and Cooke. We have therefore developed a finger sweat test, in which sweat is collected by holding a small polypropylene centrifuge tube containing 100 KL deionized water between the thumb and index finger for 10 minutes. Sweat was calculated from the Cl content and the insensible sweat rate from the other thumb measured by a perspiration meter (Perspiro 201, Suzuken, Nagoya, Japan). This method is technically simple and noninvasive and at the same time provides a reliable estimate of sweat . However, it requires an expensive capillary electrophoresis system for the accurate measurement of low in a small sample volume (100 KL). Here we describe a simple method for measuring low using a highly sensitive chloride-selective electrode (ISE/HS25Cl, Radiometer Analytical SAS, Villeurbanne, France). The electrical potential difference from the reference electrode (REF601) in 3.43 mL of 0.01 mol/L NaNO3 solution was j49.4 T 2.0 (mean T SD, n = 6) mV. As shown in Figure 1, the electrode exhibited an approximately linear response to standard NaCl solutions in the range of 2 to 20 Kmol/L. The addition of 70 KL of 0.1 mmol/L NaCl to the solution (the final is 2 Kmol/L) decreased the potential significantly (P G 0.001) by 2.8 T 0.3 mV. The mean electrical potential of samples from 18 healthy volunteers (20-22 years of age) was j64.7 (95% confidence interval: j54.3 to j75.0) mV, indicating that a reliable measurement of is possible. The calculated sweat of healthy volunteers was 16.6 T 12.0 mmol/L (n = 18). Hence, the upper limit of the normal level (mean + 2 SD) was 40.5 mmol/L, a value compatible with the normal limit of estimated by the standard method. Partial loss of CFTR function has been linked to Bnonclassic^ forms of CF, a spectrum of diseases of one organ, such as late-onset pulmonary disease, congenital bilateral absence of vas deferens, or chronic pancreatitis. In these patients, sweat exhibits variable results: normal, borderline, or abnormally high levels. Furthermore, the identification of CFTR mutations is not always possible despite extensive genetic analysis. To ascertain the pathogenesis of a CFTR-related form of chronic pancreatitis, both functional (sweat test) and genetic studies are necessary. A finger sweat chloride test in combination with a chloride-selective electrode method described here may be suitable for an initial assessment of CFTR function in a standard gastrointestinal laboratory.
The use of yttrium-rare earth aluminium garnet solid solutions for bulk-acoustic-wave (BAW) devices The isomorphic solid solution of yttrium-rare earth aluminium garnets is suggested as a dielectric material for acoustic waveguides with extremely low acoustic-wave absorption (AWA) at room temperature and for frequencies higher than 10 GHz. The two main mechanisms by which substitutional atoms decrease the bulk AWA are determined. The first one is the decrease in effective lifetime of the thermal phonons resulting in the corresponding reduction of the viscoelastic absorption-this mechanism is important for the shear acoustic waves. The second is more important for longitudinal waves. It is the reduction of Gruneisen constants for solid solution as compared to the crystal matrices.<<ETX>>
KINGSPORT — The bump-and-run is alive and well at Kingsport Speedway. Ronnie McCarty used the move made famous at neighboring Bristol Motor Speedway to nudge leader Kres VanDyke out of the way with three laps to go and win Saturday’s NASCAR Whelen All-American Series Late Model Stock feature. In the battle of former track champions, McCarty in his No. 5 Ford led most of the 60-lap race before VanDyke’s No. 15 Chevrolet pulled ahead on a late-race restart. He led a couple of laps before McCarty passed him between turns 3 and 4 with the winning move on Kingsport’s three-eighths-mile concrete oval. “He ran me good, but I wanted to win the race,” said McCarty, a hometown driver running a limited schedule. “I didn’t really have anything to lose, so I went for it. I came out on top this time and I might not next time. We worked really hard on this car, making it fast for the race. I think I had the better car today and if it hadn’t have been a five-lap shootout, I would have won easily. VanDyke, the Abingdon driver who won the season-opening race, was the only driver to break the 15- second and 90 mph barriers in qualifying before the top four cars were inverted at the start of the race. VanDyke increased his early lead in the season points standings with his runner-up finish. Chuckey’s Nik Williams finished third in the No. 32 Chevrolet to maintain second in the points. For a second straight week, he was slightly off the pace. Greeneville’s Bryson Dennis and former track champion Nate Monteith of Bluff City rounded out the top five. Defending track champion Zeke Shell of Johnson City took another major hit in the standings. A week after the motor seized up in his No. 1 Ford — leaving him unable to start the opener — he used a borrowed motor, had engine troubles again and finished last in the 11-car field. “It was spewing water. They were kind enough to lend it to us and I know when it’s about ready to blow up, so I didn’t want to burn it up. I shut her down,” Shell said. Gray’s Joey Trent started on the pole and was still running in the top four when a wheel broke on his No. 26 Chevrolet. He recovered enough to finish sixth. As exciting as the featured race was, even it couldn’t match the final lap of the Mod Street event. Kingsport drivers Austin Peters and Trey Lane raced side by side the entire final circuit. Peters in the No. 48 Dodge was leading at the white flag, but Lane pulled slightly ahead on the backstretch and the final corners in his No. 9 Dodge. Peters powered off turn 4 and won by inches at the finish line. Defending track champions Kevin Canter and Keith Helton continued to pace their respective classes. Canter, driving the black No. 3 with a Dale Earnhardt tribute paint scheme, won for a second straight week in the Mod 4 class. Billy Duty, driving a black No. 45 Adam Petty tribute car, finished second. Also for a second straight week, Helton’s No. 9 Saturn made a late-race pass of Brandon Sutherland’s No. 48 car to win in Pure 4. Doug Austin won for a second straight week in the Pure Street division, beating Kevin Darnell to the finish line.
<reponame>pabelanger/hubtty """Add can_push to project Revision ID: <KEY> Revises: 21d691<PASSWORD> Create Date: 2021-06-05 17:26:00.883182 """ # revision identifiers, used by Alembic. revision = '<KEY>' down_revision = '2<PASSWORD>' from alembic import op import sqlalchemy as sa def upgrade(): op.add_column('project', sa.Column('can_push', sa.Boolean())) def downgrade(): pass
The thriller "Glass" is the No. 1 movie at the North American box office for a third weekend, BoxOfficeMojo.com announced Sunday. "Glass" is the No. 1 movie in North America for a second weekend, earning an additional $19 million in receipts, BoxOfficeMojo.com announced Sunday. Samuel Leroy Jackson (born December 21, 1948) is an American film and television actor and film producer. After becoming involved with the Civil Rights Movement, he moved on to acting in theater at Morehouse College, and then films. He had several small roles such as in the film Goodfellas, Def by Temptation, before meeting his mentor, Morgan Freeman, and the director Spike Lee. After gaining critical acclaim for his role in Jungle Fever in 1991, he appeared in films such as Patriot Games, Amos & Andrew, True Romance and Jurassic Park. In 1994 he was cast as Jules Winnfield in Pulp Fiction, and his performance received several award nominations and critical acclaim. Jackson has since appeared in over 100 films including Die Hard with a Vengeance, The 51st State, Jackie Brown, Unbreakable, The Incredibles, Black Snake Moan, Shaft, Snakes on a Plane, as well as the Star Wars prequel trilogy and small roles in Quentin Tarantino's Kill Bill Vol. 2 and Inglourious Basterds. He played Nick Fury in Iron Man and Iron Man 2, the first two of a nine-film commitment as the character for the Marvel Cinematic Universe franchise. Jackson's many roles have made him one of the highest grossing actors at the box office. Jackson has won multiple awards throughout his career and has been portrayed in various forms of media including films, television series, and songs. In 1980, Jackson married LaTanya Richardson, with whom he has one daughter, Zoe. Jackson was born in Washington, D.C. He grew up as an only child in Chattanooga, Tennessee with his mother, Elizabeth Jackson (née Montgomery), who was a factory worker and later a supplies buyer for a mental institution, and his maternal grandparents and extended family. His father lived away from the family, in Kansas City, Missouri, and later died from alcoholism; Jackson had only met his father twice during his life. Jackson attended several segregated schools and graduated from Riverside High School in Chattanooga. Between the third and twelfth grades, he played the French horn and trumpet in the school orchestra. Initially intent on pursuing a degree in marine biology, he attended Morehouse College in Atlanta, Georgia. After joining a local acting group to earn extra points in a class, Jackson found an interest in acting and switched his major. Before graduating in 1972, he co-founded the "Just Us Theatre". It uses material from the Wikipedia article "Samuel L. Jackson."
1465. Resistance to Oral Antibiotics Among Urinary Tract Infection Isolates of Escherichia coli from the United States and Europe in 2017 Abstract Background Clinical guidelines have recommended oral antibiotics such as the cephalosporins, fluoroquinolones, and trimethoprim-sulfamethoxazole (TMP-SMX) for the treatment of urinary tract infections (UTIs) caused by Escherichia coli (EC). The utility of these agents continues to be eroded by increased prevalence of expanded spectrum -lactamase (ESBL) genes and concomitant resistance determinants to other antimicrobial classes. This study assessed the prevalence of ESBL phenotypes among EC from UTIs in the United States and 11 countries in Europe (EU) in 2017 and the impact of co-resistance to oral agents used to treat UTIs. Methods 2422 unique EC from UTIs in the United States and EU in the SENTRY Surveillance program were evaluated for susceptibility to various agents. All isolates were consecutively collected and centrally tested by CLSI methods and interpretive criteria. Isolates that met ESBL MIC screening criteria were characterized for the presence of -lactamase genes. Results Among the 2422 isolates of EC from UTIs in the United States and EU the resistance (R) rates for cefuroxime (CEF), levofloxacin (LEV) and TMP-SMX were 17.9%, 25.6% and 33.2%, respectively. The overall prevalence of ESBL phenotypes was 18.2% (18.7% in the United States and 21.0% in EU). Among the 411 ESBL phenotypes, R to CEF, LEV and TMP-SMX were: 94.3%, 70.6%, and 61.6%, respectively. In contrast, <0.1% of all EC or 0.2% of ESBL EC were meropenem (MER)-R. Only two carbapenemase-producing organisms were identified, an NDM-5- and a KPC-2-producing EC from Turkey and Greece, respectively. The CTX-M-15 was the most prevalent ESBL and identified among 167 isolates; with co-resistance to CEF, LEV and TMP-SMX noted in 100%, 82.6% and 70.7%, respectively. All CTX-M-15 isolates were susceptible to MER. Conclusion Oral agents such as CEF, LEV, and TMP-SMX exhibit R rates ≥17.9%. Co-resistance to CEF, LEV, and TMP-SMX were considerably higher among ESBL phenotypes (>61.1%) and confirmed blaCTX-M-15 genotypes (70.7%). In contrast, the carbapenems remained active against ESBL phenotypes and genotypes, such as blaCTX-M-15. New oral agents with the spectrum and potency of the carbapenems would address an unmet need for new options to treat multi-drug-resistant EC UTIs. Disclosures All authors: No reported disclosures. Background. Urinary tract infections (UTIs) are among the most common indications for antibiotic therapy. As antibiotic resistance continues to grow, it is critical to identify those at higher risk for drug-resistant (DR) UTIs to guide empiric therapy, improve clinical outcomes, and limit costs of care. The aim of this study was to identify risk factors for DR UTI and develop a risk scoring tool which could aid in empiric antibiotic prescribing. Methods. Single-center retrospective pilot study of adult patients treated for UTI from August 1, 2015 to August 31, 2016. Patients who had asymptomatic bacteriuria, were pregnant within 4 months of admission, or had improperly collected urine cultures were excluded. DR was defined as phenotypic resistance to at least 1 agent in 3 or more antibiotic classes commonly used to treat UTIs. Risk factors for DR UTI were derived from previously published literature and multivariable logistic regression of individual patient data (IPD). Adjusted odds ratios (aORs) were developed by combining ORs from previous literature and IPD. A scoring tool was derived from weight-proportional integer-adjusted coefficients of the predictive model aORs. Conclusion. Residence in long-term care and previous antibiotics were among the risk factors most closely associated with DR UTI. Considering cumulative risk scores may be useful in predicting DR UTI however the current study was hindered by a large degree of heterogeneity in previous literature. Disclosures. All authors: No reported disclosures. Background. Hospitalizations attributable to urinary tract infections (UTI) have increased in recent years. One possible reason for the increase in admissions is a lack of effective oral agents, due to increasing rates of antimicrobial resistance, necessitating treatment with IV antibiotics. Our objective was to compare the rates of inpatient vs. outpatient treatment for UTIs. Methods. We used the MarketScan database to identify UTI inpatient and outpatient visits from January 2001 through September 2015. Incidence rates for inpatient and outpatient visits were determined as a function of people at risk for UTIs. A difference-in-difference model with a change point in 2007 was used. Results. During our study period, we identified 32,521,146 outpatient visits for UTI and 297,470 inpatient UTI visits. Rates for inpatient and outpatient visits were rising at similar rates before 2007. After 2007, the slopes differed, and the incidence of outpatient visits increased statistically (P = 0.023) when compared with inpatient visits. Conclusion. Incidence of UTI hospitalizations is increasing but not as quickly as UTI outpatient visits. Since 2007, patients are more likely to be treated in the outpatient setting rather than in the inpatient setting. Disclosures. All authors: No reported disclosures. Poster Abstracts OFID 2019:6 (Suppl 2) S535 EC from UTIs in the United States and 11 countries in Europe (EU) in 2017 and the impact of co-resistance to oral agents used to treat UTIs. Methods. 2422 unique EC from UTIs in the United States and EU in the SENTRY Surveillance program were evaluated for susceptibility to various agents. All isolates were consecutively collected and centrally tested by CLSI methods and interpretive criteria. Isolates that met ESBL MIC screening criteria were characterized for the presence of -lactamase genes. Results. Among the 2422 isolates of EC from UTI's in the United States and EU the resistance (R) rates for cefuroxime (CEF), levofloxacin (LEV) and TMP-SMX were 17.9%, 25.6% and 33.2%, respectively. The overall prevalence of ESBL phenotypes was 18.2% (18.7% in the United States and 21.0% in EU). Among the 411 ESBL phenotypes, R to CEF, LEV and TMP-SMX were: 94.3%, 70.6%, and 61.6%, respectively. In contrast, <0.1% of all EC or 0.2% of ESBL EC were meropenem (MER)-R. Only two carbapenemase-producing organisms were identified, an NDM-5-and a KPC-2-producing EC from Turkey and Greece, respectively. The CTX-M-15 was the most prevalent ESBL and identified among 167 isolates; with co-resistance to CEF, LEV and TMP-SMX noted in 100%, 82.6% and 70.7%, respectively. All CTX-M-15 isolates were susceptible to MER. Conclusion. Oral agents such as CEF, LEV, and TMP-SMX exhibit R rates ≥17.9%. Co-resistance to CEF, LEV, and TMP-SMX were considerably higher among ESBL phenotypes (>61.1%) and confirmed bla CTX-M-15 genotypes (70.7%). In contrast, the carbapenems remained active against ESBL phenotypes and genotypes, such as bla. New oral agents with the spectrum and potency of the carbapenems would address an unmet need for new options to treat multi-drug-resistant EC UTIs. Disclosures. All authors: No reported disclosures. Background. Urinary tract infections (UTIs) are one of the most common indications for antibiotics in both the inpatient and outpatient setting. The purpose of this study was to examine the impact of urinary pH on recurrence of UTIs. A recent review article stated imaging should be considered for patients with a urinary pH of 7 or higher. This study examines the impact of pH on outcomes of patients with UTI to determine whether pH plays a role in recurrent infection and representations to the healthcare facility. Alkaline Urine: A Cause for Urinary Tract Infection Recurrence Methods. This was a retrospective chart review via the computerized patient record system. Patients over the age of 18 years who presented to the healthcare facility between January 1, 2005 to January 1, 2019 for treatment of UTIs were included in this study. Alkaline urine was defined as a urinary pH greater than or equal to 7, while acidic urine was defined as a urinary pH less than 7. Urease splitting organisms included Proteus spp., Providencia spp., and Morganella spp. Outcomes included recurrence and re-presentation to the healthcare facility within 30 days. Results. A total of 793 patients were included in this study, of which 21.3% had alkaline urine. Patients with alkaline urine were more likely to have recurrence of UTI (8.3% vs. 4.3%). Patients with a catheter were more likely to have alkaline urine (30% vs 18%; P = 0.0005). As expected, alkaline urine was associated with a higher frequency of urease splitting organisms (19% in alkaline urine vs. 3% in acidic urine). Renal calculi were found in 3.6% of patients with alkaline urine; however, only 34.3% of patients with alkaline urine had imaging completed. The use of drugs which can alkalinize the urine did not differ significantly between groups. Conclusion. Patients with an alkaline urinary pH were more likely to experience recurrence and readmission within 30 days. Imaging was performed in a minority of patients which may represent a potential target for stewardship programs. Alkaline urine may be a marker for urease splitting organisms and calculi formation. More widespread imaging may be able to detect stones, allowing for potential urologic intervention, preventing subsequent antibiotic courses and repeated healthcare presentations. Disclosures. All authors: No reported disclosures. Background. Enterobacteriaceae is the main pathogens of UTI. It is important to be aware the local epidemiological data for an appropriate initial treatment. Resistance to antimicrobial agents has increased, especially to first-choice antibiotics in the treatment of cystitis. Our objective is to asses the antimicrobial susceptibility profile from uropathogens isolated in community and evaluated the dissemination of extended-spectrum lactamase (ESBL), in E. coli and K. pneumoniae in south of Brazil. Antimicrobial Susceptibility and Molecular Characterization of Extended-Spectrum -Lactamase of Escherichia coli and Klebsiella pneumoniae of Urine Samples Isolated from Community Patients in South Brazil Methods. From June 2016 to June 2017, all urine samples collected in the Basic Health Units and Emergency Departments were sent to a Central Laboratory. Identification and susceptibility tests were performed on the VITEK® 2 (bioMrieux, France) system. Clinical Laboratory Standards Institute (CLSI) breakpoints were used for the interpretation of susceptibility. Positive cultures were defined as those demonstrating ≥10 5 CFU / mL (colony-forming units). The presence of ESBL was also subjected to the Chrom ID BLEE ® agar plate test (bioMrieux-Marcyl'Etoile, France). PCR technique uses specific primers for genes bla TEM and bla SHV. Detection of the bla CTX-M genes was performed by multiplex PCR. Results. A total of 56,555 microbiologic tests were performed, 8189 were positive. Women were responsible for 89.4%, and 10% were pregnant. Table 1 shows uropathogens isolated. Graphic 1 shows antimicrobial susceptibility. Extended-spectrum lactamase production was present in 6.7% (n = 489). People older than 60 years had ESBL more frequent (P <0.05) as well as being pregnant is not related to ESBL (P <0.05). Table 2 shows the distribution of the bla genotypes. Table 3: Distribution of blaCTX-M. Among blaCTX-M1 genotype, blaCTX-M15 was the most frequent. Conclusion. In this study, the most frequent uropathogen isolated was E. coli followed by K. pneumoniae. Cotrimoxazol had high rates of resistance and nitrofurantoin the lowest. Quinolone resistance is more than 10%. Sensitivity to aminoglycosides and carbapenems remains high.We found relevant frequency of ESBL, CTX-M-1-group most commonly found. Among CTX-M-1, blaCTX-M15 was the most isolated.
Community policing meetings are set for the Far Northwest Side in April. View Full Caption CAPS EDISON PARK — Chicago Alternative Policing Strategy meetings will discuss crime trends and issues across the Northwest Side in April. Officers and facilitators will be on hand for each meeting. A map of each beat is available here. For more information, call 312-742-4521. Edison Park Beat 1612: 7 p.m. April 5 at Olympia Park, 6566 N. Avondale Ave. Norwood Park Outdoor roll call, beat 1611: 11 p.m. April 8 at Indian Road Park, 6010 W. Matson Ave. Jefferson Park Beat 1622: 7 p.m. April 13 at Dunham Park, 4638 N. Melvina Ave. Dunning Outdoor roll call, beat 1632, 6:45 p.m. April 14 at Schorsch Village Hall, 6940 W. Belmont Ave. Beat 1632: 7 p.m. April 14 at Schorsch Village Hall, 6940 W. Belmont Ave. Portage Park Outdoor roll call, beat 1633, 11 a.m. April 18 at Community First Medical Center, 5645 W. Addison St. Jefferson Park Senior subcommittee meeting: 1 p.m. April 19 at Jefferson Park Police District Headquarters, 5151 N. Milwaukee Ave. District Advisory Committee meeting: 6 p.m. April 21 at Jefferson Park Police District Headquarters, 5151 N. Milwaukee Ave. O'Hare Beat 1614: 7 p.m April 26 at Salvation Army Citadel, 8354 W. Foster Ave., Norridge Portage Park Outdoor roll call, beat 1624, 6:45 p.m. April 27 at Portage Park Senior Center, 4100 N. Long Ave. Beat 1624: 7 p.m. April 27 at Portage Park Senior Center, 4100 N. Long Ave. Beat 1634: 7 p.m. April 28 at St. Bartholomew Church, Kreuger Hall, 4910 W. Addison St. Sauganash Beats 1711 and 1712: 7-8:30 p.m. April 27 at Mayfair Church, 5020 N. Pulaski Road For more neighborhood news, listen to DNAinfo Radio here:
Adolescent Sexuality and Chastity Having been involved in the area of adolescent sexuality for two years, I thought it might be appropriate for me to share with you, my fellow physicians, some ideas on the subject. I have been teaching a seven part series, on the chaste approach to sexuality, to teens with unstable, abusive backgrounds, who are currently living in group homes. In light of this involvement, I recently attended a "Contraceptive Technology" conference in Anaheim, sponsored by Planned Parenthood and the California Family Planning Council. The experience inspired a few thoughts. A panel discussion on adolescent sexuality was conducted at the conference and included two of the co-authors of the familiar text, Contraceptive Technology. During the discussion, one of the panelists dramatically asked for a show of hands in answer to the question, "What is the problem (when considering the general issue of adolescent sexuality)?" He offered three possible answers: teens involved in premarital sexual activity, teen pregnancy, or teens giving birth. The choice was unanimous among the "experts" on the panel: the problem was teens giving birth. It is amazing that after two decades of having defined the problem as the teen pregnancy rate, suddenly the emphasis has been changed to the problem of teens giving birth. What prompted this magical change in emphasis? The change is a result of a gradual realization by those in the field that the simplistic approach of giving teens contraceptives, in an effort to cure the complex problem of teen pregnancy, has failed. Since this approach has failed, and discussion of any other approach is intolerable for most of the recognized "experts", the problem has simply been re-defined. How do we know that promotion of contraceptives to teens has failed to reduce the teen pregnancy rate? Two types of studies which have been
Feature Wavelength Selection Based on the Combination of Image and Spectrum for Aflatoxin B1 Concentration Classification in Single Maize Kernels Aflatoxin B1 (AFB1) is a very strong carcinogen, maize kernels are easily infected by this toxin during storage. Rapid and accurate identification of AFB1 is of great significance to ensure food safety. In this study, a novel method for classification of AFB1 in single maize kernels was developed. Four groups of maize kernel samples with different AFB1 concentrations (10, 20, 50, and 100 ppb) were prepared by artificial inoculation of toxin. In addition, one group of maize kernel samples without AFB1 were prepared as control, each group with 70 samples. The visible and short wave near-infrared (Vis-SWNIR) region (5001000 nm) and long wave near-infrared (LWNIR) region (10002000 nm) hyperspectral images of all samples were obtained respectively, and the hyperspectral images in 5002000 nm range was obtained after spectral pretreatment and fusion. Kennard-Stone algorithm was used to divide the samples into calibration set or prediction set. Competitive adaptive reweighted sampling (CARS) and successive projections algorithm (SPA) were used to roughly select the characteristic wavelengths of the calibration set samples, and 25 and 26 effective wavelengths were obtained respectively. Based on the roughly selected wavelengths, a method of fine selection of the characteristic wavelengths was proposed by using the gray-value difference of image (GDI), and a few number of characteristic wavelengths were further selected. Under the LDA classification model, 10 characteristic wavelengths were selected to test the prediction set and the independent verification samples, and the ideal result were obtained with an accuracy of 94.46% and 91.11%, respectively. This study provides a new approach for AFB1 concentration classification of single maize kernels.
I’m not sure if there has ever been an ACTUAL printing press at this restaurant. According to their website blurb, in the late 18th century, 25 George Street was home to the novelist Susan Ferrier. Then, in 1840, it seems that a dude called John Oliphant lived at the same spot. Apparently, the descendants of these two former residents went on to establish Scottish publishing house Oliphant, Anderson and Ferrier. It released classics such as A Story of Antonia Told by the Lady with the Sun Lamp by Jean A Reed; The Story of Tatters (a street urchin) by Hermione, as well as loads of religious books and a series on famous Scots. The Printing Press, part of The George Hotel, have run with the loose literary link, with an opening party that featured guests including Ian Rankin, Chris Brookmyre and Val McDermid. (I didn’t go, I was busy reading about the adventures of Tatters). In the rear dining room, where we sat on a Sunday lunchtime, there are dappled walls that, I suppose, are designed to look like the antiqued pages of a book (created with the first case of stippling I’ve seen since Changing Rooms back in 1997). This isn’t a criticism, this place looks expensive and well considered, from front to back and through to their next door cafe Burr & Co. Owners Principal Hayley Hotels have transformed the tired old Tempus restaurant with the help of Des McDonald (once head chef at London celebrity haunt The Ivy, and the former CEO of Caprice Holdings, who own London’s Holborn Dining Room amongst others). They’ve also appointed head chef Colin Fleming, formerly of Restaurant Martin Wishart and The Kailyard by Nick Nairn. Mr Claws’ head, which was a bit pointless, since we weren’t planning on crunching our way through his scalp. Still, gorgeous. Our roast wood pigeon (£8) had a lot to live up to, but it was an elegant looking option, with neatly rolled tubes of golden and magenta beetroot, and curls of frisée. The meat was beautifully cooked and seasoned, though slightly sinewy, and there were buttons of crowdie and crumbs of crushed hazelnut in the mix. The spatchcock grouse (£19) had been usurped by a more seasonally appropriate partridge, which came with two confit legs, a juicy red mixture of vinegary sweet and peppery red cabbage and brambles that were as chubby as a pre-hibernation groundhog. Beautiful. My main of seabass was crispy skinned (£21) and, beneath it, like beasties tucked under a rockpool stone, were a dozen pillowy mussels. It also came with a rich and lemony butter sauce, with samphire and sprigs of what I think was sea aster. As is the way with so many restaurants these days, carbs are an additional purchase, to be found in the side dishes section. We went for the truffle chips (£4), which are ridiculously addictive, and the wilted greens (£3.50) were just an excuse to guzzle garlic butter through the medium of chopped cabbage and spinach. As I’m bulking up for winter, I went out on a sugar high with marmalade steamed pudding (£5.50). It was a neat mound of airy sponge, topped with around half a jar of Dundee’s sugary finest. There was also a little jug of cold Drambuie custard on the side. Better hot? Probably. The chocolate and salted caramel pot (£5.50) was a mug full of stuff to make your chest as hairy as Tom Selleck – caramel at the bottom, then a layer of ganache and crumbly bits of honeycomb, cream, then choco shavings. And there were two biscotti-like ginger and hazelnut biscuits on the side, just in case you didn’t have diabetes already. Anyway, fabulous food, genuinely lovely staff and a coffee shop next door, where we got a post prandial flat white (£2.40) and a citrussy tasting espresso (£1.80) to help us past the post-feasting bloat. This is the sort of place that might just be worth tearing yourself away from The Origin of the Chinese People by the Reverend John Ross for.
. The cell and humoral immunity state was studied up in 35 patients with diabetic angiopathy (insulin-dependent diabetes mellitus) before and 7 days, 3, 6, 9 and 12 months after the pancreatic islet cells (PIC) xenotransplantation conduction in newborn piglets. Stimulation or suppression of the recipient immune system were not observed. This is associated with the PIC immune modulation due to their cultivation. Transplantation of the newborn piglets PIC is a safe method concerning the recipient immune system state. The contents of antibodies to insulin do not change in term of observation up to one year after the PIC cultures xenotransplantation conduction.
import React from "react"; type LoadingProps = { loading: boolean; }; const Loading = (props: LoadingProps) => { return ( <div className="d-flex justify-content-center align-items-center vh-100 vw-100 position-fixed"> <div className="spinner-border" role="status"> <span className="sr-only">Loading...</span> </div> </div> ); }; export default Loading;
/** * Graph representing a set of module configurations with dependencies mapped by name inside the configuration. */ public class ConfigurationGraph { private static final Logger LOG = LoggerFactory.getLogger(ConfigurationGraph.class); /** * The special property which uniquely identifies the name of the module. */ public static final String MODULE_NAME_KEY = "moduleName"; /** * The special property which identifies dependent modules. */ public static final String DEPENDENT_MODULE_KEY = "moduleDependencies"; /** * Map of the names of modules to the backing configuration files. * These serve as the vertices of the graph. */ private final Map<String, Configuration> moduleConfigurations; /** * Map of the names of modules to the names of the modules they depend upon. * Store in reverse order from the property to support right to left traversal. These serve as the edges of the * graph. */ private final Map<String, List<String>> moduleDependencies; /** * Create a configuration graph from a collection of Configuration, resource name pairs and a name validation * function. * * @param configurationNamePairs A map whose keys are configurations and values are the resource names use to * report errors while processing configurations. * @param nameValidator A function which throws exceptions on module names which are not valid. */ public ConfigurationGraph(Map<Configuration, String> configurationNamePairs, Consumer<String> nameValidator) { moduleConfigurations = new HashMap<>(); moduleDependencies = new LinkedHashMap<>(); for (Map.Entry<Configuration, String> configEntry : configurationNamePairs.entrySet()) { addVertex(configEntry.getKey(), configEntry.getValue(), nameValidator); } } /** * Take a configuration and if it is a valid module, load it into the moduleConfigurations map and load it's * dependency moduleDependencies. * * @param configuration A configuration which may be a module * @param configName The resource name for that configuration * @param nameValidator A function which throws exceptions on module names which are not valid. */ private void addVertex(Configuration configuration, String configName, Consumer<String> nameValidator) { if (!configuration.containsKey(MODULE_NAME_KEY)) { // This may be the result of another library using one of our configuration names LOG.warn(MODULE_NAME_MISSING.logFormat(configName)); return; } String moduleName = configuration.getString(MODULE_NAME_KEY); nameValidator.accept(moduleName); LOG.debug(MODULE_FOUND_MESSAGE.logFormat(moduleName, configName)); if (moduleConfigurations.containsKey(moduleName)) { LOG.error(MODULE_NAME_DUPLICATION.format(configName, moduleName)); throw new SystemConfigException(MODULE_NAME_DUPLICATION.format(configName, moduleName)); } moduleConfigurations.put(moduleName, configuration); List<String> dependencies = configuration.getList(DEPENDENT_MODULE_KEY, Collections.<String>emptyList()) .stream() .map(Object::toString) .collect(Collectors.toList()); // later dependencies have higher precedence. Store moduleDependencies in precedence order descending Collections.reverse(dependencies); LOG.debug(MODULE_DEPENDS_ON_MESSAGE.logFormat(moduleName, dependencies)); moduleDependencies.put(moduleName, dependencies); } /** * Return the configuration corresponding to a module name. * * @param nodeName The module name for the graph * * @return The configuration of a module */ public Configuration getConfiguration(String nodeName) { return moduleConfigurations.get(nodeName); } /** * Find the prioritized stream of configurations for a given module (inclusive of the module itself). * * @param nodeName The name of the initial module whose dependency should be resolved * * @return A list of modules returned in the order of increasing precedence * * @throws SystemConfigException if the graph can't be resolved */ public Stream<String> preOrderRightToLeftTraversal(String nodeName) throws SystemConfigException { if (!moduleConfigurations.containsKey(nodeName)) { LOG.error(NO_SUCH_MODULE.logFormat(nodeName)); throw new SystemConfigException(NO_SUCH_MODULE.format(nodeName)); } return preOrderRightToLeftTraversal(nodeName, new ArrayList<>()); } /** * Find the prioritized stream of configurations for a given module (inclusive of the module itself). * * @param nodeName The name of the initial module whose dependencies to load (inclusively) * @param path The list of nodes back to the root of the tree parse * * @return A list of modules returned in the order of increasing precedence * * @throws SystemConfigException if there is a broken or circular dependency link */ protected Stream<String> preOrderRightToLeftTraversal(String nodeName, List<String> path) throws SystemConfigException { if (!moduleConfigurations.containsKey(nodeName)) { LOG.error(MISSING_DEPENDENCY.logFormat(nodeName, path)); throw new SystemConfigException(MISSING_DEPENDENCY.format(nodeName, path)); } if (path.contains(nodeName)) { LOG.error(CIRCULAR_DEPENDENCY.logFormat(nodeName, path)); throw new SystemConfigException(CIRCULAR_DEPENDENCY.format(nodeName, path)); } List<String> pathLocal = new ArrayList<>(path); pathLocal.add(nodeName); Stream<String> childrenStream = moduleDependencies.get(nodeName).stream() .flatMap(childNode -> preOrderRightToLeftTraversal(childNode, pathLocal)); return Stream.concat(Stream.of(nodeName), childrenStream); } @Override public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof ConfigurationGraph)) { return false; } final ConfigurationGraph that = (ConfigurationGraph) o; if (!moduleConfigurations.equals(that.moduleConfigurations)) { return false; } return moduleDependencies.equals(that.moduleDependencies); } @Override public int hashCode() { int result = moduleConfigurations.hashCode(); result = 31 * result + moduleDependencies.hashCode(); return result; } }
// NewServer initializes all of the internal data structures. Right now this basically // looks as follows: // - ConnectionManager starts and keeps track of peers. // - When messages are received from peers, they get forwarded on a channel to // the Server to handle them. In that sense the ConnectionManager is basically // just acting as a router. // - When the Server receives a message from a peer, it can do any of the following: // * Take no action. // * Use the Blockchain data structure to validate the transaction or update the // Blockchain data structure. // * Send a new message. This can be a message directed back to that actually sent this // message or it can be a message to another peer for whatever reason. When a message // is sent in this way it can also have a deadline on it that the peer needs to // respond by or else it will be disconnected. // * Disconnect the peer. In this case the ConnectionManager gets notified about the // disconnection and may opt to replace the now-disconnected peer with a new peer. // This happens for example when an outbound peer is disconnected in order to // maintain TargetOutboundPeers. // - The server could also receive a control message that a peer has been disconnected. // This can be useful to the server if, for example, it was expecting a response from // a particular peer, which could be the case in initial block download where a single // sync peer is used. // // TODO: Refactor all these arguments into a config object or something. func NewServer( _params *DeSoParams, _listeners []net.Listener, _desoAddrMgr *addrmgr.AddrManager, _connectIps []string, _db *badger.DB, postgres *Postgres, _targetOutboundPeers uint32, _maxInboundPeers uint32, _minerPublicKeys []string, _numMiningThreads uint64, _limitOneInboundConnectionPerIP bool, _hyperSync bool, _syncType NodeSyncType, _maxSyncBlockHeight uint32, _disableEncoderMigrations bool, _rateLimitFeerateNanosPerKB uint64, _minFeeRateNanosPerKB uint64, _stallTimeoutSeconds uint64, _maxBlockTemplatesToCache uint64, _minBlockUpdateIntervalSeconds uint64, _blockCypherAPIKey string, _runReadOnlyUtxoViewUpdater bool, _snapshotBlockHeightPeriod uint64, _dataDir string, _mempoolDumpDir string, _disableNetworking bool, _readOnlyMode bool, _ignoreInboundPeerInvMessages bool, statsd *statsd.Client, _blockProducerSeed string, _trustedBlockProducerPublicKeys []string, _trustedBlockProducerStartHeight uint64, eventManager *EventManager, _nodeMessageChan chan NodeMessage, ) (_srv *Server, _err error, _shouldRestart bool) { var err error var _snapshot *Snapshot shouldRestart := false archivalMode := false if _hyperSync { _snapshot, err, shouldRestart = NewSnapshot(_db, _dataDir, _snapshotBlockHeightPeriod, false, false, _params, _disableEncoderMigrations) if err != nil { panic(err) } if IsNodeArchival(_syncType) { archivalMode = true } } srv := &Server{ DisableNetworking: _disableNetworking, ReadOnlyMode: _readOnlyMode, IgnoreInboundPeerInvMessages: _ignoreInboundPeerInvMessages, snapshot: _snapshot, nodeMessageChannel: _nodeMessageChan, } timesource := chainlib.NewMedianTime() _incomingMessages := make(chan *ServerMessage, (_targetOutboundPeers+_maxInboundPeers)*3) _cmgr := NewConnectionManager( _params, _desoAddrMgr, _listeners, _connectIps, timesource, _targetOutboundPeers, _maxInboundPeers, _limitOneInboundConnectionPerIP, _hyperSync, _syncType, _stallTimeoutSeconds, _minFeeRateNanosPerKB, _incomingMessages, srv) If this is the first time this data structure is being initialized, it will contain only the genesis block. Otherwise it loads all of the block headers (actually BlockNode's) from the db into memory, which is a somewhat heavy-weight operation. TODO: Would be nice if this heavier-weight operation were moved to Start() to keep this constructor fast. srv.eventManager = eventManager eventManager.OnBlockConnected(srv._handleBlockMainChainConnectedd) eventManager.OnBlockAccepted(srv._handleBlockAccepted) eventManager.OnBlockDisconnected(srv._handleBlockMainChainDisconnectedd) _chain, err := NewBlockchain( _trustedBlockProducerPublicKeys, _trustedBlockProducerStartHeight, _maxSyncBlockHeight, _params, timesource, _db, postgres, eventManager, _snapshot, archivalMode) if err != nil { return nil, errors.Wrapf(err, "NewServer: Problem initializing blockchain"), true } glog.V(1).Infof("Initialized chain: Best Header Height: %d, Header Hash: %s, Header CumWork: %s, Best Block Height: %d, Block Hash: %s, Block CumWork: %s", _chain.headerTip().Height, hex.EncodeToString(_chain.headerTip().Hash[:]), hex.EncodeToString(BigintToHash(_chain.headerTip().CumWork)[:]), _chain.blockTip().Height, hex.EncodeToString(_chain.blockTip().Hash[:]), hex.EncodeToString(BigintToHash(_chain.blockTip().CumWork)[:])) Create a mempool to store transactions until they're ready to be mined into blocks. _mempool := NewDeSoMempool(_chain, _rateLimitFeerateNanosPerKB, _minFeeRateNanosPerKB, _blockCypherAPIKey, _runReadOnlyUtxoViewUpdater, _dataDir, _mempoolDumpDir) Useful for debugging. Every second, it outputs the contents of the mempool and the contents of the addrmanager. Initialize the BlockProducer TODO(miner): Should figure out a way to get this into main. var _blockProducer *DeSoBlockProducer if _maxBlockTemplatesToCache > 0 { _blockProducer, err = NewDeSoBlockProducer( _minBlockUpdateIntervalSeconds, _maxBlockTemplatesToCache, _blockProducerSeed, _mempool, _chain, _params, postgres) if err != nil { panic(err) } go func() { _blockProducer.Start() }() } TODO(miner): Make the miner its own binary and pull it out of here. Don't start the miner unless miner public keys are set. if _numMiningThreads <= 0 { _numMiningThreads = uint64(runtime.NumCPU()) } _miner, err := NewDeSoMiner(_minerPublicKeys, uint32(_numMiningThreads), _blockProducer, _params) if err != nil { return nil, errors.Wrapf(err, "NewServer: "), true } If we only want to sync to a specific block height, we would disable the miner. _maxSyncBlockHeight is used for development. if _maxSyncBlockHeight > 0 { _miner = nil } Set all the fields on the Server object. srv.cmgr = _cmgr srv.blockchain = _chain srv.mempool = _mempool srv.miner = _miner srv.blockProducer = _blockProducer srv.incomingMessages = _incomingMessages Make this hold a multiple of what we hold for individual peers. srv.inventoryBeingProcessed = lru.NewCache(maxKnownInventory) srv.requestTimeoutSeconds = 10 srv.statsdClient = statsd TODO: Make this configurable srv.Notifier = NewNotifier(_chain, postgres) srv.Notifier.Start() Start statsd reporter if srv.statsdClient != nil { srv.StartStatsdReporter() } Initialize the addrs to broadcast map. srv.addrsToBroadcastt = make(map[string][]*SingleAddr) This will initialize the request queues. srv.ResetRequestQueues() Initialize the timer struct. timer := &Timer{} timer.Initialize() srv.timer = timer If shouldRestart is true, it means that the state checksum is likely corrupted, and we need to enter a recovery mode. This can happen if the node was terminated mid-operation last time it was running. The recovery process rolls back blocks to the beginning of the current snapshot epoch and resets to the state checksum to the epoch checksum. if shouldRestart { glog.Errorf(CLog(Red, "NewServer: Forcing a rollback to the last snapshot epoch because node was not closed "+ "properly last time")) if err := _snapshot.ForceResetToLastSnapshot(_chain); err != nil { return nil, errors.Wrapf(err, "NewServer: Problem in ForceResetToLastSnapshot"), true } } return srv, nil, shouldRestart }
def stop_torchserve(self, exec_env="docker", virtual_env_name=None): if exec_env == "docker": self.connection.run(f"docker rm -f ts", warn=True) else: activation_command = "" if virtual_env_name: activation_command = f"cd /home/ubuntu/serve/benchmark/automated/tests/resources/neuron-bert && source activate {virtual_env_name} && " self.connection.run(f"{activation_command}torchserve --stop", warn=True) time.sleep(5)
An Engaging and Inclusive Approach to Contemporary Feminist Research from Theory to Practice: A Review Contemporary Feminist Research from Theory to Practice by Patricia Leavy and Anne Harris offers an engaging and inclusive perspective to feminist research. What makes this book unique is the balance between theory, method, and activism. The authors take you on a journey of feminist research from past implications to present day inferences in qualitative, quantitative and community based research. They expand upon theory, method and what happens after research is completed, bringing it full circle. Each chapter is filled with in depth, clear writing that engages the reader as well as various resources, discussion questions, and activities at the end of each chapter. Contemporary Feminist Research from Theory to Practice written by Patricia Leavy and Anne Harris was intended to bring forth a fresh and comprehensive overview of feminist research for the modern world. Its interactive and engaging content make it an excellent book for anyone interested in feminist research and feminism overall. The book covers theory, method, and practice from a diverse perspective for not only qualitative research but also quantitative and community-based research as well. It respects the past implications of feminist research and paves the way for innovative ideas, highlighting how times have changed and with it, feminism and research as well. It is comprised of three parts. The first part consists of feminist theoretical frameworks, analyzed from a historical and inclusive perspective. The second is comprised of feminist approaches to conducting research for qualitative, quantitative, and communitybased research. It also includes sections on ethics and inferences for studies using nonliving data such as media analysis and program evaluation. Lastly, the third section covers being a feminist researcher-meaning what happens after the research is done. It includes writing and publishing, propositions for public scholarship, and influences of social media and technology. Furthermore, this book offers a plethora of resources. The reader will find a glossary of key terms, bubbles highlighting key points and definitions, various tables and figures to expand on topics, case examples of feminist research, sample letters to research participants, discussion questions and activities at the end of each chapter, as well as additional resources for books, articles, and online components at the end of each chapter. Furthermore, an appendix of feminist scholars organized by discipline or area of study is included. Patricia Leavy and Anne Harris are both deeply unwavering to the inclusion of feminist research. Patricia Leavy is an independent sociologist, novelist, and public speaker. She has over 20 publications and has won numerous awards. She is the former Chair of Sociology and Criminology and Founding Director of Gender Studies at Stonehill College in Easton, Massachusetts. Anne Harris has several publications and is on the editorial board of numerous journals and book series. She is Associate Professor and Vice Chancellor's Senior Research Fellow in the School of Education and the Design and Creative Practice ECP at RMIT University in Melbourne, Australia. To give some context of who I am, similar to the authors of the book under review, I too share a deep attentiveness in feminist implications for academia and beyond. As a selfproclaimed feminist and marriage and family therapist trained in a postmodern program, feminist theory was something that intrigued me from the beginning of my graduate studies. Currently, I am a PhD Candidate working on my dissertation utilizing a qualitative method. Being that one of the central values in feminist theories is to incorporate female perspectives in every part of research and practice, this book offered a refreshing and inclusive approach to various methods of doing this. It was exhilarating to see how the authors not only highlighted theory and method but also introduced the component of integrating current events and calls for activism. As a female, researcher, and human being, I found it inspiring. This book can be of interest to undergraduate students, graduate students, and professors who wish to expand their knowledge of this topic with a fresh, diverse perspective. It invites the reader to come on a full-circle, in depth journey from historical implications to theory, method, and suggestions for post-research action in the modern-day climate. Patricia Leavy and Anne Harris strike a harmonious balance between philosophy and activism-all the while keeping the reader absorbed with discussion questions, activities, and valuable additional information on resources.
Crimes against life and health committed in the past: the current state of the problem of these offences solution The article is devoted to the problem of solving crimes against life and health having been committed in the Russian Federation in recent years. The study aims to analyze the current state of efficiency of the investigative authorities of the Russian Federation enquiring previously suspended criminal cases dealing with life and health being regarded as the most dangerous group of crimes on the subject of encroachment.The research methodology consists of formal legal, statistical and analytical methods. The author gives the definition to crimes against life and health committed in the past. The paper describes statistical data of the activities of the investigative authorities of the Russian Federation enquiring previously suspended criminal cases. The study reveals negative dynamics of crime solution effectiveness and indicates the declining interest in a record of subjects of this crime category. Crimes against life and health committed in the past are the most dangerous on the subject of their encroachment. A person, his rights and freedoms including the right to life is the highest value protected by the state. Bringing a guilty person to justice and timely crime solution prove to be important principles of inevitability of responsibility. The analysis has confirmed the priority of further improvement of the methods of investigation of this criminal cases category.
package com.huan.redisstat.persistence.entities; import lombok.Getter; import lombok.Setter; import lombok.experimental.Accessors; import org.springframework.security.core.GrantedAuthority; import org.springframework.security.core.userdetails.UserDetails; import java.util.Collection; import java.util.Collections; import java.util.Date; @Setter @Getter @Accessors(chain = true) public class User implements UserDetails { private String userId; private String username; private String password; private String ldapNo; private String sex; private Date registerTime; private String registerIp; @Override public Collection<? extends GrantedAuthority> getAuthorities() { return Collections.emptyList(); } @Override public boolean isAccountNonExpired() { return true; } @Override public boolean isAccountNonLocked() { return true; } @Override public boolean isCredentialsNonExpired() { return true; } @Override public boolean isEnabled() { return true; } }
In the high-production cookware, appliance and automotive industries, as well as the low- and medium-production aircraft, aerospace, and job-shop industries, metallic sheet may be formed by a variety of different dies, the type and size of the die being dictated by the shape and intended use of the particular part. One process which is used to form a wide variety of these parts is the conventional drawing process. In a draw die, the blank is drawn across a binder surface allowing metal to flow from the bind surface and onto the part. Unfortunately, variable and non-uniform stresses are thereby developed throughout the part which results in localized stretching. This creates severe springback and shape retention problems which make it nearly impossible to predict, especially with large parts, the amount of springback that will occur. The common practice to overcome this springback or shape retention problem is to overbend (deform beyond the desired shape) the part. Finding the appropriate degree of overbend requires a number of costly trial and error procedures. There is also a significant amount of material waste in the drawing process because the blank is oversized to compensate for the metal flowing across the binder surface and into the die cavity. In U.S. Pat. No. 4,576,030, a process is described wherein sheet metal can be one hundred percent stretch formed between co-acting male and female die halves. This is accomplished by providing a pair of opposed lock beads, at least one of which is provided with a number of spaced apart beads adapted to bite into the sheet metal, around the periphery thereof, when the gripper steels are closed. This permits the sheet metal to be homogeneously, one hundred percent stretch formed, thus resulting in a higher quality of shape retention, a reduction in the number of shock lines and stretch lines, less waste, and increased overall part strength. Another procedure which enhances the quality of the formed part is fluid forming, that is, applying pressurized fluid against one side of the blank in the forming process. The benefits include increased versatility, a better finish on the final part, lower tool and reduced maintenance costs. In U.S. patent application Ser. No. 07/855,815, entitled "Apparatus and Method for Hydroforming Sheet Metal," issued as U.S. Pat. No. 5,372,026 incorporated herein by reference, a process for stretch forming sheet metal by applying pressurized fluid against one side of the blank is described. The blank is 100% stretch formed into the part print cavity of the upper die. The process for stretch forming described involves placing the sheet metal in preferably, a conventional double action press. The gripper beads fitted to the upper and lower binders of the die are configured to bite into the sheet metal around the periphery to hold the blank in place and to seal it along the periphery. The type of gripper beads that were found to be particularly useful in gripping and sealing the sheet metal blank were those disclosed in U.S. Patent No. 4,576,030 described above. When the press is closed, the gripper beads are forced into the metal sealing its periphery. The liquid is then applied under pressure to the side of the sheet metal opposite from the die cavity configured for the part to be produced. The pressure of the liquid is sufficiently high to stretch form the sheet metal against the die cavity to produce the shaped part. While these advancements have continued to improve the quality of the part and stretch the limits of product design, there are part configurations which cannot take advantage of 100% stretch forming. In particular, a part may have a configuration which, if the blank were 100% stretched, would cause thinning in areas where the elongation requirements of the configuration are above that of the blank material. In addition, tearing of the blank material may result. It is desirable to provide specific tooling usable in a conventional double action press which combines the favorable aspects of fluid forming, the advantages of stretch forming and the flexibility of draw forming to permit a more accurate approximation of the desired part while reducing if not eliminating the problem of thinning or tearing of the blank material. Another problem in using the process and apparatus of the prior art is that when large parts are being formed, enormous total hydraulic pressure is generated on the dies and transmitted to the press. For example, a car hood has generally about 2,000 square inches of area. If the desired forming pressure is 4,000 psi, then the resultant force on the dies is 2,000 square inches times 4,000 psi which equals 4,000 tons. Such force can deflect the die which spans across the outer blank holder opening sufficiently to cause the grippers to disengage. Even a slight deflection of the die can cause the gripper beads to disengage causing the hydraulic fluid to leak. To assure that the pressure of the liquid does not distort the shape of the die and cause leaks, high tonnage rated presses must be used. However, this significantly increases the cost of the operation. Additionally, conventional presses of sufficient tonnage may not be available for large parts that require high forming pressure. It is desirable to provide a mechanism which locks the upper and lower dies securely together during the forming process. Such security allows lower tonnage presses to be used in the forming process.
In regard to plastic members that require characteristics of being lightweight and having high strength, and have complex shapes, so-called FRP (Fiber Reinforced Plastics; also referred to as fiber-reinforced composite materials) are conventionally used for the forming of component parts of fishing ships, sports goods, bathtubs, automobiles, and the like. In recent years, among these FRP materials, sheet-like or bulk-like materials that use short fibers as reinforcing materials, namely, so-called SMCs (sheet-molding compounds) and BMCs (bulk molding compounds), have been increasingly utilized from the viewpoints of workability, working environment, and the like. Regarding the curable resins that constitute SMCs and BMCs, unsaturated polyesters and materials obtained by diluting oligomers such as vinyl esters with styrene are generally used, and if necessary, a curing agent and a thickening agent are selected and incorporated thereinto. Furthermore, according to the use applications, a colorant, a low constrictive agent, a mold releasing agent, a filler, and the like can also be added to the curable resin. Patent Literatures 1 to 4 describe SMCs and BMCs that use epoxy resins. Meanwhile, fiber-reinforced composite materials (FRP) formed from reinforcing fibers and matrix resins have been widely used for aircraft, automobile, and industrial applications, due to their excellent mechanical properties and the like. In recent years, as the usage results accumulate, the range of applications of fiber-reinforced composite materials is becoming even broader. The matrix resin that constitutes such a composite material is required to have excellent moldability and to exhibit superior mechanical strength even in a high-temperature environment. Regarding the matrix resin, thermosetting resins having excellent impregnating properties or heat resistance are used in many occasions, and a phenolic resin, a melamine resin, a bismaleimide resin, an unsaturated polyester resin, an epoxy resin, or the like is used as such a thermosetting resin. Among these, an epoxy resin has excellent thermal resistance and moldability, and when an epoxy resin is used, a fiber-reinforced composite material having superior mechanical strength is obtained. Therefore, epoxy resins are widely used. A fiber-reinforced composite material is produced by autoclave molding filament winding molding, resin infusion molding, vacuum resin infusion molding, press molding or the like, using an intermediate material containing reinforcing fibers and a matrix resin composition. Above all, press molding is accompanied by high productivity, and a molded product having excellent design surfaces may be easily obtained. Therefore, the demand for press molding has been increasing in recent years. Particularly, since a molded product having a complex shape can be easily produced by pres molding a SMC (sheet-molding compound), utilization of fiber-reinforced composite materials in, for example, structural members for automobiles is becoming popular. Regarding curable resins that constitute SMCs, unsaturated polyesters and materials obtained by diluting oligomers such as vinyl esters with styrene are generally used; however, since these undergo significant cure shrinkage, development of a SMC that uses an epoxy resin as a base resin is desired. Here, regarding epoxy resin compositions that are used for adhesives, for example, the following have been suggested. A resin composition including (A) an epoxy resin; (B) an amine-based curing agent; and (C) an accelerator having at least one functional group selected from a dimethylureido group, an imidazole group, and a tertiary amino group, the resin composition being liquid at normal temperature without substantially including a solvent (Patent Literature 5), a one-liquid heating-curable epoxy resin composition including an epoxy resin; a curing agent including dicyandiamide; a first curing accelerator including 3,4-dichlorophenyl-1,1-dimethylurea; and a second curing accelerator including an imidazole compound having a triazine ring (Patent Literature 6), and a one-component-based heating-curable epoxy resin composition including (A) an epoxy compound; (B) a curing agent composition obtainable by reacting an amine compound with an epoxy compound; and (C) a filler (Patent Literature 7).
SANAA: A strike on a bus in rebel-held northern Yemen killed at least 29 children Thursday, the Red Cross said, as the Saudi-led coalition faced a growing outcry over the attack. The coalition said it had carried out what it called “legitimate military action” in the area targeting Huthi rebels responsible for a deadly missile attack on the Saudi city of Jizan on Wednesday. But the International Committee of the Red Cross said the strike hit a bus filled with children in the Huthi stronghold of Saada, causing dozens of casualties. “A hospital supported by our team in Yemen received the bodies of 29 children under the age of 15 and 48 wounded, including 30 children,” the ICRC said on Twitter.A spokesman for the Red Cross in Sanaa told AFP the toll was not final as casualties from the attack were taken to several hospitals. “Under international humanitarian law, civilians must be protected during conflict,” the ICRC said as alarm grew among international aid agencies. Geert Cappelaere, the UN Children’s Fund regional director in the Middle East and North Africa, said all the children on the bus were “reportedly under the age of 15”. “Does the world really need more innocent children’s lives to stop the cruel war on children in Yemen?”, he added. Saudi Arabia shot down a missile fired by the Huthis on Wednesday, with debris killing a Yemeni man and wounding 11 others, the coalition said.The missile was fired from the rebel-held Yemeni province of Amran towards Jizan, the coalition said. “The coalition will take all necessary measures against the terrorist, criminal acts of the Huthi militia, such as recruiting child soldiers, throwing them in battlefields and using them as tools,” coalition spokesman Turki al-Maliki said, referring to Thursday’s attack. The Huthis have in recent months ramped up missile attacks against Saudi Arabia, which Riyadh usually says it intercepts. Wednesday’s attack brings the tally to 165 rebel missiles launched since 2015, according to the coalition, which that year joined the Yemeni government’s fight against Huthi rebels.
package storage import ( "context" "github.com/pkg/errors" "github.com/filecoin-project/go-filecoin/address" "github.com/filecoin-project/go-filecoin/proofs" "github.com/filecoin-project/go-filecoin/types" ) // This will likely depend on the sector size and proving period. const submitPostGasLimit = 300 // ProofReader provides information about the blockchain to the proving process. type ProofReader interface { // ChainHeight returns the current height of the best chain. ChainHeight() (*types.BlockHeight, error) // ChallengeSeed returns the PoSt challenge seed for a proving period. ChallengeSeed(ctx context.Context, periodStart *types.BlockHeight) (types.PoStChallengeSeed, error) } // ProofCalculator creates the proof-of-spacetime bytes. type ProofCalculator interface { // CalculatePost computes a proof-of-spacetime for a list of sector ids and matching seeds. // It returns the Snark Proof for the PoSt and a list of sector ids that failed. CalculatePost(sortedCommRs proofs.SortedCommRs, seed types.PoStChallengeSeed) ([]types.PoStProof, []uint64, error) } // Prover orchestrates the calculation and submission of a proof-of-spacetime. type Prover struct { actorAddress address.Address ownerAddress address.Address chain ProofReader calculator ProofCalculator } // PoStInputs contains the sector id and related commitments used to generate a proof-of-spacetime. type PoStInputs struct { CommD types.CommD CommR types.CommR CommRStar types.CommRStar SectorID uint64 } // PoStSubmission is the information to be submitted on-chain for a proof. type PoStSubmission struct { Proofs []types.PoStProof Fee types.AttoFIL GasLimit types.GasUnits } // NewProver constructs a new Prover. func NewProver(actor address.Address, owner address.Address, reader ProofReader, caculator ProofCalculator) *Prover { return &Prover{ actorAddress: actor, ownerAddress: owner, chain: reader, calculator: caculator, } } // CalculatePoSt computes and returns a proof-of-spacetime ready for posting on chain. func (sm *Prover) CalculatePoSt(ctx context.Context, start, end *types.BlockHeight, inputs []PoStInputs) (*PoStSubmission, error) { // Gather PoSt request inputs. seed, err := sm.chain.ChallengeSeed(ctx, start) if err != nil { return nil, errors.Wrap(err, "failed to fetch PoSt challenge seed") } // Compute the actual proof. commRs := make([]types.CommR, len(inputs)) for i, input := range inputs { commRs[i] = input.CommR } proofs, faults, err := sm.calculator.CalculatePost(proofs.NewSortedCommRs(commRs...), seed) if err != nil { return nil, errors.Wrap(err, "failed to generate PoSt") } // Compute fees. if len(faults) != 0 { log.Warningf("some faults when generating PoSt: %v", faults) // TODO: include faults in submission https://github.com/filecoin-project/go-filecoin/issues/2889 } height, err := sm.chain.ChainHeight() if err != nil { // TODO: what should happen in this case? return nil, errors.Errorf("failed to submit PoSt, as the current block height can not be determined: %s", err) } if height.LessThan(start) { // TODO: what to do here? not sure this can happen, maybe through reordering? return nil, errors.Errorf("PoSt generation time took negative block time: %s < %s", height, start) } if height.GreaterEqual(end) { // TODO: pay late fees https://github.com/filecoin-project/go-filecoin/issues/2942 return nil, errors.Errorf("PoSt generation was too slow height=%s end=%s", height, end) } return &PoStSubmission{ Proofs: proofs, Fee: types.ZeroAttoFIL, GasLimit: types.NewGasUnits(submitPostGasLimit), }, nil }
A key biochemical change observed in diabetes mellitus in humans and in animal models of the disease is an increase in the chemcial attachment of glucose to proteins which occurs without the aid of enzymes (N nonenzymatic glycation," formerly called "nonenzymatic glycosylation"). This occurs due to the increased glucose concentration in the blood of poorly-controlled diabetics. Therefore, the amount of nonenzymatic glycation of a given protein is indicative of how well a diabetic is controlling his or her blood glucose concentration, and may also be of value in predicting the progression of tissue complications that occur in diabetes such as renal, ocular, microvaascular and nervous system disease. Many proteins such as hemoglobin, albunim, fibrinogen, fibrin, low density lipoproteins (LDL), lens crystallins, peripheral nerve proteins, interstitial collagens and type IV basement membrane collagen, have been found to be nonenzymatically glycated to a greater extent in diabetic patients than in normal subjects. The glycation reaction results in the attachment of glucose to proteins via nucleophilic addition to form a Schiff base between glucose and the N-terminal amino group of apolypeptide or the epsilon-amino group of a lysine residue in the polypeptide chain. The formation of the initial linkage (the labile glucose adduct formed via an aldimine linkage) is reversible. Therefore, the Schiff base reaches an equilibrium level in vivo which reflects the ambient glucose concentrations. With time, however, there is a slow chemical rearrangement of the Schiff base (termed an Amadori rearrangement") which results in the formation of a stable ketoamine (the 1-amino-1-deoxy-2-keto adduct termed the Amadori product"). The kinetics of these reactions have been documented by studies of the steps involved in the formation of the glycated Amadori product, hemoglobin A.sub. 1c. In terms of the tissue complications of diabetes mellitus, the nonenzymatic glycation of various proteins has been implicated in a number of pathological sequelae, including the progression of kidney disease, cataract formation, neuropathy, and atherosclerosis. For example, glycation of hemoglobin alters its affinity for oxygen. Lens crystallin glycation results in opacification and may contribute to cataract formation. Glycation of collagen alters the extent and perhaps the type of collagen cross-linking that leads to stiffening of tissues. Glycation of LDL alters cellular uptake and degradation of this protein. The nonenzymatic glycation of fibronectin, laminin and type IV collagen alters the molecular association of these molecules with each other and with heparan sulfate proteoglycan, and may alter the composition of basement membranes in tissues affected by the complications of diabetes. The development of quantitative methods for the measurement of the nonenzymatic glycation of proteins has been carried out mainly on hemoglobin. Because of the relatively long half-life of red blood cells (approximately 60 days), when properly done, the glycosylated hemoglobin assay provides a retrospective index of glucose control in patients that correlates well with mean plasma glucose levels, 24-hour urinary glucose concentrations, and other indexes of metabolic control determined over the preceding two to three months. However, the quantitation of glycation levels in proteins other than hemoglobin is important since other readily accessible proteins in plasma, urine, or tissue biopsies can provide information about glycemic control within different time frames. For example, the half-life of albumin or low density lipoproteins is 3 to 5 days and the measurement of the glycation of these proteins may indicate the degree of glucose control over a very short period of time. On the other hand, the quantitation of glycation levels of skin collagen (half-life of approximately 2-3 years), for example, would indicate the ability of diabetic subjects to regulate glucose concentrations over a much longer period of time than that which can be determined by measuring glycated hemoglobin. Assays have been designed to measure the total glycation levels of the adult form of hemoglobin (hemoglobin A). This glycated fraction of hemoglobin A (termed "hemoglobin A.sub.1 " is modified by glucose at .beta.-chain terminal valine residues and at epsilon-amine groups of internal lysine residues and is more negatively charged than normal hemoglobin A (unmodified hemoglobin or hemoglobin A.sub. 0). Hemoglobin A.sub. 1c, another clinically useful substrate for the measurement of nonenzymatic glycation, on the other hand, is a subfraction of hemoglobin A.sub. 1 which consists of hemoglobin A glycated by a ketoamine linkage at only the .beta.-chain terminal valine residue. Immunological approaches to the measurement of the levels of nonenzymatic glycation of hemoglobin have been attempted using .sup.125 I-labelled antibody in a radioimmunoassay. The first of these approaches is based on the observation that glycated products cannot be demonstrated in sheep red cell hemolysates. This may be because sheep hemoglobin lacks the "diphosphoglycerate pocket" which permits the glycation of the .beta.-chain N-terminus of hemoglobin. The sheep, as disclosed by J. Javid, et al., Brit. J. Haematology, 38, 329 (1978), therefore, recognizes the N-terminus of human hemoglobin A.sub. 1c as foreign and produces an antibody against it. However, this polyclonal antibody is difficult to raise and it also cross-reacts with hemoglobin A.sub. 1a and hemoglobin A.sub. 1b, chromatographically-stable components of hemoglobin A.sub. 1 which are distinct from the A.sub. 1c species. The A.sub. 1c antisera must also be repeatedly absorbed with agarose-linked hemoglobin A.sub. 0 at the expense of a considerable loss of antibody titer. The observation that the antibody to human A.sub. 1c reacts less well with dog and mouse hemoglobin A.sub. 1c also raises the possibility that the steric fit of the antibody includes more than the sugar molecule and probably extends to surface features of the protein adjacent to the glucose modification. L.K. Curtiss, et al., in J. Clin. Invest., 72, 1427 (1983) have disclosed the formation of murine monoclonal antibodies which react with nonenzymatically-glycated murine low density lipoprotein. However, the glucose adducts on the protein had to be first chemically reduced with sodium borohydride or sodium cyanoborohydride to yield an immunogenic hexose alcohol (glucitol-lysine) since these authors did not succeed in raising monoclonal antibodies to the unreduced adducts naturally found on proteins in diabetic tissues (the labile Schiff's base or Amadori product). It would, therefore, also be necessary to reduce the target proteins in a test sample in a similar fashion to produce glucitol-lysine residues in order to obtain reaction with the antibody. The clinical utility of this method remains to be determined, especially since the detection of various glycated epsilon-amino groups of lysine on a protein is limited to those that can be selectively reduced by chemical-reducing agents in vitro. Therefore, a need exists for monoclonal antibodies which recognize and will selectively react with the unmodified Schiff's base or Amadori glucose adducts which result from the nonenzymatic glycation of proteins, such as the proteins associated with physiological fluids such as blood and lymph.
import traceback import time from . import string class test: """ A decorator that runs tests automatically when running a file. Provide a setup function, and it will run before the test. Provide a teardown function, and it will run after the test, even if an exception occurs. """ def __init__(self, setup: callable = lambda: None, teardown: callable = lambda: None): self.setup = setup self.teardown = teardown def __call__(self, method): self.setup() try: t1 = time.time() method() t2 = time.time() ms = f"{((t2 - t1) * 1000):.1f}ms" print(string.colored(f"Test {method.__name__}() finished in {ms}", "bright_green")) except AssertionError: print(string.colored(f"Test {method.__name__}() failed!", "bright_red")) print(string.colored(traceback.format_exc(), "bright_red")) except BaseException: raise finally: self.teardown() class test_class: """ A decorator that runs all tests of a class automatically whose function names start with "test_". The class_setup runs before all tests, and the class_teardown runs after all tests. each_setup and each_teardown runs before and after each test. """ def __init__(self, class_setup: callable = lambda: None, class_teardown: callable = lambda: None, each_setup: callable = lambda: None, each_teardown: callable = lambda: None): self.class_setup = class_setup self.class_teardown = class_teardown self.each_setup = each_setup self.each_teardown = each_teardown def do_test(self, method): self.each_setup() try: t1 = time.time() method() t2 = time.time() ms = f"{((t2 - t1) * 1000):.1f}ms" print("--> " + string.colored(f"Test {method.__name__}() finished in {ms}", "bright_green")) except AssertionError: print("--> " + string.colored(f"Test {method.__name__}() failed!", "bright_red")) print(string.colored(traceback.format_exc(), "bright_red")) except BaseException: self.class_teardown() raise finally: self.each_teardown() def __call__(self, method): print(f"Run test class {method.__name__}:") self.class_setup() obj = method() for test_method_name in [m for m in dir(obj) if m.startswith("test_")]: self.do_test(getattr(obj, test_method_name)) self.class_teardown()
Chabad on Campus centers have been growing in leaps and bounds over the past decade, both in the increasing number of schools served and the added Jewish programs offered. In the past year, 14 new couples have started Chabad centers, with many others buying, renovating or building new facilities that welcome students, faculty, community members and visitors. From Chabad.org by Karen Schwartz: The annual Chabad on Campus International Shabbaton—now called Pegisha: International Student Conference—takes place from Nov. 3 to Nov. 5, when more than 1,000 university students will converge on New York to learn, pray, socialize, tour and spend a traditional Shabbat in the Crown Heights neighborhood of Brooklyn, N.Y. An ever-growing number of Campus emissaries from around the world will accompany the students. In the past year, 14 couples have established new Chabad centers on campuses large and small, urban and suburban—13 in the United States and one in France (at the Université de Montpellier, Faculty of Medicine)—bringing the total of Chabad on Campus centers to a whopping 256. That almost doubles the number over the past decade. In 2007, there were 130 Chabad on Campus centers. Add to that a number of Chabad-Lubavitch emissaries who have joined existing centers, growing their presence and Jewish offerings to students across the globe. “The start of a new academic year holds so much promise, whether students are freshmen, seniors or working on graduate degrees,” says Rabbi Yossy Gordon, executive vice president of Chabad on Campus International. “Chabad Houses and Chabad emissaries are there to serve them. From classes to prayer services, and holiday programs to social events, there is a home away from home for them.” Here are brief profiles of some of the newest centers: Stockton University It was a whirlwind of sorts. Rabbi Meir and Shaina Rapoport started a Chabad House at Stockton University in Galloway Township, N.J., this time last year, living off-campus to serve the 900 or so Jewish students there. Within a few months, they already had their minds on something bigger and closer to the main college center. In January, they purchased their current center, opening it in April. Originally an attorney’s office and home, it seemed the perfect fit. “The local community rallied together to put together the money to help us purchase the place,” says the rabbi. “And in a short amount of time, we were able to make it a reality.” For the Rapoports, their 7,500-square-foot student center has become a larger community center as well. An hour after the sign went in front of the opened building, reports the rabbi, a Jewish woman from Texas who was new to the area saw it and called to get involved. Week in and week out, they get more and more responses from community members looking for a Jewish place to eat, pray and learn; the Chabad couple has added some 200 to 300 area Jewish families to their guest lists. In addition to allowing them to host more people, the space is home to a student lounge and game room, among other features. “After Shabbat dinner, many students sit around relaxing and schmoozing until the wee hours of the morning,” says Rapoport. “They are so proud and happy to have Jewish life and a vibrant Jewish experience here; that’s something that’s really changed in the last 18 months. Everyone’s just come out of the woodwork.” Rice University It has was less than a year since Rabbi Shmuel and Nechama Slonim founded a center to serve the Jewish needs of students at Rice University, Baylor College of Medicine, the University of Texas Medical School, South Texas College of Law and the University of Houston. Then came Hurricane Harvey. The couple rallied students and immediately led the charge, bringing students volunteers to hard-hit homes around the Houston area. Gordon notes that their work was reflected all across Texas, Florida and the Caribbean, which were pummeled by Hurricanes Harvey, Irma and Maria. Led by campus Chabad rabbis, students came out in droves to help clean up afterward the storms, often traveling miles to pitch in. Goods are still being collected on their behalf, and schools have initiated fundraisers for these areas. In California, too, local campus Chabad centers have been organizing groups of students to assist families dealing with the aftershocks of wildfires that ripped through the northern part of the state, as well as those outside Anaheim in the south. “For the first two days, many students were sitting around and feeling bad,” says Leah Sherman, a native of Memphis, Tenn., who is majoring in bioengineering at Rice. “When Rabbi Shmuli Slonim from Chabad asked us to get involved, we were very happy to have a way to contribute,” she says. “The action of these young adults is in keeping with Jewish values,” emphasizes Gordon, “and we commend them for their time, efforts, chesed and tzedakah.” Chapman University Rabbi Eliezer and Mushky Gurary are creating a community for Jewish students in the city of Orange, 15 minutes from Anaheim and home to Chapman University. The Gurarys moved out in February to serve four universities, including Chapman; California State University, Fullerton; Fullerton College and Rancho Santiago Community College District. With a total enrollment of 8,000 students at Chapman, and of them, an estimated 700 to 800 Jewish ones—added to another 2,000 Jewish students among the other schools—the Gurarys have been busy meeting and getting to know a whole roster of people. “We’ve really established ourselves as an active entity on campus,” says the rabbi, “and a vital place for Jewish life and activity.” The couple rented a house through July and recently closed on a two-story home with a sizable backyard. Their campus activities include a mezuzah bank that lends out mezuzahs to affix to the doorposts of student rooms and a chicken-soup express service, where students who are under the weather or in need of comfort food can get homemade hot soup delivered right to their doors, courtesy of the Chabad emissaries. “We’re creating a community for the Jewish students,” says Gurary. “In college, where you’re overwhelmed and searching for meaning, having a place to go where you’re able to feel safe and connect to G‑d—and feel a sense of purpose and meaning while on campus—is the best thing that could happen.” Mission College A few hours’ drive away in Santa Clara, Calif., Rabbi Yigal and Elana Rosenberg welcome undergraduates, graduate students and young professionals into their home and community garden, a 10-minute walk from campus. Since they arrived in the Northern California city a year ago, the Rosenbergs have hosted more than 60 Shabbat meals for students—many with themes, such as an Israeli Shabbat, a “Cinco de Mayo” Shabbat, a “Shabbat in America” for the Fourth of July. The rabbi, also a city chaplain on the Santa Clara police force, is easy to spot, as he frequently travels by skateboard. “Students see me riding around campus, and it breaks down a lot of stereotypes and barriers from the beginning,” he says. Some 250 students out of Mission College’s total of 5,000 enrollees are estimated to be Jewish. The Rosenbergs also look for ways to interact with Jewish career professionals who work in nearby Silicon Valley. Initiatives include “Jewwork,” a shared workspace at Chabad, complete with a kosher lunch, and “Pitch Night,” where local startup companies, many of them tech innovators, can spout out creative ideas to a panel of judges for feedback and incentives. “As opposed to a typical ‘Pitch Night,’ here you actually have fellow Jewish community members who will follow up with you and who you’ll bump into on a regular basis, and who can help you for no ulterior motive, other than that you’re part of the community,” explains Rosenberg. Rollins College For the school year ahead, Rabbi Shmuli and Chayala Sasonkin have been expanding their activities to include more programs, classes and other ways to engage students, in addition to their regular Shabbat meals and holiday events. The Sasonkins arrived in Winter Park, Fla., at the end of 2016 to establish a new Chabad House for the more than 1,000 Jewish college students in this area just outside of Orlando. From their home within walking distance of Rollins College, where an estimated 15 percent of the overall student body is Jewish, they have been focusing on outreach and networking, says the rabbi. They also serve students at the nearby Full Sail University. (Both schools have been affected by Hurricane Irma, and the Sasonkins continue to help alleviate the situation and make sure that student needs are met.) The couple, along with their two young daughters, looks forward to meeting and getting to know every Jewish student on campus. “The truth is, even though I grew up in a Chabad House [in Akron, Ohio], to really get out there and start a new center is so different,” says Sasonkin. “The whole experience is very fulfilling.” Middlebury College Rabbi Binyamin (aka “Rabbi B”) and Davida Murray, co-directors of Middlebury Chabad in Middlebury, Vt., arrived this August, and have since been working on meeting people and building relationships around campus. They’ve been chatting with students over coffee, and inviting students and faculty to their home for Shabbat meals. An estimated 14 percent of the school’s approximately 2,500 students are Jewish, according to the rabbi, a number that’s historically remained strong. The couple’s focus includes not only college students and the town of Middlebury, but also Jewish households in the larger Addison County. From their home adjacent to campus—there’s a dormitory and dining hall in their backyard—the Murrays and their year-old daughter welcome guests. They have a dining room, library and back room with a fireplace where students can study. “We’re just getting things rolling,” says the rabbi. Given students’ busy schedules, he says, “our challenge is to figure out how to offer what they’re looking for in a way that they can best receive it.” They hope to bring joyful Jewish experiences to campus, whether it’s through Torah classes, cooking for Shabbat, making challah or performing acts of kindness. “That’s what we hope to bring them—that there should be more Judaism on campus, that students should feel empowered about their Judaism,” says Murray. After a busy High Holiday season, the couple is in the process of planning Chanukah events, including a public menorah-lighting at their house. San Jose State University Rabbi Shaya and Brochy Bernstein headed to San Jose, Calif., last August to serve the nearly 800 Jewish students at San Jose State University, a public educational institution with more than 32,000 students overall. Based in a rented home near campus, they spent the last school year networking with students and hosting frequent Shabbat dinners. They worked with the Jewish fraternity AEPi for a Shabbat event and a Holocaust-related movie night, and are now already planning for Chanukah parties, festivities and menorah-lightings. This year the couple is offering students more Jewish experiences, information and learning. “I hope they have a more positive and meaningful outlook on Judaism as it relates to them on any level that is meaningful to them as people,” says the rabbi. “It’s not their grandmother’s gefilte fish they grew up with.” University of Rhode Island Rabbi Avraham Adam (“Avi”) and Tzippy Goldstein arrived at the University of Rhode Island in Kingston, R.I., last year before Sukkot. Today, they serve the estimated 1,000-plus Jewish students out of a total enrollment of about 17,000. From their rented storefront a few miles from campus in an area highly trafficked by students, they are proud to be offering students more Jewish options, says Rabbi Goldstein. In addition to weekly Shabbat dinners and holiday programming, they’ve been spending a lot of time one-on-one with students, he says. They took a group to the campus Shabbaton in New York, which draws students worldwide, and are also starting a group that volunteers with children with special needs. And this school year, they say they’re looking forward to doing even more. Goldstein, who attended the University of Massachusetts in Amherst before becoming a Chabad rabbi, says he was drawn to return to the area as an emissary on campus. “I came in through Chabad on Campus myself,” he says. “These years are a crucial time; it’s a real turning point between childhood and adulthood. I thought that the campus seems like as good a place as any to reach people the way I was reached.” A Decade of Growth at Lehigh University While Rabbi Zalman and Dit Greenberg have served as co-directors of the Rohr Chabad at Lehigh University in Bethlehem, Pa., for nearly a decade, they are now busy welcoming students to a new 11,000-square-foot center. They dedicated the space last October: the Joachim Schaufeld Center for Jewish Life. The couple moved from the small townhouse, where they previously held events, into the expansive new facility with state-of-the-art amenities. Now, says the rabbi, they can host up to 150 comfortably in the synagogue, student lounge and guest suites for visiting alumni. “And we have a proper shul with an aron kodesh,” says the rabbi. Of the school’s 5,000 students, Greenberg says about 1,000 are Jewish, and that Jewish life on campus is booming. The rabbi notes higher rates of participation in events, services and classes, including the amount of food he needs to serve attendees at the weekly lunch-and-learns hosted by Chabad. “Since our move to the new center, our weekly Friday-night services and dinners have increased from an average of 60 people to more than 80,” reports the rabbi. “This year’s High Holidays were the most attended to date with as many as 400 students participating in the services and meals. We also saw an uptick in students coming to our Torah classes, including the Sinai Scholars program.” The emissaries are proud of the growth in the Lehigh Jewish community. “And when you have growth in one area,” they say, in the best of ways, “it becomes contagious.” To find a Chabad on Campus center, click here. To learn more about the annual Chabad on Campus International Shabbaton,click here.
package observatorio.svg; import observatorio.portals.ckan.CKANtest; import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.FileReader; import java.io.FileWriter; /** * Esta clase representa la nube de datos enlazados. * @author vroddon */ public class Lodcloud { public static void main(String[] args) { parse(); } /** * This method loads a LOD.svg file and generates a LOD2.svg where, for each dataset, a color is stablished based on a property */ public static void parse() { try { BufferedReader br = new BufferedReader(new FileReader("lod.svg")); String str = ""; String sout = ""; int cambiar=1000; String res=""; while ((str = br.readLine()) != null) { String search = "<a target=\"_blank\" xlink:type=\"simple\" xlink:href=\""; cambiar++; if (cambiar==2) { int index=str.indexOf("<g"); if (index!=-1) { String s1=str.substring(0,index+20); String s2=str.substring(index+26); String color="FFFFFF"; if (res.equals("notspecified")) color="FFFFFF"; if (res.equals("publicdomain")) color="0000FF"; if (res.equals("attribution")) color="0088FF"; if (res.equals("sharealike")) color="00FF88"; if (res.equals("restrictions")) color="FF8800"; if (res.equals("closed")) color="FF0000"; if (res.equals("other")) color="888888"; str=s1+color+s2; } } if (str.contains(search)) { int index = str.indexOf(search); if (index != -1) { String strt = str.substring(index+51); int index2 = strt.indexOf("\""); if (index2 != -1) { String ds = strt.substring(0, index2); System.out.println(ds); res=CKANtest.mapa.get(ds); if (res==null) res=""; // String color = "00FFFF"; cambiar=0; // System.out.println(res); } } } sout += str + "\n"; } BufferedWriter out = new BufferedWriter(new FileWriter("lod2.svg")); out.write(sout); out.close(); } catch (Exception e) { System.err.println("HA HABIDO UN ERROR SE VA HABE UN FOLLON"+e.getMessage()); } } }
// ready ensure that only one upload occurs ( like sync.Once ) // the first call to Create() will proceed ( abort false ) and must close the done channel once done // subsequent calls to Create() will abort ( abort true ) and must : // - wait on the done channel for the former Create() call to complete ( if not nil ) // - return the error in upload.err func (upload *Upload) ready() (done chan struct{}, abort bool) { upload.lock.Lock() defer upload.lock.Unlock() if upload.done != nil { return upload.done, true } if upload.metadata != nil { return nil, true } upload.done = make(chan struct{}) return upload.done, false }
<reponame>Poulpy/Za-Warudo from functools import partial from datetime import datetime from datetime import timedelta from tkinter import * from tkinter import ttk import logging as log from gui.widgets import Spinbox class TicketingPage(ttk.Frame): ''' Page to book or sell tickets ''' def __init__(self, parent, controller): ttk.Frame.__init__(self, parent) self.controller = controller self.event = None self.projection_room = None # Default padding for the widgets pad = 10 all_labels = ('name', 'projection_type', 'location', 'date', 'seats_left', 'sold_seats', 'booked_seats', 'revenue', 'notification') labels = dict() self.textvar = dict() for var in all_labels: self.textvar[var] = StringVar() labels[var] = ttk.Label(self, text=var.capitalize().replace('_', ' ')) self.tickets_frame = ttk.Frame(self) # Buttons back_button = ttk.Button(self, text='Back', command=self.back) sell_button = ttk.Button(self, text='Sell', command=partial(self.pass_order, 'sell')) book_button = ttk.Button(self, text='Book', command=partial(self.pass_order, 'book')) # Labels event_name_label = ttk.Label(self, textvariable=self.textvar['name'], font=("TkDefaultFont", "15")) event_type_label = ttk.Label(self, textvariable=self.textvar['projection_type']) location_label = ttk.Label(self, textvariable=self.textvar['location']) event_date_label = ttk.Label(self, textvariable=self.textvar['date']) seats_left_label = ttk.Label(self, textvariable=self.textvar['seats_left']) seats_sold_label = ttk.Label(self, textvariable=self.textvar['sold_seats']) seats_booked_label = ttk.Label(self, textvariable=self.textvar['booked_seats']) revenue_label = ttk.Label(self, textvariable=self.textvar['revenue']) notification_label = ttk.Label(self, textvariable=self.textvar['notification']) # GRID event_name_label.grid(row=0, column=0, padx=pad, pady=pad) event_type_label.grid(row=0, column=1, padx=pad, pady=pad) back_button.grid(row=0, column=4, padx=pad, pady=pad) event_date_label.grid(row=1, column=1, padx=pad, pady=pad, sticky=E) self.tickets_frame.grid(row=1, column=2, rowspan=5, padx=pad, pady=pad, sticky=NSEW) location_label.grid(row=2, column=1, padx=pad, pady=pad, sticky=E) labels['seats_left'].grid(row=3, column=0, padx=pad, pady=pad, sticky=W) seats_left_label.grid(row=3, column=1, padx=pad, pady=pad, sticky=E) labels['sold_seats'].grid(row=4, column=0, padx=pad, pady=pad, sticky=W) seats_sold_label.grid(row=4, column=1, padx=pad, pady=pad, sticky=E) labels['booked_seats'].grid(row=5, column=0, padx=pad, pady=pad, sticky=W) seats_booked_label.grid(row=5, column=1, padx=pad, pady=pad, sticky=E) labels['revenue'].grid(row=6, column=0, padx=pad, pady=pad, sticky=W) revenue_label.grid(row=6, column=1, padx=pad, pady=pad, sticky=E) sell_button.grid(row=7, column=0, padx=pad, pady=pad, sticky=NSEW) book_button.grid(row=7, column=1, padx=pad, pady=pad, sticky=NSEW) notification_label.grid(row=8, column=0, columnspan=3, padx=pad, pady=pad, sticky=NSEW) def get_seats(self) -> int: ''' Return the number of seats requested ''' seats = 0 for s in self.seats: if s['var'].get() != '': seats += int(s['var'].get()) return seats def total_price(self) -> int: ''' Return the total price, given a price and the number of seats ''' total = 0 for s in self.seats: if s['var'].get() != '': total += s['price'] * int(s['var'].get()) return total def back(self): ''' Go back to the events page and update the events displayed ''' self.controller.show_frame('EventsPage') self.controller.update_events_page() def pass_order(self, order_type: str): ''' Sell or book seats for the event ''' seats_purchased = self.event.sold_seats + self.event.booked_seats seats_requested = self.get_seats() total_price = self.total_price() values_to_update = dict() if seats_requested <= 0: self.textvar['notification'].set('Select at least 1 seat to sell/book') return if self.projection_room.total_seats == seats_purchased: self.textvar['notification'].set('No more seats available') return if seats_requested > self.projection_room.total_seats - seats_purchased: self.textvar['notification'].set('Not enough seats left') return if order_type == 'sell': values_to_update['sold_seats'] = self.event.sold_seats + seats_requested elif order_type == 'book': values_to_update['booked_seats'] = self.event.booked_seats + seats_requested else: return values_to_update['revenue'] = self.event.revenue + self.total_price() log.info(values_to_update) self.textvar['notification'].set(str(seats_requested) + ' seats taken') self.controller.update(self.event.id, values_to_update) self.event = self.controller.get_event_by_id(self.event.id) self.display_events_seats_information() def set_event(self, event): self.event = event def set_projection_room(self, projection_room): self.projection_room = projection_room def display_events_seats_information(self): # day-month-year begin_hour - end_hour date = self.event.begin.strftime("%d-%m-%Y %H") date += 'h - ' date += (self.event.begin + timedelta(minutes=self.event.running_time)).strftime("%H") date += 'h' seats_left = str(self.projection_room.total_seats - self.event.booked_seats - self.event.sold_seats) seats_left += ' / ' + str(self.projection_room.total_seats) revenue = str(self.event.revenue) + ' €' self.textvar['name'].set(self.event.name) self.textvar['projection_type'].set(self.event.projection_type) self.textvar['location'].set(self.projection_room.location) self.textvar['date'].set(date) self.textvar['seats_left'].set(seats_left) self.textvar['sold_seats'].set(self.event.sold_seats) self.textvar['booked_seats'].set(self.event.booked_seats) self.textvar['revenue'].set(revenue) def set_inputs(self): pad = 10 self.display_events_seats_information() for widget in self.tickets_frame.winfo_children(): widget.destroy() categories = self.controller.get_categories_for_event(self.event) log.debug(categories) self.seats = [None for i in categories] for i, c in enumerate(categories): self.seats[i] = {'price':c.price, 'var':StringVar()} price = str(c.price) + ' €' ttk.Label(self.tickets_frame, text=c.title).grid(row=i, column=0, padx=pad, pady=pad, sticky=W) ttk.Label(self.tickets_frame, text=price).grid(row=i, column=1, padx=pad, pady=pad, sticky=W) Spinbox(self.tickets_frame, textvariable=self.seats[i]['var'], from_=0, to=90).grid(row=i, column=2, padx=pad, pady=pad, sticky=E) self.seats[i]['var'].set(0)
An emotional Rahm Emanuel said goodbye Friday to the White House in what President Obama described as the least suspenseful announcement in history. Emanuel’s departure was rumored from the moment Chicago Mayor Richard Daley announced his retirement, and the news of a White House announcement that he would leave immediately to run for Daley’s old job leaked out early this week. But that didn’t prevent the White House from giving Emanuel a grand send-off from the East Room, where most of Emanuel’s colleagues sat in attendance. Emanuel choked up as he said farewell to profuse applause from White House staff. Obama described the day as "bittersweet," saying he is excited for Emanuel's mayoral bid. He added that the former Illinois congressman is "extraordinarily well-qualified" to be Chicago's mayor. "He has been a great friend of mine and will continue to be a great friend of mine," Obama said. "I will miss him dearly." Pete Rouse, a senior adviser to Obama who served as his chief of staff in the Senate, will take over from Emanuel on an acting basis. He stood with Obama and Emanuel during the announcement. White House press secretary Robert Gibbs later said Rouse could see the acting part of his title disappear. Gibbs said a decision on a permanent chief of staff is still “several months” away, but added that Rouse’s interim role would not preclude him from the job. He said Rouse is undergoing an organization review as part of the normal turnover at the White House. Republicans took time to criticize the new chief of staff, who is less well-known inside and outside the Beltway than the colorful Emanuel. Rouse will have big shoes to fill. Emanuel was a former member of the Democratic leadership with close ties to the party’s influential voices on Capitol Hill. Rouse has deep experience on Capitol Hill, where he’s a well-known figure, but is likely to face an even more challenging environment if he stays on permanently. Republicans are poised to make big gains in the House and Senate, and could take over one or both chambers, making it more difficult to navigate the White House agenda through Congress. Obama signaled he has full faith in an aide known as a White House fixer. "There is a saying around the White House: 'Let's let Pete fix it,'" Obama joked. "And he does." While neither Obama nor Emanuel specifically said Emanuel is running for mayor — Obama joked that Emanuel is resigning to "explore other opportunities" — the outgoing chief of staff is reportedly embarking on a listening tour in Chicago this weekend. Obama and Emanuel joked about the Washington legend's brash style, with Obama telling his time-worn joke about Emanuel being rendered mute when he sliced off part of his middle finger in high school. The president praised Emanuel for his "unmatched level of energy and enthusiasm and commitment," crediting his chief of staff for helping to shepherd healthcare reform and financial reform through Congress and for helping to restore America's leadership in the world. Obama said after he won the presidency, Emanuel was the only person he knew could help at a time of dire economic crisis. The president joked that he told Emanuel he had "no choice in the matter" when he asked him to serve as chief of staff. Since then, Obama said, Emanuel "has exceeded all of my expectations." The president did not offer an endorsement for Emanuel's mayoral bid, but he did say that Emanuel is "extraordinarily well qualified" for the position. Obama acknowledged Rouse and Emanuel have starkly different styles. While Emanuel is a former congressman and Democratic House leader, Rouse, according to Obama, "has never seen a microphone or a TV camera that he liked." Emanuel, speaking after Obama, appeared to be kicking off his campaign in the East Room, calling Chicago "the greatest city in the greatest country in the world." While Emanuel said the day is "bittersweet" for him, too, he said he is "energized by the prospect of new challenges and eager to see what I can do to make our hometown even greater." Emanuel praised Obama for his "unfailing grace, intelligence and courage," saying that while on the verge of total economic collapse, Obama "had the guts to make the tough calls" to prevent a second Great Depression. While Emanuel didn't win Obama's endorsement Friday, he appeared optimistic the president will soon return to the Windy City, perhaps on Emanuel's behalf. "Thank you, Mr. President, I look forward to seeing you in Chicago," Emanuel said.
Sam Foley (artist) Life and career Sam Foley was born in Wellington, New Zealand and in 1998 received his Bachelor of Fine Arts from the Otago School of Art in Dunedin. In 2007 he won a Merit Award (1st equal) at the Parklane Art Awards in Auckland, with his painting Pathway at Night. He was awarded twice (2008 - 2009) the Peoples Choice Award at the Norfolk House Realist Invitational in Dunedin, and twice (2009 - 2010) the Peoples Choice Award at The Wallace Art Awards in Auckland. In 2013 he won The Kaipara Wallace Arts Trust Award, with his painting Tilting at the Beast. The award founder and arts patron Sir James Wallace acquired one of Foley's kinetic paintings entitled Opoho Intersection No.1. Since 2008 he has been visiting Europe regularly, spending extensive periods of time in Berlin and attending residencies in Norway and Switzerland. His works can be found in several private and public art collections such as the Dunedin International Airport collection, the Historic Places Trust of New South Wales in Australia, The ASB Bank in Auckland, The Wallace Trust in Auckland, The Central Library and Salmon Hall in the University of Otago. Moving Image Paintings In 2008 Foley embarked on a 10 week research tour in Europe where he visited more than 30 major museums and galleries. Most of the contemporary galleries had a dedicated moving image section which brought up the idea how to incorporate moving image onto his work. At the end of his research tour Foley returned to New Zealand and started experimenting in his studio with video projections onto his paintings. He recorded video footage of the landscapes he was painting and projected those onto the finished painting. The result was a 'moving image painting' which transports the viewer into the painting for a more immersive experience.
<reponame>dumganhar/spine-runtimes<filename>spine-cpp/src/spine/BaseAtlas.cpp /******************************************************************************* * Copyright (c) 2013, Esoteric Software * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, this * list of conditions and the following disclaimer. * 2. 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. * * 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. ******************************************************************************/ #include <cstdio> #include <fstream> #include <algorithm> #include <functional> #include <cctype> #include <stdexcept> #include <spine/BaseAtlas.h> using std::string; using std::runtime_error; using std::invalid_argument; namespace spine { static inline string& trim (string &s) { s.erase(s.begin(), std::find_if(s.begin(), s.end(), std::not1(std::ptr_fun<int, int>(std::isspace)))); s.erase(std::find_if(s.rbegin(), s.rend(), std::not1(std::ptr_fun<int, int>(std::isspace))).base(), s.end()); return s; } static inline void readLine (const char *&current, const char *end, string &value) { const char *begin = current; while (current != end) { char c = *current++; if (c == '\n') break; } value.clear(); value.append(begin, current - 1); } static inline string& readValue (const char *&begin, const char *end, string &value) { readLine(begin, end, value); int colon = value.find(':'); if (colon == -1) throw runtime_error("Invalid line: " + value); value = value.substr(colon + 1); return trim(value); } /** Returns the number of tuple values read (2 or 4). */ static inline int readTuple (const char *&begin, const char *end, string &value, string tuple[4]) { readLine(begin, end, value); int colon = value.find(':'); if (colon == -1) throw runtime_error("Invalid line: " + value); int i = 0, lastMatch = colon + 1; for (i = 0; i < 3; i++) { int comma = value.find(',', lastMatch); if (comma == -1) { if (i == 0) throw runtime_error("Invalid line: " + value); break; } tuple[i] = value.substr(lastMatch, comma - lastMatch); trim(tuple[i]); lastMatch = comma + 1; } tuple[i] = value.substr(lastMatch); trim(tuple[i]); return i + 1; } static inline int indexOf (const string *array, int count, const string &value) { for (int i = count - 1; i >= 0; i--) if (array[i] == value) return i; throw runtime_error("Invalid value: " + value); } static string formatNames[] = {"Alpha", "Intensity", "LuminanceAlpha", "RGB565", "RGBA4444", "RGB888", "RGBA8888"}; static string textureFilterNames[] = {"Nearest", "Linear", "MipMap", "MipMapNearestNearest", "MipMapLinearNearest", "MipMapNearestLinear", "MipMapLinearLinear"}; // BaseAtlas::~BaseAtlas () { for (int i = 0, n = pages.size(); i < n; i++) delete pages[i]; for (int i = 0, n = regions.size(); i < n; i++) delete regions[i]; } void BaseAtlas::load (std::ifstream &file) { if (!file) throw invalid_argument("file cannot be null."); if (!file.is_open()) throw runtime_error("Atlas file is not open."); load((std::istream&)file); } void BaseAtlas::load (std::istream &input) { if (!input) throw invalid_argument("input cannot be null."); string text; std::getline(input, text, (char)EOF); const char *begin = text.c_str(); const char *end = begin + text.length(); load(begin, end); } void BaseAtlas::load (const string &text) { const char *begin = text.c_str(); const char *end = begin + text.length(); load(begin, end); } void BaseAtlas::load (const char *current, const char *end) { if (!current) throw invalid_argument("current cannot be null."); if (!end) throw invalid_argument("end cannot be null."); string value; string tuple[4]; BaseAtlasPage *page = 0; while (current != end) { readLine(current, end, value); trim(value); if (value.length() == 0) { page = 0; } else if (!page) { page = newAtlasPage(value); pages.push_back(page); page->name = value; page->format = static_cast<Format>(indexOf(formatNames, 7, readValue(current, end, value))); readTuple(current, end, value, tuple); page->minFilter = static_cast<TextureFilter>(indexOf(textureFilterNames, 7, tuple[0])); page->magFilter = static_cast<TextureFilter>(indexOf(textureFilterNames, 7, tuple[1])); readValue(current, end, value); if (value == "x") { page->uWrap = repeat; page->vWrap = clampToEdge; } else if (value == "y") { page->uWrap = clampToEdge; page->vWrap = repeat; } else if (value == "xy") { page->uWrap = repeat; page->vWrap = repeat; } } else { BaseAtlasRegion *region = newAtlasRegion(page); regions.push_back(region); region->name = value; region->rotate = readValue(current, end, value) == "true"; readTuple(current, end, value, tuple); region->x = atoi(tuple[0].c_str()); region->y = atoi(tuple[1].c_str()); readTuple(current, end, value, tuple); region->width = atoi(tuple[0].c_str()); region->height = atoi(tuple[1].c_str()); if (readTuple(current, end, value, tuple) == 4) { // split is optional region->splits = new int[4]; region->splits[0] = atoi(tuple[0].c_str()); region->splits[1] = atoi(tuple[1].c_str()); region->splits[2] = atoi(tuple[2].c_str()); region->splits[3] = atoi(tuple[3].c_str()); if (readTuple(current, end, value, tuple) == 4) { // pad is optional, but only present with splits region->pads = new int[4]; region->pads[0] = atoi(tuple[0].c_str()); region->pads[1] = atoi(tuple[1].c_str()); region->pads[2] = atoi(tuple[2].c_str()); region->pads[3] = atoi(tuple[3].c_str()); readTuple(current, end, value, tuple); } } region->originalWidth = atoi(tuple[0].c_str()); region->originalHeight = atoi(tuple[1].c_str()); readTuple(current, end, value, tuple); region->offsetX = (float)atoi(tuple[0].c_str()); region->offsetY = (float)atoi(tuple[1].c_str()); region->index = atoi(readValue(current, end, value).c_str()); } } } BaseAtlasRegion* BaseAtlas::findRegion (const std::string &name) { for (int i = 0, n = regions.size(); i < n; i++) if (regions[i]->name == name) return regions[i]; return 0; } // BaseAtlasRegion::BaseAtlasRegion () : x(0), y(0), width(0), height(0), offsetX(0), offsetY(0), originalWidth(0), originalHeight(0), index(0), rotate(false), flip(false), splits(0), pads(0) { } BaseAtlasRegion::~BaseAtlasRegion () { if (splits) delete splits; if (pads) delete pads; } } /* namespace spine */
You Don’t Know Jack developer Jackbox Games has announced the launch of Word Puttz on mobile, combining word games with a miniature golf course. In each level, the game challenges players to create words to form a path the golf ball can take to the hole, earning points related to the quality of their words. In each stage, players are given a starting letter, and must build words horizontally and vertically until one letter overlaps the hole. Letter tiles are offered in small groups, as in a game of Scrabble, and players are allowed to create words and then delete them from the board if they get stuck. As players progress, the path to the hole may become longer, and obstacles will appear on the green. Gamers earn up to three stars on each level, and must earn a set number of stars to unlock additional stages (or unlock them via in-app purchase). Power-ups are also available to purchase, like word hints and additional lives, as well as ad removal and other permanent unlocks. Word Puttz comes with four courses and more than 70 levels at launch, but Jackbox plans to add additional courses in the future. Word Puttz is available to download for free on iOS, Google Play and the Amazon App Store. Check back soon to follow the game on AppData, our tracking platform for mobile and social apps and developers.
Ant Colony algorithm for routing problem using rule-mining The proposed work presented a modified MAX-MIN Ant System (MMAS) algorithm to solve the routing problem, in which known demand are supplied from a store house with parallel routes for new local search. Routing Problem is an optimization problem and solved to nearly optimum by heuristics. The objective of routing issues is to use a fleet of vehicles with specified capacity to serve a number of users with dissimilar demands at minimum cost, without violating the capacity and route length constraints. Many meta-heuristic approaches like Simulated Annealing (SA), Tabu Search (TS) and An Improved Ant Colony System (IACS) algorithm are compared for the performance result analysis. The well-founded theory of fuzzy sets is a special way to model the uncertainty. The rules in a fuzzy model contain a set of propositions, each of which restricts a fuzzy variable to a single fuzzy value by means of the predicate equivalency. That way, each rule covers a single fuzzy region of the fuzzy grid. The proposed system of this thesis extends this structure to provide more general fuzzy rules, covering the input space as much as possible. In order to do this, new predicates are considered and a Max-Min Ant System is proposed to learn such fuzzy rules.
import { useEffect } from "react"; export function useChangeBackgroundColor(): any { //store previous color const originalBackroundColor = document.body.style.background; useEffect(() => { //change color document.body.style.background = "#fafafa"; // returned function will be called on component unmount return () => { //reset color document.body.style.background = originalBackroundColor; }; }, [originalBackroundColor]); }
def DeregisterHelper(cls, helper_class): helper_name = helper_class.NAME.lower() if helper_name not in cls._helper_classes: raise KeyError(u'Helper class not set for name: {0:s}.'.format( helper_class.NAME)) del cls._helper_classes[helper_name]
Joseph W. Chalmers Biography Born in Halifax County, Virginia, he studied law in the University of Virginia at Charlottesville, and in Richmond. He was admitted to the bar and practiced. He moved with his family to Jackson, Tennessee in 1835 and to Holly Springs, Mississippi in 1839, practicing law in both places. He followed the rapid expansion of the cotton industry in the Deep South. Chalmers was appointed as vice chancellor of the northern Mississippi district in 1842 and 1843. He was appointed to and subsequently elected by the Mississippi legislature as a Democrat to the U.S. Senate to fill the vacancy caused by the resignation of Robert J. Walker, serving from November 3, 1845, to March 4, 1847. While in the Senate, Chalmers was chairman of the Committee on Engrossed Bills (29th United States Congress). Chalmers engaged in the practice of law in Holly Springs until his death in 1853; interment was in Hill Crest Cemetery. His son James Ronald Chalmers was first elected in 1876 as a U.S. Representative from Mississippi's 6th congressional district, serving from 1877 to 1884. His term was interrupted in 1882, as his election in 1880 had been contested by John R. Lynch, his Republican opponent. Congress seated Lynch for the remainder of the term. In 1882 Chalmers won as an Independent Democrat.
Exploring the Mediating Role of Knowledge Sharing between Informal Business Networks and Organizational Performance: An Insight into SMEs Internationalization in CEE The current study aims to explore the mediating role of knowledge-sharing between international informal business networks and organizational performance. Emphasis is laid on a context-driven perspective, namely the internationalization of small- and medium-sized enterprises (SMEs) in Central and East Europe (CEE). To that end, an online questionnaire-based survey was conducted with 111 managers of CEE SMEs operating in different trade branches. The findings have shown that 46.6% of the variance in organizational performance is explained by the proposed model while 38.9% of the variance in the knowledge sharing process is explained by the affiliation of CEE SMEs to international informal business networks. The results have both theoretical and practical implications, supporting the imperative to further study the phenomena apposite to CEE region as a compelling research laboratory for multidimensional organizational idiosyncrasies.
. A combined cultivation in vitro of the hippocampal and raphe nuclei explants have been performed. Certain conditions and mechanisms on connections formed between them have been analysed. Vital observations by means of a phase-contrast microscope makes it possible to reveal three types of connections between the explants which differ by the degree of development and differentiation. The base of the earliest diffuse type of connection is presented by a fine network of flat multipressed and intercontacting gliocytes. The intermediate type of connection is characterized by aggregation of glial elements and formation of loose cords with anastomoses. Reduction of the fine network results from reduction of the glyocytic processes. The most differentiated type of connections is presented by raphe-hippocampal tracts. They are always rectilinear and develop along the shortest way between the explants. When the explants from the hippocamp and cerebellum, which have no natural intercerebral connections, are cultivated together, no formation of any magistral or intermediate types of connection is observed. An important factor in differentiation of the magistral tracts is the reactive kinetics of the glial cells. Strict straightness of the tracts and selectivity in formation of connections between various explants demonstrate also an important role of the neuro-neuronal mechanisms of chemotaxis. The direction of the connections formed can be correlated by means of some artificial guides-threads.
<gh_stars>10-100 from .Adv_Loss import Adv_Loss from .ComplEx_NNE_AER_Loss import ComplEx_NNE_AER_Loss from .SimplE_Loss import SimplE_Loss from .Cross_Entropy_Loss import Cross_Entropy_Loss from .RGCN_Loss import RGCN_Loss from .KBAT_Loss import KBAT_Loss from .CrossE_Loss import CrossE_Loss from .Margin_Loss import Margin_Loss from .RugE_Loss import RugE_Loss
Study: Netflix is biggest source of Internet traffic NEW YORK — Move over, Web surfing. Netflix movies now take up more of the Internet pipes going into North American homes. A study published Tuesday by Sandvine Inc. shows that Netflix movies and TV shows account for nearly 30 percent of traffic into homes during peak evening hours, compared with less than 17 percent for Web browsing. Only about a quarter of homes with broadband subscribe to Netflix, but watching movies and TV shows online takes up a lot of bandwidth compared with Web surfing, email and practically every other Internet activity except file sharing and videoconferencing. As late as last year, both Web surfing and peer-to-peer file sharing — mainly the illegal trading of copyrighted movies — were each larger than Netflix's traffic. Sandvine makes equipment that helps cable and phone-company manage their Internet delivery systems. It collected data from unidentified customers for the survey. It has previously been linked to Comcast Corp., the largest Internet service provider in the U.S. Sandvine says its data should be representative of overall home Internet use. The number of Netflix customers is growing quickly, to 23.6 million subscribers in the U.S. and Canada as of the end of March. The growing use of the streaming service is good news for the company, which is trying to reduce what it spends to mail DVDs. This year, the number of Netflix subscribers surpassed the number of video subscribers at Comcast. Netflix's streaming service could put it in competition with cable and satellite companies, but for now, there are few signs of people cancelling their pay-TV subscriptions in favor of Netflix, which doesn't provide live TV. The growth in Netflix traffic doesn't mean overall Internet traffic is growing faster than before. Rather, it means the type of traffic that's driving growth has shifted, as it has several times before. A few years ago, YouTube traffic was driving the growth of overall Internet traffic. It now accounts for 11 percent of traffic into the home at peak hours, according to Sandvine. Internet service providers are increasingly placing monthly limits on each subscriber's data consumption and charging extra when the limit is surpassed. Analysts see this strategy as insurance for the future, in case viewing shifts from traditional services to the Internet. Copyright 2011 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed. Brent Jones. For publication consideration in the newspaper, send comments to For more information about reprints & permissions , visit our FAQ's. To report corrections and clarifications, contact Standards Editor. For publication consideration in the newspaper, send comments to letters@usatoday.com . Include name, phone number, city and state for verification. To view our corrections, go to corrections.usatoday.com
// Copyright 2021 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "ash/app_list/views/assistant/assistant_dialog_plate.h" #include "ash/app_list/views/app_list_view.h" #include "ash/assistant/test/assistant_ash_test_base.h" #include "ash/assistant/ui/assistant_ui_constants.h" #include "ash/assistant/ui/assistant_view_ids.h" #include "ash/constants/ash_pref_names.h" #include "ash/public/cpp/style/color_provider.h" #include "ash/session/session_controller_impl.h" #include "ash/shell.h" #include "ash/style/ash_color_provider.h" #include "base/test/scoped_feature_list.h" #include "chromeos/constants/chromeos_features.h" #include "testing/gtest/include/gtest/gtest.h" #include "ui/views/controls/textfield/textfield.h" namespace ash { using AssistantDialogPlateTest = AssistantAshTestBase; TEST_F(AssistantDialogPlateTest, DarkAndLightTheme) { base::test::ScopedFeatureList scoped_feature_list( chromeos::features::kDarkLightMode); AshColorProvider::Get()->OnActiveUserPrefServiceChanged( Shell::Get()->session_controller()->GetActivePrefService()); ASSERT_TRUE(chromeos::features::IsDarkLightModeEnabled()); ASSERT_FALSE(ColorProvider::Get()->IsDarkModeEnabled()); ShowAssistantUi(); views::View* assistant_dialog_plate = app_list_view()->GetViewByID(AssistantViewID::kDialogPlate); views::Textfield* assistant_text_field = static_cast<views::Textfield*>( assistant_dialog_plate->GetViewByID(AssistantViewID::kTextQueryField)); EXPECT_EQ(assistant_text_field->GetTextColor(), ColorProvider::Get()->GetContentLayerColor( ColorProvider::ContentLayerType::kTextColorPrimary)); Shell::Get()->session_controller()->GetActivePrefService()->SetBoolean( prefs::kDarkModeEnabled, true); ASSERT_TRUE(ColorProvider::Get()->IsDarkModeEnabled()); EXPECT_EQ(assistant_text_field->GetTextColor(), ColorProvider::Get()->GetContentLayerColor( ColorProvider::ContentLayerType::kTextColorPrimary)); } TEST_F(AssistantDialogPlateTest, DarkAndLightModeFlagOff) { ASSERT_FALSE(chromeos::features::IsDarkLightModeEnabled()); ShowAssistantUi(); views::View* assistant_dialog_plate = app_list_view()->GetViewByID(AssistantViewID::kDialogPlate); views::Textfield* assistant_text_field = static_cast<views::Textfield*>( assistant_dialog_plate->GetViewByID(AssistantViewID::kTextQueryField)); EXPECT_EQ(assistant_text_field->GetTextColor(), kTextColorPrimary); } } // namespace ash
Does Government Human Capital Spending Contribute to Human Capital Development? Evidence from Nigeria This study empirically estimated the long-run and short-run impact of federal government human capital spending on human capital development in Nigeria. The study was motivated by the fact that despite growth in public spending in the past decade Nigeria still ranks low in human capital development. Time series data from 1990-2015 was collected and autoregressive distributed lag (ARDL) and Bounds test were used to estimate the short-run and long-run relationships respectively. The Bounds test was used to determine that a long-run relationship exists between Human Development Index (HDI) and government human capital spending while controlling for macroeconomic state of the economy using economic growth and inflation rate. The study finds that 1-year and 2-year lags of government recurrent education expenditure has weak significant negative impact on HDI rather than the expected positive impact. Only government recurrent health spending has positive impact on human capital development up to the 2-year lag. The speed of adjustment of the short-run relations is 41% significant at 5% level. The results demonstrated that both in the long and short run, government health spending has remained positive but to a very large extent insignificant to human capital development in Nigeria; whereas government education spending has not produced the desired positive impact on human capital development in Nigeria. This accounts for the low HDI of Nigeria over the years. The study therefore concludes that human capital development could be achieved through more efficient health spending in Nigeria. This study therefore strongly recommends that federal government should raise substantially the level of capital spending on education and health in order to achieve meaningful human capital development in Nigeria.
This morning’s winter solstice in Newgrange, Ireland, was slightly hampered by the lack of a sunrise with thanks to endless clouds in the completely overcast Irish skies. As today marked the 50th anniversary of the discovery of the ancient light chamber that is illuminated by sunrise in the few days leading up to the solstice, the shortest day of the year, it was the first time that a live stream video event had been made available to the public who could not get their hands on a golden ticket into the ancient burial tomb itself. With over 30,000 people applying this year and only 60 sets of tickets being awarded, there were certainly many people who made good use of the live stream and even if the light stream didn’t make an appearance, they didn’t let it get them down and only made some great jokes about just how bad the Irish weather is. Like most Irish people, I will be spending the morning peeping out my letterbox, hoping to replicate the spectacle of #Newgrange at home. Another dull morning at #Newgrange. In prehistoric times, that was probably a bad omen and the king was for the chop. Happy #Solstice! What's with all these journalists out in #Newgrange for the #WinterSolstice ? Are you expecting it to not happen this year or something? Even those who had thought themselves lucky enough to get a ticket, only to witness nothing, were in good form at Newgrange itself. With drumming circles and plenty of Irish wolfhounds in attendance, it was said to be a great way to follow on the 5,000-year-old tradition, mark the end of winter and the lengthening of the days again. Read more: Is Newgrange’s famous solstice light show a fake? To witness sunrise send its first #wintersolstice rays down the tunnel at #Newgrange must be an awe-inspiring sight. Today the weather didn’t oblige, yet again. Did you watch the Newgrange live stream this morning? What did you think? Is Newgrange somewhere you would like to visit?
Medium, the online writing system created by Evan Williams, one of the founders of Twitter, has been something of a tabula rasa. Its publishing system and pretty interface have drawn raves, but as a media business it has been tough to pin down. But Medium made its content ambitions clearer on Wednesday with the announcement that it had hired Steven Levy, an author and longtime technology writer who has worked at Wired and Newsweek, as the editor in chief of an as-yet-unnamed technology site. Mr. Levy, 63, will continue to write deep, long reports about the role of technology — perhaps broken up into smaller articles that will unfurl over days. He will also be commissioning articles from other writers. Mr. Levy is the most prominent writer to join Medium full time, and his hiring signals that Medium, intended to be a place where anyone can write, may begin to build a number of professionally produced journalism subject areas — tech, sports and music among them — to generate interest and an audience. Original content on the web, once the poor stepchild in Internet realms, is fast becoming something many people want a part of. Everyone from Pierre Omidyar, the founder of eBay, who is building First Look Media, to Yahoo, which has hired a number of high-profile journalists, wants in on content creation. Last year, the company bought Matter, a kind of general interest magazine that includes professionally produced content. In the past, the company had employed editors to create article collections and commission articles, but Mr. Levy’s hiring suggests that what has been a platform is also beginning to look more and more like a publisher, albeit one with no revenues and no business model to date. Medium has already become something of a go-to site for people in Silicon Valley — Elon Musk used it to announce product changes at Tesla — with articles from coders and entrepreneurs about the value and consequences of technology. Mr. Levy, who has written seven books about technology, including “In the Plex,” about Google, said that after years of covering digital entrepreneurs he wanted to become involved in the game firsthand. He also said he was not worried — much — about being swallowed by the growing content bubble on the web.
March 20 marks the 20th anniversary of the IRA bombing in Warrington which resulted in the deaths of two young boys, Tim Parry and Johnathan Ball. IT WAS a Saturday that began like any other. On the morning of March 20, 1993, Colin and Wendy Parry set off from their Warrington home to visit family in Wigan, while their children, 14-year-old Dominic, 12-year-old Tim and 11-year-old Abbi, stayed behind. It was the day before Mother’s Day so Tim had gone into Warrington town centre with a friend to do some shopping, particularly keen on buying football shorts of his beloved team Everton. It was the most ordinary of Saturdays, but by later that afternoon, the Parrys’ world would have turned upside down forever. At 12.25pm, a bomb planted by the IRA in a litter bin outside Boots ripped through Warrington as families shopped.Three-year-old Johnathan Ball was killed instantly and 56 people were left injured. Colin and Wendy’s son Tim was left fighting for his life after suffering massive brain injuries. For five days the nation prayed he’d recover but the damage to his young body was too severe and his parents made the heartbreaking decision to allow surgeons at Liverpool’s Walton Hospital to turn off Tim’s life support system. The senseless deaths sparked a wave of revulsion in Britain and Ireland and two decades on, the memory of that day will never be forgotten. But though they’d be forgiven for their anger and hostility to the perpetrators behind the attack, who have never been brought to justice, Colin and Wendy have inspired others with their desire, not for vengeance but for peace. Their tireless work has produced the Peace Foundation Charity and the Tim Parry/Johnathan Ball Peace Centre, an educational resource facility bringing youngsters together from different backgrounds and provide a safe haven were they can learn how to live together in peace. It’s become a beacon of hope and reconciliation to many, as well as remaining a living memorial to Tim and Johnathan. On Saturday, the centre will host a community reflection event after the civic memorial in Warrington town centre. Colin and Wendy worked with Warrington Borough Council to organise the commemorative event, open to the people of Cheshire who may have been in Warrington that day or who just want to pay their respects to the victims. Led by the Mayor of Warrington, the event, taking place in Bridge Street between noon and 12.45pm, focuses on a programme of events celebrating how the town has remained united and moved forward since 1993. Speaking to the Chronicle, Wendy said this anniversary is different to others because it is such a milestone. “Media and outside interest in this anniversary is greater than any year since the 10th anniversary which means we can openly share Tim with the public again. Twenty years on, Colin and Wendy are grandparents to Olivia, Isla, Evie and Arthur, the children of Dominic and Abbi, now aged 34 and 31. It’s difficult for them not to wonder what Tim might be doing if he were alive today. “We’d like to think he’d be very proud of his parents and family,” says Wendy. “And we’re pretty sure if Tim were alive at 32, he’d be dad to at least one, two or maybe three very handsome, charming, witty and intelligent children! Over the last 20 years, the Parrys have had to witness the consequences of numerous other unspeakable acts of terrorism, like 9/11 and the London bombings. “We were as horrified as every other right thinking person in this country, particularly because they were suicide attacks,” recalled Wendy. But their tireless campaign for peace and the success of the foundation which has helped thousands of people, has ensured Colin and Wendy did not let their son die in vain. “We’re proud of the number of people we have helped through the foundation,” added Wendy.
/* thanks for the author who write this book. * Professional C++, third Edition */ #include <iostream> int main(){ std::cout << "Hello, Professional C++" << std::endl; }
package spencercjh.problems; /** * https://leetcode-cn.com/problems/binary-subarrays-with-sum/ * * @author spencercjh */ class BinarySubarraysWithSum { public int numSubarraysWithSum(int[] nums, int goal) { } }
Modified Implantation of a Transvenous Defibrillator in a Patient After Tricuspid Valve Replacement SCHREIBER, C., et al.: Modified Implantation of a Transvenous Defibrillator in a Patient after Tricuspid Valve Replacement. A different approach to transvenous implantation in a patient after tricuspid valve replacement with a mechanical prosthesis is described. To our knowledge, this is the first report in this setting, using a CPI system with a single shock electrode only.
Interplay of superconductivity and ferromagnetism in YBa2Cu3O7/ La1−xSrxMnO3 heterostructures Oxide manganite/cuprate superlattices are an attractive model system to study the proximity effect in oxide ferromagnet/cuprate superlattices. This report describes recent experimental results obtained on manganite/cuprate heterostructures. The experimental results are discussed in terms of the impact of hole charge transfer from cuprate to manganite layers on the proximity between the oxide ferromagnet and oxide superconductor layers.
When a knee injury forced Lashinda Demus to withdraw from contention for the US team at the Rio Olympics, the former world champion hurdler, who had hoped to better her silver in the 400m event at the 2012 London games, was devastated. “The athlete over these four years hasn’t come close to the athlete that I knew myself to be,” she wrote on her blog last June. Injury struck again this year when Demus tore two ligaments in an ankle, putting her out of international competition. But this time the 34-year-old had a back-up plan to ease the pain: going to business school to learn how to start her own company. Demus had been invited to enrol on a two-and-a-half week course, called Next Step: Transition to Business, created by Dartmouth College’s Tuck School of Business in New Hampshire specifically for former Team USA Olympians and military veterans. “It was perfect timing,” says Demus, who had already started to prepare for the end of her 15-year career in international athletics by studying for the GMAT entry exam required by most top MBA programmes. She is now preparing to launch a fitness app. Top-level athletes are in the spotlight at events such as the Olympics, but what they do when they retire attracts less attention. Actively marketing courses to elite athletes was a departure for Tuck, too. The idea that came to course organiser Punam Keller on Veterans Day, the November holiday to honour US service people, was to create an executive education programme to help ex-military personnel find a new career. It seemed obvious, she says, because ex-military personnel were a known group in need of preparation for the world of work and the US government would fund formal training for them for civilian life. A clause in the rules governing this taxpayer support, however, meant that no course could gain 100 per cent of its revenue from veterans. Keller was forced to find other potential recruits facing similar challenges. At the time, elite athletes were in the news in the build-up to the 2016 Rio games. “The more I looked into educational opportunities available to elite athletes, discovering that the US really falls behind in this area, the more I realised how much they had in common with people in the armed forces,” she says. The pairing of soldiers and sportspeople proved a good fit when students arrived for the 18 days of teaching in March, she adds, noting that the two groups would often get together on the sports field after lessons. A typical day on the Next Step programme starts at 7.30 with breakfast, followed by two hour-long strategy courses, an entrepreneurship class and a lesson on marketing before one-on-one coaching and tuition on CV writing. The evening is spent preparing for the next day’s case work and assignments. A group dinner provides time to relax and usually includes a talk by a guest speaker from participating companies, including Visa, the National Football League and Dell. One of the athletes on the programme was Julien Bahain, a rower who won a bronze medal at the 2008 Beijing Olympics, competing for France in the men’s quadruple sculls; he rowed for Canada in Rio in 2016 but went home empty-handed. Bahain found he bonded with fellow students who had spent part of their working life in war zones. “We share a passion for teamwork, resilience, work ethic and the capacity to learn and to adapt,” he says. Bahain says it helped to be learning alongside people who shared his values but came from a profession other than sport. “We fed each other with stories, experiences and the simple feeling that I am not alone out there with my transition problems,” he says. Bahain had secured a job before starting at Tuck, in project and business management at Partnerships BC, a business wholly owned by British Columbia’s finance ministry that advises the Canadian province’s government on public-private sector partnerships. However, he believes he picked up skills in analytics and problem solving that could help him take a different career path, such as consulting or entrepreneurship. Another factor that unites ex-service personnel and elite athletes is money — or rather the lack of it. Keller had been aware of the paucity of resources available to military personnel when she was first planning the course, but she was surprised to find it was also the case for many Olympians. When she asked the US Olympic Committee about the affordability of the course, she was told that many athletes would struggle to find the money. Fortunately, two former Tuck students, who were both military veterans and sports enthusiasts, answered an appeal for support from the school’s alumni association, providing a donation that enabled Tuck to slash the cost of the Next Step programme from $10,000 to $500 per participant. Money is not the only constraint on athletes hoping to go to business school. Many feel they cannot spare the time to attend a programme when they are in the midst of training. The 18-day course was, therefore, an appealing compromise for many of those taking part, like the rower Robin Prendes. What Prendes feels he did learn from the Olympics was the need to work with others to win races. It is something he also found being taught at Tuck, which makes him confident he will be well prepared for the cut and thrust of the business environment. “A lot of people are competitive, but sport made me part of a team,” he says.
package com.di1shuai.aop.test; import com.di1shuai.aop.service.DoService; import org.junit.Assert; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringRunner; /** * @author: Shea * @date: 2020/6/24 * @description: */ @RunWith(SpringRunner.class) @SpringBootTest public class AOPTest { @Autowired DoService doService; @Test public void testAop() { String res = doService.hello("张三"); System.out.println(res); Assert.assertTrue(res.equals("hello 张三")); } }
1. Field of the Invention The present invention relates to an image display apparatus provided with image forming devices arranged in a matrix, and more particularly to a signal processing unit which is applicable to a television receiver or a display apparatus, utilizing a display panel provided with plural surface conduction devices wired in a matrix and a phosphor plate for emitting light by receiving the irradiation of electron beams from such surface conduction devices and adapted to display an image by receiving a television signal or a display signal from a computer, and which is composed of image data adjustment means for adjusting the drop in the drive voltage resulting from the electrical resistance in the matrix wirings of the aforementioned display panel and gray scale number conversion means for converting the number of gradation levels of the image data or the adjustment data. 2. Related Background Art Within such image display apparatus, the Japanese Patent Application Laid-open No. 8-248920 discloses an image display apparatus having a configuration, in order to adjust the luminance loss resulting from the voltage drop in the wiring resistance such as the wirings for electrical connection to the electron emitting devices, of calculating adjustmnent data by statistical calculation and synthesizing the requested value of the electron beam and the adjustment value. FIG. 18 is a schematic block diagram showing the configuration of an image display apparatus of conventional technology. In the following there will be explained the configuration relating to the data adjustment. At first luminance data of a line of digital image signal are added in an adder 206, and adjustment rate data corresponding to the added value are read from a memory 207. On the other hand, the digital image signal is subjected to serial/parallel conversion in a shift register 204, then held for a predetermined time in a latch circuit 205 and entered at predetermined timings into multipliers 208 provided respectively in the column wirings. For each column wiring, the multiplier 208 multiplies the luminance data with the adjustment data read from the memory 207, and the obtained data after adjustment are transferred to a modulation signal generator 209 to generate a modulation signal corresponding to the adjusted data, whereby an image displayed on the display panel based on such modulation signal. As explained in the foregoing, there is executed a statistical calculation on the digital image signal such as the calculation of sum or average, such as the addition calculation of the luminance data of a line of the digital luminance data in the adder 206, and the adjustment is executed based on the result of such statistical calculation. On the other hand, in the dither processing for the image signal, it is already known to obtain a multi-value image signal by a dither matrix, as disclosed in the Japanese Patent Application Laid-open No. 63-213084. However, in such conventional configurations, there is required a hardware of a large magnitude such as multipliers respectively for the column wirings, a memory for supplying the adjustment data and an adder for providing the memory with address signals. Also there has been a drawback that such adjustment involves discarding of bits of the digital data, thereby resulting in deterioration of the gradation of the image.