content
stringlengths
7
2.61M
<reponame>rkusantos/dnc_teacher_directory from django.contrib import admin from .models import User, UserImage from django.contrib.auth.models import Group from .forms import GroupAdminForm admin.site.register(User) admin.site.register(UserImage) # Unregister the original Group admin. admin.site.unregister(Group) # Create a new Group admin. class GroupAdmin(admin.ModelAdmin): # Use our custom form. form = GroupAdminForm # Filter permissions horizontal as well. filter_horizontal = ['permissions'] # Register the new Group ModelAdmin. admin.site.register(Group, GroupAdmin)
<reponame>dn0000001/test-automation<gh_stars>1-10 package com.taf.automation.expressions; import java.util.Arrays; import java.util.List; /** * Class to evaluate multiple expressions */ public class ExpressionsUtil { private ExpressionsUtil() { // } /** * Test the value/object against all expressions * * @param value - The value/object to be tested against * @param expressions - All the Expressions that need to be true * @param <T> - Type * @return true if ALL expressions are true with the value/object else false */ public static <T> boolean and(T value, Expression... expressions) { return (expressions == null) || and(value, Arrays.asList(expressions)); } /** * Test the value/object against all expressions * * @param value - The value/object to be tested against * @param expressions - All the Expressions that need to be true * @param <T> - Type * @return true if ALL expressions are true with the value/object else false */ public static <T> boolean and(T value, List<Expression> expressions) { if (expressions == null) { return true; } for (Expression expression : expressions) { if (!expression.eval(value)) { return false; } } return !expressions.isEmpty(); } /** * Test the value/object against all expressions * * @param value - The value/object to be tested against * @param expressions - Any of the Expressions that need to be true * @param <T> - Type * @return true if ANY of the expressions are true with the value/object else false */ public static <T> boolean or(T value, Expression... expressions) { return (expressions == null) || or(value, Arrays.asList(expressions)); } /** * Test the value/object against all expressions * * @param value - The value/object to be tested against * @param expressions - Any of the Expressions that need to be true * @param <T> - Type * @return true if ANY of the expressions are true with the value/object else false */ public static <T> boolean or(T value, List<Expression> expressions) { if (expressions == null) { return true; } for (Expression expression : expressions) { if (expression.eval(value)) { return true; } } return false; } }
<reponame>xzfn/toy<gh_stars>0 #pragma once #include <pybind11/pybind11.h> void wrap_basic_pipeline(pybind11::module_& m);
<reponame>zywaited/leetcode package one func NumBusesToDestination(routes [][]int, source int, target int) int { if source == target { return 0 } type node struct { index int step int } sm := make(map[int][]int) vm := make([]bool, len(routes)) te := false var q []node for i := range routes { for j := range routes[i] { sm[routes[i][j]] = append(sm[routes[i][j]], i) if routes[i][j] == source { q = append(q, node{index: i, step: 1}) vm[i] = true continue } if !te && routes[i][j] == target { te = true } } } if !te { return -1 } for len(q) > 0 { n := q[0] q = q[1:] for _, st := range routes[n.index] { if st == target { return n.step } for _, ni := range sm[st] { if !vm[ni] { vm[ni] = true q = append(q, node{index: ni, step: n.step + 1}) } } } } return -1 }
def run(**kw): log.info(f"MetaData Information {log.metadata} in {__name__}") ceph_nodes = kw.get("ceph_nodes") results = dict() log.info("Running sosreport test") with parallel() as p: for cnode in ceph_nodes: if cnode.role != "client": p.spawn(generate_sosreport, cnode, results) log.info(results) if all(results.values()): return 0 return 1
<gh_stars>1-10 package com.amaze.filemanager.adapters; /** * Created by Arpit on 25-01-2015. */ import android.app.Activity; import android.content.Context; import android.graphics.Color; import android.graphics.drawable.Drawable; import android.graphics.drawable.GradientDrawable; import android.os.Build; import android.support.v7.widget.RecyclerView; import android.util.SparseBooleanArray; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.view.animation.Animation; import android.view.animation.AnimationUtils; import android.widget.ImageButton; import android.widget.ImageView; import android.widget.TextView; import com.amaze.filemanager.R; import com.amaze.filemanager.fragments.ZipViewer; import com.amaze.filemanager.services.asynctasks.RarHelperTask; import com.amaze.filemanager.services.asynctasks.ZipExtractTask; import com.amaze.filemanager.services.asynctasks.ZipHelperTask; import com.amaze.filemanager.ui.ZipObj; import com.amaze.filemanager.ui.icons.Icons; import com.amaze.filemanager.ui.views.CircleGradientDrawable; import com.amaze.filemanager.ui.views.RoundedImageView; import com.amaze.filemanager.filesystem.BaseFile; import com.amaze.filemanager.utils.Futils; import com.amaze.filemanager.filesystem.HFile; import com.github.junrar.rarfile.FileHeader; import com.timehop.stickyheadersrecyclerview.StickyRecyclerHeadersAdapter; import java.io.IOException; import java.util.ArrayList; import java.util.zip.ZipFile; public class RarAdapter extends RecyclerArrayAdapter<String, RecyclerView.ViewHolder> implements StickyRecyclerHeadersAdapter<RecyclerView.ViewHolder> { Context c; Drawable folder, unknown; ArrayList<FileHeader> enter; ArrayList<ZipObj> enter1; ZipViewer zipViewer; LayoutInflater mInflater; private SparseBooleanArray myChecked = new SparseBooleanArray(); boolean zipMode=false; public RarAdapter(Context c,ArrayList<FileHeader> enter, ZipViewer zipViewer) { this.enter = enter; for (int i = 0; i < enter.size(); i++) { myChecked.put(i, false); } mInflater = (LayoutInflater) c.getSystemService(Activity.LAYOUT_INFLATER_SERVICE); this.c = c; folder = c.getResources().getDrawable(R.drawable.ic_grid_folder_new); unknown = c.getResources().getDrawable(R.drawable.ic_doc_generic_am); this.zipViewer = zipViewer; } public RarAdapter(Context c, ArrayList<ZipObj> enter, ZipViewer zipViewer,boolean l) { this.enter1 = enter; for (int i = 0; i < enter.size(); i++) { myChecked.put(i, false); } zipMode=true; this.c = c; if(c==null)return; folder = c.getResources().getDrawable(R.drawable.ic_grid_folder_new); unknown = c.getResources().getDrawable(R.drawable.ic_doc_generic_am); this.zipViewer = zipViewer; mInflater = (LayoutInflater) c .getSystemService(Activity.LAYOUT_INFLATER_SERVICE); } /** * called as to toggle selection of any item in adapter * @param position the position of the item * @param imageView the circular {@link CircleGradientDrawable} that is to be animated */ public void toggleChecked(int position, ImageView imageView) { zipViewer.stopAnim(); stoppedAnimation=true; if (myChecked.get(position)) { // if the view at position is checked, un-check it myChecked.put(position, false); Animation checkOutAnimation = AnimationUtils.loadAnimation(c, R.anim.check_out); if (imageView!=null) { imageView.setAnimation(checkOutAnimation); } else { // TODO: we don't have the check icon object probably because of config change } } else { // if view is un-checked, check it myChecked.put(position, true); Animation iconAnimation = AnimationUtils.loadAnimation(c, R.anim.check_in); if (imageView!=null) { imageView.setAnimation(iconAnimation); } else { // TODO: we don't have the check icon object probably because of config change } } notifyDataSetChanged(); if (zipViewer.selection == false || zipViewer.mActionMode == null) { zipViewer.selection = true; /*zipViewer.mActionMode = zipViewer.getActivity().startActionMode( zipViewer.mActionModeCallback);*/ zipViewer.mActionMode = zipViewer.mainActivity.toolbar.startActionMode(zipViewer.mActionModeCallback); } zipViewer.mActionMode.invalidate(); if (getCheckedItemPositions().size() == 0) { zipViewer.selection = false; zipViewer.mActionMode.finish(); zipViewer.mActionMode = null; } } public void toggleChecked(boolean b,String path) { int k=0; // if(enter.get(0).getEntry()==null)k=1; for (int i = k; i < (zipMode?enter1.size():enter.size()); i++) { myChecked.put(i, b); notifyItemChanged(i); } } public ArrayList<Integer> getCheckedItemPositions() { ArrayList<Integer> checkedItemPositions = new ArrayList<Integer>(); for (int i = 0; i < myChecked.size(); i++) { if (myChecked.get(i)) { (checkedItemPositions).add(i); } } return checkedItemPositions; } public static class ViewHolder extends RecyclerView.ViewHolder { // each data item is just a string in this case public RoundedImageView pictureIcon; public ImageView genericIcon,apkIcon; public TextView txtTitle; public TextView txtDesc; public TextView date; public TextView perm; public View rl; public ImageView checkImageView; public ViewHolder(View view) { super(view); txtTitle = (TextView) view.findViewById(R.id.firstline); pictureIcon = (RoundedImageView) view.findViewById(R.id.picture_icon); genericIcon = (ImageView) view.findViewById(R.id.generic_icon); rl = view.findViewById(R.id.second); perm = (TextView) view.findViewById(R.id.permis); date = (TextView) view.findViewById(R.id.date); txtDesc = (TextView) view.findViewById(R.id.secondLine); apkIcon=(ImageView)view.findViewById(R.id.apk_icon); checkImageView = (ImageView) view.findViewById(R.id.check_icon); } } @Override public long getHeaderId(int position) { if (zipMode) return getHeaderid(position); if (position < 0) return -1; if (position >= 0 && position < enter.size()) { if (enter.get(position) == null) return -1; else if (enter.get(position).isDirectory()) return 'D'; else return 'F'; } return -1;} long getHeaderid(int position) { if (position >= 0 && position < enter1.size()) if (enter1.get(position ) == null) return -1; else if (enter1.get(position).isDirectory()) return 'D'; else return 'F'; return -1; } public static class HeaderViewHolder extends RecyclerView.ViewHolder { public TextView ext; public HeaderViewHolder(View view) { super(view); ext = (TextView) view.findViewById(R.id.headertext); } } @Override public RecyclerView.ViewHolder onCreateHeaderViewHolder(ViewGroup viewGroup) { View view = mInflater.inflate(R.layout.listheader, viewGroup, false); /*if(zipViewer.mainActivity.theme1==1) view.setBackgroundResource(R.color.holo_dark_background);*/ HeaderViewHolder holder = new HeaderViewHolder(view); return holder; } @Override public void onBindHeaderViewHolder(RecyclerView.ViewHolder viewHolder, int i) { if(zipMode && i>=0){ HeaderViewHolder holder=(HeaderViewHolder)viewHolder; if(enter1.get(i)!=null && enter1.get(i).isDirectory())holder.ext.setText("Directories"); else holder.ext.setText("Files"); } else if(i>=0){ HeaderViewHolder holder=(HeaderViewHolder)viewHolder; if(enter.get(i)!=null && enter.get(i).isDirectory())holder.ext.setText(R.string.directories); else holder.ext.setText(R.string.files); } } @Override public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { if(viewType==0){ View v= mInflater.inflate(R.layout.rowlayout, parent, false); v.findViewById(R.id.picture_icon).setVisibility(View.INVISIBLE); return new ViewHolder(v); } View v= mInflater.inflate(R.layout.rowlayout,parent, false); ViewHolder vh = new ViewHolder(v); if(zipViewer.mainActivity.theme1==1) vh.txtTitle.setTextColor(zipViewer.getActivity().getResources().getColor(android.R.color.white)); ImageButton about = (ImageButton) v.findViewById(R.id.properties); about.setVisibility(View.INVISIBLE); return vh; } int offset=0; public boolean stoppedAnimation=false; Animation localAnimation; @Override public void onViewDetachedFromWindow(RecyclerView.ViewHolder holder) { super.onViewAttachedToWindow(holder); ((ViewHolder)holder).rl.clearAnimation(); } @Override public boolean onFailedToRecycleView(RecyclerView.ViewHolder holder) { ((ViewHolder)holder).rl.clearAnimation(); return super.onFailedToRecycleView(holder); } void animate(RarAdapter.ViewHolder holder){ holder.rl.clearAnimation(); localAnimation = AnimationUtils.loadAnimation(zipViewer.getActivity(), R.anim.fade_in_top); localAnimation.setStartOffset(this.offset); holder.rl.startAnimation(localAnimation); this.offset = (30 + this.offset); } public void generate(ArrayList<FileHeader> arrayList){ offset=0; stoppedAnimation=false; notifyDataSetChanged(); enter=arrayList; } public void generate(ArrayList<ZipObj> arrayList,boolean zipMode){ offset=0; stoppedAnimation=false; notifyDataSetChanged(); enter1=arrayList; } /** * onBindViewHolder for zip files * @param vholder the ViewHolder reference for instantiating views * @param position1 the position of the view to bind */ void onBindView(RecyclerView.ViewHolder vholder,final int position1){ final RarAdapter.ViewHolder holder = ((RarAdapter.ViewHolder)vholder); if (!this.stoppedAnimation) { animate(holder); } final ZipObj rowItem=enter1.get(position1); final int p=position1; GradientDrawable gradientDrawable = (GradientDrawable) holder.genericIcon.getBackground(); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) { holder.checkImageView.setBackground(new CircleGradientDrawable(zipViewer.accentColor, zipViewer.theme1, zipViewer.getResources().getDisplayMetrics())); } else holder.checkImageView.setBackgroundDrawable(new CircleGradientDrawable(zipViewer.accentColor, zipViewer.theme1, zipViewer.getResources().getDisplayMetrics())); if(rowItem.getEntry()==null){ holder.genericIcon.setImageDrawable(zipViewer.getResources().getDrawable(R.drawable.abc_ic_ab_back_mtrl_am_alpha)); gradientDrawable.setColor(Color.parseColor("#757575")); holder.txtTitle.setText(""); holder.txtDesc.setText(""); holder.date.setText(R.string.goback); } else { holder.genericIcon.setImageDrawable(Icons.loadMimeIcon(zipViewer.getActivity(), rowItem.getName(), false,zipViewer.res)); final StringBuilder stringBuilder = new StringBuilder(rowItem.getName()); if (zipViewer.showLastModified) holder.date.setText(new Futils().getdate(rowItem.getTime(), "MMM dd, yyyy", zipViewer.year)); if (rowItem.isDirectory()) { holder.genericIcon.setImageDrawable(folder); gradientDrawable.setColor(Color.parseColor(zipViewer.iconskin)); if (stringBuilder.toString().length() > 0) { stringBuilder.deleteCharAt(rowItem.getName().length() - 1); try { holder.txtTitle.setText(stringBuilder.toString().substring(stringBuilder.toString().lastIndexOf("/") + 1)); } catch (Exception e) { holder.txtTitle.setText(rowItem.getName().substring(0, rowItem.getName().lastIndexOf("/"))); } } } else { if (zipViewer.showSize) holder.txtDesc.setText(new Futils().readableFileSize(rowItem.getSize())); holder.txtTitle.setText(rowItem.getName().substring(rowItem.getName().lastIndexOf("/") + 1)); if (zipViewer.coloriseIcons) { if (Icons.isVideo(rowItem.getName()) || Icons.isPicture(rowItem.getName())) gradientDrawable.setColor(Color.parseColor("#f06292")); else if (Icons.isAudio(rowItem.getName())) gradientDrawable.setColor(Color.parseColor("#9575cd")); else if (Icons.isPdf(rowItem.getName())) gradientDrawable.setColor(Color.parseColor("#da4336")); else if (Icons.isCode(rowItem.getName())) gradientDrawable.setColor(Color.parseColor("#00bfa5")); else if (Icons.isText(rowItem.getName())) gradientDrawable.setColor(Color.parseColor("#e06055")); else if (Icons.isArchive(rowItem.getName())) gradientDrawable.setColor(Color.parseColor("#f9a825")); else if(Icons.isApk(rowItem.getName())) gradientDrawable.setColor(Color.parseColor("#a4c439")); else if (Icons.isgeneric(rowItem.getName())) gradientDrawable.setColor(Color.parseColor("#9e9e9e")); else gradientDrawable.setColor(Color.parseColor(zipViewer.iconskin)); } else gradientDrawable.setColor(Color.parseColor(zipViewer.iconskin)); } } holder.rl.setOnLongClickListener(new View.OnLongClickListener() { @Override public boolean onLongClick(View view) { if(rowItem.getEntry()!=null) { toggleChecked(p, holder.checkImageView); } return true; } });holder.genericIcon.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { if(rowItem.getEntry()!=null){ toggleChecked(p, holder.checkImageView); } } }); Boolean checked = myChecked.get(p); if (checked != null) { if (zipViewer.mainActivity.theme1 == 0) { holder.rl.setBackgroundResource(R.drawable.safr_ripple_white); } else { holder.rl.setBackgroundResource(R.drawable.safr_ripple_black); } holder.rl.setSelected(false); if (checked) { //holder.genericIcon.setImageDrawable(zipViewer.getResources().getDrawable(R.drawable.abc_ic_cab_done_holo_dark)); holder.checkImageView.setVisibility(View.VISIBLE); gradientDrawable.setColor(Color.parseColor("#757575")); holder.rl.setSelected(true); } else holder.checkImageView.setVisibility(View.INVISIBLE); } holder.rl.setOnClickListener(new View.OnClickListener() { public void onClick(View p1) { if(rowItem.getEntry()==null) zipViewer.goBack(); else{ if(zipViewer.selection) { toggleChecked(p, holder.checkImageView); } else { final StringBuilder stringBuilder = new StringBuilder(rowItem.getName()); if (rowItem.isDirectory()) stringBuilder.deleteCharAt(rowItem.getName().length() - 1); if (rowItem.isDirectory()) { new ZipHelperTask(zipViewer, stringBuilder.toString()).execute(zipViewer.s); } else { String x=rowItem.getName().substring(rowItem.getName().lastIndexOf("/")+1); BaseFile file = new BaseFile(c.getCacheDir().getAbsolutePath() + "/" + x); file .setMode(HFile.LOCAL_MODE); zipViewer.files.clear(); zipViewer.files.add(0, file); try { ZipFile zipFile = new ZipFile(zipViewer.f); new ZipExtractTask(zipFile, c.getCacheDir().getAbsolutePath(), zipViewer.getActivity(), x,true,rowItem.getEntry()).execute(); } catch (IOException e) { e.printStackTrace(); } }} }} }); } @Override public void onBindViewHolder(RecyclerView.ViewHolder vholder,final int position1) { if(zipMode){ onBindView(vholder,position1); return; } final RarAdapter.ViewHolder holder = ((RarAdapter.ViewHolder)vholder); if (!this.stoppedAnimation) { animate(holder); } if(position1<0)return; final FileHeader rowItem = enter.get(position1); zipViewer.elementsRar.add(position1, headerRequired(rowItem)); final int p = position1; GradientDrawable gradientDrawable = (GradientDrawable) holder.genericIcon.getBackground(); holder.genericIcon.setImageDrawable(Icons.loadMimeIcon(zipViewer.getActivity(), rowItem.getFileNameString(), false,zipViewer.res)); holder.txtTitle.setText(rowItem.getFileNameString().substring(rowItem.getFileNameString().lastIndexOf("\\") + 1)); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) { holder.checkImageView.setBackground(new CircleGradientDrawable(zipViewer.accentColor, zipViewer.theme1, zipViewer.getResources().getDisplayMetrics())); } else holder.checkImageView.setBackgroundDrawable(new CircleGradientDrawable(zipViewer.accentColor, zipViewer.theme1, zipViewer.getResources().getDisplayMetrics())); if (rowItem.isDirectory()) { holder.genericIcon.setImageDrawable(folder); gradientDrawable.setColor(Color.parseColor(zipViewer.iconskin));} else { if (zipViewer.coloriseIcons) { if (Icons.isVideo(rowItem.getFileNameString()) || Icons.isPicture(rowItem.getFileNameString())) gradientDrawable.setColor(Color.parseColor("#f06292")); else if (Icons.isAudio(rowItem.getFileNameString())) gradientDrawable.setColor(Color.parseColor("#9575cd")); else if (Icons.isPdf(rowItem.getFileNameString())) gradientDrawable.setColor(Color.parseColor("#da4336")); else if (Icons.isCode(rowItem.getFileNameString())) gradientDrawable.setColor(Color.parseColor("#00bfa5")); else if (Icons.isText(rowItem.getFileNameString())) gradientDrawable.setColor(Color.parseColor("#e06055")); else if (Icons.isArchive(rowItem.getFileNameString())) gradientDrawable.setColor(Color.parseColor("#f9a825")); else if(Icons.isApk(rowItem.getFileNameString())) gradientDrawable.setColor(Color.parseColor("#a4c439")); else if (Icons.isgeneric(rowItem.getFileNameString())) gradientDrawable.setColor(Color.parseColor("#9e9e9e")); else gradientDrawable.setColor(Color.parseColor(zipViewer.iconskin)); } else gradientDrawable.setColor(Color.parseColor(zipViewer.iconskin)); } holder.rl.setOnLongClickListener(new View.OnLongClickListener() { @Override public boolean onLongClick(View view) { toggleChecked(p, holder.checkImageView); return true; } }); holder.genericIcon.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { toggleChecked(p, holder.checkImageView); } }); Boolean checked = myChecked.get(p); if (checked != null) { if (zipViewer.mainActivity.theme1 == 0) { holder.rl.setBackgroundResource(R.drawable.safr_ripple_white); } else { holder.rl.setBackgroundResource(R.drawable.safr_ripple_black); } holder.rl.setSelected(false); if (checked) { //holder.genericIcon.setImageDrawable(zipViewer.getResources().getDrawable(R.drawable.abc_ic_cab_done_holo_dark)); holder.checkImageView.setVisibility(View.VISIBLE); gradientDrawable.setColor(Color.parseColor("#757575")); holder.rl.setSelected(true); } else holder.checkImageView.setVisibility(View.INVISIBLE); } holder.rl.setOnClickListener(new View.OnClickListener() { public void onClick(View p1) { if(zipViewer.selection) { toggleChecked(p, holder.checkImageView); } else { if (rowItem.isDirectory()) { zipViewer.elementsRar.clear(); new RarHelperTask(zipViewer, rowItem.getFileNameString()).execute (zipViewer.f); }else { if (headerRequired(rowItem)!=null) { FileHeader fileHeader = headerRequired(rowItem); BaseFile file1 = new BaseFile(c.getCacheDir().getAbsolutePath() + "/" + fileHeader.getFileNameString()); file1.setMode(HFile.LOCAL_MODE); zipViewer.files.clear(); zipViewer.files.add(0, file1); new ZipExtractTask(zipViewer.archive, c.getCacheDir().getAbsolutePath(), zipViewer.mainActivity, fileHeader.getFileNameString(), false, fileHeader).execute(); } } }} }); } private static final int TYPE_HEADER = 0; private static final int TYPE_ITEM = 1; @Override public int getItemViewType(int position) { if (isPositionHeader(position)) return TYPE_HEADER; return TYPE_ITEM; } private boolean isPositionHeader(int position) { return false;} private FileHeader headerRequired(FileHeader rowItem) { for (FileHeader fileHeader : zipViewer.archive.getFileHeaders()) { String req = fileHeader.getFileNameString(); if (rowItem.getFileNameString().equals(req)) return fileHeader; } return null; } @Override public int getItemCount() { return zipMode?enter1.size():enter.size(); } }
#pragma once enum class CollisionDirection { NORTH, EAST, SOUTH, WEST };
/** Finds the frequency of a given musical note, n, where A0 corresponds to n=0 and A4 (A440) corresponds to n=48 @return The frequency of note n, in Hz */ float freq(unsigned note) { float val = 27.5F; float exp = TWRT_2; for(; note > 0; note /= 2) { if(note % 2 == 1) { val *= exp; } exp *= exp; } return val; }
# Generated by Django 3.0.3 on 2020-04-06 02:17 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('marketplace', '0003_auto_20200404_0042'), ] operations = [ migrations.RemoveField( model_name='conversation', name='root_message', ), migrations.AddField( model_name='message', name='conversation', field=models.ForeignKey(default=1, on_delete=django.db.models.deletion.CASCADE, to='marketplace.Conversation'), preserve_default=False, ), ]
/* * Copyright 2019 Klarna AB * * 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.klarna.rest.api.instant_shopping; import com.klarna.rest.api.BaseApi; import com.klarna.rest.api.instant_shopping.model.*; import com.klarna.rest.api.order_management.OrderManagementOrdersApi; import com.klarna.rest.http_transport.HttpTransport; import com.klarna.rest.model.ApiException; import com.klarna.rest.model.ApiResponse; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import java.io.IOException; /** * The Instant Shopping API is serving two purposes: * * <ol> * <li>to manage the orders as they result from the Instant Shopping purchase flow</li> * <li>to generate Instant Shopping Button keys necessary for setting up the Instant Shopping * flow both onsite and offsite</li> * </ol> * * Note that as soon as a purchase initiated through Instant Shopping is completed within Klarna, * the order should be read and handled using the {@link OrderManagementOrdersApi Order Management API}. */ public class InstantShoppingButtonKeysApi extends BaseApi { protected String PATH = "/instantshopping/v1/buttons"; public InstantShoppingButtonKeysApi(final HttpTransport transport) { super(transport); } /** * Creates a button key based on setup options. * * @see examples.InstantShoppingExample.CreateButtonKeyExample * * @param options setup options * @return server response * @throws ApiException if API server returned non-20x HTTP CODE and response contains * a <a href="https://developers.klarna.com/api/#errors">Error</a> * @throws IOException if an error occurred when connecting to the server or when parsing a response. */ public InstantShoppingButtonSetupOptionsV1 createButtonKey(InstantShoppingButtonSetupOptionsV1 options) throws ApiException, IOException { final byte[] data = objectMapper.writeValueAsBytes(options); final ApiResponse response = this.post(PATH, data); response.expectSuccessful() .expectStatusCode(Response.Status.CREATED) .expectContentType(MediaType.APPLICATION_JSON); return fromJson(response.getBody(), InstantShoppingButtonSetupOptionsV1.class); } /** * Updates the setup options for a specific button key. * * @see examples.InstantShoppingExample.UpdateButtonKeyExample * * @param options setup options * @param buttonKey button identifier * @return server response * @throws ApiException if API server returned non-20x HTTP CODE and response contains * a <a href="https://developers.klarna.com/api/#errors">Error</a> * @throws IOException if an error occurred when connecting to the server or when parsing a response. */ public InstantShoppingButtonSetupOptionsV1 updateButtonKey(String buttonKey, InstantShoppingButtonSetupOptionsV1 options) throws ApiException, IOException { final String path = String.format("%s/%s", PATH, buttonKey); final byte[] data = objectMapper.writeValueAsBytes(options); final ApiResponse response = this.put(path, data); response.expectSuccessful() .expectStatusCode(Response.Status.OK) .expectContentType(MediaType.APPLICATION_JSON); return fromJson(response.getBody(), InstantShoppingButtonSetupOptionsV1.class); } /** * Fetches the setup options for a specific button key. * * @see examples.InstantShoppingExample.FetchButtonKeyExample * * @param buttonKey button identifier * @return server response * @throws ApiException if API server returned non-20x HTTP CODE and response contains * a <a href="https://developers.klarna.com/api/#errors">Error</a> * @throws IOException if an error occurred when connecting to the server or when parsing a response. */ public InstantShoppingButtonSetupOptionsV1 fetchButtonKeyOptions(String buttonKey) throws ApiException, IOException { final String path = String.format("%s/%s", PATH, buttonKey); final ApiResponse response = this.get(path); response.expectSuccessful() .expectStatusCode(Response.Status.OK) .expectContentType(MediaType.APPLICATION_JSON); return fromJson(response.getBody(), InstantShoppingButtonSetupOptionsV1.class); } }
Comparative study of the use of natural and artificial coagulants for the treatment of sullage (domestic wastewater) This work presented a comparative study of the effectiveness of natural coagulant (Moringa oleifera and hydrolyzed cassava) extracts and artificial coagulant (alum) as primary coagulants for sullage from homes and cafeteria at the University of Nigeria, Nsukka. Stock solutions of these coagulants were prepared, and jar test of their varying mixing ratios used to obtain optimum dosages of 200, 30 and 1,000 mg/l for Moringa, alum and cassava respectively. The effects of these optimum dosages were tested against turbidity, pH, BOD, nutrients, hardness and coli form. All tested parameters were significantly sensitive to concentrations of used stock solutions. 100% Moringa seed extract resulted in all the treated parameters (except turbidity) being within tolerable limits. The stock solution of 100% Alum also showed all tested parameters (except pH) to be within the standards for drinking water. The combination of Moringa and alum stock solutions at 50% each (A50M50) showed the overall best result with the resultant water fit for drinking. The result of the comparative test showed that alum with its residual and health implications can be successfully replaced, partially or wholly, with natural coagulants. *Corresponding author: S.N. Ugwu, Department of Mechanical and Industrial Engineering, University of South Africa, Pretoria, South Africa; Department of Agricultural and Bioresources Engineering, University of Nigeria, Nsukka, Nigeria E-mail: samnnaemeka.ugwu@unn. edu.ng Reviewing editor: Hamidi Abdul Aziz, Universiti Sains Malaysia Kampus Kejuruteraan Seri Ampangan, Malaysia Additional information is available at the end of the article PUBLIC INTEREST STATEMENT The amount of wastewater generated daily in kitchens (homes or restaurants) is enormous amidst acute shortage of potable water in most African countries. The short supply of drinkable water compels people to reuse wastewater without any form of treatment, exposing them to water-related or water-borne diseases. However, the indispensability of water to man's existence on earth necessitates the need for proper treatment. Settling of impurities in water is an important stage of water/wastewater treatment which requires addition of coagulants (artificial or natural). Alum (artificial coagulant) is mostly used in settling water impurities, but it has health concerns when used for long. Natural coagulants (from plants or animal) includes Moringa seed extracts, hydrolyzed cassava, etc. In this work, we replaced artificial coagulants(alum) partially or wholly with more health friendly natural coagulants (Moringa seed extracts and hydrolyzed cassava extracts) in other to encourage cheap and safe treatment/reuse of wastewater. Introduction Water occupies about 70% of the earth's space with only 0.4% available for use (Himesh, Rao, & Mahajan, 2000). The available minute fraction is threatened by over exploitation, poor management and ecological degradation (Jodi, Birnin-Yauri, Yahaya, & Sokoto, 2012). Growing human activities not only have increased demand for potable water, but have also increased the generation of wastewater (UN Report, 2013). Clean water is very essential to human existence, and the unavailability of potable water is the predominant reason for most deaths and diseases. The quality of water according to CDC is a health concern; water-related and waterborne diseases are responsible for about 80% of diseases in the world. These qualities include but not limited to colour, odour, coli form count, turbidity, nutrients (Renuka, Binayke, & Jadhav, 2013). Poor sanitation and unsafe water cause 88% of the 4 billion annual cases of diarrhea, resulting in the death of about 1.8 million people per annum. Safe water and hygienic environment can reduce about 94% death cases (World Health Organization, 2007). It is however important to subject water from every source to varying forms of treatment or purification before consumption, or discharge in the case of wastewater. These forms of purification are aimed at making water potable and attractive. The level of threat water poses determines the choice of treatment to be employed (Ali, Muyibi, Salleh, Salleh, & Alam, 2009). Alum (aluminium sulphate), has been the most popular for treatment of water and widely used in treatment plants. It has been found to pose some health, economic and environmental problems upon usage, among which are neurological diseases such as percentile dementia and induction of Alzheimer's disease (). Sludge produced is also voluminous and non-biodegradable after treatment, leading to increase in cost of treatment. The high cost of chemical importations results in loss of foreign exchange to nations. The effect of most chemical coagulants like Aluminum on the pH of the treated water, attracts extra cost on lime which should be added to buffer its effect. Although the use of plant materials as natural coagulants in the reduction of turbidity in wastewaters, dates to ancient times, there seems to be renewed interest in applying natural coagulants for water treatment in emerging economies (Ndabigengesere & Narasiah, 1998b;Nilanjana, 2005). Coagulants from natural sources are often seen to be safe for human health. Some natural coagulants have been studied, and are known to have the following advantages: the sludge produced is usually biodegradable, it is virtually toxin-free, relatively cheap to obtain, and locally available. Moringa olifera and Cassava are also abundant in the tropics and found to be good coagulants (Adamu, Adie, & Alka, 2014;Prasad & Rao, 2013;). The residual elements present in these natural coagulants are within the WHO limits for water treatment; and the sludge from the treatment process is biodegradable (). Figure 1 shows the coagulants of interest in this research. Some of these coagulants have been found to have high coagulation activity only for high turbid water, while others are effective in low turbid water (Muyibi & Evison, 1995). Though there had been many studies on Moringa oleifera and Manihot palmate separately in comparison to alum as coagulants for domestic wastewater treatment (;Renuka & Karunyal, 2017), there is no study on the combined effects of Moringa seed and cassava extracts when compared with alum on sullage treatment. Large amount of sullage is generated from homes and restaurants in most Nigerian cities and other developing climes. There is also an abundance of Cassava and Moringa in the Tropics. This necessitates the need to explore the potentials of combining Cassava and Moringa extracts as substitute for alum. The objective of this study was to meet the increasing demands for potable water by replacing wholly or partly/singularly or in combination the artificial coagulant (alum) with natural coagulants (M. oleifera and M. palmate) at varying doses and ratios in treating sullage generated in homes and cafeterias. In a nutshell, utilizing the efficacies of Moringa seed and cassava (M. palmate) extracts relative to that of alum in treating sullage was studied. Site description The experiment was carried out in the University of Nigeria, Nsukka (UNN) with the population size of about 50,000 staff and students. Nsukka is a mixed forest region (tropical rainforest and Guinea savanna), located on latitude 6°5124N and longitude 7°2345E with average temperature and annual rainfall of 24.9°C and 1,579 mm respectively. Water scarcity is a constant phenomenon in staff quarters and students' hostels because of low water table and few water bodies in Nsukka. The University has a Students' Centre (Chukwuma Kaduna Nzeogwu Building) which accommodates five big cafeterias with sullage generation capacity of about 22.7 m 3 per day. Wastewater from wash basins and kitchens are centrally collected in several big bowls and subsequently discharged through the sewers daily. Experimental samples of fresh domestic wastewater were collected at the sullage disposal point. The M. oleifera seeds, cassava tubers (M. palmate) and solid crystalline alum (aluminium sulfate) were sourced from the Nsukka local market. Laboratory reagents and other consumables were bought from GeoChem Laboratory, Nsukka ( Figure 2). Design of experiment The experimental layout was Completely Randomized Design (CRD) with 13 treatments and 3 replications. Statistical software (GenStat Discovery Edition 4.2 and Microsoft Excel 2016) was used for the One-way analysis of variance (ANOVA) and Duncan's multiple range test. The three treatments shown in Table 1 Sample collection, preparation and set-up Fresh sullage from the storage bowl was collected before disposal into the sewer with 10-liter container (contaminant free) and stored in a refrigerator at 6°C until usage. The locally sourced raw materials were processed into powdered form. Stock solutions of Moringa and alum were prepared directly some minutes before dosing. For cassava solution, 200 g of the grinded cassava flour was added to 0.3 M HNO 3, and allowed to stand for 24 h, before washing with distilled water to obtain a pH of 7.1. Fifty grams (50 g) of cassava solution was then dissolved in 1,000 ml of distilled water, and the filtrate used directly (). The sullage was then poured into 10 beakers of 250 ml capacity at the Public Health Laboratory of Civil Engineering Department, UNN for jar test. The jar test to determine appropriate/optimum dosage of the coagulants was conducted with different doses of the coagulants. Jar test Out of the ten beakers of 250 ml capacity, nine beakers were filled with 250 mL sullage and labeled according to the dosage of the coagulant added to it, while one beaker of sullage was left without addition of any coagulant and labeled as control. The doses used for the jar test are as shown in Table 2. These doses were added to the freshly sourced sullage and stirred vigorously with a magnetic stirrer for 3 min and then slowly for another 5 min. It was then left to settle for about one hour, the clearer of each dosage was picked as optimum for that coagulant. From these jar test doses, the optimum dose of each of the coagulant was determined and later mixed by percentages as shown in Table 1 for sullage treatment. Determination of nutrients The nutrient component of the wastewater was characterized using methods prescribed by Standard Method for Wastewater examination by APHA and AWWA while the qualitative inorganic analysis was carried out as described in Vogel. Back-titration method was used for the determination of nitrogen (nitrate); ascorbic acid method was used in determining phosphorus (phosphate) composition; and EDTA (Ethylene diaamine tetra acetate) method was used in knowing the quantity of calcium in the wastewater before and after treatment. Determination of biochemical oxygen demand (BOD) This was done by taking the dissolved oxygen level of the treated water on the 1st day, and on the 5th day using the dissolved oxygen meter. According to United States Environmental Protection Agency, the difference in the two levels gives an estimate of the BOD. where BOD 5 is the five-day biochemical oxygen demand; D 1 is the initial dissolved oxygen; D 2 is the final dissolved oxygen level after five days. Coliform count As outlined in APHA and AWWA, Multiple Tube Fermentation technique was used to statistically determine the number of coliform bacteria in a known volume of the wastewater sample. A threefold dilution series was prepared for each sample using Lauryl Tryptose Broth (LTB) tubes for the presumptive test and Brilliant Green Bile broth (BGB) for theconfirmatory test. After incubation at 37°C for 12-48 ± 3 h, the pattern of positives and negatives were noted and a standardized MPN table consulted to determine the most probable number of organisms (causing the positive results) per 100 mL of each of the effluent samples. Determination of other parameters The temperature of waste samples was measured using thermometer at room temperature. With the aid of an electronic pH meter (HACH Senson 3), the pH of waste samples was determined. Also, a portable turbidimeter was used to show the turbidity level of waste samples. Result and discussion The physicochemical characteristics of sullage such as turbidity, pH, BOD, Phosphorus, Nitrogen, Calcium, hardness, Coliform were measured. The experiments were run in triplicates and the obtained results are reproducible. The mean concentrations of chemical properties for the treatments are presented in Table 3 and on Figure 4. The ANOVA results for the measured sullage properties after treatment using CRD are presented in Tables 3 and 4. Turbidity In Table 3, the turbidity results of optimum doses from different mixing ratios (in percentage) of the coagulants after the jar test are shown. The varying mixing ratios were used to obtain optimum dosages of 200 mg/l for Moringa, 30 mg/l for alum and 1,000 mg/l for cassava. The turbidity values were obtained about two hours after the treated samples were left undisturbed and then decanted. After the introduction of coagulants, Adamu et al. suggested that layer compression and adsorption as well as neutralization of charged particle by other charged particles results in cleaving, settling and formation of precipitates during coagulation. From Table 3 above, it was observed that A100 and A50M50 had the best results at 96 and 95% turbidity reduction level respectively, which are within the World Health Organization standards for drinking water. M100 reduced turbidity in sampled sullage by 91%, which is consistent with Ndabigengesere and Narasiah (1998a) whose report showed that turbidity was reduced by 89.2%. Rodrguez-Nez et al. also recorded 88.9% on water samples with an initial turbidity of 118 NTU, using a dosage of 250 mg/l. The C70M30 had the least reduction in turbidity from 102.5 to 57 NTU. The limitation in turbidity removal recorded in moringa confirmed that it is less effective at treating water with low levels of turbidity (Prasad & Rao, 2013). Similarly, low level of turbidity and high pH may be responsible for the low turbidity removal in all cassava ratio (). The turbidity results of all samples were statistically different at 95% probability level. Table 3 shows the variation in pH values as a function of coagulant dosages. It was observed that sample A100 gave the lowest pH value of 6.2. This, according to Muyibi, is caused by the reaction of alum with natural alkalinity present in the water. This result was in sync with that of Ndabigengesere, Narasiah, and Talbot which showed that Alum causes the pH to decrease rapidly. pH of A100 when compared (Figure 4) is not within the World Health Organization and Nigerian Industrial Standard water standards which recommended limits between 6.5 and 8.5. Additional treatment is therefore required to correct and lower the pH by using calcium hydroxide or lime. There is no significant difference in the mean values of M100, Control and C70M30 at 6.8; C100 and M50C50 at 6.9 and M70A30 and C50A50. Others, M70C30, C70A30, A100, A70M30, A70C30 and A50M50 at 7.1, 7.3, 6.2, 6.5, 6.6 and 7.2 respectively are significantly different at 95% probability level. Moringa and cassava doses need no pH adjustment, but the low pH resulting from the use of alum can be remediated by the addition of alkali like lime or sodium hydroxide if water alkalinity is not high already (). However, while the high pH in cassava doses is a cost saving measure, it is contrary to the report of Adamu et al. which suggested that coagulation processes are dependent on pH values and that low pH of hydrolyzed cassava extracts enables more coagulation. Hence leaving the cassava extracts more acidic ensures lower pH which in turn improves its coagulating abilities. BOD 5 The initial BOD 5 was low at 5.2 mg/l, but was still outside the standard range of 5 mg/l (World Health Organization, 2017). All the treatments of Moringa, alum and cassava (in combination or singularly) reduced further the initial BOD after treatment. BOD measures the level of demand for oxygen by Table 3. Separation of significant differences between the mean% reductions of chemical properties of sullage at different rate of application by Fishers least significant difference (FLSD) at 5% probability level (Penn, Pauer, & Mihelcic, 2009). In accordance with previous works, 50% of BOD could be reduced by treating with moringa seed cake (Folkard & Sutherland, 2001). This shows that seed cake of moringa has noticeable effect on BOD. Unlike Sajidu, Henry, Kwamdera, and Mataka who reported no alternation on BOD value after the treatment, BOD value was reduced from 5.2 to 2.3 mg/L. This was consistent with results obtained in Shan, Mater, Makky, and Ali and the conclusions of Folkard and Sutherland. High BOD noticed in various combinations of cassava and moringa may be because cassava and moringa are organic compounds, with tendencies of increasing the organic content of the wastewater hence causing BOD to rise (). All the results after treatment were within the World Health Organization standards for drinking water. The highest reduction was recorded in A70C30, while A50M50 and C70A50 showed the lowest reduction value. Nutrient analysis Phosphorus and nitrogen are nutrients needed for plant growth. Where the levels of these elements are much in the treated water, there will be a tendency for algae growth during storage, making the water aesthetically displeasing. It is obvious that nitrates must be limited in drinking water to avoid the risk of methaemoglobinaemia in infants (United States Environmental Protection Agency, 2012). Table 3 gives the values of the nutrient (P and N) content of the treated water samples. The control (no coagulant) recorded the highest values of N and P at 15.4 and 1.56 mg/l respectively. This can be traced to the food items found in the waste as it was gotten from a domestic source (kitchen). The levels of the nutrients dropped for all treated samples and are all within the World Health Organization allowable limit for drinking water, unlike what Ndabigengesere and Narasiah (1998a) reported that nutrient was not successfully removed by Moringa extracts. In the phosphorus result obtained, M70C30 and M50C50 were statistically the same at 0.105 mg/l, C100 and C70M30 with the value of 0.054 ± 0.001 mg/l which has no significant difference at p < 0.05 levels. The nitrogen composition in Table 3 shows that M100 and M70A30; M70C30, C100, C70A30 and A70C30; C70M30 and A70M30; C50A50, A70C30 and A50M50 are statistically the same respectively. It was noticed that the mixtures containing Moringa gave higher values than others. This can be attributed to the fact that Moringa seeds contain proteins with Nitrogen and Phosphorus as its major constituents. The nutrient content of the treated water when reused should be taken into consideration to avoid the effect of algae boom which may occur if the values of N and P are high (United States Environmental Protection Agency, 2012). Hardness analysis Calcium levels in drinking water have no fixed value according to Nigerian Industrial Standard standards. In the US and Canada, the values ranged from 1 to 135 mg/l with an average of 21.8 mg/l, and inadequate intake of this element has been implicated for osteoporosis and bone deficiency (Simon, Esteban, Basil, & Joseph, 2006). The other aspect of calcium importance is in the hardness of water, which is the level of CaCO 3 in the water. To obtain the level of CaCO 3, the value of Ca is divided by 0.4 (), which is the mass ratio of Ca alone in the compound. Table 3 gives the level of Ca and CaCO 3 in the water samples analyzed. For Ca, M70A30 and A100 are statistically the same, but all other results of Ca and CaCO 3 are significantly different at p < 0.05 probability level. From Figure 4, apart from the control, mixtures containing Moringa gave relatively higher values of calcium, though the levels in all the treated water were within the standard classified as soft water (World Health Organization, 2017), while that of the untreated fell into the range of slightly hard (Sharon & Bruce, 2009). Sample C100 showed lowest value for both Ca and CaC0 3. This result was in agreement with the report of Muyibi and Evison (1995a) and Adamu et al. that M. oleifera and cassava extracts are capable of softening hard water, but at variance with the result obtained by Ndabigengesere and Narasiah (1998b) which reported increase in hardness. The implication of this is that they would not consume much soap before lather formation if used for washing or cleaning purposes, unlike when the untreated is used. Microbial analysis Aside the removal of turbidity, Moringa and Cassava extracts also possesses antimicrobial properties. As shown in Figure 4, all ratios gave very good reduction in the level of Coliform to between 90 and 98.5%. M100, A100 and A50M50, reducing the coliform count from 200 cfu/100 ml by 97.5, 98.5 and 97.5% respectively. These results gave acceptable range of 0-5 cfu/100 ml which agreed with World Health Organization, Moringa olifera seed also achieved 90-99% reduction of faecal coliform in drinking water. Ghebremichael, Gunaratna, Henriksson, Brumer, and Dalhammar reported reductions of several microorganisms including E. coli. Table 3 shows results of a comparative performance of all samples under the same condition which achieved 91.5-98.5% coliform reduction. It was observed that A70C30 and A70M30; M100 and A50M50 are statistically the same at p < 0.05 confidence level. In all, Alum (singularly or in combination) performed better than other coagulants considered. This however beckons for further disinfection with higher concentrations of Moringa extract as recommended in Yousif, Elamin, Ali, and Sulieman to achieve enhancement as well as avoid recontamination of treated water where applicable. Conclusion Coagulants from M. oleifera and M. palmate (cassava) were successfully extracted and tested at different ratios and doses in comparison with the alum solution singularly or in combination with each other. All coagulants tested reduced all the tested parameters considerably. Although the results of combining Cassava and Moringa at varying ratios did not meet most of the WHO standards, they all showed high potentials. Alum alone (A100) achieved reduction of the other parameters, but increased acidity of the treated water and sludge. In the case of Moringa seed extract alone (M100), all other parameters were brought within WHO tolerable level with less sludge except turbidity. Combining the advantages of both Moringa and Alum (A50M50) yielded overall best results with all parameters within WHO drinking water standards and ultimately enabling reusability of sullage. This combination minimizes negative impacts of alum on the environment with respect to the production of non-biodegradable sludge after treatment and its residual effect on treated water. It is further recommended that increased doses of cassava, Moringa and other natural coagulants as well as varying ratios be studied with a view to isolating the bioactive ingredients from these natural coagulants at much cheaper cost than what is obtainable presently to attract usage at a larger scale water and water treatment.
The oceans are warming up faster than we thought. While this is bad news for the planet, it's good news for climate change scientists who have — for the last two decades — puzzled over warming trends in ocean surface temperatures for nearly 20 years. According to a big chunk of ocean surface temperature recorded by boat, the oceans were not warming nearly as quickly as the rest of the planet. This mystified scientists, but climate change skeptics used it as surefire, "scientific" proof that climate change either wasn't as bad as scientists thought, or it didn't exist, at all. Now, a new study, published in Science Advances, has confirmed what NOAA first discovered in 2015— the oceans are indeed warming, and faster than we thought. So why the change? It comes down to what every scientist knows too well — analyzing data collected by different methods, and at different times, is a tricky business because some methods of collecting ocean surface temperatures are more accurate than others. The new study confirmed that data collected by boats were slightly different than data collected by buoys and satellites. So, when scientists combined all of the data, it skewed the results. To identify what's really happening, the new study analyzed numerous data sets individually— instead of combing them all together. They discovered that oceans have been warming about 70% more per decade for the last 19 years than previously thought.
NAP and ADNF-9 protect normal and Down's syndrome cortical neurons from oxidative damage and apoptosis. NAP (Asn-Ala-Pro-Val-Ser-Ile-Pro-Gln, single letter code: NAPVSIPQ) and ADNF-9 (activity-dependent neurotrophic factor-9; Ser-Ala-Leu-Leu-Arg-Ser-Ile-Pro-Ala; single letter code: SALLRSIPA) are peptides derived from naturally occurring glial proteins that have shown neuroprotection in rodent model systems. Here, the neuroprotective activity of ADNF-9 and NAP was tested in two human models of neuronal degeneration in culture mediated by oxidative stress: normal human cortical neurons treated with H2O2 and Down's syndrome (DS) cortical neurons. Incubation of normal cortical neurons with 50 microM H2O2 for 1 hour resulted in morphological and structural changes consistent with neuronal degeneration and loss of viability of more than 60% of the neurons present in the culture. Addition of ADNF-9 or NAP at femtomolar concentrations resulted in significant increases in survival of normal neurons treated with H2O2. Femtomolar concentrations of ADNF-9 or NAP exhibited a similar neuroprotective efficacy, comparable to the antioxidant N-tert-butyl-2-sulpho-phenylnitrone at 100 microM (s-PBN). Treatment of DS cortical neurons with ADNF-9 or NAP resulted in a significant increase in neuronal survival as well as reduction of degenerative morphological changes. The results suggest that ADNF-9 and NAP possess potent neuroprotective properties against oxidative damage in human neurons that may be useful to preserve neuronal function and prevent neuronal death associated with chronic neurodegenerative disorders.
Q: Username Enumeration in 2018 - How serious is this I am looking at an application redesign and one of our business team research says that we are not getting or losing customers because they are not able to login. While I don't really care about the stats, my goal is to see that the app is secure. The current message is as written in the ancient world "Your username or password is invalid" and this is planned to change to "Your username is invalid". Note this is only to get the username and we have a tight flow for password recovery. I understand the abuse cases on this change, however, I am always given references of Google, eBay, Facebook... and more, that they do allow user enumeration. Need comments on how you guys are tackling this issue, strategies, design changes - anything that will help me. A: As a pentester, I generally call out username enumeration as a very low or informational issue, but this can vary based on the application I'm looking at. Things that factor into how big an issue username enum really is: Authentication lockout enforced at the IP level. If you can only try a couple passwords before getting locked out, password guessing becomes much less practical, even with a list of valid usernames. Most attackers aren't going to have access to enough IP addresses to bypass an IP address lockout. Password policy. If you don't enforce strong passwords on your site, username enum can degrade an already poor password hygiene. Having a list of usernames is slightly less useful if they're all using decent passwords. Is there any value for enumerating users outside of password guessing? Does the username reveal anything about the user? Would this help an attacker guess the name of an administrative account? One last point to keep in mind - almost every site has username enumeration in the registration flow (you can't sign up for gmail with an existing email, and the site will tell you that). One mitigation for this is the use of captchas, but this is a risk that nearly every site has to live with to some extent. In your example regarding error messages upon login, I'll always advocate for the safer 'Invalid username/password combo' message. However, I understand that fixing security flaws can be resource intensive, and I'd rather those resources be devoted to more significant problems. If you have the time and resources to fix it, by all means do so. If you have poor password hygiene as it is, maybe prioritize this a little higher than you would otherwise.
Osaka principal resigns after sexual harassment accusation, claimed ‘007 actions’ OSAKA (TR) – On Friday, a former elementary school principal within the Osaka Board of Education who earlier this month denied charges of sexual harassment by claiming the deeds were in fact similar to that of the main character in the James Bond films resigned from teaching, reports the Mainichi Broadcasting System (Oct. 25). In May and June, Takashi Yoshida, 59, touched the bodies of the female parents of students and sent them inappropriate mails, the board announced in early October. At the time, Yoshida denied the accusations, saying his deeds were akin to that of the English spy James Bond. “These were actions like 007,” Yoshida wrote to the board in a 27-page letter that explained his intention. “To get information from female spies, I showed them affection.” He further said that the mails were in part intended to be “jokes,” and that he was not “consciously committing sexual harassment with his actions.” In September, Yohida was reassigned and received a six-month pay cut. He was also enrolled in sexual harassment training. However, several members of the board were skeptical of the punishment, saying they felt that Yoshida did not regret his actions. According to the Mainichi Shimbun (Oct. 12), Osaka Mayor Toru Hashimoto showed some sympathy with the former principal. “It is a problem but I don’t think it is an unforgivable failure,” said the mayor. In a two-hour interview with Yoshida on October 22, the board explained that he had made very little progress in his training. Two days later, the board suggested he retire voluntarily, which he did the next day. Yoshida had assumed the post this spring as a part of a nationwide recruitment program.
For nearly nine months the Obama Administration has refused to approve any new deepwater Gulf permits, which affects thousands of workers, an entire region’s economy, and our nation’s energy security. Multiple uprisings across the Middle East threaten the world’s oil supply and oil prices are rapidly increasing worldwide. Gulf Coast companies have done their part, developing viable containment strategies against spills, now President Obama must do his part and completely lift the moratorium and put thousands of Americans back to work. I congratulate Noble Energy for making it through this ever-changing maze of regulation and ensuing delays that have strangled the Gulf economy since the moratorium began last year.
Clinicopathological correlates in HIV seropositive tuberculosis cases presenting with jaundice after initiating antiretroviral therapy with a structured review of the literature Background The development of jaundice after initiation of HAART in HIV-TB co-infected patients is a challenging presentation in resource constrained settings, and is often attributed to drug induced liver injury (DILI).Some investigators have described hepatic tuberculosis Immune Reconstitution Inflammatory Syndrome (TB-IRIS) as a cause of liver disease in patients initiating HAART, which could also cause jaundice. Case presentations We report the clinical and histopathological features of five HIV-TB co-infected patients presenting with a syndrome of jaundice, tender hepatomegaly, bile canalicular enzyme rise and return of constitutional symptoms within 8 weeks of initiation of highly active antiretroviral therapy (HAART) for advanced HIV infection at a rural clinic in KwaZulu Natal, South Africa. All five patients had been diagnosed with tuberculosis infection prior to HAART initiation and were on antituberculous medication at time of developing jaundice. There was evidence of multiple aetiologies of liver injury in all patients. However, based on clinical course and pathological findings, predominant hepatic injury was thought to be drug induced in one case and hepatic tuberculosis associated immune reconstitution inflammatory syndrome (TB-IRIS) in the other four. In these later 4 patients, liver biopsy findings included necrotising and non-necrotising granulomatous inflammation in the lobules and portal tracts. The granulomas demonstrated in addition to epithelioid histiocytes and Langhans giant cells neutrophils, plasma cells and large numbers of lymphocytes, which are not features of a conventional untreated tuberculous response. Conclusion In this high TB prevalent, low resource setting, TB-IRIS may be an important cause of jaundice post-HAART initiation. Clinicopathological correlation is essential for optimal diagnosis. Further multi-organ based histopathological studies in the context of immune reconstitution would be useful to clinicians in low resource settings dealing with this challenging presentation. Background The roll out of highly active anti-retroviral therapy (HAART) is proceeding rapidly in low and middle income countries, with the number of patients on antiretroviral therapy (ARV) rising from about one quarter million at the end of 2002 to over five million at the end of 2009. Anecdotally, the development of jaundice after initiation HAART in HIV-TB co-infected patients is more common in low resource, high tuberculosis prevalent areas, and is often attributed to drug induced liver injury (DILI).Some investigators have described hepatic tuberculosis Immune Reconstitution Inflammatory Syndrome (TB-IRIS) as a cause of liver disease in patients initiating HAART, which could also cause jaundice. However, the literature describing this presentation is sparse. We describe five HIV seropositive tuberculosis cases presenting with jaundice after initiating antiretroviral therapy and consider DILI and TB-IRIS as aetiological factors and present detailed clinico-pathological description. This is followed by a structured review of the literature pertinent to these cases. Background to cases This article reports five patients presenting with jaundice within two months of HAART initiation in rural KwaZulu Natal, South Africa and discusses the possible clinicopathological causes with a focus on tuberculosisassociated immune reconstitution inflammatory syndrome (TB-IRIS) involving the liver. All five cases were originally included in a prospective audit of HAART initiation in a rural district level ARV clinic in Nongoma, KwaZulu Natal, South Africa. This audit recorded baseline and follow-up data at 2 and 8 weeks post-HAART initiation for 90 consecutive adult patients referred for HAART initiation between 18 th June and 27 th July 2010. The population that the cases are drawn from can therefore be accurately described from the audit sample (Table 1). Of the 90 patients in this audit series, six presented with jaundice during 8 weeks of follow up post-HAART initiation. Five of these six gave written consent to have their cases reported and are presented below, the first and fifth cases are described in detail while the remaining three are summarised. All five patients underwent liver biopsy and Table 2 details the microscopic findings. Patient 1 A 58 year old woman with a CD4 count of 23cells/L was referred for HAART initiation by a local general practitioner. She had a 2 week history of fever, night sweats, increasing dyspnoea and right sided chest pain, in addition to 7 days of lethargy and fast palpitations. She could walk only with assistance of 2 people. A large right sided pleural effusion was detected, which was confirmed to be a lymphocytic exudate on cytological and chemical testing. Apart from a mildly raised alkaline phosphatase, liver function tests (LFTs) were normal, and hepatitis B surface antigen was negative. She was admitted for inpatient care and commenced on empirical quadruple anti-tubercular therapy as per South African national guidelines (rifampicin, isoniazid, pyrazinamide and ethambutol), along with a 5 day course of ceftriaxone and prophylactic co-trimoxazole. In addition 4 litres of fluid was drained from the pleural space. Induced sputum and pleural fluid were acid fast bacilli (AFB) negative. After two weeks, the fever, night sweats, chest pain and palpitations had resolved. She could walk unaided. A small pleural effusion and mild abdominal tenderness in the right upper quadrant remained, but there was no hepatomegaly. She was commenced on efavirenz, tenofovir and lamivudine as per national guidelines. At routine review two weeks post-HAART initiation she was found to be confused with fever, dyspnoea, and chest pain. She had again lost her ability to walk unaided. Examination revealed jaundice, a re-accumulated pleural effusion and new tender hepatomegaly. Ultrasound scan of the abdomen identified epigastric lymph nodes >3 cm in diameter and an enlarged liver with abnormal texture. The LFTs demonstrated marked elevation in bile canalicular hepatic enzymes; raised bilirubin was predominantly conjugated, and clotting studies were normal (Table 3). A liver biopsy was performed which showed necrotising ( Figure 1A, 1B) and non-necrotising ( Figure 2A) granulomatous inflammation with AFB. Some of the necrotising granulomas demonstrated caseative necrosis ( Figure 1A) while others were suppurative ( Figure 1B). All the granulomas also contained a lymphocytic infiltrate with an admixed CD3 + / CD4 + and CD3 + /CD8 + immunoprofile. The latter predominated ( Figure 2B). There was also cholestasis and a mixed, predominantly macrovesicular,steatosis, and no viral inclusions (Table 2). Pleural fluid and mycobacterial blood culture sent at the time of first presentation confirmed fully sensitive Mycobacterium tuberculosis. The jaundice was felt to be primarily due to hepatic TB IRIS. HAART and TB therapy were continued, and a 14 day course of prednisolone 30 mg OD prescribed. All symptoms resolved over a 4 week period, along with the normalisation of observation chart variables, resolution of the hepatomegaly and pleural effusion. Patients 2, 3 and 4 The clinical and laboratory features of patients 2, 3 and 4 were similar to patient 1, and are summarised below. TB-IRIS was favoured as a primary cause of jaundice in these three cases. The histopathological features of patients 2 and 3 were also similar to patient 1. The biopsy from patient 4 was inadequate for optimal appraisal and investigation; this patient's working diagnosis was based on clinical and nonbiopsy laboratory findings. Patient 2 was a 33 year old man with a history of problem alcohol use and pleural TB treated the previous year. He had a CD4 count of 61 cells/L and had repeat treatment for pleural and pericardial TB starting three weeks prior to HAART initiation. After four weeks of HAART he deteriorated with re-accumulated effusions, plus new jaundice and tender hepatomegaly. Liver enzymes were cholestatic and abdominal ultrasound showed diffusely abnormal liver with epigastric lymphadenopathy. He was thought to have underlying chronic liver disease secondary to hepatitis B virus and alcohol consumption, with a superadded hepatic TB-IRIS, and was successfully managed with continued HAART and TB drugs with inpatient monitoring of liver enzymes. Patient 3 was a 38 year old female diagnosed commenced on pulmonary TB therapy 2 weeks prior to HAART initiation (CD4 32 cells/L). She then did not attend for follow up for 6 weeks, when she had deteriorated with systemic symptoms and functional decline, plus a worsened chest x-ray. Jaundice and tender hepatomegaly were noted, with cholestatic pattern liver enzymes. Disseminated TB-IRIS was suspected (including hepatic); TB therapy and HAART were continued but prednisolone not given as sensitivity results from mycobacterial culture were still pending. She made a full recovery. Patient 4 was a 41 year old man with CD4 123 cells/ L who had a prolonged hospital admission during which he was treated for disseminated tuberculosis infection, being commenced on HAART on discharge (after 4 weeks TB therapy). At two week review he was Alb albumin in g/L, Bil total total bilirubin mol/L, ALT alanine aminotransteraseiu/L, ALP alkaline phosphatase iu/L, GGT Gamma-glutamyltranspeptidaseiu/L., Hb haemoglobin in g/dL; WCC = white cell count (total) x10 9 /L; plt = platelets x10 9 /L; lactate is measured in mmol/L; INR = international normalised ratio. unwell with systemic symptoms, jaundice, new hepatosplenomegaly, epigastric lymphadenopathy and a deteriorated chest x-ray. Although ALT was significantly raised (grade 3) liver enzyme derangement was mixed, predominantly cholestatic. A fully sensitive Mycobacterium tuberculosis was grown from his induced sputum and he was treated for multi-systemic (and hepatic) TB-IRIS with prednisolone and made a rapid recovery. Additional clinical details on cases 2,3 and 4 are available in Additional file 1: Table S1. Patient 5 A 34 year old woman with CD4 count 17 cells/L was referred from a local hospital outpatient department for initiation of HAART. However, she reported 2 months intermittent diarrhoea which was watery with associated abdominal cramp pain, and vomiting after food. There was also a 2 month history of lethargy, anorexia, and weight loss. On direct questioning she also described a dry cough for the last 4 days. She had been diagnosed previously with tuberculosis, and finished treatment 4 months prior to this presentation. Examination findings included cachexia, tachycardia, temperature of 37.7°C, oral candidiasis and a long standing hyperpigmented rash of prior pruritic papular eruption. Abdominal palpation revealed a tender epigastric fullness and possible mass or medial liver enlargement. Chest radiology demonstrated calcified hilar nodes and a sub-pulmonic effusion while ultrasound scanning confirmed pleural fluid and epigastric lymphnodes greater than 3 cm and hepatomegaly of normal texture. Routine blood biochemistry and full blood count results included mild hyponatraemia, normocytic anaemia, and hypoalbuminaemia. Induced sputum was sent for mycobacterial culture, and stool and blood were sent for bacterial culture, but the pleural effusion was too small for aspiration. She was commenced on quadruple therapy for tuberculosis plus streptomycin as a 're-treatment' case of pleural tuberculosis as per the national South African guidelines. Prophylactic dose co-trimoxazole was also initiated. Two weeks later the pyrexia had resolved, but the diarrhoea and tachycardia persisted and she had a postural drop in blood pressure. Admission for intravenous fluids and antibiotics for gastroenteritis (ceftriaxone, erythromycin) was arranged and HAART was initiated (efavarenz, lamivudine and tenofovir as per national guidelines). Previous aerobic blood cultures and stool culture showed no growth. The vomiting and diarrhoea had resolved 10 days into admission but the patient was noted to have jaundice, high fever, on-going tachycardia and weight loss. On examination there was now a 4 finger width tender hepatomegaly and a moderate sized right sided pleural effusion. The ward doctor discontinued tuberculosis treatment and continued co-trimoxazole and HAART. Over the next 7 days there was continued fever and weight loss, with some resolution of abnormal liver function tests ( Table 3). Aspirate of the pleural effusion confirmed a lymphocytic exudate. Ultrasound imaging showed an enlarged liver, normal biliary tree, normal spleen, no large nodes, and no free fluid; a liver biopsy was performed. After a 10 day interruption, because of improved liver biochemistry and progressing clinical deterioration felt to be due to disseminated tuberculosis, full TB treatment was restarted. This again resulted in worsening liver biochemistry ( Table 3). The liver biopsy ( Table 2) ( Figure 3) demonstrated necroinflammatory foci with eosinophils, marked hepatocyte swelling, regenerative activity with multinucleation and diffuse mixed macroand-microvesicularsteatosis and cholestasis. The portal tracts were expanded by a mixed, but predominantly lymphoplasmacytic and eosinophilic, infiltrate. There was irregularity of the portal-parenchymal interface in 2 portal tracts with conspicuous destruction of hepatocytes by lymphocytes in these foci. Granulomas were not identified. Mycobacterial PCR investigation was negative. Tuberculosis therapy was stopped for a second time with a plan to reintroduce at a later date using a drug hepatotoxicity protocol. However, all mycobacterial culture results (induced sputum and pleural fluid) were negative at 42 days, the patient's symptoms resolved and she gained weight. It was felt her jaundice was primarily drug induced liver injury, although cholestasis relating to bacterial sepsis is also a possibility. The lymphocytic pleural exudate and abdominal lymphadenopathy may have been a paradoxical reaction to residual TB antigen from her previously treated tuberculosis. She remained well without TB treatment at 12 months follow up. Discussion All five patients discussed above had a diagnosis of tuberculosis made pre-HAART and were on TB therapy at time of HAART initiation. They were immunosuppressed, as evidenced by clinical findings and CD4 count. All presented with new tender hepatomegaly, jaundice with bile canalicular enzyme rise and preserved liver synthetic function, as evidenced by normal clotting studies and return of constitutional symptoms within 8 weeks of initiation of HAART. Ultrasound scan was not diagnostic in any of the patients; in particular none had bile duct dilatation. There was evidence of multiple potential aetiologies in all patients, but the predominant cause was felt to be DILI in one case and hepatic TB-IRIS in the other four. We discuss these findings in the context of previous literature under the headings liver disease in HIV infection, drug induced liver injury and hepatic TB IRIS below. Liver disease in HIV infection In the pre-HAART era abnormal liver enzymes were regarded common in HIV, with prevalence rising with advancing immunosuppression. Histopathology studies demonstrated a multiplicity of HIV associated disease in the liver, with aetiology differing widely in different population settings. Despite this, jaundice has been regarded as infrequent in HIV. Again, as might be expected, the incidence and aetiology of jaundice in HIV-infected patients may vary in different populations. Since the introduction of HAART there has understandably been greater focus on drug associated hepatotoxicity in HIV. In high income settings, chronic liver diseaseassociated with Hepatitis C and B virus, long term drug-induced toxicity, alcohol related and nonalcoholic fatty liver diseasehas become a leading cause of chronic morbidity and mortality in people living with HIV. Mechanisms underlying long-term hepatic injury are probably distinct from hepatotoxicity seen acutely after introduction of HAART. Early severe hepatotoxicity (SH) is often arbitrarily defined as elevated serum aminotransferases >5 times the upper limit of normal (grade 3 and above by the AIDS Clinical Trial Group classification) within the first 6 months of HAART; in randomised controlled trials (RCTs) incidence of SH ranges from 2 to 18%, and may have even greater variability in observational studies. However there are well described problems with assessing hepatotoxicity of HAART in randomised and observational trials. Asymptomatic elevations in liver enzymes may not be an accurate surrogate for risk of developing rare, clinically relevant, liver disease. Furthermore, the biochemical definition of hepatotoxicity is not standardised despite use of the AIDS Clinical trial Group (ACTG) classification. Although ACTG give parameters for significant elevation of all liver enzymes, many studies only include transaminase elevationsraised total bilirubin is often inconsistently defined, and alkaline phosphatase rarely considered. Which liver enzymes are included can have a large effect on conclusions. In addition, when considering patients with baseline abnormalities of transaminases investigators generally use modified ACTG criteria (for example elevations of transaminases > 3.5 times baseline), but such modifications are not standardised. Finally, upsets in liver enzymes can occur in the absence of HAART, but in hepatotoxicity studies all significant hepatic abnormalities are attributed to "toxicity", or it is often not clear how investigators have excluded cases due to other causes. Nevertheless, it is clear that, again, in high income settings co-infection with viral hepatitides is pivotal in determining risk of early hepatotoxicity. By comparison, HIV cohorts in limited resource settings tend to have much lower rates of Hepatitis C infection, and are more likely to use nevirapine in first line regimens. Hepatotoxicity studies in these settings reveal a heterogeneous picture. Reported rates of early hepatotoxicity in people initiating HAART in African studies are generally low at 1-2% but occasionally much higher at 3.4-18.4%. Grade 1 or 2 rises in liver enzymes are very prevalent in all these studies. Some well conducted studies have reported a significantly higher rate of early grade 3 or 4 hepatotoxicity in patients treated with nevirapine compared to efavarenz, while other studies have not. Co-infection with viral hepatitides is not found to be a significant risk factor for hepatotoxicity, in most but not all studies. In contrast, co-treatment with anti-tuberculous medications is found to be a major risk factor in African cohorts, although this also has exceptions. Different follow up times and frequencies of serum liver enzyme assessment may explain much of this variationfor example the studies which have found high rates of early nevirapine associated hepatotoxicity have higher rates of blood sampling in the first 3 months post-HAART initiation, which is when most hepatotoxicity was identified, suggesting other studies may simply have missed this occurrence. In correspondence with the high income setting studies, there is also the problem of definition of hepatotoxicity. This difficulty is underlined in light of the finding that point prevalence of 'grade 3 or 4 hepatotoxicity' may be very similar before and after HAART initiation, or that HAART initiation even reduces the rates of transaminitis in African HIV treatment cohorts. This suggests trials which define HAART related hepatotoxicity as any significant rise in liver enzymes after HAART initiation have oversimplified a complex, multifactorial problem. Helping get beyond these problems are papers that report clinically relevant outcomes, which several studies in an African setting do. Reported rate of changing HAART regimen in response to hepatotoxicity is generally lower than reported rate of grade 3 or 4 liver enzyme risefor example 0.7% v. 1.4%; 9.1% v. 13.8%; ; 2.6% v. 3.4%; 0.9% v. 4.6%. It is possible that clinicians do not always think such rises are heralding life threatening drug induced liver injury, perhaps relying instead on additional features such as lactic acidosis, hypersensitivity rash or eosinophilia or are reassured by the transient nature of a rise. Several investigators have recorded that grade 3 or 4 liver enzyme abnormalities often resolve spontaneously without change in medications. However, some investigators have noted higher incidence of symptoms in those with compared to those without grade 3 or 4 liver enzyme elevation. Importantly, while deaths attributed to HAART hepatotoxicity are infrequent, they do occur; reported rates are 0 to 0.5%. Further clinical context is provided in some hepatotoxicity studies. In reports of hepatotoxicity in a treatment cohort in rural Uganda, Weidle and colleagues describe clinical hepatitisdefined as presence of jaundice, liver enlargement and gastrointestinal symptomsin 4 out of 1029 enrolled patients within 3 months of HAART initiation. Although 12.7% of this cohort received TB treatment, none of the 4 patients with clinical hepatitis were on anti-mycobacterial medication at the time of their reactions. All 4 patients also exhibited a hypersensitivity rash, one case was caused by co-trimoxazole, and 3 were attributed to nevirapine; one of the 4 patients died from the reaction. Kalyesubula et al. reporting from urban clinics in Kampala give a detailed account of clinical and biochemical surveillance for hepatitis in HIV seropositive patients. In a cohort of 236 individuals, 66 developed new transaminitis within 14 weeks of commencing HAART, although only 3/66 were grade 3 or 4 rises. The investigators report that, in the 66 patients with any aminotransferase elevation, 33% had vomiting, 20% right upper quadrant pain, 17% hepatomegaly and 8% jaundice. Although only 8/236 patients were receiving any TB treatment, the authors found current TB therapy to be a risk factor for any grade 2 -4 transaminitis, but it is not clear what clinical findings were observed in HIV-TB co-infected patients who developed transaminitis. Unlike in this previous work, the current case series is defined by a clinical presentation rather than the presence or absence liver enzyme elevation. In addition, we present a detailed clinico-pathological description in an attempt to better define the causes of the liver disease in these patients, which is not found in the literature on hepatotoxicity post-HAART. It should be emphasised that the treatment cohort these cases are drawn from may be quite atypical compared to some of the above studies. In particular, the very high rate of culture confirmed tuberculosis in our cohort (about 40% from samples obtained during HAART initiation work up). Drug Induced Liver Injury (DILI) There is no gold standard for the diagnosis of DILI. The clinical and histopathological spectrum of DILI is wide and overlaps with other hepatic diseases. The more common hepatitic pattern of DILI, with ALT >5 times upper limit of normal, was not apparent in these five patients who had predominant bile canalicular enzyme elevation. However, cholestatic or mixed hepatocellular/ cholestatic DILI has been reported with use of rifampicin, isoniazid, ethambutol, and co-trimoxazole, hence, drug hepatotoxicity must still be considered. In lieu of a gold standard diagnostic test, clinical scales for diagnosis of DILI have been developed. One of the most validated is the Maria &Victorino (M&V) system. Based on the M&V system score, patient 5 above might be considered a 'possible' DILI, while patients 1 to 4 score as 'unlikely' to be DILI. Caution must be taken in application of DILI clinical scales: poor reproducibility along with inter-rater and inter-scale disagreement have been shown, and they are not validated in HIV-positive populations or low resource settings. Despite these limitations, from a clinical perspective, worsening of LFTs on drug re-challenge in patient 5 is strong evidence of DILI, and normalisation of LFTs without interrupting therapy is strong evidence that DILI was not a predominant cause of the jaundice seen in the four other cases. Histopathologic assessment of possible DILI can also be problematic. Drug hepatotoxicity can produce a spectrum of acute hepatic pathology that imitates a range of patterns described in primary hepatic disease. This mimicry poses a major diagnostic challenge because the shared histopathological features, comprising mainly necro-inflammatory hepatocellular, cholestatic and mixed hepatocellular-cholestatic patterns, cannot be attributed unequivocally to drugs. Although this wide spectrum of histopathological reaction patterns displayed in DILI includes a granulomatous reaction pattern, drug-induced granulomatous responses are usually non-necrotising. Because 3/5 patients in the present study demonstrated necrotizing granulomatous inflammation, a drug-induced cause is morphologically inappropriate. This is also strengthened by the identification of acid fast bacilli in one biopsy and confirmation of an M. tuberculosis complex footprint by polymerase chain reaction. One of the five biopsy results in these cases was considered strongly suggestive of DILI and resulted in decision to interrupt TB medications (case 5, Figure 3, histology showed moderate portal tract and lobular inflammation with eosinophils and interface hepatitis). The presence of eosinophils is a well-recognised feature of drug reactions in many organs, but caution is necessary in the interpretation of their presence. This is particularly pertinent in the current context, because patients with advanced AIDS demonstrate a dominant Th2 response with associated tissue "eosinophilia". Furthermore, silent parasitic infections may be responsible for heightened eosinophil numbers. Notwithstanding this, however, whilst all biopsies in the present study contained eosinophils, the density of eosinophils was most intense in the biopsy from patient 5. In this biopsy, there were no other histopathological clues of a parasitic infestation. In summary, no gold-standard exists for diagnosis of DILI, but liver biopsy with clinicopathological correlation suggests DILI as a probable primary cause of hepatic disease in only one of the five cases presented here. Hepatic TB-IRIS Although tuberculosis of the liver is not commonly diagnosed clinically, it is a frequent post-mortem finding in HIV positive patients. It is possible that hepatic tuberculosis (IRIS) may be similarly under recognised. Lawn and Wood report not infrequent involvement of the liver in South African patients with TB-IRISfour patients in a case series of seventeen TB-IRIS patients. They suggest that predominant rise in bile canalicular enzymes, liver capsular pain, manifestations of TB-IRIS at another anatomical site, are all suggestive features, while jaundice may develop in some patients. Meintjes et al. have also shown high prevalence of cholestatic pattern liver enzyme derangement and hepatomegaly in South African patients diagnosed with TB-IRIS in a large prospective observational study, but do not comment specifically on jaundice. Similarly, Haddow et al. report a high frequency of elevated liver enzymes in a cohort of South African patients initiating HAART who were consequently classified as possible cases of hepatic TB-IRIS by expert consensus. By contrast other TB-IRIS cohort studies do not report any liver involvement. Such variability may represent differences in study populations or may relate to diagnostic difficulty. In likeness with DILI, TB-IRIS has no diagnostic gold standard test, but a consensus clinical case definition has been proposed for low income settings. Four of the five jaundiced patients in this series were felt to have met this TB-IRIS case definition (Additional file 1: Table S2). A specific case definition for hepatic TB-IRIS has also been suggested, which additionally requires the presence of granulomatous inflammation on liver biopsy. Lawn and Wood suggest that large epithelioid granulomatous inflammation seen on liver biopsy is evidence of hepatic TB-IRIS. In the present study, not only was necrotising and non-necrotising granulomatous inflammation present in the lobules and portal tracts, but the granulomas demonstratedin addition to epithelioid histiocytes and Langhans giant cellsneutrophils, plasma cells and large numbers of lymphocytes, which are not features of a conventional untreated tuberculous response. The microscopic spectrum of the tuberculous IRIS reaction is poorly documented, but a similar dense neutrophilic and lymphoplasmacytic inflammatory response has been documented in reaction to cryptococcal antigen in tissue. Although the present study is limited by the absence of interval CD4 counts and viral load measurements, in view of the other laboratory findings and clinical history, including patient outcome, the spectrum of histopathological findings is proposed as the expanding morphological profile of tuberculous granulomas in the setting of IRIS. We believe this is the most detailed clinico-pathological description of hepatic TB-IRIS to date. Further multi-organ based histopathological studies in multiple organs are necessary for such validation. Multiple causes of jaundice in individual patient Immune-compromised patients are often found to have multiple concurrent liver pathologies. The majority of cases presented above have evidence of more than one potential cause of jaundice. A further contributor to jaundice in these cases could be the isolated hyperbilirubinaemia (without evidence of cholestasis or hepatocellular damage) related to rifampicin interference with bilirubin uptake. Heller et al. postulate this may be at least a partial cause of their 'relatively frequent' observation of jaundice shortly after initiation of TB medications in South African patients. This might be particularly relevant to patient 5 in this case series, who had jaundice in the presence of only minor alkaline phosphatase elevation. Preliminary guidelines on how healthcare workers in resource-limited settings should respond to jaundice in HIV positive TB cases on antiretroviral therapy A lack of evidence exists informing the management of the clinical presentation of jaundice in this context and the preliminary nature of the following guidance should be emphasised. Presentation with jaundice in HIV positive patients on TB treatment and HAART should prompt full clinical assessment. Bloods for biochemical and haematology assays, and ultrasound assessment of the abdomen should be performed if available. Elevations in transaminases or bilirubin >5x upper limit of normal, or >3.5x the baseline level, are not typical of hepatic TB-IRIS. If present, clinicians should strongly suspect DILI and follow local or national guidelines for hepatotoxicity from antituberculosis and anti-retroviral medications. The presence of hypersensitivity rash, lactic acidosis, significant coagulopathy or eosinophilia is strongly suggestive of DILI and clinicians should follow local or national guidelines for hepatotoxicity from antituberculosis and anti-retroviral medications. In cases where anti-tuberculosis and/or antiretroviral medications have been discontinued but liver enzymes are failing to resolve, liver biopsy should be considered if available. Features suggestive of hepatic TB-IRIS as a cause of jaundice include: evidence of IRIS in another system; new tender hepatomegaly; predominantly cholestatic liver test derangement; abdominal ultrasound findings of diffusely abnormal liver texture, lymphadenopathy and normal biliary tree. If diagnostic uncertainty exists clinicians should consider liver biopsy, if available, or transfer to a higher level of care. Histopathological findings which suggest TB-IRIS in liver tissue include large epithelioid granulomatous inflammation. Features which are atypical of conventional tuberculous responseincluding neutrophils, plasma cells and large numbers of lymphocytesmay also be present. Multiple causes of liver disease are common in HIV-TB co-infected patients presenting with jaundice following HAART initiation, and additional diagnoses such as bacterial sepsis, DILI from traditional medicines, and active hepatitis B infection should be actively sought. Causes of liver disease in HIV-TB co-infected patients show wide variation in relative frequency according to geographical location and population studied; clinicians should be aware of local and national experience for their setting. Conclusion HIV seropositive tuberculosis cases presenting with jaundice after initiating antiretroviral therapy represent a challenge to clinicians working in resource constrained settings. We believe hepatic TB-IRIS is an important aetiological factor in our setting. Fastidious clinicopathological correlation is essential for optimal diagnosis. Prospective histopathological studies in multiple organs for better characterisation of the morphological profile of tuberculous granulomas in the setting of immune reconstitution are necessary to aid clinical decision making in difficult cases such as those presented here. Consent statement Written informed consent for publication was obtained from the 5 patients whose cases are presented above. A copy of the written consent is available for review by the Series Editor of this journal.
THE DETERMINANTS OF CAPITAL STRUCTURE: A CASE STUDY This paper investigates the determinants of capital structure of business startups utilizing simultaneously a survey of business owners characteristics and data collected from financial reports submitted to the taxation authorities of 268 newly established enterprises in Hanoi. The results have indicated that most of the hypotheses are accepted and consistent with relevant theoretical models. However, unlike existing studies on the capital structure of startups in developed nations, the influence of a start up size, profitability, work experience based on relationships prior to starting up a new company, growth orientation and the age of a business are the major determinants of the initial capital structure decision while the asset structure, organizational type, gender, age of owner and education level of business owners does not seem to have a significant impact on the choice of capital structure in the context of transitional economies and financial markets that are not quite developed, such as in Vietnam. The major findings are discussed based on the trade-off theory and the pecking order theory. The article also provides some implications and recommendations for future research.
import { pugTemplateConverter, jsonTemplateConverter } from './converter'; describe("converter", () => { describe("pugTemplateConverter()", () => { test("having pug string content converted from translations to strings", () => { const template = ` block append config +options({ title: t('main.page.title'), subTitle: t('main.page.subtitle'), description: t('main.page.description-string'), }) `; const converted = ` block append config +options({ title: t('_main_page_title'), subTitle: t('_main_page_subtitle'), description: t('_main_page_description_string'), }) `; expect(pugTemplateConverter(template)).toEqual(converted); }); }); describe("jsonTemplateConverter()", () => { test("having json template content converted from translations to strings", () => { const template = ` { title: <% main.page.title %>, subtitle: <% main.page.subtitle %>, description: <% main.page.description-string %>, } `; const converted = ` { title: {{t _main_page_title}}, subtitle: {{t _main_page_subtitle}}, description: {{t _main_page_description_string}}, } `; expect(jsonTemplateConverter(template)).toEqual(converted); }); }); });
This invention primarily relates to infant seats, removable seats and latches therefore, and more particularly to an infant seat, a seat latch, and an a removable seat which may be removed and used separately therefrom. However, the seat of the invention is not limited to an infant seat for use within a car or other vehicle by a child. The invention may be sized to fit an adult and may have a base inappropriate for vehicular use; such as for example, a wheeled base usable as a stroller or a fixed upright base usable as a chair. Car seats are widely used for the transportation of children within vehicles. With previous car seats either the child or the car seat or both must be secured with a seatbelt or the car seat's restraining system, just prior to use. It is difficult to secure or unsecure a car seat containing a child with a seat belt. It is also difficult to restrain or unrestrain a child in a previously secured car seat particularly if the child is uncooperative. Both are made more difficult by limited access; such as in the back seat of a two door automobile, by inclement weather, and by other conditions, such as, for example, a sleeping child. Because of the difficulty of securing a child containing car seat, such car seats are not readily usable for transporting a child portal to portal. It is also difficult to change the orientation of previous car seats. Previous car seats do not allow for the seat to recline, face both forward and rearward, or otherwise be selectively positioned during use. Previous car seats also do not provide for a car seat latch which allows the seat to be removed and used on a variety of bases. It is therefore highly desirable to provide an improved seat, and an improved seat latch. It is also highly desirable to provide an improved seat, and an improved seat latch in which a separable base and seat are latched together. It is also highly desirable to provide an improved seat, and an improved seat latch, which provide for easy assembly and disassembly of the seat and base with or without a child present in the car seat. It is also highly desirable to provide an improved seat and an improved car seat latch which provide for separable seat and base portions. It is also highly desirable to provide an improved seat and an improved seat latch which provide for easy alignment of the two separable portions of the seat. It is also highly desirable to provide an improved seat and an improved seat latch which are safe and convenient to use. It is also highly desirable to provide an improved car seat and an improved car seat latch which provides all of the above desired features.
I don't typically share post-game quotes here, but I found some of the things the Knicks said following last night's loss in Toronto particularly funny/appropriate/inappropriate, so here are a few of those things. The main point of contention in the locker room last night was the amount of swag/swagger befitting a team in the Knicks' position. Raymond Felton, speaking to SB Nation's James Herbert, expressed hopes of regaining swagger as the Knicks return to Madison Square Garden: "We're going back home. Just get our swagger back when we go back to the house, go back to our home, our building." Swagger levels are depleted. Returning home will hopefully replenish them. Got it. FULL SWAG AHEAD. But wait, Amar'e Stoudemire disagrees: "We got plenty of swagger, we may have too much swag,’’ Stoudemire said. "We got to get more greedy, from the standpoint of wanting to defend, wanting to win and having a sense of urgency. We have to want to win. We got to have the mentality to want to win. It don’t matter if it looks good or not. We just got to get it done. It’s not a great feeling right now.’’ Too much swag! Is Amar'e drawing a distinction between swagger and swag, or is he repeating himself in that first line? I don't know. The Knicks just need to get on the same page swag/swagger-wise and adjust accordingly. Meanwhile, here's J.R. Smith: "We’re still alive. We still got a heartbeat. It’s just a matter of do we get off the bed or not?" And here's Carmelo Anthony: "That’s been one of our downfalls – not giving effort," Anthony said before they lost to the Raptors. And Mike Woodson: "We had an opportunity where we could have drove the ball and got smashed and went to the line to make free throws," Woodson said. "We got to take advantage of that and we didn't." Agreed on all counts (well maybe not the "got smashed" part. Just drawing fouls would be fine). The effort we've seen suits an elite, proven team pissing away wintertime games because they're too cool for the regular season. The Knicks are not that. One more kinda weird thing: "I disagree with the slow start," he said of a first quarter in Toronto that saw the Knicks score 32 points, but also give up 32. "You guys [media] are saying that's a slow start," he said, "I don't know what else you want us to do in the beginning of the game." Like Alan Hahn says: that was a slow start, Jason. No way around it. What we want you (all of you) to do in the beginning of the game is play offense and defense at the same time. That's all. So, yeah, good job saying the right things, Knicks. Nothing new there. Now just DO some stuff, please.
#ifndef _CPLT_AFFINERELU_H #define _CPLT_AFFINERELU_H #include "../testneural.h" bool checkAffineRelu(float eps=CP_DEFAULT_NUM_EPS, int verbose=1) { bool allOk=true; t_cppl states; MatrixN x(2,4); x << -2.44826954, 0.81707546, 1.31506197, -0.0965869, -1.58810595, 0.61785734, -0.44616526, -0.82397868; MatrixN W(4,5); W << 0.86699529, -1.01282323, -0.38693827, -0.74054919, -1.1270489, -2.27456327, 0.190157 , -1.26097006, -0.33208802, 0.16781256, 0.08560445, -0.24551482, 0.30694568, -1.61658197, -3.02608437, 0.18890925, 1.7598865 , -0.14769698, -0.59141176, -0.85895842; MatrixN b(1,5); b << 1.81489966, 1.27103839, 1.58359929, -0.8527733 , 1.24037006; MatrixN y(2,5); y << 0. , 3.41322609, 1.91853897, 0. , 0.24028072, 0. , 1.65643012, 1.40374932, 1.32668765, 5.19182449; AffineRelu arl(R"({"inputShape":[4],"hidden":5})"_json); t_cppl cache; t_cppl grads; *(arl.params["af-W"])=W; *(arl.params["af-b"])=b; MatrixN y0=arl.forward(x, &cache, &states); bool ret=matCompT(y,y0,"AffineRelu",eps,verbose); if (!ret) allOk=false; MatrixN dx(2,4); dx << 2.29906266, -1.48504925, 6.47154972, 1.00439731, 1.8610674 , -0.74000018, -0.6322688 , -4.68601953; MatrixN dW(4,5); dW << 0. , 4.7081366 , -2.63137168, 0.27607488, 4.10764656, 0. , -1.78497082, 0.90776884, -0.10740775, -1.32401681, 0. , 0.6314218 , 0.97587313, 0.07756096, -2.89927552, 0. , 2.03769315, -0.36020745, 0.1432397 , -0.24398387; MatrixN db(1,5); db << 0. , -2.77768192, 1.19310997, -0.17383908, -1.49039921; MatrixN dchain(2,5); dchain << -1.08201385, -0.34514762, 0.8563332 , 0.7021515 , -2.02372516, -0.26158065, -2.43253431, 0.33677677, -0.17383908, 0.53332595; MatrixN dx0=arl.backward(dchain, &cache, &states, &grads); ret=matCompT(dx,dx0,"AffineRelu dx",eps,verbose); if (!ret) allOk=false; ret=matCompT(dW,*(grads["af-W"]),"AffineRelu dW",eps,verbose); if (!ret) allOk=false; ret=matCompT(db,*(grads["af-b"]),"AffineRelu db",eps,verbose); if (!ret) allOk=false; cppl_delete(&cache); cppl_delete(&grads); return allOk; } bool testAffineRelu(int verbose) { Color::Modifier lblue(Color::FG_LIGHT_BLUE); Color::Modifier def(Color::FG_DEFAULT); bool bOk=true; t_cppl s1; cerr << lblue << "AffineRelu Layer: " << def << endl; // Numerical gradient AffineRelu rx(R"({"inputShape":[2],"hidden":3})"_json); MatrixN xarl(30, 2); xarl.setRandom(); //floatN h = 1e-5; //if (h < CP_DEFAULT_NUM_H) // h = CP_DEFAULT_NUM_H; floatN h = 1e-5; floatN eps = 1e-6; if (eps < CP_DEFAULT_NUM_EPS) eps = CP_DEFAULT_NUM_EPS; bool res=rx.selfTest(xarl, &s1, h, eps, verbose); registerTestResult("AffineRelu", "Numerical gradient", res, ""); if (!res) bOk = false; res=checkAffineRelu(CP_DEFAULT_NUM_EPS, verbose); registerTestResult("AffineRelu", "Forward/Backward (with test-data)", res, ""); if (!res) bOk = false; return bOk; } #endif
State Street Corp said on Saturday the top executive of its electronic foreign exchange trading business has left the company in a leadership shake-up. The departure of Clifford Lewis raises questions about the direction of Boston-based State Street&apos;s high-frequency trading platform for forex called Currenex. Lewis was chief executive and chairman of Currenex when State Street agreed in 2007 to buy the company for nearly $600 million in cash. "Because we have combined teams and solutions that previously resided within other business units, we&apos;ve had to make tough decisions about leadership, and Cliff Lewis left as a result of those decisions," said State Street spokeswoman Carolyn Cichon. "We are very grateful for the contributions he has made and strong management team that he leaves behind." On Friday, State Street said Jeff Conway would oversee a global exchange group that included electronic FX trading, data analytics and derivatives clearing. Lewis was not mentioned in the reorganization announcement. He did not return messages seeking comment. Lewis was an executive vice president at State Street and head of the e-Exchange business, which includes Currenex, FXConnect and a range of other trading platforms. The e-Exchange FX businesses averaged over $150 billion in daily volume in 2012, making them one of the largest FX trading platforms in the world. Lewis also managed State Street&apos;s derivatives and bond clearing businesses. Last year, though, State Street&apos;s revenue from electronic forex trading fell 16 percent to $210 million from $249 million in 2011, according to company financial statements. The company blamed declines in currency volatility and pricing. Total FX trading revenue at State Street fell 25 percent in 2012. Part of the drop was related to a shift away from non-negotiated FX trades by State Street customers, such as state-run pension funds. On those trades, it has been alleged that State Street had been overcharging customers, an accusation the company has steadfastly denied. Lewis&apos; operations did not include non-negotiated trades. Instead, Currenex, for example, focused on sophisticated algorithmic trading, which uses computers to place orders that sometimes are executed within milliseconds. These high-frequency FX trades are a big area for potential growth at banks. Computer-run algorithms allow hedge funds, for example, to unload large amounts of currencies without tipping their hand. They can also read and interpret news and economic data releases, generating trading orders before the rest of the forex market is fully aware of what is happening.
/*- * #%L * Autolog core module * %% * Copyright (C) 2019 <NAME> * %% * 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% */ package com.github.maximevw.autolog.core.logger; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; import org.junit.jupiter.params.provider.ValueSource; import org.mockito.junit.jupiter.MockitoExtension; import java.io.ByteArrayOutputStream; import java.io.PrintStream; import java.util.stream.Stream; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.is; import static org.junit.jupiter.api.Assertions.assertThrows; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; /** * Unit tests for the class {@link LoggingUtils}. */ @ExtendWith(MockitoExtension.class) class LoggingUtilsTest { private static final ByteArrayOutputStream STD_OUT = new ByteArrayOutputStream(); private static final ByteArrayOutputStream STD_ERR = new ByteArrayOutputStream(); /** * Initializes the context for all the tests in this class. */ @BeforeAll static void init() { // Redirect standard system output and standard error output. final PrintStream outStream = new PrintStream(STD_OUT); final PrintStream errStream = new PrintStream(STD_ERR); System.setOut(outStream); System.setErr(errStream); } /** * Verifies that reporting a given message effectively logs it with level DEBUG in the standard output. */ @Test void givenMessage_whenReportDebugMessage_logsMessageInStandardOutput() { LoggingUtils.report("Test message."); assertThat(STD_OUT.toString(), containsString("[DEBUG] Autolog: Test message.")); } /** * Verifies that reporting a given message effectively logs it with the specified level in the standard output. * * @param level The log level to use. */ @ParameterizedTest @ValueSource(strings = {"TRACE", "DEBUG", "INFO", "WARN", "ERROR"}) void givenMessageAndLevel_whenReportMessage_logsMessageInStandardOutput(final String level) { LoggingUtils.report("Test message.", LogLevel.valueOf(level)); assertThat(STD_OUT.toString(), containsString(String.format("[%s] Autolog: Test message.", level))); } /** * Verifies that reporting an error effectively logs it with level ERROR in the error output. */ @Test void givenMessageAndThrowable_whenReportError_logsMessageInErrorOutput() { final Throwable throwable = mock(Throwable.class); LoggingUtils.reportError("Test error message.", throwable); assertThat(STD_ERR.toString(), containsString("[ERROR] Autolog: Test error message.")); verify(throwable, times(1)).printStackTrace(); } /** * Verifies that formatting a duration in milliseconds returns the expected formatted value. * * @param durationInMs The duration (in milliseconds) to format. * @param expectedResult The expected formatted value. */ @ParameterizedTest @MethodSource("provideDurations") void givenDuration_whenFormatDuration_returnsExpectedValue(final long durationInMs, final String expectedResult) { final String result = LoggingUtils.formatDuration(durationInMs); assertThat(result, is(expectedResult)); } /** * Builds arguments for the parameterized test relative to the formatting of durations: * {@link #givenDuration_whenFormatDuration_returnsExpectedValue(long, String)}. * * @return The duration in milliseconds and the corresponding formatted value for the parameterized tests. */ private static Stream<Arguments> provideDurations() { return Stream.of( Arguments.of(10, "10 ms"), Arguments.of(1010, "1 s 010 ms"), Arguments.of(65_010, "1 m 5 s 010 ms"), Arguments.of(3_665_010, "1 h 1 m 5 s 010 ms"), Arguments.of(87_005_010, "1 day(s) 0 h 10 m 5 s 010 ms") ); } /** * Verifies that getting the qualified method name with a null method name throws a {@link NullPointerException}. * * @see LoggingUtils#getMethodName(String, Class, boolean) */ @Test void givenNullMethodName_whenGetMethodName_throwsException() { assertThrows(NullPointerException.class, () -> LoggingUtils.getMethodName(null, Object.class, true)); } /** * Verifies that computing the topic name with a null caller class throws a {@link NullPointerException}. * * @see LoggingUtils#computeTopic(Class, String, boolean) */ @Test void givenNullCallerClass_whenComputeTopic_throwsException() { assertThrows(NullPointerException.class, () -> LoggingUtils.computeTopic(null, "topic", true)); } }
Piltdown man: the realization of fraudulence. canopy, and directly below on the ground. Pre±iminary observations indicate that vertebrates such as squirrels and birds that are otherwise unlikely to come very near to man when he is on the ground react differently to an observer in the canopy and can be approached sometimes almost to within arm's reach. Usually they carry on normal activities in the presence of the observer. The reactions of squirrels and other arboreal mammals to the transect walkways is similar to their reactions to vines and other growth that join the crowns of individual trees; they sometimes use them to get from tree to tree. ILLAR MUUL*, LIM Boo LIAT Department of Medical Ecology, Institute for Medical Research, Kuala Lumpur, Malaysia
package com.dragontalker.filter; import java.io.IOException; import javax.servlet.Filter; import javax.servlet.FilterChain; import javax.servlet.ServletException; import javax.servlet.ServletRequest; import javax.servlet.ServletResponse; public class Filter2 implements Filter { @Override public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { System.out.println("Filter2: before chaining..."); chain.doFilter(request, response); System.out.println("Filter2: after chaining..."); } }
// Player shift-click a slot. public ItemStack transferStackInSlot(EntityPlayer player, int index) { ItemStack stack = null; Slot slot = (Slot) this.inventorySlots.get(index); if (slot != null && slot.getHasStack()) { ItemStack slotStack = slot.getStack(); stack = slotStack.copy(); if (index < 8) { if (!this.mergeItemStack(slotStack, 8, this.inventorySlots.size(), false)) return null; } else if (!this.getSlot(0).isItemValid(slotStack) || !this.mergeItemStack(slotStack, 0, 4, false)) return null; if (slotStack.stackSize == 0) slot.putStack((ItemStack) null); else slot.onSlotChanged(); if (slotStack.stackSize == stack.stackSize) return null; slot.onPickupFromSlot(player, slotStack); } return stack; }
I am amused by India’s loudest TV anchor and a few of his ilk lionising Interpol as if it were a super investigating agency that can be ordered about by all and sundry to nab dreadful criminals. The fact is that the Lyon-based organisation is a paper tiger, a little more than a glamorous post office, which has been overrated by some ignoramuses. Gullible TV viewers in India have been made to believe, during the past few days, that the government – both UPA and NDA – had been grievously slothful in not invoking Interpol’s assistance to bring Lalit Modi to book. The false story that has been planted in many minds is that, if only the government had wanted, Lalit Modi could have been brought back to India by the next available flight from wherever he was, and questioned, nay incarcerated, for all his alleged sins. Nothing can be farther from truth. As one who headed Interpol in India, I believe I can speak with some authority.
#include "Scene_Shaders.h" namespace scenery { Program &create_solid_program(Shader_Manager &shader_manager) { return shader_manager.create_program("solid", shader_manager.create_shader_from_file(Shader_Type::vertex, "scenery/solid.vertex"), shader_manager.create_shader_from_file(Shader_Type::fragment, "scenery/solid.fragment"),{}); } Program &create_textured_program(Shader_Manager &shader_manager) { return shader_manager.create_program("textured", shader_manager.create_shader_from_file(Shader_Type::vertex, "scenery/textured.vertex"), shader_manager.create_shader_from_file(Shader_Type::fragment, "scenery/textured.fragment"),{}); } Program &create_colored_program(Shader_Manager &shader_manager) { return shader_manager.create_program("colored", shader_manager.create_shader_from_file(Shader_Type::vertex, "scenery/textured.vertex"), shader_manager.create_shader_from_file(Shader_Type::fragment, "scenery/textured.fragment"),{}); } }
The exuberance of Texans wide receiver Braxton Miller was on display Sunday during his touchdown catch as he punctuated the score by doing a forward flip into the end zone. Miller had been a healthy scratch for the previous two games. Texans coach Bill O'Brien wasn't a fan of how Miller celebrated the touchdown. "Yeah, I didn't like the flip, I did not like the flip," O'Brien said Monday. "Just score, hand the ball to the official would be my advice to him." A former third-round draft pick and converted quarterback from Ohio State, Miller caught two passes against the Cleveland Browns. At least one person approved of Miller's acrobatics: Texans quarterback Deshaun Watson. "Yeah. I mean, that's something that he wanted to do," Watson said. "His opportunity came and he took advantage of it and he did a flip and it was pretty dope." O'Brien wants to see more growth from Miller going forward. There are some creative things the Texans can do with Miller because of his athleticism and versatility. "I think he can add some things to our offense," O'Brien said. "Just continue to work and improve in the classroom and on special teams and he'l get more reps on offense."
//Called either when the player wins or looses void GameManager::OnGameEnd(std::string titleText) { dialogBox = make_unique<DialogBoxSprite>(); title text dialogTitleText = make_unique<GameText>(titleText, Vector2f(0, -50), 200); enter text dialogEnterText = make_unique<GameText>("Press enter to Exit",Vector2f(0,50),100); }
/* * Copyright 2021 The Modelbox Project Authors. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "output_broker_flowunit.h" #include <modelbox/base/timer.h> #include <modelbox/base/utils.h> #include <securec.h> #include <queue> #include "driver_util.h" #include "modelbox/base/config.h" #include "modelbox/flowunit.h" #include "modelbox/flowunit_api_helper.h" #define DEFAULT_RETRY_COUNT 5 BrokerDataQueue::BrokerDataQueue(const std::string &broker_name, size_t queue_size) : broker_name_(broker_name), queue_size_(queue_size) {} void BrokerDataQueue::PushForce( const std::shared_ptr<modelbox::Buffer> &buffer) { std::lock_guard<std::mutex> lock(queue_lock_); while (queue_.size() >= queue_size_ && !queue_.empty()) { MBLOG_WARN << "Data in broker " << broker_name_ << " exceed limit " << queue_size_ << ", old data drop one. set mode=\"sync\" will not drop data " "but will stuck, " "or you can enlarge queue_size in mode=\"async\"."; queue_.pop(); } queue_.push(buffer); } modelbox::Status BrokerDataQueue::Front( std::shared_ptr<modelbox::Buffer> &buffer) { std::lock_guard<std::mutex> lock(queue_lock_); if (queue_.empty()) { return modelbox::STATUS_NODATA; } buffer = queue_.front(); return modelbox::STATUS_OK; } bool BrokerDataQueue::Empty() { return queue_.empty(); } void BrokerDataQueue::PopIfEqual( const std::shared_ptr<modelbox::Buffer> &target) { std::lock_guard<std::mutex> lock(queue_lock_); if (queue_.empty()) { return; } if (queue_.front() != target) { return; } queue_.pop(); } BrokerInstance::BrokerInstance(std::shared_ptr<OutputBrokerPlugin> &plugin, const std::string &name, std::shared_ptr<OutputBrokerHandle> &handle, size_t async_queue_size) : plugin_(plugin), name_(name), handle_(handle), data_queue_(name, async_queue_size) {} BrokerInstance::~BrokerInstance() {} void BrokerInstance::SetRetryParam(int64_t retry_count_limit, size_t retry_interval_base_ms, size_t retry_interval_increment_ms, size_t retry_interval_limit_ms) { retry_count_limit_ = retry_count_limit; retry_interval_base_ms_ = retry_interval_base_ms; retry_interval_increment_ms_ = retry_interval_increment_ms; retry_interval_limit_ms_ = retry_interval_limit_ms; } modelbox::Status BrokerInstance::Write( const std::shared_ptr<modelbox::Buffer> &buffer) { cur_data_retry_count_ = 0; bool retry = true; do { auto ret = plugin_->Write(handle_, buffer); UpdateInstaceState(ret); if (ret == modelbox::STATUS_AGAIN) { if (cur_data_retry_count_++ < retry_count_limit_ || retry_count_limit_ < 0) { MBLOG_ERROR << "Write data to " << name_ << " failed, detail: Try again"; } else { retry = false; } if (send_interval_ != 0) { std::this_thread::sleep_for(std::chrono::milliseconds(send_interval_)); } } else { return ret; } } while (retry); return {modelbox::STATUS_FAULT, "Reach max retry limit " + std::to_string(retry_count_limit_)}; } modelbox::Status BrokerInstance::AddToQueue( const std::shared_ptr<modelbox::Buffer> &buffer) { data_queue_.PushForce(buffer); std::lock_guard<std::mutex> lock(stop_lock_); if (is_stopped && !exit_flag_) { auto timer_task = std::make_shared<modelbox::TimerTask>([&]() { WriteFromQueue(); }); is_stopped = false; timer_.Start(); timer_.Schedule(timer_task, send_interval_, 0, true); } return modelbox::STATUS_OK; } void BrokerInstance::WriteFromQueue() { std::shared_ptr<modelbox::Buffer> buffer; data_queue_.Front(buffer); // Will not be empty auto ret = plugin_->Write(handle_, buffer); UpdateInstaceState(ret); if (ret == modelbox::STATUS_AGAIN) { if (cur_data_retry_count_ < retry_count_limit_ || retry_count_limit_ < 0) { ++cur_data_retry_count_; MBLOG_ERROR << "Write data to " << name_ << " failed, detail: Try again "; } else { MBLOG_ERROR << "Write data to " << name_ << " failed, drop this data, detail: Reach max retry limit " << retry_count_limit_; cur_data_retry_count_ = 0; data_queue_.PopIfEqual(buffer); } } else { if (!ret) { MBLOG_ERROR << "Write data to " << name_ << " failed, drop this data, detail: " << ret.Errormsg(); } else { MBLOG_INFO << "Write data to " << name_ << " success"; } cur_data_retry_count_ = 0; data_queue_.PopIfEqual(buffer); } std::lock_guard<std::mutex> lock(stop_lock_); if (!data_queue_.Empty()) { // if task stop, retry param will be changed by Dispose() auto timer_task = std::make_shared<modelbox::TimerTask>([&]() { WriteFromQueue(); }); is_stopped = false; timer_.Start(); timer_.Schedule(timer_task, send_interval_, 0, true); } else { is_stopped = true; stop_cv_.notify_all(); } } void BrokerInstance::Dispose() { MBLOG_INFO << name_ << " start dispose"; // set retry param to ensure task could exit if (retry_count_limit_ == -1) { retry_count_limit_ = DEFAULT_RETRY_COUNT; } retry_interval_increment_ms_ = 0; retry_interval_limit_ms_ = retry_interval_base_ms_; send_interval_ = retry_interval_base_ms_; // wait for sending task end exit_flag_ = true; std::unique_lock<std::mutex> lock(stop_lock_); stop_cv_.wait(lock, [&]() { return is_stopped.load(); }); plugin_->Sync(handle_); plugin_->Close(handle_); MBLOG_INFO << name_ << " dispose over"; } void BrokerInstance::UpdateInstaceState(modelbox::Status write_result) { switch (write_result.Code()) { case modelbox::STATUS_AGAIN: if (send_interval_ == 0) { send_interval_ = retry_interval_base_ms_; } else if (send_interval_ < retry_interval_limit_ms_) { send_interval_ += retry_interval_increment_ms_; if (send_interval_ > retry_interval_limit_ms_) { send_interval_ = retry_interval_limit_ms_; } } break; default: send_interval_ = 0; break; } } OutputBrokerFlowUnit::OutputBrokerFlowUnit(){}; OutputBrokerFlowUnit::~OutputBrokerFlowUnit(){}; modelbox::Status OutputBrokerFlowUnit::Open( const std::shared_ptr<modelbox::Configuration> &opts) { auto dev_mgr = GetBindDevice()->GetDeviceManager(); if (dev_mgr == nullptr) { MBLOG_ERROR << "Can not get device manger"; return modelbox::STATUS_FAULT; } auto drivers = dev_mgr->GetDrivers(); if (drivers == nullptr) { MBLOG_ERROR << "Can not get drivers"; return modelbox::STATUS_FAULT; } auto ret = driverutil::GetPlugin<OutputBrokerPlugin>( DRIVER_CLASS_OUTPUT_BROKER_PLUGIN, drivers, factories_, plugins_); if (!ret) { return ret; } for (auto &item : plugins_) { auto ret = item.second->Init(opts); if (!ret) { MBLOG_ERROR << "Init plugin " << item.first << " failed, detail : " << ret.Errormsg(); } } mode_ = opts->GetString("mode", SYNC_MODE); if (mode_ != SYNC_MODE && mode_ != ASYNC_MODE) { MBLOG_ERROR << "Mode only support {sync, async}"; return modelbox::STATUS_BADCONF; } retry_count_limit_ = opts->GetInt64("retry_count_limit"); retry_interval_base_ms_ = opts->GetUint64("retry_interval_base_ms"); retry_interval_increment_ms_ = opts->GetUint64("retry_interval_increment_ms"); retry_interval_limit_ms_ = opts->GetUint64("retry_interval_limit_ms", retry_interval_base_ms_); if (retry_interval_limit_ms_ < retry_interval_base_ms_) { MBLOG_WARN << "retry_interval_limit < retry_interval_base is unacceptable, " "use retry_interval_base as retry_interval_limit"; retry_interval_limit_ms_ = retry_interval_base_ms_; } async_queue_size_ = opts->GetUint64("queue_size", 100); return modelbox::STATUS_OK; } modelbox::Status OutputBrokerFlowUnit::Close() { for (auto &item : plugins_) { item.second->Deinit(); } plugins_.clear(); return modelbox::STATUS_OK; } modelbox::Status OutputBrokerFlowUnit::Process( std::shared_ptr<modelbox::DataContext> data_ctx) { auto input_buffer_list = data_ctx->Input(INPUT_DATA); for (auto &buffer : *input_buffer_list) { std::string output_broker_names; buffer->Get(META_OUTPUT_BROKER_NAME, output_broker_names); auto ret = SendData(data_ctx, output_broker_names, buffer); if (!ret) { MBLOG_ERROR << "Send data to output broker " << output_broker_names << "failed"; } } return modelbox::STATUS_OK; } modelbox::Status OutputBrokerFlowUnit::SendData( std::shared_ptr<modelbox::DataContext> &data_ctx, const std::string &output_broker_names, const std::shared_ptr<modelbox::Buffer> &buffer) { auto broker_instances = std::static_pointer_cast<BrokerInstances>( data_ctx->GetPrivate(CTX_BROKER_INSTANCES)); auto loaded_broker_names = std::static_pointer_cast<BrokerNames>( data_ctx->GetPrivate(CTX_BROKER_NAMES)); if (broker_instances == nullptr || loaded_broker_names == nullptr) { MBLOG_ERROR << "Output broker handles has not been inited"; return modelbox::STATUS_FAULT; } auto output_broker_name_list = modelbox::StringSplit(output_broker_names, '|'); if (output_broker_name_list.empty()) { output_broker_name_list = *loaded_broker_names; } for (auto &target_broker_name : output_broker_name_list) { auto item = broker_instances->find(target_broker_name); if (item == broker_instances->end()) { MBLOG_ERROR << "Wrong broker name " << target_broker_name << ", it's not named in config"; continue; } auto &broker = item->second; if (mode_ == SYNC_MODE) { auto ret = broker->Write(buffer); if (!ret) { MBLOG_ERROR << "Write data to " << target_broker_name << " failed, drop this data, detail: " << ret.Errormsg(); } else { MBLOG_INFO << "Write data to " << target_broker_name << " success"; } } else { broker->AddToQueue(buffer); } } return modelbox::STATUS_OK; } modelbox::Status OutputBrokerFlowUnit::DataPre( std::shared_ptr<modelbox::DataContext> data_ctx) { auto config = data_ctx->GetSessionConfig(); auto cfg_str = config->GetString(SESSION_OUTPUT_BROKER_CONFIG); if (cfg_str.empty()) { MBLOG_ERROR << "Output broker config in session has not been set"; return modelbox::STATUS_FAULT; } auto ret = ParseCfg(data_ctx, cfg_str); if (!ret) { MBLOG_ERROR << "Parse output broker config failed"; return ret; } return modelbox::STATUS_OK; }; modelbox::Status OutputBrokerFlowUnit::DataPost( std::shared_ptr<modelbox::DataContext> data_ctx) { auto broker_instances = std::static_pointer_cast<BrokerInstances>( data_ctx->GetPrivate(CTX_BROKER_INSTANCES)); for (auto &item : *broker_instances) { item.second->Dispose(); } broker_instances->clear(); return modelbox::STATUS_OK; }; modelbox::Status OutputBrokerFlowUnit::ParseCfg( std::shared_ptr<modelbox::DataContext> &data_ctx, const std::string &cfg) { nlohmann::json json; try { json = nlohmann::json::parse(cfg); } catch (const std::exception &e) { MBLOG_ERROR << "Parse output config to json failed, detail: " << e.what(); return modelbox::STATUS_INVALID; } if (!json.is_object()) { MBLOG_ERROR << "Output broker config must a json object"; return modelbox::STATUS_INVALID; } auto brokers = json["brokers"]; auto ret = InitBrokers(data_ctx, brokers); if (!ret) { MBLOG_ERROR << "Init output brokers failed"; return ret; } return modelbox::STATUS_OK; } modelbox::Status OutputBrokerFlowUnit::InitBrokers( std::shared_ptr<modelbox::DataContext> &data_ctx, const nlohmann::json &brokers_json) { if (brokers_json.empty()) { MBLOG_ERROR << "Key <brokers> is missing in json object"; return modelbox::STATUS_INVALID; } if (!brokers_json.is_array()) { MBLOG_ERROR << "Value of <brokers> must be an array"; return modelbox::STATUS_INVALID; } auto broker_instances = std::make_shared<BrokerInstances>(); auto broker_names = std::make_shared<BrokerNames>(); for (auto &broker_json : brokers_json) { try { AddBroker(broker_instances, broker_names, broker_json); } catch (const std::exception &e) { MBLOG_ERROR << "init output broker failed, config: " << broker_json.dump(); return modelbox::STATUS_INVALID; } } data_ctx->SetPrivate(CTX_BROKER_INSTANCES, broker_instances); data_ctx->SetPrivate(CTX_BROKER_NAMES, broker_names); return modelbox::STATUS_OK; } void OutputBrokerFlowUnit::AddBroker( std::shared_ptr<BrokerInstances> &broker_instances, std::shared_ptr<BrokerNames> &broker_names, const nlohmann::json &broker_json) { if (!broker_json.is_object()) { MBLOG_ERROR << "Single broker config must be object"; return; } auto type = broker_json["type"]; if (type.empty()) { MBLOG_WARN << "Key <type> is missing in single broker config"; return; } if (!type.is_string()) { MBLOG_WARN << "Key <type> must has string value"; return; } auto plugin = GetPlugin(type); if (plugin == nullptr) { MBLOG_WARN << "No ouput broker plugin for type " << type; return; } auto name = broker_json["name"]; if (name.empty()) { MBLOG_WARN << "Key <name> is missing in single broker config, type " << type; return; } if (!name.is_string()) { MBLOG_WARN << "Key <name> must has string value, type " << type; return; } auto cfg = broker_json["cfg"]; if (cfg.empty()) { MBLOG_WARN << "Key <cfg> is missing in single broker config, type " << type << ", name " << name; return; } if (!cfg.is_string()) { MBLOG_WARN << "Key <cfg> must has string value, type " << type << ", name " << name; return; } auto handle = plugin->Open(cfg); if (handle == nullptr) { MBLOG_WARN << "Get broker handle for " << name << ":" << type << " failed"; return; } handle->output_broker_type_ = type; auto instance = std::make_shared<BrokerInstance>(plugin, name, handle, async_queue_size_); instance->SetRetryParam(retry_count_limit_, retry_interval_base_ms_, retry_interval_increment_ms_, retry_interval_limit_ms_); (*broker_instances)[name] = instance; broker_names->push_back(name); } std::shared_ptr<OutputBrokerPlugin> OutputBrokerFlowUnit::GetPlugin( const std::string &type) { auto item = plugins_.find(type); if (item == plugins_.end()) { return nullptr; } return item->second; } MODELBOX_FLOWUNIT(OutputBrokerFlowUnit, desc) { desc.SetFlowUnitName(FLOWUNIT_NAME); desc.SetFlowUnitGroupType("Output"); desc.AddFlowUnitInput({INPUT_DATA}); desc.SetFlowType(modelbox::FlowType::STREAM); desc.SetInputContiguous(false); desc.SetDescription(FLOWUNIT_DESC); } MODELBOX_DRIVER_FLOWUNIT(desc) { desc.Desc.SetName(FLOWUNIT_NAME); desc.Desc.SetClass(modelbox::DRIVER_CLASS_FLOWUNIT); desc.Desc.SetType(FLOWUNIT_TYPE); desc.Desc.SetDescription(FLOWUNIT_DESC); desc.Desc.SetVersion("1.0.0"); }
Field of the Invention This invention relates to an ankle brace and more particularly to an ankle brace including a tensioning system which functionally stabilizes the ankle as it reaches extreme ranges of motion. Description of the Related Art Conventional braces for protecting joints of the body do so by restricting or limiting motion of the joint to which it is applied to prevent a new injury or to protect a pre-existing injury. An ankle joint, just like all the joints in the human body, has a natural range of motion that it can move through without causing damage to itself. As it reaches the end of these ranges, the body has structure such as ligaments and tendons to create tension to end range of motion and protect the joint. Many of the prior art ankle braces do prevent the ankle from exceeding its extreme ranges of motion but do not provide the necessary flexibility to permit the athlete to function normally. Applicant's ankle brace described and shown in the co-pending application represents an improvement in the ankle brace art. The instant invention represents a further improvement in the ankle brace art.
#include <stdio.h> #define TRUE 1 #define FALSE 0 int main() { char input[50]; char ch; int n, i, m; char has_first_char; char first_char[50]; int len_first_char; int num[2]; scanf("%d", &n); while (n--) { scanf("%s", input, sizeof(input)); i = 0; m = 0; num[0] = 0; num[1] = 0; len_first_char = 0; has_first_char = FALSE; while (ch = input[i++]) { if (ch >= 'A' && ch <= 'Z') { if (has_first_char) m = 1; else first_char[len_first_char++] = ch; } else { if (!has_first_char) { first_char[len_first_char] = NULL; has_first_char = TRUE; } num[m] *= 10; num[m] += ch - '0'; } } if (num[1] > 0) { i = 0; do { m = num[1] % 26; if (m == 0) { input[i++] = 'Z'; num[1] -= 26; } else { input[i++] = 'A' + (num[1] % 26) - 1; } num[1] /= 26; } while (num[1] > 0); while (--i >= 0) { printf("%c", input[i]); } printf("%d\n", num[0]); } else { i = -1; while (++i < len_first_char) { num[1] *= 26; num[1] += first_char[i] - 'A' + 1; } printf("R%dC%d\n", num[0], num[1]); } } return 0; }
Driving veterinary nursing May is VN awareness month and what better way to mark it than to hear from Sam Morgan, president of the British Veterinary Nursing Association and inspirational teacher of veterinary nurses? ! HAVING grown up around animals and enjoyed science at school, I wanted a career that would combine the two. The careers advice I was given was not very helpful; I was told that veterinary surgery was a hard course to be accepted on and that anything else to do with animals was poorly paid, so maybe I should consider being a nursery nurse. Luckily, my uncle was a partner in a mixed practice nearby in Cardiff and I was able to do my school work experience alongside him. That led to a Saturday job and it was then that I got to know the two veterinary nurses who worked at the practice. They were both qualified, but were very different people, with different roles. One was especially good with the owners and staff and the other was clever clinically. They inspired me to aim to be a mixture of both all I had to do was convince my mum that veterinary nursing was a good career choice. I was directed to the BVNA for some career information. I started at my uncle's practice a month later, when I donned my green and white striped uniform and became a student member of the BVNA. I attended a local college one day a week to complete my training, working the rest of the time to develop my practical skills. I qualified in 1999 and was proud to attend the RCVS : /embed/inline-graphic-1.gif
A nation of Jack Sprats? Cholesterol program to stress dietary changes. THE NATIONAL CHOLESTEROL Education Program, mandated by the National Heart, Lung and Blood Institute's (NHLBI) Consensus Development Conference on Lowering Blood Cholesterol to Prevent Heart Attack, is under way. Although many technical details remain to be ironed out, it is becoming clear that the program will focus on teaching the merits of dietary, rather than pharmacologic, intervention. Initially, the program will be directed principally at those in the high-risk groups and at the physicians who may be caring for them. "This is the first line of attack. We have an obligation to do something for those who have a definite, accepted risk factor for coronary heart disease ," says NHLBI's James I. Cleeman, MD, coordinator of the program. In designing the study, investigators will be aided by data from a survey the NHLBI conducted earlier this year concerning the knowledge, attitudes, and practices of physicians and the public concerning elevated
Taawuns Role in Alleviating Poverty in Makassar City This study aims to determine the role of community ta'awun in the city of Makassar in alleviating poverty, and find factors that exist in ta'awun implementation and solutions. This study uses a phenomenological approach as the main approach and assisted pedagogical approach. The results of this study indicate that ta'awun has the opportunity and potential to reduce poverty in the city of Makassar. Ta'awun inhibiting factors of the implementation is poor social ethics, their social stratification and level of understanding of religion is still lacking. As for the solution of these problems is to maximize the role of government, community leaders, and religious leaders in policy, education, and dissemination of the importance ta'awun behavior.
class SizeAccounting: """ Context manager to read and update Volume size and PV size info Usage: with SizeAccounting("storage-pool-1", "/mnt/storage-pool-1") as acc: acc.update_pv_record("pv1", 20000000) """ def __init__(self, volname, mount_path): self.mount_path = mount_path self.volname = volname self.conn = None self.cursor = None def __enter__(self): """Initialize the Db Connection""" self.conn = sqlite3.connect(os.path.join(self.mount_path, DB_NAME)) self.cursor = self.conn.cursor() self._create_tables() return self def __exit__(self, exc_type, exc_value, exc_traceback): """Close Db connection on exit of the Context manager""" self.conn.close() def _create_tables(self): """Create required tables""" self.cursor.execute(CREATE_TABLE_1) self.cursor.execute(CREATE_TABLE_2) def update_summary(self, size): """Update the total available size in storage pool""" # To retain the old value of created_at, select from existing query = """ INSERT OR REPLACE INTO summary ( volname, size, created_at, updated_at ) VALUES ( ?, ?, COALESCE((SELECT created_at FROM summary WHERE volname = ?), datetime('now', 'localtime')), datetime('now', 'localtime') ) """ self.cursor.execute(query, (self.volname, size, self.volname)) self.conn.commit() def update_pv_record(self, pvname, size): """Update Each PV size""" # To retain the old value of created_at, select from existing query = """ INSERT OR REPLACE INTO pv_stats ( pvname, size, hash, created_at, updated_at ) VALUES ( ?, ?, ?, COALESCE((SELECT created_at FROM pv_stats WHERE pvname = ?), datetime('now', 'localtime')), datetime('now', 'localtime') ) """ pv_hash = get_volname_hash(pvname) self.cursor.execute(query, (pvname, size, pv_hash, pvname)) self.conn.commit() def remove_pv_record(self, pvname): """Remove PV related entry when PV is deleted""" self.cursor.execute("DELETE FROM pv_stats WHERE pvname = ?", (pvname, )) self.conn.commit() def get_stats(self): """Get Statistics: total/used/free size, number of pvs""" self.cursor.execute("SELECT COUNT(pvname), SUM(size) FROM pv_stats") number_of_pvs, used_size_bytes = self.cursor.fetchone() self.cursor.execute("SELECT volname, size FROM summary") _, total_size_bytes = self.cursor.fetchone() if total_size_bytes is None: total_size_bytes = 0 if used_size_bytes is None: used_size_bytes = 0 if number_of_pvs is None: number_of_pvs = 0 return { "number_of_pvs": number_of_pvs, "total_size_bytes": total_size_bytes, "used_size_bytes": used_size_bytes, "free_size_bytes": total_size_bytes - used_size_bytes }
Neuroinflammation and Neuronal Loss Precede A Plaque Deposition in the hAPP-J20 Mouse Model of Alzheimers Disease Recent human trials of treatments for Alzheimers disease (AD) have been largely unsuccessful, raising the idea that treatment may need to be started earlier in the disease, well before cognitive symptoms appear. An early marker of AD pathology is therefore needed and it is debated as to whether amyloid-A? plaque load may serve this purpose. We investigated this in the hAPP-J20 AD mouse model by studying disease pathology at 6, 12, 24 and 36 weeks. Using robust stereological methods, we found there is no neuron loss in the hippocampal CA3 region at any age. However loss of neurons from the hippocampal CA1 region begins as early as 12 weeks of age. The extent of neuron loss increases with age, correlating with the number of activated microglia. Gliosis was also present, but plateaued during aging. Increased hyperactivity and spatial memory deficits occurred at 16 and 24 weeks. Meanwhile, the appearance of plaques and oligomeric A were essentially the last pathological changes, with significant changes only observed at 36 weeks of age. This is surprising given that the hAPP-J20 AD mouse model is engineered to over-expresses A. Our data raises the possibility that plaque load may not be the best marker for early AD and suggests that activated microglia could be a valuable marker to track disease progression. Introduction Alzheimer's disease (AD) is a neurodegenerative disorder characterized symptomatically by impaired memory, alterations to personality and decreased visual-spatial skills. Pathologically, AD is characterized by a loss of neurons, central inflammation, amyloid-b (Ab) aggregation into plaques and by the formation of neurofibrillary tangles (NFTs) consisting of hyperphosphorylated tau. Of these hallmarks, plaque load has historically been regarded as the definitive diagnosis of AD at autopsy of a person who had dementia. Plaques result from the cleavage of the Ab precursor protein (APP) by band c-secretases into 39-43 amino acid Ab peptides within the cerebral cortex, hippocampus and amygdala. In the normal state, APP is cleaved to produce a fragment of 40 amino acids in length termed Ab 40. However, in AD, cleavage often results in an overproduction of the more fibrillogenic form, Ab 42, which can form neuritic plaques. Since plaque load has been regarded as both a hallmark and cause of AD, numerous recent drug trials have focused on reducing fibrillogenic Ab. Unfortunately, to date these clinical trials have largely failed, raising the notion that the treatments are being delivered too late in the disease progression, and/or that reducing Ab load may not be the best target for preventing AD progression. Plaque load has long been considered to be the major hallmark and therapeutic target for AD, and as such it is now being extensively investigated as an early prognostic marker of AD. Consequently, the first FDA-approved Ab imaging ligand (Amyvid TM ), which detects neuritic plaques, has recently been released. However, there is still debate as to the clinical relevance of neuritic plaques as the correlation between plaque deposition and cognitive status is not clear. Furthermore, plaques can be detected in people without cognitive deficits indicating that plaque load may not be the most precise biomarker for AD. While the pathognomonic hallmarks of AD include plaques, AD is also associated with NFTs, neuronal loss and increased neuroinflammation. Neuronal loss is usually prominent in the hippocampus, especially the CA1 region, and is further detected throughout the cerebral cortex, increasing with disease progression. In addition, postmortem studies have also demonstrated significant neuroinflammatory changes in brain tissue from AD patients. Microglia, the brain's local macrophage, and astrocytes are known to produce pro-inflammatory cytokines such as tumor necrosis factor-alpha (TNF-a) and interleukin-6 (IL-6) when activated. These, and other, cytokines have been implicated in neurodegeneration and plaque formation. Despite an understanding that neuroinflammation and neuronal loss contribute to disease progression, the timing of these events is undetermined. It is apparent from the current debate that a full understanding of the time course of AD pathology as it relates to symptoms is required, both to allow accurate diagnosis and to potentially identify events early in disease that could be targeted for treatment. In this study we therefore aimed to determine the timing of common pathological markers of AD including Ab oligomer formation, Ab plaque load, neuronal loss, and neuroinflammation. These classical hallmarks have previously been reported in mouse models of AD that overexpress APP. In particular, the J20 mouse model, generated by Mucke et al. is of interest as it develops early plaque formation from several months of age, has severe synaptic dysfunction, and is susceptible to seizure activity. This line expresses human APP (hAPP) bearing two mutations; the Swedish (K595N) and Indiana (M596L) mutations. However, the timing of pathological events has not been well characterized in the hAPP-J20 mouse model. In order to address the timing of pathological events, we adopted a highly accurate and unbiased stereological counting method to detect age-dependent changes in the number of neurons, astrocytes, and microglia in the hippocampus of hAPP-J20 mice and their wild-type (WT) littermates. Tau hyperphosphorylation does not occur in these mice and was therefore not investigated in this study. By accurately quantifying cell numbers, we have identified that neuronal cell loss and inflammatory changes occur well in advance of the formation of Ab plaques. Current pharmacological trials are based on reducing plaque load and significant worldwide effort is being made to identify methods of imaging plaques as a marker of disease progression. Our findings therefore have important therapeutic implications because they suggest that plaque load may be among the last events, occurring late in the disease process, after cell loss and inflammatory elevation. Mice Male hemizygous transgenic (hAPP-J20) and non-transgenic mice (WT) were from the J20 line, which express h-APP containing both the Swedish and Indiana mutations, under a PDGF-b chain promoter. Mice were housed at a maximum five mice per cage, until the study began, at which time mice were housed individually. Mice were kept on a 12 h light/dark cycle (lights on at 7:00 am). Food and water were available ad libitum until dietary restrictions began. All animal experiments were performed with the approval of the Garvan Institute and St. Vincent's Hospital Animal Ethics Committee, in accordance with National Health and Medical Research Council animal experimentation guidelines and the Australian Code of Practice for the Care and Use of Animals for Scientific Purposes. Immunofluorescence Mice were anesthetized with ketamine (8.7 mg/mL) and xylazine (2 mg/mL) and transcardially perfused with 4% paraformaldehyde (PFA). Brains were harvested and postfixed in 4% PFA for 6 h before being transferred to 30% sucrose. Brains were sectioned coronally (40 mm) with a cryostat. Free-floating sections were used. For the detection of Ab oligomers, sections were washed three times in phosphate buffered saline (PBS) and incubated for 1 h at room temperature in 15% Fetal Bovine Serum (FBS) +0.1% Triton-X 100 (TX-100) blocking solution. Sections were incubated overnight at 4uC in the anti-Ab oligomer antibody, A11 (1:100, Millipore). Sections were washed three times in PBS and incubated in Alexa Fluor 594 Goat anti-rabbit IgG (1:250, Invitrogen) for 3 h at room temperature. Sections were mounted and cover slipped with Kaisers glycerol gelatin solution (Merck). Slides were imaged using a Zeiss Axioplan upright fluorescence microscope with Zeiss Axiocam MRm digital camera. Digital images were captured using Axiovision V 4.8.1.0 software. Quantification of Total Ab Quantification of the 6E10 staining was performed using the Image-Pro Plus v.6.0 image analysis system to analyze the percent area occupied by positive staining. Images from the hippocampal region subfield at the antero-posterior (AP) positions from bregma between 21.34 mm and 22.3 mm were collected at 106magnification (five sections per animal). Captured images were imported into Image-Pro Plus and an intensity threshold level was set to allow for the discrimination between 6E10 positive staining and background labeling. The percentage of positive staining was calculated as the Ab deposition load. Ab Plaque Quantification Thioflavine S staining was used to determine fibrillar Ab plaque deposition. Sections were slide mounted and allowed to dry, prior to being washed with distilled water and treated with 70% and 80% EtOH for five minutes. Slides were incubated for 15 minutes with 1% thioflavine S in 80% ethanol. Plaque counts were conducted in the hippocampal region subfield from five sections per animal at the antero-posterior (AP) positions from bregma between 21.34 mm and 22.3 mm. All plaque counts were conducted manually and were blind to genotype and age. Slides were imaged using a Zeiss Axioplan upright fluorescence microscope with Zeiss Axiocam MRm digital camera. Digital images were captured using Axiovision V 4.8.1.0 software. Dot Blot Mice were cervically dislocated and the hippocampus was rapidly dissected from the brain of hAPP-J20 and WT mice and frozen at 280uC until use. Tissue was homogenized in RIPA buffer supplemented with protease inhibitors. Protein concentrations of the supernatant were measured using a Bradford assay and samples were adjusted to the same concentrations with SDS buffer. 20 mg of extract was applied to a nitrocellulose membrane and air-dried. Membranes were incubated in a 10% solution of nonfat dry milk for 1 h at room temperature and overnight at 4uC in A11 (1:1000, Millipore). Membranes were then washed, before being incubated in HRP-conjugated secondary and visualized by ECL. Films were scanned and Ab oligomer levels were quantified using Image J Software. For quantification of dot blots, the raw values obtained from hAPP-J20 mice were adjusted with the values obtained from the WT mice. Ab ELISA Hippocampi from hAPP-J20 mice were weighed and homogenized in 5vol/wt of Tris-buffered saline (TBS) (Tris-HCL 50 mM pH 7.6; NaCl 150 mM; EDTA 2 mM) containing a cocktail of protease inhibitors. Samples were then suspended in 2% SDS containing protease inhibitors and centrifuged at 100,000 g for 60 minutes at 4uC. The supernatant was collected for the soluble Ab ELISA. The Ab levels were determined by using the commercially available BetaMark Total Beta-Amyloid Chemiluminescent ELISA Kit (Covance). Stereology Quantification of cell population estimates were made using Stereo Investigator 7 (Microbrightfield) as previously described. Estimates were conducted on the dorsal hippocampus at the antero-posterior (AP) positions from bregma between 21.34 mm and 22.3 mm. For neuronal population estimates, a minimum 20 sampling sites were sampled per section on a grid size of 84 mm660 mm and a counting frame size of 30 mm630 mm. For GFAP-positive astrocyte population estimates, a minimum of 30 sampling sites per section on a grid size of 68 mm668 mm and a counting frame size of 30 mm630 mm. For CD68-positive microglial population estimates, a minimum of 40 sampling sites were sampled per section on a grid site of 114 mm668 mm and a counting frame size of 65 mm665 mm. For all cell population estimates, a guard zone of 5 mm and a dissector height of 10 mm were used. Each marker was assessed at one in every sixth section, with a total of five sections being sampled. The regions sampled included the CA3 and CA1 regions of the hippocampus for neuronal and astrocyte populations. Microglia populations were sampled within the borders of the CA1, CA3 and dentate gyrus (DG) regions of the hippocampus. All stereological cell counts were performed blind to genotype and age. Behavior Open field test. The open field test arena (40640 cm) was situated in a large box with clear plexiglass walls, no ceiling, and a white floor. Each chamber was set inside a larger soundattenuating cubicle with lights illuminating the arena and a fan to eliminate background noise. Mice were placed into the center of the arena and allowed to explore the test box for 10 minutes, while a computer software program (Activity Monitor; Med Associates) recorded activity via photobeam detection inside the testing chambers as a measure of general activity levels. The total distance traveled over the course of the 10 minutes was recorded. The arena was cleaned with 70% ethanol (EtOH) between each mouse. Elevated plus test. The elevated plus-maze consists of four arms (77610 cm) elevated (70 cm) above the floor. Two of the arms contained 15 cm-high walls (enclosed arms) and the other two consisted of no walls (open arms). Each mouse was placed in the middle of the maze facing a closed arm and allowed to explore the maze for five minutes. A video camera recorded the mouse and a computer software program (Limelight; Med Associates) was used to measure the time spent in the open arms, as an indication of anxiety-like behavior. The maze was cleaned with 70% EtOH between each mouse. Radial arm maze. The radial arm maze (RAM) consists of eight arms (6569 cm), extending radially from a central arena (35 cm diameter), elevated (90 cm) above the ground. Each arm and the central arena were made of plexiglass, with enclosing walls made of clear plexiglass. The RAM was cleaned with 70% EtOH between each mouse. Mice were individually housed and restricted to 85% of their original body weight for one week prior to the commencement of RAM testing. On the first and second day, mice were habituated to the maze by being placed into the central arena, with each of the eight arms baited with sweetened condensed milk, and were allowed to explore the maze for 10 minutes. Starting on the third day, and continuing for 24 days twice a day, mice were subjected to a reference memory task, where the same three of the eight arms were baited with sweetened condensed milk. The training trial continued until all three baits were retrieved or until five minutes had elapsed. After a 14-day rest period mice were presented to a retention trial where the same arms were baited with sweetened condensed milk. An investigator recorded measures, with the number of successful entries into the baited arms (where the sweetened condensed milk was consumed) being divided by the total number of entries made. Data is presented as ''Session'', consisting of two days (a total of four trials). Fear Conditioning Training and testing took place in two identical cube-shaped fear-conditioning chambers (32627626 cm; Med Associates Inc.) that had a clear plexiglass door, ceiling and rear wall and grey aluminum side walls. Each chamber had a removable grid floor, which consisted of 36 parallel rods spaced 8 mm apart. Positioned under the grid was a removable grey aluminum tray for collection of waste. The rods were connected to a shock generating and scrambling system, which delivered a current to elicit a foot shock. This system was connected to and controlled by computer software (FreezeFrame2, Actimetrics). A video camera, which was positioned in front of the chambers, recorded the behavior of the mice during training and testing. The fear-conditioning chamber was cleaned with 70% EtOH and the waste tray was scented with aniseed essence between each mouse. On the conditioning day, mice were placed into a fearconditioning chamber in which the environment (context) was controlled. Mice were allowed to explore the context freely for 1 minute prior to receiving a single moderate footshock (0.5 mA, 2s). Following shock, all mice remained in the chamber for 30 seconds and were then immediately returned to their homecages. On the following day, the mice were exposed to the same context and behavior was recorded for three minutes. Freezing was assessed as a measure of fear on all days using a 4 second sampling method by investigators, who were blind to the genotype. The number of observed freezes was averaged and divided by the total number of samples taken to yield a percentage of freezing. Data is presented as the average percentage of freezing during the three minutes test period. Statistical Analysis All statistical analysis was performed using the statistical package SPSS v19 (Graduate pack) (SPSS Inc., Chicago, IL, http://www.spss.com). Differences between means were assessed, as appropriate, by one-or two-way ANOVA with or without repeated measures, followed by Bonferroni post hoc analysis. Correlations were assessed by simple linear regression. For behavioral studies, experiments were conducted three times for correct statistical approach. Ab Expression and Plaque Formation Occurs in an Age-Dependent Manner An important characteristic of AD is the accumulation of the protein Ab and the resulting formation of plaques throughout the brain. To determine whether hAPP-J20 mice exhibit agedependent accumulation of cellular and extracellular Ab, we measured total Ab using immunohistochemical techniques with the 6E10 antibody in mice of different ages. We observed neuronal Ab throughout the hippocampus at 6, 12, 24 and 36 weeks (Figures 1A) Quantification of 6E10 immunoreactivity revealed a significant increase in total Ab levels with age ( Figure 1E; F = 23.14 p,0.001). A Bonferroni post-hoc analysis revealed a significant increase in Ab at 12 (p,0.05), 24 (p,0.05) and 36 weeks (p,0.001) when compared to 6 weeks ( Figure 1E). Hippocampal oligomeric Ab expression also increased in an agedependent manner, and was significantly present by 36 weeks of age (p,0.05; Figures 1C, 1D and 1G) and interestingly appeared to form along the axons of neurons ( Figure 1C). In addition to total and oligomeric Ab, a significant number of plaques were present at 36 weeks of age (p,0.001) ( Figure 1B and 1F). This indicates that the rise in hippocampal monomeric and oligomeric Ab precedes plaque formation by a significant margin, as described in other models of AD. We further determined buffer-soluble hippocampal Ab in hAPP-J20 mice at 6, 12, 24 and 36 weeks of age by a total Ab sandwich ELISA. This showed a significant increase in total Ab levels with age ( Figure 1H; F = 7.761 p,0.001). A Bonferroni post-hoc analysis revealed a significant difference between 6 (p,0.001) and 12 weeks (p,0.05), when compared to 36 weeks of age. Combined, these results demonstrate age-dependent expression of Ab that is followed by senile plaque formation at later stages in the hippocampus of hAPP-J20 mice. hAPP-J20 Mice Exhibit Loss of Neurons in the CA1, but not CA3, Region of the Hippocampus Given the high abundance of Ab in the hippocampus of hAPP-J20 mice starting at 6 weeks of age, and its association with cell loss in other models, we hypothesized that Ab expression would be associated with neurodegeneration in the hAPP-J20 mouse model. To examine whether hAPP-J20 also exhibits agedependent neuronal cell loss in the CA3 and CA1 regions of the hippocampus, we performed unbiased stereological cell counts of NeuN-labelled neurons under brightfield microscopy. Interestingly, analysis of the neuronal population in the CA3 regions of the hippocampus (Figure 2A) demonstrated no significant agedependent neuronal cell loss from 6, 12, 24 and 36 weeks of age (interaction (F = 0.783 p = 0.514); age (F = 0.645 p = 0.593); genotype (F = 2.107 p = 0.158)). However, we observed a significant genotype by age interaction in the CA1 region of the hippocampus (F = 5.264 p,0.01; Figure 2B), thus suggesting age-dependent progressive loss of neurons. Therefore, separate one-way ANOVAs were conducted on genotype and age. Six-week-old hAPP-J20 mice did not show neuronal cell deficits in the CA1 as compared to their age-matched WT littermates. However, in contrast, significant neuronal loss in the CA1 was observed in 12 (F Figure 2C and 2D) old hAPP-J20 mice, when compared to their age-matched WT controls. A one-way ANOVA of genotype indicated significant cell loss in the CA1 of hAPP-J20 mice with age (F = 4.807 p = 0.017). A Bonferroni post-hoc analysis revealed a significant difference in neuronal cell population between 6 week and 36-week-old hAPP-J20 mice (p,0.001). Additionally, there was a significant correlation of neuronal cell loss and total Ab expression (Table 1; p,0.01). This is consistent with the idea that Ab may be playing a direct or indirect role in cell death in the CA1 region of the hippocampus, or, in theory, that cell death is playing a role in Ab accumulation. hAPP-J20 Mice Exhibit an Increased Astrocyte Population, Reaching Saturation at 24 Weeks Gliosis is a hallmark of AD and is characterized by the presence of activated astrocytes. Astrocyte activation results in morphological changes, including the shortening and thickening of processes, increased proliferation and the release of pro-inflammatory factors. To determine the number of glial cells in the hippocampus of the hAPP-J20 mouse model, we performed stereological cell counts in the CA3 and CA1 regions of the hippocampus for astrocyte cells that express the typical marker, GFAP. Our results show that at 36 weeks of age ( Figure 3A), hAPP-J20 possessed more gliotic astrocytes when compared to age-matched WT mice ( Figure 3B). There was a significant interaction effect of genotype by age for the CA3 region (F = 4.013 p = 0.021; Figure 3C). Therefore, the effect of genotype and age on glial populations in the CA3 was analyzed separately using a one-way ANOVA. Significant differences were apparent in hAPP-J20 mice that were 24 weeks (F = 9.454 p,0.05) and 36 weeks old (F = 61.728 p,0.001) as compared to age-matched WT controls. There was a trend towards significance of age in the CA3 (F = 3.197 p = 0.06) indicating that increased gliotic astrocytes may be agedependent in hAPP-J20 mice. Results were similar in the CA1 region of the hippocampus, where there was a significant genotype by age interaction effect (F = 4.013 p = 0.021; Figure 3D). A one-way ANOVA of genotypes revealed significant differences in the number of gliotic astrocytes at 12 (F = 7.862 p,0.05) and 24 weeks of age (F = 15.478 p,0.01), though interestingly not at 36 weeks of age. There was an overall significant age effect on the number of gliotic astrocytes in the CA1 region of the hippocampus of hAPP-J20 mice (F = 5.722 p,0.05). A Bonferroni post-hoc analysis revealed a significant difference between 6 weeks and 24 weeks of age (p,0.05). In addition, astrocyte numbers in the CA1 region correlated significantly with total Ab levels ( Table 1; p,0.05). Combined, these results indicate that increases in reactive astrocyte numbers in the hAPP-J20 mouse model is progressive with age, though peaks at 24 weeks of age. Microglial Activation Precedes Amyloid Plaque Deposition Microglial activation has been studied extensively in both mouse models and patients of AD. Microglial activation is characterized by morphological changes from ramified (quiescent) morphology to amoeboid (activated) morphology, the release of pro-inflammatory cytokines and increased microglial cell number. In addition, activated microglia express the marker CD68. As an indicator of increased inflammation we analyzed brain tissue from hAPP-J20 mice for changes in the number of CD68-positive activated microglial cells in the area of the hippocampus bordered by the CA1, CA3 and DG regions of the hippocampus. CD68positive microglia can be observed in clusters in the hAPP-J20 ( Figure 4B) when compared to WT ( Figure 4A) mice at 36 weeks of age. Unbiased stereology was adopted to count CD68 positive microglia. A two-way ANOVA of genotype and age revealed an interaction effect (F = 5.264 p,0.05) on the number of activated microglia in the hippocampus. Therefore, one-way ANOVAs were performed separately on genotype and age. A oneway ANOVA of genotypes revealed significant differences at 24 (F = 25.298 p,0.01) and 36 weeks of age (F = 23.425 p,0.01), but not at 6 and 12 weeks of age when compared to age-matched WT littermates. There was an overall significant age effect (F = 6.470 p,0.01). A Bonferroni post-hoc analysis revealed a significant difference between 6 weeks and 36 weeks of age (p,0.01). This indicates that activated microglia increase with age in the hAPP-J20 mouse models of AD. As found with reactive astrocytes, microglia cell populations correlated with the expression of total Ab (Table 1; p,0.05). In addition, microglia cell populations inversely correlated with the number of neurons in the CA1 region of the hippocampus (p,0.05). This shows that activated microglia populations are closely associated with Ab expression and neuronal cell loss. Figure 1. Age-dependent Ab expression and plaque deposition in the hAPP-J20 mice. (A) 6E10 immunohistochemistry illustrated increased neuronal Ab from 6 to 12, 24 and 36-week-old hAPP-J20 mice (quantified in E). (B) Ab oligomer formation was not apparent until 24 weeks of age and appeared by 36 weeks of age when it appeared to be associated with neuronal processes. (C) Plaques were present by 36 weeks of age, but not earlier (quantified in F). (D and G) A dot plot quantification with the Ab-oligomer specific antibody, A11, revealed increases in Ab oligomers through aging in the hAPP-J20 mouse, with a significant increase in 36-week-old hAPP-J20 mice. (H) Quantification of Ab by ELISA revealed an increase in total Ab from 6 (p,0.05) and 12 (p,0.05) to 36 weeks of age in the hAPP-J20 mouse. Each value represents the mean 6 standard error of the mean (SEM). *p,0.05, **p,0.01, ***p,0.001. doi:10.1371/journal.pone.0059586.g001 hAPP-J20 Mice Exhibit Hyperactivity, but no Differences in Anxiety In addition to anatomical changes, AD patients and mouse models of AD exhibit profound behavioral alterations. We tested behavioral changes in the hAPP-J20 mouse model using the elevated plus maze and open field test. The elevated plus maze and open field tests are often used as a measure of anxiety and motor activity, respectively. Several studies have indicated that hAPP-J20 mice have increased motor activity and spend more time in the open arm of the elevated plus maze than WT controls, indicating hyperactivity and lower levels of anxiety. In contrast, we found that although the hAPP-J20 mice tend to spend more time in the open arms than the WT controls at 16 (F = 1.97, p = 0.176) and 24 weeks of age (F = 6.024, p = 0.073), it is not significant (Figures 5A and 5B). However, as shown in Figures 5C and 5D, locomotor activity in hAPP-J20 was significantly increased at 16 weeks (F = 13.91, p,0.001) and 24 weeks of age (F = 6.024, p,0.05) compared to WT controls. Combined, these results indicate that hAPP-J20 mice exhibit significantly increased levels of locomotor activity and no changes in anxiety during later stages of AD progression. hAPP-J20 Mice Show Spatial Reference Memory Deficits at 16 and 24 Weeks of Age AD is an amnesic disorder and is often associated with profound memory loss. It has been shown that in hAPP-J20 mice, deficits in spatial memory and learning appear as the mice age. A powerful tool for measuring spatial memory and learning is the RAM. Within the RAM, mice use spatial cues to find the hidden food reward ( Figure 6A). By using a reference memory version of the RAM, we determined whether hAPP-J20 mice exhibit spatial memory and learning deficits at 16 (Figure 6B-C) and 24 weeks of age ( Figure 6D-E). An ANOVA with repeated measures of 16-week-old hAPP-J20 mice and WT mice revealed a significant genotype effect, trial, and a genotype by trial interaction in reference memory (p,0.05; Figure 6B). These results indicate that 16-week-old hAPP-J20 mice demonstrate spatial reference memory deficits. As expected, we observed similar deficits in spatial reference memory in 24-week-old hAPP-J20 mice (p,0.05; Figure 6D). hAPP-J20 Mice do not Show a Deficit in Contextual Fear Conditioning There is a vast amount of evidence to show contextual memories are hippocampal-dependent. As such, contextual fear conditioning offers a valuable tool to assess both short-term and long-term memory. Fear conditioning deficits have been Figure 4. Quantification of CD68-positive activated microglia in hAPP-J20 mice. CD68-positive microglia were observed in the hippocampus of (A) WT mice compared to (B) their hAPP-J20 littermates at 36 weeks of age. Quantification of CD68-positive cell numbers revealed significant increases in cell numbers at 24 (p,0.01) and 36 weeks of age (p,0.01) in hAPP-J20 mice compared to their age-matched WT littermates. Further, a significant increase in CD68 microglia occurred between 6 week and 36-week-old hAPP-J20 mice (p,0.01). Each value represents the mean 6 standard error of the mean (SEM). **p,0.01. doi:10.1371/journal.pone.0059586.g004 detected in other mouse models of AD, though not in the hAPP-J20 mouse line. Since we detected neurodegeneration and deficits in spatial learning, we hypothesized contextual fear memory and learning may also be impaired in the hAPP-J20 mouse model of AD. Figure 7A shows there is no difference in freezing behavior at 28 weeks of age (F = 1.308, p = 0.7321) as compared to age-matched WT mice. In addition, mice assessed at the 36 weeks of age also did not show a difference in freezing behavior (F = 0.433, p = 0.511) as compared to age-matched WT mice. In order to determine if long-term memory was impaired in these mice, a retention test was performed on 36- week-old mice, 28 days after their original training in the paradigm. Somewhat surprisingly,at 40 weeks of age, no differences occurred in the long-term retention test (F = 0.140, p = 0.711; Figure 7B). Discussion It has recently been suggested that successful treatment of AD may require early intervention. This requires early diagnosis, which in turn depends on identifying early pathological hallmarks of disease. We therefore aimed to identify cellular correlates of early AD in an APP overexpressing mouse, known as the hAPP-. Spatial learning and memory deficits in hAPP-J20 mice. (A) Schematic representation of the radial arm maze. Filled circles represent the baited arms (B) hAPP-J20 mice had significantly impaired spatial reference memory and learning at 16 weeks of age (p,0.05) when compared to age-matched WT littermates. (C) 16-week-old hAPP-J20 mice had significant deficits in spatial reference memory and learning retention (p,0.05) when compared to age-matched WT littermates. (D) 24-week-old hAPP-J20 mice also showed significantly impaired spatial reference memory and learning (p,0.05) when compared to age-matched WT littermates. (E) Spatial reference memory and learning retention was significantly impaired in 24-week-old hAPP-J20 mice (p,0.05). Each value represents the mean 6 standard error of the mean (SEM). *p,0.05, **p,0.01. doi:10.1371/journal.pone.0059586.g006 J20 mouse model. These mice show plaque formation by seven months of age but, interestingly, no tau hyperphosphorylation at any of the major phosphorylation sites. Our data indicates that AD pathology including neuronal loss, inflammation and behavioral impairment all occurs well before the formation of Ab plaques, indicating that plaque load may not be the best early diagnostic marker of AD. Therefore, other markers of disease may need to be explored to track the progression of AD. Neurodegeneration has been described in many mouse models of AD as well as AD patients. However, previous studies have suggested that neuronal loss does not occur in the hAPP-J20 mouse line. Our unbiased accurate estimate of neuronal numbers in these mice revealed a progressive, agedependent neurodegeneration in the CA1 region, beginning at 12 weeks and reaching a 32% loss by 36 weeks (Figure 8). Interestingly, cell loss does not occur in the CA3 region. This selective loss of CA1 neurons parallels studies of human AD patients that show greater neuron loss in the CA1 compared to the CA3 region. Though the exact reasons for this regional difference are unknown, they may be due to differential expression of both NMDA and AMPA receptor subunits, rendering the CA1 neurons more susceptible to excitotoxic cell death. Although the precise mechanisms leading to neurodegeneration in AD remain unclear, many studies indicate that Ab could play a role in cell death by inducing mitochondrial oxidative stress and other processes. In this study, we have shown that there is a correlation between cell death in the CA1 region of the hippocampus and total Ab expression, suggesting that Ab may be contributing directly or indirectly to cell death in this region. Importantly, while neurodegeneration occurred in an age-dependent manner, and correlated strongly with the expression of total Ab, cell loss was observed at least 12 weeks before the onset of plaques. Our data indicates that Ab is present as early as 6 weeks of age and that this is most likely to be monomeric Ab. Oligomeric Ab formation appears at 24 weeks of age, and is significantly present by 36 weeks, forming along axons of neurons. Most importantly, plaque formation did not occur significantly until 36 weeks of age, indicating that plaque load is not the major driver of cell loss in this model of AD. While our study does not address current questions regarding the role of Ab 40 and Ab 42, it does suggest that plaque load need not be the major contributor to neurodegeneration, which begins at 12 weeks of age. Inflammation is implicated in the etiology of AD. Many studies indicate that the release of pro-inflammatory cytokines from microglia and astrocytes can cause direct cell death of neurons both in vivo and in vitro.We have shown, through quantitative analysis, that the numbers of CD68-positive microglia was significantly increased early in the hAPP-J20 mouse model. Our data also shows that accumulation of microglia correlates with cell death in the CA1 region of the hippocampus. Microglial accumulation around plaques has been extensively described in both AD patients and transgenic mouse models of AD and this is associated with elevation in cytokine levels. Our quantitative stereological analysis revealed significant increases in activated (CD68-positive) microglia prior to Ab plaque deposition. In addition, the change in CD68-positive microglia significantly correlates with the extent of CA1 neuronal cell loss. Our data raises the possibility that imaging microgliosis might offer an approach to monitor AD progression in humans. Interestingly, astrogliosis also begins in these mice, starting at 12 weeks of age, though plateaus later in the disease progress. Other AD models have shown age-dependent increases in astrogliosis, though it is not clear why this phenomenon occurs in the hAPP-J20 model. Nonetheless, our results are consistent with recent patient data, which showed no correlation between microgliosis and astrogliosis with plaque load. The correlation between Ab and microglia, and microglia and neuronal cell death in the CA1 region of the hippocampus, supports the theory that monomeric and oligomeric Ab causes the activation of microglia, which in turn is able to release proinflammatory cytokines, stimulating toxic signaling pathways and contributing to cell death. Many pro-inflammatory cytokines have been shown to directly contribute to neurodegeneration and, in parallel, molecules secreted from neurons can promote further inflammatory processes. This order of events is consistent with the literature on the pro-inflammatory cytokines that these cells secrete controlling the promoter activity of the APP gene, thus upregulating production of APP generation in many tissues, including brain. Thus, as these processes are occurring prior to plaque onset in the hAPP-J20 mouse model, it is possible that neurodegeneration could be occurring due to a cycle of inflammation and neurodegeneration that further promotes inflammation. In this model activation of inflammatory cells, either by Ab or by other mechanisms is a key initiating event in AD that leads to a cycle of neurodegeneration and further inflammation. Behavioral impairments are a major constituent of AD and are readily described in mouse models of AD. Previous studies have characterized the hAPP-J20 mouse model using the Morris Water Maze (MWM), however interpretation has been confounded by variable results in the cued version of the MWM. Therefore, in this study, spatial memory and learning was investigated using the RAM. The RAM provides an advantage over the MWM as the hAPP-J20 mouse model has a high tendency to float and trend for thigmotactic swimming. In addition, the MWM can result in physical fatigue and hypothermia, which does not occur in the RAM. Furthermore, the RAM takes advantage of the animals' natural food exploratory behavior. Our analysis of learning and memory by RAM revealed that the hAPP-J20 mice display decreased learning and memory in a hippocampal-dependent spatial memory task. Specifically, we have revealed that spatial reference memory deficits occur in the RAM at 16 and 24 weeks of age in the hAPP-J20 mouse model. Moreover, we also found impairments in long-term memory occurred 14 days following the RAM training. Therefore, memory impairments occurred during the period that cell loss and neuroinflammation occurs, but well before the onset of plaques. These learning deficits seen in our study could not be due to increased motor activity, since hyperactivity would correspond to a decrease in the percentage of arms correct from the first session. As the percentage of correct arms was the same for both hAPP-J20 and WT at 16 and 24-weeks of age, this indicates that there is no correlation between hyperactivity and movement within the RAM. Importantly, vision is not affected in the hAPP-J20 model. We also tested hAPP-J20 mice in a context fear-conditioning paradigm to assess short-and long-term hippocampal-dependent contextual memory. We found no deficits in contextual fear conditioning at 28 weeks and 36 weeks of age. In addition, no long-term contextual fear memory and learning deficits were detected in the fear-conditioning paradigm. The results are consistent with a recent study, which indicated spatial deficits but no deficits in fear conditioning in the hAPP-J20 model. It is possible that compensatory mechanisms and/or alterations to functionality of the fear circuit may account for the lack of deficit, even in the absence of full hippocampal function. There has been significant debate about the best approach for tracking AD progression via PET. Since our quantitative stereological approach shows that CD68 positive cell numbers correlate closely with loss of neuronal cell numbers and with Ab expression, it is conceivable that a label of activated microglia may potentially aid as a marker to track progression of AD. Therefore our work raises a question as to whether PET imaging of a marker of activated microglia, while not diagnostic, might offer a useful way to track disease progression. Activated microglia can be detected in vivo using PET scan imaging, with the selective radioligand known as 11 C-PK11195, which is known to correlate with levels of CD68-positive microglia. Indeed, PET scanning in a small cohort of patients with mild cognitive impairments (MCI) has revealed the presence of activated microglia. 11 C-PK11195 labelling is significantly increased in AD patients and animal models. In addition 11 C-PK11195labelled activated microglia has been shown to correlate with AD patient Mini-Mental State examination scores. Since MCI has been shown to be a precursor for early AD there is therefore a considerable need to further investigate microglial markers, such as CD68, for PET scanning in a larger sample size of very early Figure 8. Time course of disease progression, as a percentage of hAPP-J20 6-week-old mice. Mice exhibit 32% loss of neurons in the CA1 region of the hippocampus between 6 weeks and 36 weeks of age. In addition, a 163% increase in the number of CD68-positive microglia and a 62% increase in the number of CA1 GFAP-positive astrocytes occurred between 6 weeks and 36 weeks of age. Total Ab expression increases by 242% between the ages of 6 weeks and 36 weeks of age. Small arrow represents plaque load in some mice, while larger arrow represents plaque load in all mice. doi:10.1371/journal.pone.0059586.g008 AD patients. CD68-positive microglia, combined with other markers, may be ultimately utilized to track AD progression. The consistent conclusion of our study, taken together with other studies, is that behavioral decline, neuronal cell death and inflammatory cell activation precede plaque deposition, providing a strong indication that neurodegenerative processes are occurring independent of Ab protein. Fundamentally this means that AD progressive decline may occur well before plaque deposition in patients. At present, the Ab protein is often regarded as a central component to brain degradation in AD. As such, imaging studies and therapeutic targets are largely based around decreasing Ab deposition in the brain; and new techniques such as MRI and PET scanning for Ab can only detect fibrillar forms, and are mostly directed at imaging plaques. In this study, we show that other hallmarks of AD, such as neuronal loss, neuroinflammation and behavioral deficits are vastly progressed before plaque onset in a mouse model of AD. Our study shows a correlation between activated microglia, Ab and neuronal cell loss, but not Ab deposition in plaques, highlighting the potential importance that microglia may play in the early development of degeneration and cognitive decline in AD. Therefore the imaging of microglia using PET could be a useful indicator for the progression and early detection of AD.
import { Component } from "@angular/core"; @Component({ selector: "nui-button-visual", templateUrl: "./button-visual-test.component.html", }) export class ButtonVisualTestComponent { public busy: boolean; }
Appetite, food intake, and plasma concentrations of cholecystokinin, ghrelin, and other gastrointestinal hormones in undernourished older women and well-nourished young and older women. Aging is associated with a reduction in appetite and food intake, predisposing to protein-energy malnutrition. The causes of this "anorexia of aging" are largely unknown. To investigate possible contributions of enhanced satiating effects of cholecystokinin (CCK) and reduced stimulation of food intake by ghrelin, eight undernourished older women , eight well-nourished older women (age, 77 +/- 0.9 yr; BMI, 23.7 +/- 0.8 kg/m), and eight well-nourished young women (age, 22 +/- 1.3 yr; BMI, 20.5 +/- 0.4 kg/m), in randomized order, ate on 1 d a 280-kCal preload and on the other no preload, 90 min before an ad libitum meal. At baseline the undernourished, but not the well-nourished, older subjects were less hungry (P < 0.05) than young subjects. Before and after the preload, plasma CCK levels were higher (P < 0.05) in the older than young subjects, with no difference between the older groups. Plasma ghrelin concentrations were higher in the undernourished than both well-nourished groups and decreased similarly after the preload in all groups. The preload suppressed food intake in the well-nourished older and young subjects (P < 0.05), but was without effect in the undernourished old. These observations suggest that reduced basal hunger, rather than increased meal-induced satiety, contributes to the anorexia of aging and that changes in CCK and ghrelin are unlikely to be responsible.
AB0709Switching from originator infliximab to biosimilar infliximab: efficacy and safety in a cohort of patients with established behets disease Background Infliximab (IFX) has been proved to be effective in several organ involvement of Behets Disease (BD). A recent report1 describing rapid loss of efficacy of biosimilar IFX after switching from originator IFX suggests the necessity to exercise caution regarding the automatic substitution of originator IFX with biosimilar IFX in patients achieving remission with originator IFX. Objectives The purpose of the present study was to describe our experience with biosimilar IFX CT-P13 in patients affected with BD, who were switched from originator IFX. Methods Retrieved data including demographic characteristics, clinical manifestations and previous treatments were collected. All patients met the ISG and/or ICBD classification criteria for Behets Disease. In order to evaluate disease activity, the BD Current Activity Form (BDCAF) has been evaluated before starting biosimilar, at three, six and nine months after switching to CT-P13. The occurrence of adverse events was also recorded. Wilcoxon matched-pairs signed-ranks test was carried out to evaluate differences between BDCAF distributions pre-switch and either at three, at six and at nine months after switching. Results Thirteen caucasian adult BD patients (mean age 39.77±7.46 years) with a mean disease duration of 12.54±4.21 years, underwent IFX treatment at licensed dosage for a period of 117.66±48.01 months. After 106.92±46.37 months of treatment with originator IFX, all of them were switched to CT-P13 biosimilar IFX. At 3 months after switching, none of them had discontinued CT-P13 biosimilar IFX treatment. No significant difference was noticed between BDCAF mean score assessed at switch and 3 months after switching (p=0.15). At 6 months follow up, 2/13 patients (15.38%) discontinued CT-P13 biosimilar IFX treatment, both for recurrence of mucocutaneous involvement. One out of 2 patients who discontinued CT-P13 IFX had previously experienced a disease flare under originator IFX therapy, requiring a modification of ongoing therapy. BDCAF mean score assessed before and 6 months after switching were not significantly different (p=0.81). Nine months after switching 2 out of the remaining 11 patients were lost at follow up. Once more, no difference was shown between BDCAF mean score assessed at switch and at 9 months follow up (p=0.85). No adverse events occurred during the observed period. Female n(%) 3 (23.08%) Age at Onset (mean±SD) 27.15±10.02 Clinical Manifestations n(%) Uveitis 10 (76.92) Oral Aphtosis 9 (69.23) Genital Aphtosis 7 (53.85) Cutaneous Involvement 7 (53.85) Concomitant Treatment n(%)* Colchicine 5 (38.46) csDMARDs 4 (30.77) Corticosteroids 1 (7.69)Abstract AB0709 Figure 1 Conclusions Despite the short follow up period, these data suggest that switching BD patients from originator IFX to CT-P13 seems to be effective and safe; only a small percentage of patients experienced relapse of symptoms, whereas a significant modification of BDCAF pre-switch and post-switch was not noticed. Although encouraging, these results need to be confirmed over a longer follow up period and on larger cohorts of patients. Reference Cantini F, et al. Rapid loss of efficacy of biosimilar infliximab in three patients with Behcets disease after switching from infliximab originator. Eur J Rheumatol4 :288290 Disclosure of Interest None declared
/// Create a new instance of `FsCacheService`. pub fn new( path: &str, dir: &str, tag: Option<&str>, blob_cache_mgr: Arc<BlobCacheMgr>, ) -> Result<Self> { info!( "fscache: create FsCacheHandler with dir {}, tag {}", dir, tag.unwrap_or("<None>") ); let mut file = OpenOptions::new() .write(true) .read(true) .create(false) .open(path)?; let poller = Poll::new().map_err(|_e| eother!("fscache: failed to create poller for service"))?; let waker = Waker::new(poller.registry(), Token(TOKEN_EVENT_WAKER)) .map_err(|_e| eother!("fscache: failed to create waker for service"))?; poller .registry() .register( &mut SourceFd(&file.as_raw_fd()), Token(TOKEN_EVENT_FSCACHE), Interest::READABLE, ) .map_err(|_e| eother!("fscache: failed to register fd for service"))?; // Initialize the fscache session file.write_all(format!("dir {}", dir).as_bytes())?; file.flush()?; if let Some(tag) = tag { file.write_all(format!("tag {}", tag).as_bytes())?; file.flush()?; } file.write_all(b"bind ondemand")?; file.flush()?; let state = FsCacheState { id_to_object_map: Default::default(), id_to_config_map: Default::default(), blob_cache_mgr, }; Ok(FsCacheHandler { active: AtomicBool::new(true), barrier: Barrier::new(2), file, state: Arc::new(Mutex::new(state)), poller: Mutex::new(poller), waker: Arc::new(waker), }) }
Ángel Fernández Artime Life Ángel Fernández Artime was born in Gozón-Luanco, Asturias, in 1960 to a fishing family. In 1970 his family moved to Astudillo, Palencia where he enrolled in boarding school. Three years after he entered the Salesian School of León, he joined the Salesian Order, doing his first religious profession at 18. In 1987 he was ordained a priest at 26 in that same city. Fernández holds a bachelor in Pastoral Theology, Philosophy and Pedagogy of the University of Valladolid. Following his ordination, he began his ministry as teacher of religion at the Santo Angel Salesian College of Avilés (Asturias) and was also director at the Salesian College of Ourense. Career As a member of the Salesian Province of León, Fernandez was member of the Provincial Council and Vice-Provincial. Between 2000 and 2006 he was Superior of that Province. He was selected to team with the organizers of the 26th General Chapter in Rome in 2008. In 2009 he was elected as Provincial for the Argentina South with headquarters in Buenos Aires. After his designation for a new position as Provincial in Sevilla, Spain, he was elected by the General Council as the new Rector Major. Fernandez worked with Cardinal Jorge Mario Bergoglio in Buenos Aires, who later became Pope Francis. As the new superior of his Order, he presided at the opening of the world celebrations of the 200th birthday of Saint John Bosco on January 24, 2014 in Turin.
An Introduction to Offshore Life Assurance Business ABSTRACT Over the last 10 years, in centres surrounding the United Kingdom, a cross-border insurance industry has been developing an industry which is exporting British expertise in life assurance and investment products on a large scale to a world-wide market. The industry is offshore life assurance. The purpose of this paper is principally to outline what this industry is and why it exists. The particular financial management and operational management issues resulting from this activity are highlighted and explored in subsequent sections. The paper concludes with an assessment of market trends and future development in what is a very young, dynamic and highly competitive market.
def create_cover(self): raise NotImplementedError('create_cover method not implemented!')
Stabilizing Grain Yield and Nutrition Quality in Purple Rice Varieties by Management of Planting Elevation and Storage Conditions Purple rice has become an interesting source of nutritional value among healthy cereal grains. The appropriate cultivation together with post-harvest management would directly benefit farmers and consumers. This study aimed (i) to determine the yield, grain nutritional quality, and antioxidant capacity of purple rice varieties grown at lowland and highland elevations, and (ii) to evaluate the effects of storage conditions on the stability of the rice nutritional value during six months of storage. The high anthocyanin PES variety grown in the lowlands had a higher grain yield than the plants grown in the highlands, but grain anthocyanin concentration had the opposite pattern. In the high antioxidant capacity KAK variety, grain yield and DPPH activity were not significantly different between plants grown at the two elevations. The storage of brown rice and vacuum-sealed packages were both found to preserve greater anthocyanin concentrations in PES, but there was no effect on the DPPH activity of KAK. The grain properties were not significantly different between storage at 4 °C and room temperature. This study suggests that the optimal cultivation practices and storage conditions would result in the higher yield and grain quality of purple rice varieties.
def authbroker_login_required(func): def decorated(request): if not has_valid_token(request): return redirect('authbroker_login') return func(request) return decorated
<gh_stars>1-10 import { Injectable } from '@angular/core'; import { AudioUtilService } from '../audioutil/audio-util.service'; @Injectable() export class RecorderService { constructor() { } init() { let Recorder = function (source, cfg) { let config = cfg || {}; let bufferLen = config.bufferLen || 4096; let numChannels = config.numChannels || 2; this.context = source.context; this.node = (this.context.createScriptProcessor || this.context.createJavaScriptNode).call(this.context, bufferLen, numChannels, numChannels); this._audioUtil = new AudioUtilService(); this._audioUtil.init({ sampleRate: this.context.sampleRate, numChannels: numChannels }); let recording = false, currCallback; this.node.onaudioprocess = (e) => { if (!recording) return; let buffer = []; for (let channel = 0; channel < numChannels; channel++) { buffer.push(e.inputBuffer.getChannelData(channel)); } this._audioUtil.record(buffer); } this.record = function () { recording = true; } this.stop = function () { recording = false; } this.exportWAV = (cb, type) => { currCallback = cb || config.callback; type = type || config.type || 'audio/wav'; if (!currCallback) throw new Error('Callback not set'); currCallback(this._audioUtil.exportWAV(type)); } source.connect(this.node); this.node.connect(this.context.destination); //this should not be necessary }; (<any>window).Recorder = Recorder; } }
/** * Class * Object template for Game client. * @author Jon Reyes */ public class Connect4Client { private String host = "localhost"; private Socket socket; private DataInputStream fromServer; private DataOutputStream toServer; private SimpleIntegerProperty moveProp = new SimpleIntegerProperty(-1); private SimpleStringProperty symbolProp = new SimpleStringProperty(); private Symbol symbol; public Connect4Client(){ connect(); } private void connect(){ try { System.out.println("Connecting to Server..."); // Create a socket to connect to the server socket = new Socket(host, 8000); System.out.println("Connected to Server."); // Create an input stream to receive data from the server fromServer = new DataInputStream(socket.getInputStream()); // Create an output stream to send data to the server toServer = new DataOutputStream(socket.getOutputStream()); }catch (Exception e) { System.out.println("Failed to connect to the Server."); e.printStackTrace(); } Thread client = new Thread(){ public void run(){ try { System.out.println("Waiting for Players..."); int ready = fromServer.readInt(); System.out.println("Checking if Ready..."); if (ready == 1) { System.out.println("Ready!"); symbol = readSymbol(); symbolProp.set(symbol.toString()); System.out.printf("You are Player %s.\n",symbol); while (true) { moveProp.set(getMove()); moveProp.set(-1); } } } catch(SocketException e){ System.out.println("Client Disconnected."); } catch(IOException e){ e.printStackTrace(); } catch (Exception e){ e.printStackTrace(); } } }; client.start(); } public void sendMove(int col){ try{ System.out.printf("Sending Player %s's Move to Server...\n",symbol); toServer.writeInt(col); System.out.println("Sent Move to Server."); } catch (IOException e){ e.printStackTrace(); } } public int getMove() throws IOException, SocketException{ Symbol active = symbol.equals(X)?O:X; int move = fromServer.readInt(); System.out.printf("Received Player %s's Move.\n",active); return move; } public Symbol readSymbol() throws IOException, SocketException{ return ((fromServer.readInt()==0)? X: O); } public Symbol getSymbol(){ return this.symbol; } public SimpleIntegerProperty moveProperty(){ return this.moveProp; } public SimpleStringProperty symbolProperty(){ return this.symbolProp; } public void close(){ try { this.socket.close(); } catch (IOException e) { e.printStackTrace(); } } }
A) Field of the Invention This invention relates to an apparatus and a method for manufacturing a semiconductor device, and more specifically relates to an apparatus and a method for growing a nitride semiconductor crystal film by using a metal organic chemical vapor deposition (MOCVD) method. B) Description of the Related Art A metal organic chemical vapor deposition (MOCVD) method is one of chemical vapor deposition methods and used mainly for growing semiconductor crystal. FIG. 6 is a schematic diagram showing an example of a conventional semiconductor manufacturing apparatus 200. For example, the semiconductor manufacturing device 200 consists of a reaction chamber 1, a susceptor 2, a substrate heater 3, a reactant gas supplying unit 4, a vacuum (exhaust) pump 5, a substrate rotating unit 7, a subflow gas source 8, a subflow gas controller 50, and a baffle plate (subflow-directing unit) 51. The reactant gas supplying unit 4 consists of, for example, a reactant gas source, a mass flow controller (MFC), reactant gas nozzle 4p, etc. and supplies reactant gas such as trimethyl gallium (TMG), ammonia gas (NH3), etc. via a reactant gas nozzle 4p placed near the susceptor 2 in the reaction chamber 1. The supplied reactant gas is pyrolysed in the reaction chamber 1 and forms a desired material film on a growth substrate 6 placed on the susceptor 2 supported by a rotating shaft 2s in the reaction chamber 1. The rotating shaft 2s is connected to a substrate rotating unit 7 and rotates in a predetermined direction. Therefore, the growth substrate 6 placed on the susceptor 2 also rotates in the predetermined direction. The baffle plate (subflow-directing unit) 51 emits subflow gas 52 supplied from the subflow gas source 8 via a subflow gas controller 50 onto an upper surface of the growth substrate 6. The subflow gas source 8 supplies inactive gas such as H2, N2, etc. as the subflow gas which does not include reactant gas, and the subflow gas controller 50 controls an amount of flow of the subflow gas. The baffle plate 51 defines a flowing direction of the subflow gas 52 and has holes functioning as subflow gas emitting nozzles tilted with a predetermined angle (e.g., 90 degrees) to the upper surface of the substrate 6. From those holes the subflow gas 52 is emitted onto the upper surface of the substrate 6 with the determined angle. The subflow gas 52 brings the reactant gas into contact with the upper surface of the substrate 6 for spreading the reactant gas evenly all over the upper surface of the substrate 6 without being diffused in the reaction chamber 1 by thermal convection or the likes. The reactant gas and the subflow gas 52 are exhausted from the reaction chamber 1 by the vacuum pump 5 via the exhaust port. A cleaning mechanism (not shown in the drawing) for capturing hazardous waste in the exhaust gas is configured before the vacuum pump 5 because the exhaust gas includes massive reaction byproducts and residual substances. Moreover, special equipment for safety disposal (not shown in the drawing) is configured at the end because the exhaust gas tends to include toxic waste such as arsenic or the likes. FIG. 7 is a graph showing relationships between a distance from an edge of a substrate and a growth rate when nitride semiconductor crystal films are grown by the conventional semiconductor manufacturing apparatus 200. In this graph the distance from one edge of the growth substrate 6 in the unit of [mm] is on the horizontal axis, and the growth rate for one hour in the unit of [μm/hour] is on the vertical axis. A diameter of the growth substrate 6 was 50 mm. Good growth of semiconductor films could be obtained in a range of 20 mm to 30 mm from the edge, that is, near the center (about 25 mm from the edge) of the growth substrate 6, and growth of semiconductor films which could be used for an LED could be obtained in a range of 10 mm to 40 mm from the edge. However, in a region closer than about 10 mm from the edge and in a region further than about 40 mm from the edge (in a 10 mm wide area from the outer periphery of the growth substrate 6), film thicknesses became too thick comparing to the center and so it could not be used for an LED. As in the above, in order to prevent the growth rate in the outer periphery of the growth substrate 6 from becoming larger than the growth rate in the center of the growth substrate 6 and to prevent the thickness of the outer periphery from becoming thicker than that in the center, it has been suggested that gas is emitted for removing a part of reactant gas in the outer periphery (see Japanese Patent No. 4096678). Japanese Patent No. 4096678 (hereinafter patent document 1) discloses a technique using first subflow gas (pressing gas) emitted with an angle of 45 to 90 degrees for bringing reactant gas into contact with a surface of a substrate and second subflow gas (removing gas) for removing the reactant gas in a periphery of the substrate. A nozzle for the second subflow gas is emitted at a right angle or slanted to an emitting direction of the reactant gas in an in-plane direction of the growth substrate and to an opposite direction to a rotating direction of the substrate. In the conventional technique according to the patent document 1, the nozzle for the second subflow gas is placed in front of the reactor. That is, the nozzle for the second subflow gas and a nozzle for the reactant gas are arranged to make their emitting angles to the surface of the substrate 6 same with each other (placed in parallel to the surface of the substrate); therefore, a large space around the substrate becomes necessary. Because the nozzle for the second subflow gas is placed in parallel to the surface of the substrate, the second subflow gas spread in a direction in parallel to the surface of the substrate 6 and a component flowing in an opposite way to a flow of the reactant gas may be generated and cause generation of spiral flow which obstructs reproducibility. Moreover, the first subflow gas and the second subflow gas are emitted to the same place so that the second subflow gas obstructs the flow of the first subflow gas and the effect of the first subflow gas, brining the reactant gas into contact with the substrate, is reduced.
Comparison of Molecular Subtypes of Carcinoma of the Breast in Two Different Age Groups: A Single Institution Experience Background Hormonal analysis and molecular subtyping are used as an important predictive and prognostic factors in women with carcinoma of the breast. The aim of this study was to analyze and compare the hormonal (estrogen receptor (ER) and progesterone receptor (PR)) and human epidermal growth factor (HER2) status among women with carcinoma breast belonging to two different age groups and classify them in molecular subtypes (luminal A, luminal B, triple negative, and HER2). Materials and Methods This was an analytical cross-sectional study performed at a tertiary care center in Northern India. Breast carcinoma cases treated over a period of two years were stratified into two groups (≤ 40 years: younger group, n = 27 and > 40 years: older group, n = 33). Their hormonal (ER, PR) and HER2 status were studied using immunohistochemistry (IHC) and classified according to the molecular classification of the breast carcinoma. Results A total of 60 cases of breast carcinoma were treated for hormonal and HER2 status during our study period and were classified into four subtypes. In the younger group (n = 27), luminal A (n = 16, 59.2%) was the most common molecular subtype, followed by triple negative (n = 6, 22.2%), HER2 (n = 4, 14.8%), and luminal B (n = 1, 3.7%). Similarly, in the older group luminal A (n = 20, 60.6%) ranked first, followed by triple negative (n = 10, 30.3%), HER2 (n = 2, 6.0%), and luminal B (n = 1, 3.0%). Conclusion Carcinoma of the breast in young women shows variation in the prevalence of molecular subtypes in different regions of the world. The results of our study are in accordance with the Asian literature, showing no significant difference in molecular subtyping of carcinoma breast in younger versus older women. More molecular research is needed to clearly understand the pathophysiology associated with carcinoma of the breast in young women. Materials and Methods This was an analytical cross-sectional study performed at a tertiary care center in Northern India. Breast carcinoma cases treated over a period of two years were stratified into two groups (≤ 40 years: younger group, n = 27 and > 40 years: older group, n = 33). Their hormonal (ER, PR) and HER2 status were studied using immunohistochemistry (IHC) and classified according to the molecular classification of the breast carcinoma. Conclusion Carcinoma of the breast in young women shows variation in the prevalence of molecular subtypes in different regions of the world. The results of our study are in accordance with the Asian literature, showing no significant difference in molecular subtyping of carcinoma breast in younger versus older women. More molecular research is needed to clearly understand the pathophysiology associated with carcinoma of the breast in young women. Introduction Globally, carcinoma breast accounts for the most common type of malignancy in women. It is an extremely heterogeneous disease, resulting from the interaction of both inherited and environmental risk factors. Age, marital status, menstrual history, diet and lifestyle factors, hormonal exposure, and family history are important factors in the etiopathogenesis of breast carcinoma. Prognosis depends on multiple clinical, pathological, and molecular factors. These include histological type, histological grade, lymphovascular invasion, lymph node metastases, and the status of hormonal receptors-estrogen receptor (ER), progesterone receptor (PR), and human epidermal growth factor (HER2) status of the tumor. Current treatment strategies rely on the characterization of the hormone receptors ER/PR protein expression status and the HER2 protein expression or gene amplification. Breast carcinoma tends to be more advanced, with inferior survival and higher recurrence rates in young women compared to older women. Risk factors, clinical outcomes, and tumor biology of the breast carcinoma are different in these women (≤ 40 years of age), suggesting that it represents a distinct entity altogether. To the best of our knowledge, a study showing the variation in the prevalence of molecular subtypes in young and old subjects with breast carcinoma has not been reported from India. This study aims to characterise the differences in hormonal and molecular subtyping of carcinoma of the breast in the two different age groups. Materials And Methods This analytical cross-sectional study was conducted from January 2015 to December 2016 at a tertiary care center in Northern India after obtaining approval from the Institute Ethics Committee. The study population comprised of all diagnosed carcinoma of the breast cases, received for hormonal and HER2 status. The cases were divided into two groups on the basis of their age: ≤ 40 years (younger group) and > 40 years (older group). Histological type, grade, lymph node involvement, and lymphovascular invasion were separately evaluated for correlation. Immunohistochemistry Representative formalin-fixed, paraffin-embedded sections of tumor and the adjacent normal breast tissue (internal control) were processed for ER, PR, and HER2 immunohistochemistry (IHC) staining. Antigen retrieval was done with Tris-EDTA buffer (pH = 9) and the slides stained with monoclonal antibodies against estrogen and progesterone receptors by a labeled streptavidin-biotin (LSAB) system (ER Clone ID5 and PR Clone IA6, DAKO). HER-2 staining was done with a polyclonal antibody against HER2 oncoprotein (DAKO). All the immunostained slides were reviewed and evaluated as per the current American Society of Clinical Oncology (ASCO)/College of American Pathologists (CAP) guidelines. Cases were then classified into different molecular subtypes. Data collection Continuous variables were described as the mean and standard deviation (SD) while the categorical variables were stated as percentages. Results A total of 60 breast carcinoma cases were received for IHC over a period of two years. Mean (± SD) age was 46.6 (± 3.42) years with a maximum incidence in the fourth decade (41.7%) and fifth decade (26.7%) ( Table 1). Lymph node metastases in the younger and older groups were seen in 13 (48.1%) and 14 (42.4%) cases, respectively. Overall, lymphovascular invasion was seen in 10 (16.7%) cases, being more common in the younger group compared to the older group ( Table 5). Discussion Breast carcinoma pathophysiology involves the complex interplay of a number of variables. Assessment of its prognosis and predictive outcomes requires the understanding of both clinicopathological and molecular factors. Our study focuses on the unique pathogenesis of carcinoma breast in younger versus older women and tries to elucidate the differences in molecular subtyping between them. There is no consistent uniformity in molecular subtyping in different regions of the world, suggesting a need to apprehend young breast carcinogenesis in our setting. The mean age in the younger group and older group in our study was 37.3 and 54.2 years, respectively. This was similar to the study done by Alzaman et al., where the mean age in the younger and older groups was 36 and 55 years, respectively. Invasive carcinoma NST was the most common histological subtype, followed by lobular carcinoma, tubular carcinoma, medullary carcinoma, colloid carcinoma, and IDC with neuroendocrine differentiation. This was in accordance with a study done by Makki, which reported IDC as the commonest subtype. At a molecular level, luminal A was the most common molecular subtype, followed by triple negative, HER 2, and luminal B, which is comparable with a study done by Alnegheimish et al., where the most prevalent subtype was luminal A (58.5%), followed in descending order of frequency by triple negative (14.8%), luminal B (14.5%), and HER2 (12.3%). The prevalence of molecular subtypes in older women was consistent with the study by Alzaman et al., showing luminal A as the most common subtype (51.6%). Interestingly, in our study, luminal A was the most common molecular subtype in younger group followed by triple negative, HER2, and luminal B. However, studies of breast carcinoma in younger women belonging to African or American ethnicity show HER2, triple negative, and luminal B subtypes to be more common compared to luminal A, indicating aggressive disease, higher grade, and poorer prognosis. The results of our study are comparable to that done by Lin et al. from Taiwan in concluding that younger patients had a significantly higher prevalence of luminal A and lower prevalence of triple negative-like subtypes. Studies by Kurebayashi et al. from Japan and Kumar et al. from India also revealed a high prevalence of luminal A subtype (63%) and a low prevalence of triple negative-like subtype (8%) in breast cancers, although an age-specific variation was not described. A comparison of various studies on molecular subtyping in young breast carcinoma has been described in Table 6. In contrast to the women in the United States (US), younger women with breast carcinoma in Asia did not have worse outcomes compared to older women. This occurred, in spite of more advanced disease at diagnosis and higher grade tumors, suggesting an ethnic and environmental variation, a possible etiology for outcome discrepancies. Asian women have been described to have a relatively better outcome in terms of survival and prognosis as compared to African, Latin, and non-Hispanic native American women. The possible reason could be a high prevalence of the lethal triple-negative phenotype (ER−, PR−, HER2−) in young African-American women. These observations suggest that ethnic differences in breast carcinogenesis exist among Asian and Occidental populations. Therefore, genetic factors or their interaction with other environmental factors may contribute to the observed variation of young breast carcinogenesis in India and other parts of Asia. Along with molecular subtyping, we correlated other prognostic factors, like lymph node metastasis and lymphovascular invasion, to strengthen our findings and for a better description of the pathogenesis. Lymph node metastases were more common in the younger group compared to the older age group, which reemphasizes the aggressive nature of young breast carcinoma and is consistent with a study done by Anders et al.. HER2 molecular subtype was associated with the highest percentage of lymphatic metastases, which is comparable with a study done by Tokatli et al.. Higher lymphovascular invasion in younger age group, suggestive of aggressive disease, was also in agreement with a study done by Lee et al.. The strength of our study is a comprehensive analysis of the molecular pathology of young breast carcinogenesis in Indian women, highlighting its distinctive behaviour. However, the study is limited by small sample size and lack of inclusion of the Ki-67 marker for molecular subtyping due to financial constraints. Conclusions Molecular classification assessment with the aid of IHC is highly informative and should be adopted as a part of routine diagnosis in the management of breast carcinoma patients. Hormonal (ER, PR) and HER2 status elucidation not only helps in assessing the prognosis but is also useful for predictive analysis. This study throws light on the correlation of molecular subtyping and age in Indian women, an area largely unexplored in clinical research. As opposed to the prevalent Western literature showing breast carcinoma in the younger group as a more aggressive disease, the results of our study are in accordance with the Asian literature, showing no significant difference in molecular subtyping of breast carcinoma in the two age groups. Additional Information Disclosures Human subjects: Consent was obtained by all participants in this study. Government Medical College, Kota, Rajasthan issued approval N/A. Animal subjects: All authors have confirmed that this study did not involve animal subjects or tissue. Conflicts of interest: In compliance with the ICMJE uniform disclosure form, all authors declare the following: Payment/services info: All authors have declared that no financial support was received from any organization for the submitted work. Financial relationships: All authors have declared that they have no financial relationships at present or within the previous three years with any organizations that might have an interest in the submitted work. Other relationships: All authors have declared that there are no other relationships or activities that could appear to have influenced the submitted work.
Neurological problems in advanced cancer This chapter covers the common neurological symptoms encountered in patients with advanced malignancy such as seizures, local and central nerve damage, and paraneoplastic neurological syndromes. Non-convulsive status epilepticus (NCSE) is a possible cause of confusion or delirium in terminally ill patients. The clinical presentation varies from altered mental status to comatose patients, without visible convulsions. In comatose patients, unilateral tonic head and eye movement is often observed. Other symptoms include myoclonic contractions of the angle of the mouth, mild clonus of an extremity, or, rarely, epileptic nystagmus. EEG is the most important diagnostic tool to identify epileptiform activity. Treatment should be initiated following a stepwise model (e.g. phenytoin, sodium valproate, levetiracetam, together with benzodiazepines), avoid intubation, and transfer to the intensive care unit. Although mortality rates are high, in some patients NCSE can be reversed by treatment.
// Copyright 2017 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/touch/touch_devices_controller.h" #include "ash/accelerators/debug_commands.h" #include "ash/public/cpp/ash_pref_names.h" #include "ash/public/cpp/ash_switches.h" #include "ash/session/session_controller.h" #include "ash/session/test_session_controller_client.h" #include "ash/shell.h" #include "ash/test/ash_test_base.h" #include "base/command_line.h" #include "base/test/histogram_tester.h" #include "components/prefs/pref_service.h" #include "components/prefs/testing_pref_service.h" namespace ash { namespace { constexpr char kUser1Email[] = "<EMAIL>"; constexpr char kUser2Email[] = "<EMAIL>"; bool GetUserPrefTouchpadEnabled() { PrefService* prefs = Shell::Get()->session_controller()->GetLastActiveUserPrefService(); return prefs && prefs->GetBoolean(prefs::kTouchpadEnabled); } bool GetGlobalTouchpadEnabled() { return Shell::Get()->touch_devices_controller()->GetTouchpadEnabled( TouchDeviceEnabledSource::GLOBAL); } bool GetUserPrefTouchscreenEnabled() { return Shell::Get()->touch_devices_controller()->GetTouchscreenEnabled( TouchDeviceEnabledSource::USER_PREF); } bool GetGlobalTouchscreenEnabled() { return Shell::Get()->touch_devices_controller()->GetTouchscreenEnabled( TouchDeviceEnabledSource::GLOBAL); } void SetTapDraggingEnabled(bool enabled) { PrefService* prefs = Shell::Get()->session_controller()->GetLastActiveUserPrefService(); prefs->SetBoolean(prefs::kTapDraggingEnabled, enabled); prefs->CommitPendingWrite(); } class TouchDevicesControllerSigninTest : public NoSessionAshTestBase { public: TouchDevicesControllerSigninTest() = default; ~TouchDevicesControllerSigninTest() override = default; // NoSessionAshTestBase: void SetUp() override { base::CommandLine::ForCurrentProcess()->AppendSwitch( switches::kAshDebugShortcuts); NoSessionAshTestBase::SetUp(); CreateTestUserSessions(); // Simulate user 1 login. SwitchActiveUser(kUser1Email); ASSERT_TRUE(debug::DebugAcceleratorsEnabled()); } void CreateTestUserSessions() { GetSessionControllerClient()->Reset(); GetSessionControllerClient()->AddUserSession(kUser1Email); GetSessionControllerClient()->AddUserSession(kUser2Email); } void SwitchActiveUser(const std::string& email) { GetSessionControllerClient()->SwitchActiveUser( AccountId::FromUserEmail(email)); } private: DISALLOW_COPY_AND_ASSIGN(TouchDevicesControllerSigninTest); }; TEST_F(TouchDevicesControllerSigninTest, PrefsAreRegistered) { PrefService* prefs = Shell::Get()->session_controller()->GetLastActiveUserPrefService(); EXPECT_TRUE(prefs->FindPreference(prefs::kTapDraggingEnabled)); EXPECT_TRUE(prefs->FindPreference(prefs::kTouchpadEnabled)); EXPECT_TRUE(prefs->FindPreference(prefs::kTouchscreenEnabled)); } TEST_F(TouchDevicesControllerSigninTest, SetTapDraggingEnabled) { auto* controller = Shell::Get()->touch_devices_controller(); ASSERT_FALSE(controller->tap_dragging_enabled_for_test()); SetTapDraggingEnabled(true); EXPECT_TRUE(controller->tap_dragging_enabled_for_test()); // Switch to user 2 and switch back. SwitchActiveUser(kUser2Email); EXPECT_FALSE(controller->tap_dragging_enabled_for_test()); SwitchActiveUser(kUser1Email); EXPECT_TRUE(controller->tap_dragging_enabled_for_test()); SetTapDraggingEnabled(false); EXPECT_FALSE(controller->tap_dragging_enabled_for_test()); } // Tests that touchpad enabled user pref works properly under debug accelerator. TEST_F(TouchDevicesControllerSigninTest, ToggleTouchpad) { ASSERT_TRUE(GetUserPrefTouchpadEnabled()); debug::PerformDebugActionIfEnabled(DEBUG_TOGGLE_TOUCH_PAD); EXPECT_FALSE(GetUserPrefTouchpadEnabled()); // Switch to user 2 and switch back. SwitchActiveUser(kUser2Email); EXPECT_TRUE(GetUserPrefTouchpadEnabled()); SwitchActiveUser(kUser1Email); EXPECT_FALSE(GetUserPrefTouchpadEnabled()); debug::PerformDebugActionIfEnabled(DEBUG_TOGGLE_TOUCH_PAD); EXPECT_TRUE(GetUserPrefTouchpadEnabled()); } TEST_F(TouchDevicesControllerSigninTest, SetTouchpadEnabled) { ASSERT_TRUE(GetUserPrefTouchpadEnabled()); ASSERT_TRUE(GetGlobalTouchpadEnabled()); Shell::Get()->touch_devices_controller()->SetTouchpadEnabled( false, TouchDeviceEnabledSource::GLOBAL); ASSERT_TRUE(GetUserPrefTouchpadEnabled()); ASSERT_FALSE(GetGlobalTouchpadEnabled()); Shell::Get()->touch_devices_controller()->SetTouchpadEnabled( false, TouchDeviceEnabledSource::USER_PREF); ASSERT_FALSE(GetUserPrefTouchpadEnabled()); ASSERT_FALSE(GetGlobalTouchpadEnabled()); Shell::Get()->touch_devices_controller()->SetTouchpadEnabled( true, TouchDeviceEnabledSource::GLOBAL); ASSERT_FALSE(GetUserPrefTouchpadEnabled()); ASSERT_TRUE(GetGlobalTouchpadEnabled()); } // Tests that touchscreen enabled user pref works properly under debug // accelerator. TEST_F(TouchDevicesControllerSigninTest, SetTouchscreenEnabled) { ASSERT_TRUE(GetGlobalTouchscreenEnabled()); ASSERT_TRUE(GetUserPrefTouchscreenEnabled()); debug::PerformDebugActionIfEnabled(DEBUG_TOGGLE_TOUCH_SCREEN); EXPECT_TRUE(GetGlobalTouchscreenEnabled()); EXPECT_FALSE(GetUserPrefTouchscreenEnabled()); // Switch to user 2 and switch back. SwitchActiveUser(kUser2Email); EXPECT_TRUE(GetUserPrefTouchscreenEnabled()); SwitchActiveUser(kUser1Email); EXPECT_TRUE(GetGlobalTouchscreenEnabled()); EXPECT_FALSE(GetUserPrefTouchscreenEnabled()); debug::PerformDebugActionIfEnabled(DEBUG_TOGGLE_TOUCH_SCREEN); EXPECT_TRUE(GetUserPrefTouchscreenEnabled()); EXPECT_TRUE(GetGlobalTouchscreenEnabled()); // The global setting should be preserved when switching users. Shell::Get()->touch_devices_controller()->SetTouchscreenEnabled( false, TouchDeviceEnabledSource::GLOBAL); EXPECT_FALSE(GetGlobalTouchscreenEnabled()); SwitchActiveUser(kUser2Email); EXPECT_FALSE(GetGlobalTouchscreenEnabled()); } using TouchDevicesControllerPrefsTest = NoSessionAshTestBase; // Tests that "Touchpad.TapDragging.Started" is recorded on user session added // and pref service is ready and "Touchpad.TapDragging.Changed" is recorded each // time pref changes. TEST_F(TouchDevicesControllerPrefsTest, RecordUma) { auto* controller = Shell::Get()->touch_devices_controller(); ASSERT_FALSE(controller->tap_dragging_enabled_for_test()); TestSessionControllerClient* session = GetSessionControllerClient(); // Disable auto-provision of PrefService. constexpr bool kEnableSettings = true; constexpr bool kProvidePrefService = false; // Add and switch to |kUser1Email|, but user pref service is not ready. session->AddUserSession(kUser1Email, user_manager::USER_TYPE_REGULAR, kEnableSettings, kProvidePrefService); const AccountId kUserAccount1 = AccountId::FromUserEmail(kUser1Email); session->SwitchActiveUser(kUserAccount1); base::HistogramTester histogram_tester; histogram_tester.ExpectTotalCount("Touchpad.TapDragging.Started", 0); histogram_tester.ExpectTotalCount("Touchpad.TapDragging.Changed", 0); // Simulate active user pref service is changed. auto pref_service = std::make_unique<TestingPrefServiceSimple>(); Shell::RegisterUserProfilePrefs(pref_service->registry(), true /* for_test */); Shell::Get()->session_controller()->ProvideUserPrefServiceForTest( kUserAccount1, std::move(pref_service)); histogram_tester.ExpectTotalCount("Touchpad.TapDragging.Started", 1); histogram_tester.ExpectTotalCount("Touchpad.TapDragging.Changed", 0); EXPECT_FALSE(controller->tap_dragging_enabled_for_test()); SetTapDraggingEnabled(true); histogram_tester.ExpectTotalCount("Touchpad.TapDragging.Started", 1); histogram_tester.ExpectTotalCount("Touchpad.TapDragging.Changed", 1); } } // namespace } // namespace ash
<filename>libs/libc/bits/wordsize.h<gh_stars>0 /* Determine the wordsize from the preprocessor defines. */ #if defined __x86_64__ # define __WORDSIZE 64 # define __WORDSIZE_COMPAT32 1 #else # define __WORDSIZE 32 #endif
package com.hibo.cms.component.controller; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import javax.servlet.http.HttpServletRequest; import javax.validation.Valid; import org.eclipse.jetty.util.ajax.JSON; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.ResponseBody; import com.github.miemiedev.mybatis.paginator.domain.PageBounds; import com.github.miemiedev.mybatis.paginator.domain.PageList; import com.hibo.bas.util.MapUtil; import com.hibo.bas.util.ObjectId; import com.hibo.bas.util.page.taglib.utils.PageUtils; import com.hibo.cms.component.model.CountryBas; import com.hibo.cms.component.service.country.ICountryBasService; import com.hibo.cms.sys.utils.json.JsonUtil; import com.hibo.cms.user.model.User; /** * <p>标题:</p> * <p>功能: </p> * <p>版权: Copyright © 2015 HIBO</p> * <p>公司: 北京瀚铂科技有限公司</p> * <p>创建日期:2015年11月11日 下午3:34:40</p> * <p>类全名:com.hibo.cms.component.controller.CountryBasController</p> * 作者:曾小明 * 初审: * 复审: */ @Controller @RequestMapping("/admin/countrybas") public class CountryBasController { @Autowired private ICountryBasService countryBasService; /** * <p>功能:查询国家<p> * <p>创建日期:2015年11月12日 上午9:42:17<p> * <p>作者:曾小明<p> * @param model * @param request * @return */ @RequestMapping(value="/list") public String list(Model model,HttpServletRequest request){ String select = request.getParameter("select"); PageList<CountryBas> pageList = null; if(select==null){ Map map = request.getParameterMap(); Map selectMap = MapUtil.getMapValues(map); pageList = countryBasService.selectByCondition(map,new PageBounds(PageUtils.getCurrentPage(request),PageUtils.getPageSize(request))); model.addAttribute("page", pageList.getPaginator()); model.addAttribute("selectMap",selectMap); model.addAttribute("list", pageList); }else{ model.addAttribute("select",select); } Map<String, String> lockeds = new HashMap<String, String>(); lockeds.put("0", "未启用"); lockeds.put("1", "已启用"); model.addAttribute("lockeds", lockeds); return "component/country/list"; } /** * <p>功能:删除国家<p> * <p>创建日期:2015年11月12日 上午9:42:39<p> * <p>作者:曾小明<p> * @param id * @return */ @RequestMapping(value="/del.ajax",method=RequestMethod.POST) @ResponseBody public String del(String id){ int row = countryBasService.deleteByPrimaryKey(id); String json = JSON.toString(row); return json; } /** * <p>功能:修改国家<p> * <p>创建日期:2015年11月12日 上午9:45:20<p> * <p>作者:曾小明<p> * @param id * @param model * @return */ @RequestMapping(value="/{id}/update",method=RequestMethod.GET) public String update(@PathVariable(value="id") String id,Model model){ CountryBas bean=countryBasService.selectByPrimaryKey(id); model.addAttribute("bean",bean); model.addAttribute("method", "post"); return "component/country/add"; } @RequestMapping(value="/{id}/update",method=RequestMethod.POST) public String update(@PathVariable(value="id") String id,@Valid CountryBas bean,Model model){ countryBasService.updateByPrimaryKey(bean); model.addAttribute("updateSuccess", true); return "redirect:/admin/countrybas/list"; } @RequestMapping(value="/add",method=RequestMethod.GET) public String add(Model model){ CountryBas bean=new CountryBas(); model.addAttribute("bean",bean); model.addAttribute("method", "post"); return "component/country/add"; } @RequestMapping(value="/add",method=RequestMethod.POST) public String add(Model model,@Valid CountryBas bean){ bean.setId(ObjectId.getUUId()); countryBasService.insert(bean); return "redirect:/admin/countrybas/list"; } @RequestMapping(value="/list.ajax",method=RequestMethod.POST) @ResponseBody public String selectlist(User user){ String title=user.getUsername(); List<CountryBas> city = countryBasService.selectList(title); List<User> list=new ArrayList<User>(); if(city!=null&&city.size()>0){ for(int i=0;i<city.size();i++){ User u=new User(); u.setUsername(city.get(i).getTitle()); u.setUserid(city.get(i).getCode()); list.add(u); } } return JsonUtil.toJsonString(list); } }
Isospin symmetry breaking and baryon-isospin correlations from Polyakov$-$Nambu$-$Jona-Lasinio model We present a study of the 1+1 flavor system of strongly interacting matter in terms of the Polyakov$-$Nambu$-$Jona-Lasinio model. We find that though the small isospin symmetry breaking brought in through unequal light quark masses is too small to affect the thermodynamics of the system in general, it may have significant effect in baryon-isospin correlations and have a measurable impact in heavy-ion collision experiments. II. FORMALISM In the last few years PNJL model has appeared in several forms and context to study the various aspects of phases of strongly interacting matter (see e.g. +( / D −m) + G 1 + G 2 , T ] is the effective potential expressed in terms of traced Polyakov loop and its charge conjugate: Although and are complex valued fields, in the mean field approximation their expectation values are supposed to be real. In all the previous studies the u and d quarks were considered to be degenerate. Here we shall consider a mass matrix of the form:m where, 1 1 22 is the identity matrix in flavor space and 3 is the third Pauli matrix. Here m u and m d are the current masses of the u and d quarks respectively. While a non-zero m 1 breaks the chiral SU A symmetry explicitly a non-zero m 2 does the same for the isospin SU V symmetry. We shall restrict ourselves to G 1 = G 2 = G which implies m 2 = (M d − M u )/2, where M u and M d are the constituent masses of the u and d quarks respectively. The thermodynamic potential in the mean field approximation is given by, where u and d are the condensates for u and d quarks respectively. Here, T ] is the modified Polyakov loop potential ; is known as Vandermonde determinant and is a phenomenological parameter, taken to be 0.1 here. The behavior of different charge susceptibilities can be studied from corresponding chemical potential derivatives of the pressure (P ) obtained from the thermodynamic potential. In general the n th order diagonal and off-diagonal susceptibilities are respectively given by, These susceptibilities are related to the fluctuations and correlations of conserved charges X and Y with corresponding chemical potentials X and Y. Given a two flavor system the global charge conservation is expected for baryon number B, (third component of) isospin I 3 and electric charge Q. In the isospin symmetric limit one can easily check that the B − I correlation vanishes exactly. For an explicit isospin symmetry breaking, this correlation may be non-zero. Therefore it is an interesting and important observable that we wish to study here. III. RESULTS AND DISCUSSIONS Here we consider the average quark mass m 1 = (m u + m d )/2 fixed at 0.0055 GeV and study the effect of ISB with three representative values of m 2 = (m d − m u )/2. The parameter set in the NJL sector has been determined separately for the different values of m 2 and the differences in the parameter values were found to be practically insignificant. The bulk thermodynamic properties of the system expressed through pressure, energy density, specific heat, speed of sound etc. did not show significant dependence on m 2. Even the diagonal susceptibilities were almost identical to those at the isospin symmetric limit. However, interesting differences were observed for the off-diagonal susceptibilities in the B − I sector. We first discuss the results for B = 0 and then move to finite B. A. Off-diagonal Susceptibilities for B = 0 In Fig.1 the second order off-diagonal susceptibility BI 11, is plotted against T /T c for different values of m 2. Here T c is the crossover temperature obtained from the inflection point of the scalar order parameters -the mean values of chiral condensate and Polyakov Loop. As expected we find BI 11 = 0 for m 2 = 0. For non-zero m 2 we find BI 11 to have non-zero values that change non-monotonically with the increase in temperature. At low temperatures the excitations are suppressed due to large constituent masses as well as confining effects of the Polyakov loop. As the constituent masses and confining effects decrease with the increase in temperature, the correlations are enhanced. The peak value appears very close to T c. Thereafter as the constituent masses become small with respect to the corresponding temperature, the correlation drops and approaches zero at very high temperatures. The sensitivity of BI 11 on m 2 is clearly visible. An exciting feature observed here is that there is an almost linear scaling of BI 11 with m 2. This is shown in the inset of Fig.1. The fourth order off-diagonal susceptibilities in the B − I sector are BI 13, BI 31 and BI 22. The m 2 dependence of BI 22 was found to be insignificant. For B = 0, the T dependence for the other two susceptibilities along with their m 2 scaling is shown in Fig.2. The qualitative features of the variation of BI 13 and BI 31 with temperature may be understood by noting that these quantities are correlators between BI 11 with those of the isospin fluctuation I 2 and the baryon fluctuation B 2 respectively. In our earlier studies, we found that the both I 2 and B 2 increase monotonically with increasing temperature. On the other hand BI 11 first increases up to T ∼ T c and then decreases with increase in T, as shown in Fig.1. Therefore one expects that BI 11 has a positive correlation with I 2 and B 2 below T c and is anti-correlated above T c. To understand the presence of m 2 scaling for some correlators and absence in others we first note that the different B − I correlators may be expressed in terms of those in the flavor space. The corresponding relation between the chemical potentials are u = 1 3 B + 1 2 I and d = 1 3 B − 1 2 I. This implies, The flavor diagonal susceptibilities can be expanded in a Taylor series of the quark masses around m u = m d = 0. where, are the Taylor coefficients, with i + j = n and f ∈ u, d. Here a u 0,0 and a d 0,0 are respectively u and d flavor susceptibilities in the chiral limit; hence they are equal. Moreover, response of u 2 to a change in m u (m d ) and that of d 2 to a change in m d (m u ) are identical in the chiral limit. Thus we have a u i,j = a d j,i, ∀ i, j. Therefore we get, where It is clear that for any given n and i, the R.H.S. contains a factor (m d − m u ). Therefore. This is what we observed for the range of m 2 considered here. For the higher order correlators one can similarly write, For all these quantities the first two terms on R.H.S. were found to be dominant. Considering again the Taylor expansion of f 4 (but obviously with Taylor coefficients different from that of f 2 ) in quark masses, BI 13 and BI 31 were found to be proportional to m 2. Since BI 22 contains sum of fourth order flavor fluctuations instead of their difference, no m 2 scaling appeared in this case. B. Off diagonal Susceptibilities for B = 0 In Fig.3, the variation of BI 11 with B is shown for four different temperatures. The features vary widely over the different ranges of temperature and chemical potential. At T ∼ 2T c, BI 11 is positive, and slowly decreases with increasing B. Close to T c, BI 11 drops sharply to zero, becomes negative and then again slowly approaches zero. Going down somewhat below T c there is an initial increase in BI 11 for some range of B, and thereafter it follows the behavior at T c. Finally at very low temperatures the change in sign of BI 11 is marked by a discontinuity, arising due to a first order phase boundary which exists in this range of T and B. These various features can be understood by expressing BI 11 = ∂ ∂B ( ∂P ∂I ) = ( ∂nI ∂B ), where n I is the isospin number density. It is worth noting that although we have considered I = 0 throughout the present study, a non-zero isospin number is generated due to non-vanishing m 2. So let us study the behavior of isospin number density with changing baryon chemical potential. Now n I = (n u − n d )/2, where n u and n d are respectively the u and d quark densities. The number density of a given flavor at a constant temperature is governed by the corresponding mass as well as the chemical potential. The isospin number should be positive as the u quark mass is smaller than that of d quark. With increase in baryon chemical potential this difference is expected to increase giving an increasing n I. This expected feature is found to hold in the low temperatures for a range of B as can be seen from Fig.4. However there is a subsequent drop in isospin number as the constituent quark masses suddenly start to fall beyond a critical B, gradually becoming insignificant as the constituent masses reduce to the current mass values. The rise and fall of n I explains the complete behavior of BI 11 for T < T c. In fact the same explanation applies for the other two temperatures in the following way. Close to T c the constituent masses of the quarks are again approaching the current mass values. n I is increasing with B, but too slowly and therefore BI 11, given by the slope, starts dropping. The latter part still follows the behavior of T < T c. By 2T c the current mass is almost achieved and n I increases almost linearly with a very small slope with respect to B. The corresponding BI 11 is positive and decreasing very slowly. An amazing fact remains that the scaling of the correlators with m 2 survives for all conditions of T and B. This is shown in the insets of Fig.3. A major implication is that all higher order derivatives of n I with respect to B would also show similar scaling behavior. This can be seen by expanding BI 11 in a Taylor series in B about B = 0 as, In the above series odd order terms vanish due to CP symmetry. Since BI 11 ( B ) on the L.H.S. scales with m 2, the same can be expected to hold true individually for all the coefficients on the R.H.S. up to any arbitrary order. The first two Taylor coefficients have already been shown to follow the scaling relation in Fig.1 and Fig.2(right panel) respectively. Correlation between conserved charges, is an experimentally measurable quantity obtained from event-by-event analysis in heavy-ion collisions. To compare with experiments it is often useful to consider ratios such as R 2 = BI 11 / B 2 = C BI /C BB. C. Further implications of ISB in Heavy Ion Collisions where N E is the total number of events considered and X i and Y i are the event variables corresponding to the conserved charges in a given event i. Ratios of this kind are practically useful in eliminating uncertainties in the estimates of the measured volume of the fireball. Relevance of similar ratios of fluctuations have also been discussed in the Lattice QCD framework. The temperature variation of R 2 obtained here is shown in Fig.5. It decreases monotonically and approaches zero above T c. This is expected as the baryon number fluctuation increases much more rapidly than the B − I correlation below T c, and thereafter BI 11 goes to zero while B 2 attains a non-zero value. Though not completely monotonic, R 2 goes down to extremely small values close to the phase/crossover boundary for B = 0. This is shown in Fig. 6. If freeze-out of the particles produced in heavy-ion collisions occurs very close to phase/crossover boundary after the system has passed through the partonic phase then R 2 will have very small values. A systematic study of this ratio can thus indicate how close one could approach the phase boundary in heavy-ion collisions. In fact a small negative value of R 2 for intermediate energy experiments where the temperature is supposed to be quite low would be an exciting indicator of a phase transition. The m 2 scaling that we observed for BI 11 or R 2 is most likely model independent as it is expected on very general grounds for small current quark masses as discussed above. Therefore, at any temperature and chemical potential, one can use the m 2 scaling to estimate the mass asymmetry of constituent fermions in a physical system as, where, 'expt' and 'th' denotes the experimentally measured and theoretically calculated values of the corresponding quantities respectively. To the best of our knowledge this is the first theoretical attempt which indicates that quark mass asymmetry in thermodynamic equilibrium can be directly measured from heavy-ion collision experiments. For the fourth order correlators, an important point to note is that for fractional baryon number of the constituents, | BI 13 |/| BI 31 | > 1. It is easy to check that the inequality is reversed for integral baryon number i.e. for protons and neutrons. However from Fig.2 we see that the former inequality persists well below T c. This may well be an artifact of the PNJL model. Therefore it would be in principle interesting to crosscheck the corresponding results from Lattice QCD. Enhanced statistics of present and future experiments may make it possible to measure this extremely sensitive probe. The direction of the above inequality would be important in deciding if partonic matter may have been produced in the medium. We expect that the measurement of these correlations in experiments pose a big challenge. Firstly, at low temperatures where R 2 is large, both the numerator and denominator are quite small, making the measurement difficult. Experimentally these fluctuations are measured from the cumulants of the multiplicity distribution at chemical freezeout. For example, around highest RHIC energy, particle ratios are expected to be frozen at T ∼ 0.170 GeV and B ∼ 0.020 GeV and for those values of temperature and baryon chemical potential B 2 has been measured very accurately. To measure BI 11 at same level of accuracy, assuming normally distributed population, naively the statistics needs to be increased by a factor of 10 6 w.r.t. the same for existing calculation in case of B 2 which seems to be difficult at the present stage. In view of this the situation is somewhat better at say √ s NN ∼ 8 GeV, where the freezeout is expected for T ∼ 0.140 GeV and B ∼ 0.420 GeV. In this case absolute values of both the numerator and denominator of R 2 are well within the measurable regime for future experimental facilities like BES-II in RHIC and CBM in FAIR which will have fairly high statistics for low energy runs and possibly can overcome this problem. The other experimental challenge is the detection and measurement of neutrons which along with the protons are supposed to be the highest contributor to the baryon-isospin correlations. Incidentally the Large Area Neutron Detector facility has already been developed at GSI, Darmstadt, Germany, where one can measure neutron properties in heavy-ion collision experiments up to an incident energy of 1 GeV per nucleon. Hopefully with further developments in detection technology, relevant data for neutrons may be available for higher collision energies in near future. At this point it seems relevant to mention that the issue of neutron detection has arisen earlier even for the measurement of baryon fluctuation itself. In case of baryon number cumulants, methods are given to reconstruct and estimate the effect of unobserved neutrons as well as other effects like finite acceptance and global conservation of baryon number. In Ref. the key ingredient is the observation that due to some late stage processes the isospins of different nucleon species are almost uncorrelated which makes it possible to write the actual baryon number cumu-lants in terms of the observed proton number cumulants. It is argued that for low values of √ s NN this randomization of isospin is not favored and neutron and proton number distribution will not be factorized in the final state due to the existence of primordial isospin correlation. This is precisely what we observe in our framework. From Fig.1 and Fig.3 it can be easily seen that as we go down by √ s NN (i.e. decreasing T and increasing B ), correlation through isospin between different baryon species, i.e. BI 11 will increase. Therefore a direct measurement of neutrons is desirable even for measuring baryon number fluctuations at low energies apart from the baryon-isospin correlations. Another question that still remains is whether the isospin asymmetry brought in through nonzero electric charge may disturb the scaling and inclusion of this QED effect will be another complete study in itself and will be reported later. IV. CONCLUSION In the present paper we have investigated the effect of isospin symmetry breaking through the unequal masses of u and d flavor. The work is done within the framework of 1+1 flavor PNJL model. The main result found is the observation that the off-diagonal susceptibilities in the B − I sector depend on a small current quark-mass difference, whereas the bulk thermodynamic properties of the system (pressure, energy density, specific heat, speed of sound) do not show such dependence. The relevance of conserved charge fluctuations to the study of the transition region of strongly interacting matter is unquestionable. We showed that the B − I correlations may give important information of the state of matter created in the heavy-ion collision experiments. Whereas the correlation remains positive for small B, it may become negative in the high B partonic phase. The change of sign of the correlation seems to be completely model independent. Also the typical scaling behavior of these correlations with the quark mass difference m 2 has been argued to be model independent as long as the current masses are small. This scaling may enable one to estimate the quark mass asymmetry in heavy-ion experiments. Another model independent observable that we discussed is for the fourth order correlators. Depending on whether the ratio | BI 13 |/| BI 31 | is greater than 1 or not, one may infer if a partonic phase has been created and survived till freeze-out in the heavy-ion experiments. In our study the ratio was always found to be greater than 1, which may be model artifact. A physically more realistic scenario of course requires the incorporation of strange quarks and/or QED effects which will be reported elsewhere. The experimental observation of baryon-isospin correlation is a challenging job. Hopefully the future relativistic heavy-ion experiments with appropriate neutron detectors and high statistics data would be able to address this important issue.
package com.z.design.adapter; /** * User: zhangkb * Date: 2019/5/13 0013 * Time: 上午 10:12 */ public class TypeC extends BaseAdapter { @Override public String getType() { return "TypeC"; } @Override public String getVoltage() { return "20V"; } }
Supplemental Oxygen During Moderate Sedation and the Occurrence of Clinically Significant Desaturation During Endoscopic Procedures Gastrointestinal endoscopy is the method of choice for the diagnosis and treatment of diseases of the esophagus, stomach, and colon. Moderate sedation is commonly used to sedate patients for endoscopic procedures. The objective of this study is to determine whether supplemental oxygen administered prior to and during moderate sedation decreases episodes of clinically significant oxygen desaturation in adults undergoing endoscopic procedures. Three hundred eighty-nine subjects participated in the study. Of these, 194 patients were assigned to the experimental group and 195 patients to the control group. Use of supplemental oxygen was the study intervention. At baseline, the two groups did not differ significantly with respect to age, gender, body mass index, ethnicity, type of procedure, American Society of Anesthesiologists score, and pulse or respiratory rate. Of the control group, 70.8% (138/195) of patients experienced a desaturation episode compared with 12.4% (24/194) of experimental patients (p <.00001). Patients receiving supplemental oxygen were 98% less likely to experience desaturation than the controls. The results of this study support the routine use of supplemental oxygen (2 liters/minute) during endoscopic procedures to prevent desaturation. On the basis of the study data, it is recommended that patients undergoing endoscopy with moderate sedation, who meet the inclusion and exclusion criteria of this study, receive supplemental oxygen (2 L/min). Routine incorporation of this recommendation in hospital policies will ensure that patients routinely receive this preventive measure: supplemental oxygen during moderate sedation and the occurrence of clinically significant desaturation during endoscopic procedures.
/** * The {@code ResourceCollection} abstract base class represents a collection of * Splunk resources. * * @param <T> The type of members of the collection. */ public class ResourceCollection<T extends Resource> extends Resource implements Map<String, T> { protected LinkedHashMap<String, LinkedList<T>> items = new LinkedHashMap<String, LinkedList<T>>(); protected Class itemClass; /** * Class constructor. * * @param service The connected {@code Service} instance. * @param path The target endpoint. * @param itemClass The class of this resource item. */ ResourceCollection(Service service, String path, Class itemClass) { super(service, path); this.itemClass = itemClass; } /** * Class constructor. * * @param service The connected {@code Service} instance. * @param path The target endpoint. * @param itemClass The class of this resource item. * @param args Collection arguments that specify the number of entities to * return and how to sort them (see {@link CollectionArgs}). */ ResourceCollection( Service service, String path, Class itemClass, Args args) { super(service, path, args); this.itemClass = itemClass; } /** {@inheritDoc} */ public void clear() { throw new UnsupportedOperationException(); } /** {@inheritDoc} */ public boolean containsKey(Object key) { return validate().items.containsKey(key); } /** * Determines whether a scoped, namespace-constrained key * exists within this collection. * * @param key The key to look up. * @param namespace The namespace to constrain the search to. * @return {@code true} if the key exists, {@code false} if not. */ public boolean containsKey(Object key, Args namespace) { Util.ensureNamespaceIsExact(namespace); validate(); LinkedList<T> entities = items.get(key); if (entities == null || entities.size() == 0) return false; String pathMatcher = service.fullpath("", namespace); for (T entity: entities) { if (entity.path.startsWith(pathMatcher)) { return true; } } return false; } /** {@inheritDoc} */ public boolean containsValue(Object value) { // value should be a non-linked-list value; values are stored as linked // lists inside our container. LinkedList<Object> linkedList = new LinkedList<Object>(); linkedList.add(value); return validate().items.containsValue(linkedList); } static Class[] itemSig = new Class[] { Service.class, String.class }; /** * Creates a collection member. * * @param itemClass The class of the member to create. * @param path The path to the member resource. * @param namespace The namespace. * @return The new member. */ protected T createItem(Class itemClass, String path, Args namespace) { Constructor constructor; try { constructor = itemClass.getDeclaredConstructor(itemSig); } catch (NoSuchMethodException e) { throw new RuntimeException(e); } T item; try { while (true) { Object obj = constructor.newInstance(service, service.fullpath(path, namespace)); //if (obj instanceof Message) { // We ignore messages sent back inline. // continue; //} else { item = (T)obj; break; //} } } catch (IllegalAccessException e) { throw new RuntimeException(e); } catch (InvocationTargetException e) { throw new RuntimeException(e.getTargetException()); } catch (InstantiationException e) { throw new RuntimeException(e); } return item; } /** * Creates a collection member corresponding to a given * Atom entry. This base implementation uses the class object that was * passed in when the generic {@code ResourceCollection} was created. * Subclasses may override this method to provide alternative means of * instantiating collection members. * * @param entry The {@code AtomEntry} corresponding to the member to * instantiate. * @return The new member. */ protected T createItem(AtomEntry entry) { return createItem(itemClass, itemPath(entry), namespace(entry)); } /** {@inheritDoc} */ public Set<Map.Entry<String, T>> entrySet() { throw new UnsupportedOperationException(); } /** {@inheritDoc} */ @Override public boolean equals(Object o) { return validate().items.equals(o); } /** * Gets the value of a given key, if it exists within this collection. * * @param key The key to look up. * @return The value indexed by the key, or {@code null} if it doesn't * exist. * @throws SplunkException The exception to throw if there is more than one * value represented by this key. */ public T get(Object key) { validate(); LinkedList<T> entities = items.get(key); if (entities != null && entities.size() > 1) { throw new SplunkException(SplunkException.AMBIGUOUS, "Key has multiple values, specify a namespace"); } if (entities == null || entities.size() == 0) return null; return entities.get(0); } /** * Gets a the value of a scoped, namespace-constrained key, if it exists * within this collection. * * @param key The key to look up. * @param namespace The namespace to constrain the search to. * @return The value indexed by the key, or {@code null} if it doesn't * exist. */ public T get(Object key, Args namespace) { Util.ensureNamespaceIsExact(namespace); validate(); LinkedList<T> entities = items.get(key); if (entities == null || entities.size() == 0) return null; String pathMatcher = service.fullpath("", namespace); for (T entity: entities) { if (entity.path.startsWith(pathMatcher)) { return entity; } } return null; } @Override public int hashCode() { return validate().items.hashCode(); } /** {@inheritDoc} */ public boolean isEmpty() { return validate().items.isEmpty(); } /** * Returns the value to use as the key from a given Atom entry. * Subclasses may override this value for collections that use something * other than "title" as the key. * * @param entry The {@code AtomEntry} corresponding to the collection * member. * @return The value to use as the member's key. */ protected String itemKey(AtomEntry entry) { return entry.title; } /** * Returns the value to use as the member's path from a given Atom entry. * Subclasses may override this value to support alternative methods of * determining a member's path. * * @param entry The {@code AtomEntry} corresponding to the collection * member. * @return The value to use as the member's path. */ protected String itemPath(AtomEntry entry) { return entry.links.get("alternate"); } private Args namespace(AtomEntry entry) { Args namespace = new Args(); try { // no content? return an empty namespace. if (entry == null || entry.content == null) return namespace; HashMap<String, String> entityMetadata = (HashMap<String, String>)entry.content.get("eai:acl"); // If there is no ACL info, we just create an empty map if (entityMetadata == null) { entityMetadata = new HashMap<String, String>(); } if (entityMetadata.containsKey("owner")) namespace.put("owner", entityMetadata.get("owner")); if (entityMetadata.containsKey("app")) namespace.put("app", entityMetadata.get("app")); if (entityMetadata.containsKey("sharing")) namespace.put("sharing", entityMetadata.get("sharing")); return namespace; } catch (Exception e) { return namespace; } } /** {@inheritDoc} */ public Set<String> keySet() { return validate().items.keySet(); } /** * Issues an HTTP request to list the contents of the collection resource. * * @return The list response message. */ public ResponseMessage list() { return service.get(path, this.refreshArgs); } /** * Loads the collection resource from a given Atom feed. * * @param value The {@code AtomFeed} instance to load the collection from. * @return The current {@code ResourceCollection} instance. */ ResourceCollection<T> load(AtomFeed value) { super.load(value); for (AtomEntry entry : value.entries) { String key = itemKey(entry); T item = createItem(entry); if (items.containsKey(key)) { LinkedList<T> list = items.get(key); list.add(item); } else { LinkedList<T> list = new LinkedList<T>(); list.add(item); items.put(key, list); } } return this; } /** {@inheritDoc} */ public T put(String key, T value) { throw new UnsupportedOperationException(); } /** * Copies all mappings from a given map to this map (unsupported). * * @param map The set of mappings to copy into this map. */ public void putAll(Map<? extends String, ? extends T> map) { throw new UnsupportedOperationException(); } /** {@inheritDoc} */ @Override public ResourceCollection refresh() { items.clear(); ResponseMessage response = list(); assert(response.getStatus() == 200); AtomFeed feed = null; try { feed = AtomFeed.parseStream(response.getContent()); } catch (Exception e) { throw new RuntimeException(e); } load(feed); return this; } /** {@inheritDoc} */ public T remove(Object key) { throw new UnsupportedOperationException(); } /** {@inheritDoc} */ public int size() { return validate().items.size(); } /** {@inheritDoc} */ @Override public ResourceCollection<T> validate() { super.validate(); return this; } /** {@inheritDoc} */ public Collection<T> values() { LinkedList<T> collection = new LinkedList<T>(); validate(); Set<String> keySet = items.keySet(); for (String key: keySet) { LinkedList<T> list = items.get(key); for (T item: list) { collection.add(item); } } return collection; } /** * Returns the number of values that a specific key represents. * * @param key The key to look up. * @return The number of entity values represented by the key. */ public int valueSize(Object key) { validate(); LinkedList<T> entities = items.get(key); if (entities == null || entities.size() == 0) return 0; return entities.size(); } }
// Copyright 2015 The Gogs Authors. All rights reserved. // Copyright 2019 The Gitea Authors. All rights reserved. // Use of this source code is governed by a MIT-style // license that can be found in the LICENSE file. // +build gogit package git import ( "github.com/go-git/go-git/v5/plumbing" ) // SHA1 a git commit name type SHA1 = plumbing.Hash // ComputeBlobHash compute the hash for a given blob content func ComputeBlobHash(content []byte) SHA1 { return plumbing.ComputeHash(plumbing.BlobObject, content) }
Implicit Polarized F: local type inference for impredicativity System F, the polymorphic lambda calculus, features the principle of impredicativity : polymorphic types may be (explicitly) instantiated at other types, enabling many powerful idioms such as Church encoding and data abstraction. Unfortunately, type applications need to be implicit for a language to be human-usable, and the problem of inferring all type applications in System F is undecidable. As a result, language designers have historically avoided impredicative type inference. We reformulate System F in terms of call-by-push-value, and study type inference for it. Surprisingly, this new perspective yields a novel type inference algorithm which is extremely simple to implement (not even requiring unification), infers many types, and has a simple declarative specification. Furthermore, our approach offers type theoretic explanations of how many of the heuristics used in existing algorithms for impredicative polymorphism arise. the
High Tangent Radiation Therapy With Field-in-Field Technique for Breast Cancer Purpose: We evaluated whether the field-in-field (FIF) technique improves the homogeneity of the target in high tangent radiation therapy (HTRT). Materials and Methods: This study included 30 patients. In total, 3 HTRT plans were created: 1 with conventional opposed fields (Conv-p), 1 with the FIF technique (FIF-p), and 1 with FIF technique using lung-blocked subfields (FIF-LB-p). Results: The maximum dose of the breast and planning target volume (PTV) was significantly lower for FIF-p and FIF-LB-p than Conv-p. Homogeneity index of PTV was also significantly lower for FIF-p and FIF-LB-p than Conv-p. Homogeneity index of the breast or PTV was significantly better for FIF-p than FIF-LB-p. The volumes of the breast or the PTV receiving 95% and 90% of the prescribed dose were also significantly better for FIF-p, indicating the advantages of FIF-p. Conclusions: The FIF technique was useful in HTRT and improved homogeneity in the target. Introduction Most patients with early-stage breast cancer are given breastconserving treatment consisting of wide excision and postoperative radiotherapy. Similar to mastectomy, postoperative radiotherapy reduces the risk of local recurrence and results in long-term survival. Patients with positive axillary sentinel lymph node biopsy (SLNB) specimen often undergo axillary lymph node dissection (ALND). The American College of the Surgeons Oncology Group (ACSOG) Z0011 trial revealed that among patients with limited sentinel lymph node metastatic breast cancer treated with breast conservation and systemic therapy, the use of sentinel lymph node dissection alone compared with ALND did not result in decreased survival. 4 The European Organization for Research and Treatment of Cancer (EORTC) 10981-22023 After Mapping of the Axilla: Radiotherapy or Surgery (AMAROS) trial also showed that there was no significant difference in axillary recurrence rate between the SLNB group and the ALND group. 5 Therefore, attempts have been made to omit ALND even for SLNB-positive patients if certain conditions are met. As a replacement to this procedure, high tangent radiation therapy (HTRT) that intentionally irradiates the axillary lymph node region was examined. The field-in-field (FIF) technique has become a widely preferred method for administering tangential whole-breast radiotherapy. Several studies have reported that the use of the FIF technique facilitates better control of dose homogeneity. The FIF technique was reported to be useful in reducing hot regions as well as cold regions. The dual-energy FIF technique, whose energy of subfields is high, improves the homogeneity even in large-breast patients. 10 Moreover, the impact of respiratory motion is smaller with the FIF technique than with physical wedges. 11 In HTRT, the shape of the target becomes more complicated than with tangential whole-breast radiotherapy. Because HTRT involves the axilla region, the difference in body thickness of the target is large, and the dose inhomogeneity increases. However, the usefulness of the FIF technique in HTRT has not been sufficiently evaluated. The purpose of this study was to evaluate whether the FIF technique improves the homogeneity of the target in HTRT. Materials and Methods This study included 30 patients with breast cancer: 11 with right-sided and 19 with left-sided breast cancer. All patients had undergone breast-conserving surgery. This study was conducted with the approval from our institutional review board. All patients provided informed written consent. Computed tomography (CT) images were obtained using a scanner with 2 Breast Cancer: Basic and Clinical Research 16 detector arrays (LightSpeed Xtra; GE Healthcare, Waukesha, WI, USA), with patients in the supine position on a breast board with both arms above their heads. Radiopaque markers were placed at the midline, the mid-axillary line, and 1 cm below the infra-mammary fold. Scanning was performed in 2.5-mm slices from the hyoid bone to the mid-abdomen during free breathing. All CT images were transferred to a computer with Eclipse External Beam Planning 8.6 software (Varian Medical Systems, Palo Alto, CA, USA). The clinical target volume consisted of the remaining whole breast and axilla levels I and II. The axilla levels I and II were delineated by referring to the contouring atlas of breast cancer provided by the Radiation Therapy Oncology Group (Figure 1). 12 The planning target volume (PTV) was obtained by adding 5-mm margins and removing 5 mm of the build-up region from the skin surface of the breast (PTVeval). Each patient's plan was normalized to a reference point at the interface of the breast and pectoralis major muscle at the level of the nipple. None of the reference points was on the lung parenchyma or the border between the lung and chest wall. A 6-MV energy photon beam was used. The prescribed dose was 50 Gy in 25 fractions. The dose calculation algorithm used was the analytic anisotropic algorithm. The radiotherapy plan was generated as follows: 2 opposed tangential fields were created according to the clinically determined borders, and the gantry angles and beam weight were optimized (Conv-p) ( Figure 2). Leaf margin of 2 cm was added to the skin side and leaf margins of 3 mm to the other side. The method used to create the FIF plan (FIF-p) has been reported previously. 13 The medial fields were copied as the first subfield. Using multileaf collimators (MLCs) for blocking, the dose to the first subfield was 1% to 3% lower than the maximum dose on the beam's eye view. After dose calculation, the beam weight was shifted away from the original field to the first subfield until the dose cloud disappeared. The lateral field was copied as the second subfield. Again using MLCs for blocking, the dose to the second subfield was 2% to 4% lower than the dose blocked in the first subfield, and the beam weight was shifted as described above. If the maximum dose was over 107% of the prescribed dose, the medial field was copied again as the third subfield. The MLCs were not allowed to block within 1 cm of the reference point. The minimum monitor unit of each subfield was 5. Finally, the plan with lung-blocked subfields (FIF-LB-p) was created. Another main field was copied again, and the MLCs were set to block the ipsilateral lung area (Figure 3). The beam weight of the lung-blocked subfield was set at approximately one-tenth of the main field. 3 A dose volume histogram was calculated for each patient. The doses administered to 95% (D95%) and 90% (D90%) as well as the mean dose (Dmean) of axilla levels I and II were calculated. The maximum dose (Dmax) to the breast or PTVeval and the volumes of the breast or the PTVeval receiving 95% and 90% of the prescribed dose (V95% and V90%, respectively) were also calculated. The homogeneity index (HI) was calculated as follows: HI = D2% − D98%)/prescribed dose, where D2% and D98% are the doses administered to 2% and 98% of the breast or PTVeval. The Dmean and the volumes of the ipsilateral lung receiving 20 Gy (V20 Gy) were calculated. Dosimetric parameters were compared using the Wilcoxon signed rank test. A P value less than.05 was considered to indicate a statistically significant difference. Results The mean age of the patients was 54 (range: 26-76) years. The mean (±SD) volumes of the axilla levels I and II were 35.5 (±16.8) and 14.6 (±5.0) mL, respectively. The mean (±SD) volume of the breast was 352.8 (±193.6) mL. Because the enrolled patients were Asian females, the mean breast volume was relatively small. The mean (±SD) volume of the PTV was 511.7 (±220.6) mL. The mean (±SD) volume of the ipsilateral lung was 1197.7 (±249.5) mL. The investigated methods were statistically significant but showed very small differences in the D95%, D90%, and Dmean of the axilla levels I and II (Table 1). About 90% of the axilla level I received approximately 44 Gy in any plan, and the mean dose was approximately 46 Gy in any plan. About 90% of the axilla level II received approximately 40 Gy in any plan, and the mean dose was approximately 43 Gy in any plan. The Dmax values of the breast and PTVeval were significantly lower for FIF-p and FIF-LB-p than Conv-p. The HI of the PTVeval was also significantly lower for FIF-p and FIF-LB-p than Conv-p ( Table 2). The HIs of the breast or PTVeval were significantly better for FIF-p than FIF-LB-p. V95% and V90% of the breast and PTVeval were also significantly better for FIF-p, indicating the advantages of FIF-p. The dose to the ipsilateral lung was significantly lower with FIF-LB-p than with other plans (Table 3). Discussion The ACSOG Z0011 trial analyzed 891 patients with clinical T1 and T2 invasive breast cancer and 1 to 2 sentinel lymph nodes with metastases. All patients underwent lumpectomy and tangential whole-breast radiotherapy. Those with sentinel lymph node metastases identified by SLNB were randomized to undergo ALND or no further axillary treatment. The 5-year overall survival and 5-year disease-free survival were not significantly different between the 2 groups. 4 Jagsi et al 14 pointed v20 Gy, the volumes of the ipsilateral lung receiving 20 Gy; Dmean, the mean dose to the ipsilateral lung; FIF, field-in-field; SD, standard deviation. a Significantly larger than in FIF-LB-p, Conv-p, or FIF-p. out that more than half of the patients treated in Z0011 were irradiated with a high tangent field in both arms. The EORTC 10981-22023 AMAROS trial analyzed 1425 SLNB-positive patients with T1 and T2 invasive breast cancer. In total, 744 patients were randomly assigned to receive ALND followed by tangential whole-breast radiotherapy, and 681 patients received HTRT without ALND. The 5-year axillary recurrence rate was 0.43% after ALND and 1.19% after HTRT. Both ALND and HTRT in SLNB-positive patients provide excellent and comparable axillary control. 5 However, the planned noninferiority test was underpowered because of the low number of events. Lymphedema in the ipsilateral arm was noted significantly more often after ALND than after HTRT at 1, 3, and 5 years. Therefore, attempts have been made to omit ALND even for SLNB-positive patients if certain conditions are met. As a replacement to this procedure, HTRT that intentionally irradiates the axillary lymph node region was examined. In the National Comprehensive Cancer Network guidelines, patients with 1 or 2 positive sentinel lymph nodes are not recommended to undergo axillar dissection under certain conditions (eg, existence of T1 or T2 tumor, whole-breast radiation therapy planned, no preoperative chemotherapy administered). 15 It is speculated that the opportunities to perform postoperative irradiation in patients with 1 or 2 positive sentinel lymph nodes who do not undergo axillary dissection will increase in the near future. High tangent radiation therapy would be appropriate in these populations. High tangent radiation therapy considers the cranial border of the irradiation field to be within 2 cm of the humeral head that receives high tangents. 16 The coverage of the axillary region is better in HTRT than in whole-breast tangential radiotherapy both in 2-dimensional (2D)-based plans and 3-dimensional (3D)-based plans. 17,18 However, the doses to the ipsilateral lung were also high in HTRT. Alo et al 19 reported that the coverage of the axillary region was better in 3D-based plans than that in 2D-based plans for HTRT. The doses to the ipsilateral lung were also high in the 3D-based plans. Ohashi et al 20 also reported that the doses to the axillary region were higher in 3D-based plans than in 2D-based plans for HTRT. There was no significant difference in doses to the breast between 2D and 3D-based plans. Sanuki et al 21 reported that the 3D-based HTRT improved axillary control compared with 2D-based HTRT. Thus, HTRT improves the dose to the axillary region. However, the problem with HTRT is that it results in higher doses to the ipsilateral lung. In this study, we compared 3D-based HTRT with or without the FIF technique. In HTRT, the shape and thickness of the target differ considerably depending on the part, compared with normal tangential whole-breast radiation therapy; that is, it is more difficult to control dose homogeneity in HTRT than in normal tangential radiation therapy. We conducted this study to confirm whether dose homogeneity of the target could be controlled in HTRT using the FIF technique. These methods provided comparable axillary dose coverage. About 90% of the axilla level I was received approximately 44 Gy in any plan, and the mean dose was approximately 46 Gy in any plan. About 90% of the axilla level II was received approximately 40 Gy in any plan, and the mean dose was approximately 43 Gy in any plan. These values were thought to have a certain effect on the axillar lesion, which was not detected on the imaging diagnosis. Homogeneity indices of the breast and PTVeval were significantly better in HTRT with the FIF technique (FIF-p and FIF-LB-p) than in HTRT without the FIF technique (Conv-p). The HI, V95%, and V90% were significantly better for FIF-p than FIF-LB-p. These results were suggestive of the advantages of FIF-p. However, the dose to the ipsilateral lung was significantly lower with FIF-LB-p than with the other plans. Lung blocks were useful for reducing the dose delivered to the lungs, but a simultaneous decrease in the breast or PTVeval was observed. The average Dmean and V20 Gy of the ipsilateral lung in FIF-p was 10.5 and 20.2 Gy, respectively. Oetzel et al 22 reported that the recommended mean ipsilateral lung dose to eliminate the risk of grade 2 pneumonitis is 15 Gy. Alternatively, Graham et al 23 reported that the recommended V20 Gy of the ipsilateral lung to eliminate the risk of grade 2 pneumonitis is 22%. Present results were within an acceptable range of both recommendations. However, some of the patients (20%) had V20 Gy of the ipsilateral lung exceeding 22%. These patients might require lung blocks when planning for radiation planning. In conclusion, the FIF technique was useful in HTRT and improved homogeneity in the target.
package model; import java.awt.image.BufferedImage; import java.util.ArrayList; import java.util.Observable; import contract.Direction; import contract.IModel; import model.dao.DAOMap; import model.dao.DBConnection; import model.dao.GameSettingsProperties; import model.element.Element; import model.element.Mobile; public final class Model extends Observable implements IModel { private final DAOMap daoMap; private final GameSettingsProperties gameSettings = new GameSettingsProperties(); private Map map; private int score; public Model() { this.daoMap = new DAOMap(DBConnection.getInstance().getConnection()); this.map = this.daoMap.loadMap(this.gameSettings.getMapId()); } public Map createMapFromFile(final String fileName) { return this.daoMap.createMapFromFile(fileName); } @Override public synchronized void gameUpdate(final Direction direction) throws Exception { // final int tempX; // final int tempY; // System.out.println(direction); if (this.map.getPlayer() == null) { System.exit(0); } this.map.getPlayer().playerUpdate(direction, this.map); final ArrayList<Element> elementsTemp = new ArrayList<Element>(this.map.getElements()); for (final Element element : elementsTemp) { // tempX = ((Mobile) element).getX(); // tempY = ((Mobile) element).getY(); ((Mobile) element).update(this.map); } this.map.setElements(elementsTemp); // System.out.println("test"); this.setChanged(); this.notifyObservers(); } public Map getMap() { return this.map; } public Element[][] getMapping() { return this.map.getMapping(); } @Override public Observable getObservable() { return this; } public int getScore() { return this.score; } @Override public synchronized BufferedImage[][] getSprites() { final BufferedImage[][] sprites; final Element[][] elements = this.getMapping(); sprites = new BufferedImage[this.map.getWidth()][this.map.getHeight()]; for (int i = 0; i < sprites.length; i++) { for (int j = 0; j < sprites[i].length; j++) { if (elements[i][j] != null) { sprites[i][j] = elements[i][j].getSprite(); } } } return sprites; } public void saveMap() { this.daoMap.saveMap(this.map); } public void setMap(final Map map) { this.map = map; } public void setScore(final int score) { this.score = score; } private synchronized void kill(final Map map, final int x, final int y) throws Exception { map.getElements().remove(map.getElementByPosition(x, y)); map.setElementToPosition(null, x, y); } }
package parcialii.model.decorator; abstract class BusInfo implements Bus { protected Bus busInfo; public BusInfo(Bus busInfo) { this.busInfo = busInfo; } @Override public String getTodo() { return busInfo.getTodo(); } @Override public void setTodo(String placa, int capacidad, String marca) { busInfo.setTodo(placa, capacidad, marca); } }
<filename>Master Sword/src/main/java/HiggsBosonParticleinEffect/excalibur/MyFrame.java package HiggsBosonParticleinEffect.excalibur; public class MyFrame extends Nucleus1 { /** * */ private static final long serialVersionUID = 1L; private static final String MethodParameters = null; public MyFrame() { initComponents(42); centraliza(MethodParameters); } private void centraliza(String methodparameters2) { } private void initComponents(int i) { // TODO Auto-generated method stub } public void setVisible(boolean b) { // TODO Auto-generated method stub } }
<filename>TubeTKLib/Filtering/itktubeEnhanceContrastUsingPriorImageFilter.h<gh_stars>0 /*========================================================================= Library: TubeTK Copyright 2010 Kitware Inc. 28 Corporate Drive, Clifton Park, NY, 12065, USA. All rights reserved. Licensed under the Apache License, Version 2.0 ( the "License" ); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. =========================================================================*/ #ifndef __itktubeEnhanceContrastUsingPriorImageFilter_h #define __itktubeEnhanceContrastUsingPriorImageFilter_h #include <itkArray.h> #include <itkImageToImageFilter.h> #include <itktubeContrastCostFunction.h> #include <itkNormalVariateGenerator.h> #include <itkOnePlusOneEvolutionaryOptimizer.h> #include <itkFRPROptimizer.h> #include <itkImageRegionIterator.h> namespace itk { namespace tube { /** \class EnhanceContrastUsingPriorImageFilter */ template< class TPixel, unsigned int VDimension > class EnhanceContrastUsingPriorImageFilter : public ImageToImageFilter< Image< TPixel, VDimension >, Image< TPixel, VDimension > > { public: /** Standard class typedefs. */ typedef Image< TPixel, VDimension > ImageType; typedef EnhanceContrastUsingPriorImageFilter Self; typedef ImageToImageFilter< ImageType, ImageType > Superclass; typedef SmartPointer< Self > Pointer; typedef SmartPointer< const Self > ConstPointer; /** Method for creation through the object factory. */ itkNewMacro( Self ); /** Run-time type information ( and related methods ). */ itkTypeMacro( EnhanceContrastUsingPriorImageFilter, ImageToImageFilter ); /** Some convenient typedefs. */ typedef itk::tube::ContrastCostFunction< TPixel, VDimension > ContrastCostFunctionType; typedef itk::OnePlusOneEvolutionaryOptimizer InitialOptimizerType; typedef itk::FRPROptimizer OptimizerType; typedef itk::ImageRegionIterator< ImageType > ImageIteratorType; /** Set/Get input Mask Image */ itkSetObjectMacro( InputMaskImage, ImageType ); itkGetObjectMacro( InputMaskImage, ImageType ); /** Set/Get Object Scale */ itkSetMacro( ObjectScale, float ); itkGetMacro( ObjectScale, float ); /** Set/Get Background Scale */ itkSetMacro( BackgroundScale, float ); itkGetMacro( BackgroundScale, float ); /** Set/Get Mask Object Value */ itkSetMacro( MaskObjectValue, int ); itkGetMacro( MaskObjectValue, int ); /** Set/Get Mask Background Value */ itkSetMacro( MaskBackgroundValue, int ); itkGetMacro( MaskBackgroundValue, int ); /** Set/Get Optimization Iterations */ itkSetMacro( OptimizationIterations, int ); itkGetMacro( OptimizationIterations, int ); /** Set/Get Optimization Seed */ itkSetMacro( OptimizationSeed, int ); itkGetMacro( OptimizationSeed, int ); protected: EnhanceContrastUsingPriorImageFilter( void ); virtual ~EnhanceContrastUsingPriorImageFilter( void ) {} void PrintSelf( std::ostream& os, Indent indent ) const; virtual void GenerateData( void ); private: //purposely not implemented EnhanceContrastUsingPriorImageFilter( const Self& ); //purposely not implemented void operator=( const Self& ); typename ImageType::Pointer m_InputMaskImage; float m_ObjectScale; float m_BackgroundScale; int m_MaskObjectValue; int m_MaskBackgroundValue; int m_OptimizationIterations; int m_OptimizationSeed; }; // End class EnhanceContrastUsingPriorImageFilter } // End namespace tube } // End namespace itk #ifndef ITK_MANUAL_INSTANTIATION #include "itktubeEnhanceContrastUsingPriorImageFilter.hxx" #endif #endif // End !defined( __itktubeEnhanceContrastUsingPriorImageFilter_h )
<filename>src/restful/ApiApp.py import hashlib import os import time from flask import Flask from flask.logging import default_handler from src.logger import Logger from src.restful.RecommendationEndpoint import RecommendationEndpoint from src.restful.oauth2.AuthenticationEndpoint import AuthenticationEndpoint from src.restful.oauth2.Oauth2 import configOauth2 from src.restful.oauth2.OauthModel import db, User, OAuth2Client class ApiApp: def __init__(self): self._logger = Logger.getLogger(__name__, logPath='logs/server.log', console=True) self._app: Flask = Flask(__name__) self._app.logger.removeHandler(default_handler) self._app.logger.addHandler(self._logger.handlers[1]) self.app.config.from_json('../../config.json') oauthEndpoints = AuthenticationEndpoint().oauthEndpoints self.app.register_blueprint(oauthEndpoints) endpoints = RecommendationEndpoint().apiEndpoints self.app.register_blueprint(endpoints) if self.app.config.get('DEV_MODE'): self.handleInDevMode() db.init_app(self.app) configOauth2(self.app) _app = self._app @_app.before_first_request def create_tables(): if not self.app.config.get('DEV_MODE'): return self.logger.info("In dev mode, auto create authentication database.") db.create_all() self.logger.info("In dev mode, create default admin.") admin = User(username=self.app.config.get('DEF_ADMIN'), password=<PASSWORD>5(self.app.config.get('DEF_ADMIN_PASS').encode()).hexdigest(), scope='manager') db.session.add(admin) self.logger.info("In dev mode, create default client.") client_id = self.app.config.get('DEV_CLIENT_ID') client_id_issued_at = int(time.time()) adminClient = OAuth2Client(client_id=client_id, client_id_issued_at=client_id_issued_at, user_id=admin.id) client_metadata = { "client_name": 'sample_client_name', "client_uri": 'sample_client_uri', "scope": 'manager', "grant_types": ['authorization_code', 'password'], "redirect_uris": 'www.google.com', "response_types": 'code', "token_endpoint_auth_method": 'client_secret_basic' } adminClient.client_secret = self.app.config.get('DEV_CLIENT_SECRET') adminClient.set_client_metadata(client_metadata) db.session.add(adminClient) db.session.commit() @property def logger(self) -> Logger: return self._logger @property def app(self) -> Flask: return self._app @app.setter def app(self, value): pass def handleInDevMode(self): os.environ['AUTHLIB_INSECURE_TRANSPORT'] = '1' if os.path.isfile('data/oauth2/db.sqlite'): os.remove('data/oauth2/db.sqlite')
import { Constants } from '../../constants'; export enum ValidationResultSeverity { INFO = 'http://www.w3.org/ns/shacl#Info', WARNING = 'http://www.w3.org/ns/shacl#Warning', Violation = 'http://www.w3.org/ns/shacl#Violation' }
Watch It, Democrats. You Could Still Slip Up. But after the first rounds of caucuses and primaries, the prospects don't look so rosy for the Democrats or so bleak for the Republicans. The presidential race now looks like a tossup -- perhaps even with a Republican edge. If Democrats don't stay smart, tough-minded and realistic, we could blow it yet again. The first problem is our likely foe. Especially after his victory in South Carolina, Sen. John McCain has a plausible route to the GOP nomination, and he remains by far his party's best bet for holding on to the White House. The Republican field has been so preoccupied with appealing to the party's hard-core base that it seems that the eventual winner will have little appeal to the independent voters who can swing a general election. Even McCain started out by embracing the evangelical Christians he had once denounced. But as his seemingly dead campaign has been reborn, his initial efforts to pander to the religious right have been forgotten, and he is once again happily running as a "maverick." Though his nomination is hardly guaranteed, the Arizona senator would provide the GOP with a powerful mix of continuity and change -- continuity with the Bush administration on Iraq at a moment when it has become conventional wisdom that the "surge" is succeeding, and a sense of change and freshness from McCain's cheerfully frank past deviations from conservative orthodoxy. But the major reason I see trouble ahead for the Democrats is that voting patterns so far, as well as rumbling tensions over race and gender, suggest serious vulnerabilities in both of the Democratic front-runners that McCain (or another rival) could exploit. Most pundits assume it's the Republicans who have the weak field, but the leading Democrats -- both attractive and impressive people -- carry dangerous downsides of their own. Sen. Barack Obama appeals strongly to affluent whites and minorities -- the old John Lindsay coalition -- but he seems to lose working-class whites. Moreover, if the pollsters turn out to have been wrong in predicting the outcome in New Hampshire in part because of the "Bradley effect" -- that is, the polling tendency to overestimate the number of votes a black candidate will win because some bigoted whites refuse to speak to pollsters or claim to be undecided -- then Democrats may also be deceiving themselves about the Illinois senator's chances in the general election. National surveys that show Obama beating various Republicans may be overstating his potential share of the vote. For her part, Sen. Hillary Rodham Clinton has done better at appealing to lower- and middle-income whites, especially women. But her loss to Obama among male voters in New Hampshire suggests that just as race may block Obama's path to the presidency, so gender may obstruct hers. That's hardly a surprise, of course. But Democrats have been so excited about the prospect of a historical breakthrough that many of them seem to forget that plenty of voters are still swayed by old prejudices. Although each candidate faces deep and abiding obstacles, racism today operates for the most part insidiously, below the surface of politics, while gender stereotypes are on more open display. Even when race rises to the surface in a political campaign, as it did last week, it usually carries with it an uncomfortable sense that the conversation is coded and that anyone bringing up the subject is out to stigmatize a black candidate. By contrast, women can be belittled and mocked in ways that no one would dare publicly try with African Americans. (Remember the boor who disrupted a Jan. 7 Clinton rally in Salem, N.H., by yelling "Iron my shirt!" at the senator?) And in Clinton's case, much of the acid sprayed at her comes from other women, some of them on the op-ed pages of national newspapers. It was never going to be easy to elect a woman or an African American president of the United States. And it is a cruel historical twist that the republic has its first serious female candidate for president at the same time that it has its first serious black candidate, forcing the two to fight each other for the Democratic nomination. Neither Obama nor Clinton is running on their identity, but because the substantive policy differences between them are so small, identity has become central to their showdown. Even with the best of intentions, this kind of competition can easily take an ugly turn as incidental remarks or minor episodes get turned into symbols of seeming disrespect or become viewed as forms of strategic insinuation.
#include "Parent.h" void charges(double* charge, double* average, FILE* infile) { double hours = 0; fscanf(infile, "%lf", &hours); fscanf(infile, "%lf", &hours); fscanf(infile, "%lf", &hours); fscanf(infile, "%lf", &hours); double duplicate = hours; if (hours <= 10) *charge = 7.99; else { hours -= 10; *charge = 7.99 + 1.99 * hours; } *average = *charge / duplicate; } double round_money(double charge) { charge *= 100; charge = (charge > (floor(charge) + 0.5)) ? ceil(charge) : floor(charge); return charge /= 100; } void revenue(double* R, int t) { *R = 203.265 * pow(1.071, t); } void predict(int* year, double revenue) { if (revenue <= 203.265) *year = 1984; else { *year = log10(revenue / 203.265) / log10(1.071) + 1984; } }
Burden of tuberculosis in Xinjiang between 2011 and 2015: A surveillance data-based study Background Despite the reduction in reported incidence of tuberculosis globally, the burden of pulmonary tuberculosis (PTB) remains high in low- and middle- income countries, including China. The current study aims to evaluate the distribution and trend of PTB incidence in Xinjiang, the region with the highest PTB burden in China. Methods We identified all confirmed PTB case records reported to the Chinese TB Information Management System (TBIMS) between 2011 and 2015. We analyzed these records to measure the annual incidence of reported smear-positive PTB cases in Xinjiang and its trend over time. We also analyzed incidence by gender, residential area, and region. Spatial analysis was used to describe the inter-regional disparity of the disease burden during the study period. Results We identified 212,216 smear-positive PTB cases between 2011 and 2015. The reported incidence increased from 180.8 cases in 2011 to 195.8 cases in 2015 per 100,000 population. The southern region of Xinjiang had the highest disease burden (257.8/100,000 in 2011 and 312.7/100,000 in 2015). More than 60% cases occurred in persons >45 years, and 76% of cases lived in rural areas. Conclusion To reach the goal of elimination and control of TB, more comprehensive STOP TB strategies should be implemented in Xinjiang. Residents in the southern region and rural areas of Xinjiang require particular attention. Methods We identified all confirmed PTB case records reported to the Chinese TB Information Management System (TBIMS) between 2011 and 2015. We analyzed these records to measure the annual incidence of reported smear-positive PTB cases in Xinjiang and its trend over time. We also analyzed incidence by gender, residential area, and region. Spatial analysis was used to describe the inter-regional disparity of the disease burden during the study period. Results We identified 212,216 smear-positive PTB cases between 2011 and 2015. The reported incidence increased from 180.8 cases in 2011 to 195.8 cases in 2015 per 100,000 population. The southern region of Xinjiang had the highest disease burden (257.8/100,000 in 2011 and 312.7/100,000 in 2015). More than 60% cases occurred in persons >45 years, and 76% of cases lived in rural areas. Conclusion To reach the goal of elimination and control of TB, more comprehensive STOP TB strategies should be implemented in Xinjiang. Residents in the southern region and rural areas of Xinjiang require particular attention. a1111111111 a1111111111 a1111111111 a1111111111 a1111111111 Introduction Despite major achievements in tuberculosis (TB) prevention and control, TB remains a major global public health issue, especially in the low-and middle-income countries.. In China, although TB prevalence has decreased by 50% over the last two decades, it remains alarmingly high in resource-limited settings. In several regions of western China, although the prevalence of smear-positive TB decreased by 25% between 1990 and 2010, the prevalence of bacteriologically confirmed pulmonary TB (PTB) increased by 17.8%. The Xinjiang Uighur Autonomous Region is a resource-poor territory of western China with a population of 20 million people belonging to thirteen different ethnic groups. Ethnic diversity and resulting conflict coupled with stringent socio-cultural norms and religious practices may have contributed to the limited development of this region as a whole. As a result, the roll-out of a comprehensive TB control program was halted for years and only expanded to the whole region after 2000. Consequently, the burden of TB in Xinjiang has remained one of the highest among all provinces in China during the last two decades. The reported incidence of smear-positive PTB was estimated to be as high as 231 and 170 per 100,000 people during 2000 and 2010, respectively. Although surveillance data showed a slight decrease in the reported incidence of smear-positive TB, there was a simultaneous, conflicting increase in the number of bacteriologically confirmed cases. Further, the majority of the studies conducted among TB patients residing in Xinjiang are burdened by small sample sizes and scarcity of local data. The Xinjiang TB epidemic thus remains grossly understudied. The goal of this study was to develop an updated, valid estimate for the reported incidence of smear-positive TB in Xinjiang using a record-based analysis through data collected from the Chinese TB Information Management System (TBIMS). In addition, we sought to determine the distribution and variation of TB cases across time, geographic areas, and socio-demographic variables. Data collection We collected reported TB cases from 2011-2015 from the Chinese TB Information Management System (TBIMS, http://www.phsciencedata.cn/Share/index.js). Information regarding TBIMS has been described elsewhere in detail. In brief, TBIMS is a registry, containing real-time information of TB cases reported from all provinces in China. Since 2011, TBIMS has been structured into three case-definition-based databases containing information on pulmonary, extra-pulmonary and drug-resistant (presumptive diagnosis) TB cases. Each PTB case is diagnosed based on the case definitions per WHO guidelines and ICD-10. All PTB cases in mainland China are recorded in the PTB database of TBIMS within 24 hours of diagnosis. The diagnosis of PTB mainly depends on results of laboratory examination (sputum smear positivity), combined with chest imaging, personal history, clinical manifestations and necessary auxiliary examinations. For the present study, we collected all cases recorded in the PTB database that were smear positive. We also collected information on reporting time, patient ID, address, age, gender, race, medical history, laboratory testing results, chest imaging results and clinical manifestations. To ensure the quality of the data, we only included cases that reported a set of specified key variables. Data management To protect confidentiality, all personal identification information was removed from the database before data analysis. To confirm local residency and to exclude migrant populations, we only included cases who had been residing in their current household for at least last six months. We categorized the study population into five age-groups: 0-15, 16-30, 31-45, 46-60 and >60 years. Depending on the recorded address, the patients were classified into urban and rural residents. Residential areas were classified as southern, northern or eastern regions of Xinjiang and subclassified into counties. The population of Xinjiang and each of its cities were determined from the Statistical Yearbook of Xinjiang Uygur Autonomous Region and the Social Development Statistical Communique of Xinjiang Uygur Autonomous Region. Data analysis We used descriptive analysis to examine the distribution of the demographic characteristics among the participants. We calculated the annual incidence of smear-positive PTB in Xinjiang by dividing the number of smear-positive PTB cases identified per year by the total population size. We also calculated the PTB incidence by region, gender and residential area (urban and rural) and evaluated trends in the reported incidence by examining patterns in crude OR. ArcGIS 10.2 software (ESRI Inc., Redlands, CA, USA) was used for spatial analysis, to describe the inter-regional disparity of the disease burden during the study period. Ethics statement The study protocol, contents, and procedures were reviewed and approved by the Institutional Review Board of the Xinjiang Uygur Autonomous Region CDC. The study was based on case records only and did not requre informed consent. The funders of the study had no role in study design, data collection, data analysis, data interpretation, or writing of the report. The Xinjiang CDC operated under the general guidance of the Xinjiang Uyghur Autonomous Region Health Bureau and was responsible for the survey design and field investigation. Demographics Between 2011 and 2015, a total of 212,216 smears positive PTB cases were reported to TBIMS and included in the current study. The number of cases reported annually increased from 37,954 in 2011 to 46,205 in 2015. Among the included cases, 52.6% were male, 4.6% were aged 15 years, and 62.4% were aged >45 years (34.1% aged >60 years). 76.0% of the cases lived in rural areas of Xinjiang. The majority of the cases (71.8%) were reported from the southern region of Xinjiang Uygur Autonomous Region, whereas the eastern region reported only 2.9%. Also, 2.0% of the cases were reported from four counties directly managed by the province. Overall, the gender and age distribution of the reported cases remained unaltered across the study period of five years. However, the proportion of cases reported from rural areas increased from 71.4% in 2011 to 77.6% in 2015 (P for trend <0.001). In addition, the proportion of cases reported from the southern region also increased from 66.4% in 2011 to 73.8% in 2015 (P for trend <0.001) ( Table 1). Population reported incidence Within the study period, the overall population level incidence of reported PTB increased over time, from 180. (Table 2). Detailed case numbers, population sizes, and demographics are provided in S1 File. The annual incidence of reported PTB among rural residents was much higher than that among urban residents, and the overall reported incidence in the rural population increased from 228.7 cases per 100,000 people (95% CI = 226.0-231.4) in 2011 to 287.8 cases per 100,000 people (95% CI = 284.8-290.8) in 2015. The southern region of Xinjiang Uygur Autonomous Region had the highest reported incidence, while the counties administratively managed by the province had the lowest reported incidence of PTB. In addition, the reported incidence of PTB in the southern region increased from 257.8 cases per 100,000 people (95% CI = 254.7-260.9) in 2011 to 312.7 cases per 100,000 people (95% CI = 309.4-316.0) in 2015 ( Table 2). The Northwest region also has a relatively high reported incidence of PTB, specifically in Tacheng and Karamay (Fig 1). Discussion The current study analyzes 212,216 smear-positive PTB cases reported to the TBIMS between 2011 and 2015. We found that the incidence of PTB remains high with an increasing trend. This study contributes to the existing literature by examining the incidence of PTB in one of the highest-burden regions in China. We also identified an increasing trend in reported incidence of cases over time and demonstrated regional disparities in disease burden. Overall our work emphasizes the urgent need for more comprehensive intervention strategies to control PTB in the region, particularly in southern Xinjiang. Xinjiang has been implementing directly observed treatment, short-course (DOTS) control strategy for more than ten years. However, the present study indicates that the reported incidence of smear positive PTB in Xinjiang remained as high as 195.8 cases per 100,000 people in 2015. Although this reported incidence is lower than the reported incidence from 1990 (231 per 100 000 people), it is higher than the reported regional figure for 2010 (170 per 100,000 people), and is much higher than values reported from eastern and central China. Furthermore, this reported incidence is about 1.6 times the global burden of PTB reported in 2012, and higher than many countries in Africa. There are several plausible explanations for such a high reported incidence of PTB in this region. First of all, as one of the most resource-poor regions of China, Xinjiang has a weak primary care system in place. People in Xinjiang, especially rural residents in the Southern region, tend to have poor access to health care. Secondly, Xinjiang, is one of the regions in the country with high reported incidence of multidrug-resistant TB. Unsuccessfully treated cases may exacerbate re-infection in the community and thus result in upsurge and reemergence of PTB. Further, due to sociopolitical, religious and other logistic barriers, there may be a lack of effective implementation of PTB control programs in this region. Last but not least, the increased PTB incidence may actually be a sign of improved access to health care, especially for people living in the rural areas. As a result of economic development, more TB patients may have gained access to medical facilities, causing TB monitoring systems to pick up more patients and increase the incidence of reported TB. Future studies should aim to confirm these potential reasons and help design targeted intervention strategies. In 2006, under the supervision of the WHO, Xinjiang implemented the STOP TB strategy, which aimed to reduce the reported incidence of death due to TB by 50% between 1990 and 2015. Previous research has shown that the overall reported incidence of smear-positive PTB decreased by 26% from 1990 to 2010-11. The reported National-level incidence of smear-positive TB also supposedly decreased in all provinces after 2000. However our results indicate a progressively increase in the reported incidence of smear-positive PTB in the study region and an overall increase in PTB cases of about 10% during the study period. This trend was more evident among females, rural residents and those residing in southern region of Xinjiang. In fairness, the observed increase of PTB could be due to improved case detection and reporting. However, this increase raises worrisome questions regarding the effectiveness of ongoing PTB control programs. To curb this upsurge of PTB and achieve the goal of TB elimination by 2030, public health officials might consider reinforcing existing TB control strategies, including DOTS, as well as supplementing targeted intervention strategies, including promotion of TB screening among high-risk population groups. We observed regional disparity in the reported incidence of PTB, with the highest burden of PTB in the southern region of Xinjiang. This observation was consistent with the results of spatial analysis, which showed "hot spots" of PTB incidence in the Southwest region. Compared to other parts of Xinjiang, the Southern region of Xinjiang is more rural and underdeveloped, with less access to health care; these are all potential factors contributing to higher PTB incidence. Another potential contributor to this regional disparity could be the inequity in the allocation of public health resources across Xinjiang: Due to ethnic, social and cultural factors, the Southern region has historically received less attention regarding health care and fewer TB prevention and control programs. To deal with these issues, targeted intervention programs for TB control and elimination should be specifically reinforced in the Southern region of Xinjiang. We also observed large variations in the reported incidence of PTB between rural and urban populations. Previous studies indicated that rural residents in Xinjiang tend to have less education and access to health care, and reside in the poorer living environments compared to their urban counterparts. PTB patients from rural Xinjiang are likely to present later to the TB treatment clinics, after having a chance to transmit the disease to others. Hence, in order to control PTB in Xinjiang, it is essential to improve primary care capacity and emphasize timely referral and reporting of the TB cases to the DOTS facilities in rural areas. Our study has several important potential limitations, most of which are related to its surveillance data-based design. First, there may have been duplication of reporting, which could have led to an overestimation of the disease burden. In order to prevent this, study personnel from all county/city level CDC were instructed to double check the cases based on recorded address and other personal information. Second, for each case, only a few socio-demographic (for example, ethnic group) and behavioral variables were recorded in the case report system, limiting the scope of the analysis, especially with regard to risk factors and driving forces behind this epidemic. In addition, these data were not reported individually, which prevented us from conducting traditional trend tests and multivariate logistic regressions. Third, underreporting due to insufficient access to healthcare systems could be another issue in this current study, and may have resulted in an underestimation of the ongoing epidemic. Finally, we were unable to separate previously existing TB cases from newly diagnosed cases among all reports from 2011 to 2015. Conclusion Overall, the burden of smear-positive PTB was found to be high in Xinjiang, with an increasing trend over time. The southern, rural regions of Xinjiang are experiencing a particularly large increase in reported TB cases, emphasizing the need for targeted intervention strategies. Supporting information S1 File. Dataset of the study. (XLS)
A GPU accelerated framework for monitoring LTE/5G interference to DVB-T systems This work presents a new computation system to evaluate the interference maps between the radio mobile signal and the DVB-T signal based on a multiprocessor computing architecture, such as GPU systems (Graphics Processing Units) designed for high-performance parallel computing. The goal is to overcome the time complexity of current approaches based on sequential implementations on multicores CPUs that require several hours to generate and update the interference maps of the Italian territory. The new systems design considers new parallel computing methodologies to consider rapid changes in the GPU hardware and uses a high-performance distributed SQL engine on RAPIDs to create an efficient and scalable framework for processing a massive volume of simulation data radio. Carrying out test on the radio-electric data of the Italian provinces with the most significant territorial extension shows compression of at least a factor of 30 in the execution times, which for the entire Italian territory fall below 20 minutes.
BitStream is a shot of technology news followed by a chaser of gadget rumors and hearsay. It's time to get drunk on all the knowledge you missed in the last 24 hours. Okay, so it's not exactly a zillion dollars, but Seacrest's heavily invested technology company, Typo, does owe BlackBerry $860,000 for basically ignoring a previous injunction issued in March over an intellectual property dispute. Typo, if you're lucky enough to have never heard of it, is a company that is trying to bring BlackBerry-like keyboard to the iPhone with its own special case. Unfortunately, the keyboard is a error-making terror, meaning Typo keyboards may have the most ironic name in technology. Oh, and the GIF up above is from the "so terrible it's now legend" rock music video that RIM (BlackBerry) made a few years back, and the excitement displayed in that video is hopefully on par with what the company is feeling on its big pay day. I know I would be excited and maybe going out for some classic rock karaoke. 9to5Mac's Mark Gurman, one of the best-known Apple insiders, laid out some rumors and details surrounding Apple's upcoming streaming service. Gurman says that Beats will be deeply integrated into iOS, iTunes, and Apple TV. The service is still centered around the user's music library but also incorporates Beats streaming library as well, and Apple is developing a search function that will let you choose among either. As is expected, Beats technology will be powering this new streaming service but will have Cupertino's design touch. If you're a huge fan of current Apple music services, well, they won't be going away, but this new Beats/Apple get together will overlap functionality with some of Apple's old apps. But maybe the most surprising move is price and availability. Gurman says that Apple is considering a price for about $8/month, which is a decrease from the current standard hovering around $10/month. Also, Apple may be making the service available to Android users as well, marking the first time Apple has ever made an in-house app available for the Android platform. Panoramas are a cool little trick of photography, baked into almost any smartphone, that extends the frame of any image exponentially. But unless your friends are statues, you're most likely going to get jagged and unfinished results. Microsoft Research just solved that problem. Updating its Image Composite Editor, the MS team has included what they're calling "Image Autocomplete" that uses computational photography to fill in any photographic gaps in your panorama creations. Check. It. Out. Android's latest update, Lollipop 5.1, just appeared in the wild, but only for Google's super-cheap smartphone platform Android One, a popular device of choice in developing markets like India. The update thankfully reintroduces silent mode, whose absence was one of the many gripes for the OG Lollipop, at least according to Android Pit.
A MAN and a woman have been killed after a car being chased by cops ploughed into a coach while driving the wrong way down a busy road yesterday. The smash on the A40 in Harrow, North London, which has also left a man injured, came after an aggravated burglary was reported to police at around 8.40pm. A witness said the car "crashed through some railings and into the coach" before bursting into flames. Three suspects were involved in the horror smash after police trailed their car for several miles towards central London. A police helicopter was called in to assist cops in the high-speed chase and reports on social media suggested as many as 10 police cars were involved in the pursuit. At around 9pm, the car being chased moved onto the wrong side of the carriageway and crashed with a coach near the junction of Kingsdown Avenue. A man and a woman were pronounced dead at the scene and a second man was taken to hospital for treatment. The condition of the surviving occupant has not yet been revealed. In a statement, the Met Police said: "As part of this response, a vehicle pursuit was initiated. The police helicopter was also called to assist. "At approximately 9pm the vehicle being pursued moved onto the wrong side of the carriageway on the A40. The police vehicles did not follow. "The vehicle was then in collision with a coach. There were three occupants in the vehicle. "Two people - one male and one female - were pronounced dead at the scene; a second male has been taken to hospital for treatment." Police said there are no reports of any other serious injuries following the horrifying collision. A local resident name Lucy said: "Someone is lying dead in the road outside my flat..." Describing the crash, she tweeted: "Car crashed through some railings and into a coach after a police chase, car burst into flames, every emergency vehicle in London turned up, pulled dead driver out, covered body with tent which is now just lying unattended..." Other witnesses described seeing "instant flames" as the car and coach collided. One Twitter user, Hina L, claimed: "I was driving westbound and had to swerve out of the way when the car came speeding towards me." While another, Li, said: "The coach they crashed into was right behind me. So shaken, all I saw was instant flames!" Road closures remain in place following the smash. Emergency vehicles including ambulances and fire engines attended the scene.
<gh_stars>10-100 /* * Do a lot of mallocs (and memsets, so should be a linear algorithm). Work is * done in the 'worker' function; the rest is parsing input and blocking main * until the threads get through said work. Optimization might nix the memset, * so compile perhaps via: * * env CFLAGS="-g -std=c99 -Wall -pedantic -pipe -lpthread" make malloc * * And then try out various thread count (-t) and memory usage (-m) values over * a given number of test runs (-c): * * for t in 1 2 4 8; do * ./malloc -c 100 -m $((2**31)) -t $t > out.$t * done * * NOTE that the -c count is per thread, so for equality between varied runs of * threads, -c will need to change proportionally to the thread count. The * downside of such is that low thread-count tests may take that much longer * to get through those extra tests. * * Then, presumably do stats (in particular, mean and standard deviation) on * the output, and compare the results for different number of threads, amounts * of memory, etc. For example, with my r-fu wrapper around R: * * for t in 1 2 4 8; do echo -n "$t "; r-fu msdevreduce out.$t; done > stat * R * > x=read.table("stat") * > plot(x$V1,x$V2,type='h',log='y',lwd=2,bty='n',ylab="Memset (seconds)",xlab="Thread Count") * * This test is perhaps of interest on multiprocessor systems with large * amounts of memory, as for the test runs I've done performance will improve, * bottom out, and then worsen as the total number of "CPUs" on the system is * reached by the thread count (assuming a large enough amount of memory is * consumed). * * On OpenBSD, limits in login.conf(5) will doubtless need to be raised, and * other systems or hardware may set various limits, depending. */ #include <sys/time.h> #include <err.h> #include <errno.h> #include <getopt.h> #include <limits.h> #include <pthread.h> #include <signal.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <sysexits.h> #include <time.h> #include <unistd.h> // https://github.com/thrig/goptfoo #include <goptfoo.h> #define MAX_THREADS 640UL #define NSEC_IN_SEC 1000000000 unsigned long Flag_Count; // -c unsigned long Flag_Memory; // -m unsigned long Flag_Threads; // -t unsigned long Threads_Completed; size_t Mem_Size; pthread_mutex_t Lock = PTHREAD_MUTEX_INITIALIZER; pthread_cond_t Job_Done = PTHREAD_COND_INITIALIZER; void emit_help(void); void *worker(void *unused); int main(int argc, char *argv[]) { int ch; pthread_t *tids; struct timespec wait; unsigned long i; #ifdef __OpenBSD__ if (pledge("stdio", NULL) == -1) err(1, "pledge failed"); #endif while ((ch = getopt(argc, argv, "c:h?lm:t:")) != -1) { switch (ch) { case 'c': Flag_Count = flagtoul(ch, optarg, 1UL, LONG_MAX); break; case 'l': setvbuf(stdout, (char *)NULL, _IOLBF, (size_t) 0); break; case 'm': Flag_Memory = flagtoul(ch, optarg, 1UL, LONG_MAX); break; case 't': Flag_Threads = flagtoul(ch, optarg, 1UL, MAX_THREADS); break; case 'h': case '?': default: emit_help(); /* NOTREACHED */ } } argc -= optind; argv += optind; if (Flag_Count == 0 || Flag_Memory == 0 || Flag_Threads == 0) emit_help(); if (!(tids = calloc(sizeof(pthread_t), Flag_Threads))) err(EX_OSERR, "calloc failed"); Mem_Size = (size_t) Flag_Memory / Flag_Threads; for (i = 0; i < Flag_Threads; i++) { if (pthread_create(&tids[i], NULL, worker, NULL) != 0) err(EX_OSERR, "could not pthread_create() thread %lu", i); } wait.tv_sec = 7; wait.tv_nsec = 0; while (1) { pthread_mutex_lock(&Lock); if (Threads_Completed == Flag_Threads) break; pthread_cond_timedwait(&Job_Done, &Lock, &wait); pthread_mutex_unlock(&Lock); } exit(EXIT_SUCCESS); } void emit_help(void) { fputs("Usage: malloc [-l] -c count -m memory -t threads\n", stderr); exit(EX_USAGE); } void *worker(void *unused) { int *x; long double delta_t; struct timespec before, after; unsigned long c; for (c = 0; c < Flag_Count; c++) { if (clock_gettime(CLOCK_REALTIME, &before) == -1) err(EX_OSERR, "clock_gettime() failed"); if (!(x = malloc(Mem_Size))) err(EX_OSERR, "malloc failed"); memset(x, 'y', Mem_Size); free(x); if (clock_gettime(CLOCK_REALTIME, &after) == -1) err(EX_OSERR, "clock_gettime() failed"); /* hopefully close enough via double conversion; the alternative would * be to trade off timer resolution against the total time thereby * possible to measure, which I have not looked into. */ delta_t = (after.tv_sec - before.tv_sec) + (after.tv_nsec - before.tv_nsec) / (long double) NSEC_IN_SEC; printf("%.6Lf\n", delta_t); } pthread_mutex_lock(&Lock); Threads_Completed++; pthread_mutex_unlock(&Lock); pthread_cond_signal(&Job_Done); return (void *) 0; }
There were some conflicting reports about the whereabouts of former Congressman Jesse Jackson Jr, but the Tribune has confirmed that he is not in custody. His lawyer says Jackson went to the Butner Federal Correctional Complex in North Carolina Monday to start his 30-month sentence, but he was turned away. Jackson was convicted of stealing from his campaign funds and spending it on luxury items. He’s supposed to start his 30-month prison sentence by November 1. Prison officials have not said why they turned him away. Jackson is said to have gone to the prison with Congressman GK Butterfield, some lawyers, but no family members. WGN-TV’s Mark Suppelsa spoke to his wife, former Chicago Alderman Sandi Jackson. She says her family was surprised that her husband turned himself in early. She says she found out when his lawyer called her Monday night. Another bribe. Yes folks, those are not days gone past in politics!
// Package hostapd is used to interact with hostapd's control interface. // More information about the control interface: // http://w1.fi/wpa_supplicant/devel/hostapd_ctrl_iface_page.html package hostapd
// SetPrPositiveTests sets the "prPositiveTests" field. func (iruo *InfectedRecordUpdateOne) SetPrPositiveTests(i int) *InfectedRecordUpdateOne { iruo.mutation.ResetPrPositiveTests() iruo.mutation.SetPrPositiveTests(i) return iruo }
import sys from render import print_board from constants.ui import PRINT_BOARD_PLACE_MARBLE def print_board_if_verbosity_is_set(board): if "-v" in sys.argv: print_board(board, PRINT_BOARD_PLACE_MARBLE, [])
Patternmapped multiple detection of 11 pathogenic bacteria using a 16s rDNAbased oligonucleotide microarray Pathogen detection is an important issue in human health due to the threats posed by severe communicable diseases. In the present study, to achieve efficient and accurate multiple detection of 11 selected pathogenic bacteria, we constructed a 16S rDNA oligonucleotide microarray containing doubly specific capture probes. Many target pathogens were specifically detected by the microarray with the aid of traditional perfect matchbased analysis using our previously proposed twodimensional visualization plot tool. However, some target species or subtypes were difficult to discriminate by perfect match analysis due to nonspecific binding of conserved 16S rDNAderived capture probes with high sequence similarity. We noticed that the patterns of specific spots for each strain were somewhat different in the twodimensional gradation plot. Therefore, to discriminate subtle differences between phylogenetically related pathogens, a patternmapping statistical model was established using an artificial neural network algorithm trained by experimental repeats. The oligonucleotide microarray system harboring doubly specific capture probes combined with the patternmapping analysis tool resulted in successful detection of all target pathogens including even subtypes of two closely related species showing strong nonspecific binding. Collectively, the results indicate that our novel combined system of a 16S rDNAbased DNA microarray and a patternmapping statistical analysis tool is a simple and effective method for detecting multiple pathogens. Biotechnol. Bioeng. 2010;106: 183192. © 2010 Wiley Periodicals, Inc.
Heat transfer papers for transferring letters, figures, designs, and other shapes (referred to collectively as “shapes”) to a substrate for the purpose of display and/or decoration have developed into a significant industry. When heat transfer paper is used for transferring letters, figures and designs to a substrate, there have been a variety of transfer methods. For instance, the desired shape can be printed onto the heat transfer paper, in advance, on a substrate with a thermally transferable material according to a proper printing method (e.g., silk screen printing, gravure printing, offset printing, etc.), and then the shape is transferred to the substrate. Another exemplary method includes applying a thermally transferable layer on the whole surface of the heat transfer paper, cutting out the desired shape(s) from the heat transfer paper, and then transferring the shape to a substrate using heat and pressure (e.g., applied to an ironing sheet). Methods where the shapes are formed through printing can be suitable for preparing a large amount of heat transfer materials of the same letters or figures and designs. However, the relatively high costs and expenses involved in printing can lead to high costs per unit, especially for small scale production. Methods where a heat transfer sheet having a thermally transferable layer applied onto the whole surface of a base which layer is cut into the desired shape can have a number of ways to apply the shapes to the substrate. In one example, the shapes can be cut fully out of the heat transfer paper (i.e., the shape is cut through the entire thickness of the heat transfer sheet), and then arranged and applied to the substrate to be transferred. However, this method can lead to inaccuracies and difficulties in exactly replicating the design when multiple shapes must be individually arranged together (e.g., multiple letters forming a word). Alternatively, the shape can be cut into the heat transfer material only to the base sheet (i.e., leaving the base sheet intact). For example, the shape can be cut using an automatic cutting machine controlled by a computer. There have been known a variety of methods for preparing letters or patterns with such an automatic cutting machine. Then, transfer tape can be utilized to remove the shape(s) from the heat transfer material and position it (them) on the substrate. However, in this method, the areas surrounding the shape to be transferred to the substrate must be removed (i.e., weeded) from the transfer material. Then, the remaining shape on the base sheet can be lifted from the base sheet and laid onto the substrate. Thus, the tape must be able to temporarily bond to the shape, and the substrate, withstand the transfer process, and then be removable from the transferred shape and the substrate without damaging either. Such selection of tape can be difficult, and the tape can significantly increase the cost of the transfer as suitable tape can be expensive. In another alternative method, the shape can be cut into the heat transfer material leaving the base sheet intact, and the areas surrounding the shape can be removed leaving only the shape on the base sheet. Then, the shape can be transferred to the substrate. However, removing the areas around the shape can be difficult using presently available heat transfer sheets. For example, the removal of the unnecessary portions of the transfer layer by peeling can be relatively easy when the thickness of the transfer layer which is applied onto the base sheet over a releasing layer is thick. However, such thick transfer layers can lead to overly thick shapes transferred onto the substrate and are subject to more wear over time. On the other hand, removing the unwanted portion of a thin transfer layer is difficult and can lead to deformation in the shape to be transferred. A need exists, therefore, for an improved method of heat transfer for shapes and improved heat transfer material.
import { Interaction } from 'discord.js'; import DiscordBot from '../../DiscordBot'; import Command, { Reply } from '../Command'; import CommandHandler from './CommandHandler'; export default class ReactionHandler { constructor() { DiscordBot._client.on('interactionCreate', this.onReaction.bind(this)); } private onReaction(interaction: Interaction): void { if (!interaction.isCommand()) return; const command: Command | undefined = CommandHandler._commands.find( (findCommand: Command): boolean => findCommand.deploy.name === interaction.commandName ); if (!command) return; const reply: Reply = command.handleCommand( interaction.options.data, interaction ); if (!reply.ephemeral) reply.ephemeral = false; if (!reply.afterResponse) reply.afterResponse = (): void => {}; interaction .reply({ content: reply.reply, ephemeral: reply.ephemeral }) .then(reply.afterResponse.bind(this)) .catch(console.error); } }
// // SwanKit.h // SwanKit // // Created by JK on 2020/10/09. // #import <Foundation/Foundation.h> //! Project version number for SwanKit. FOUNDATION_EXPORT double SwanKitVersionNumber; //! Project version string for SwanKit. FOUNDATION_EXPORT const unsigned char SwanKitVersionString[]; // In this header, you should import all the public headers of your framework using statements like #import <SwanKit/PublicHeader.h>
Q: How does the law of gravity work? I was taught that if I wanted to find the attraction force between two objects I would use the formula: $F=(G*m_1*m_2)/d^2$. Where $d$ is the distance from the center of object $m_1$ to $m_2$. I find this counter intuitive because in orbits the orbiting object orbits the center of mass not the center of the object. For instance if we pretended that we did not know the mass of the earth and attempted to find it using the period of the moon's orbit and the distance from the center of the earth to the center of the moon, we get an answer which is too large. So what is the purpose of the formula above? A: The $d$ in the formula is considered the distance between center of masses of the two objects - earth, and the satellite. If someone mentions the distance between center of the objects, they assume spherical bodies and uniform density, which is generally not true. The distance $d$ is actually distance between centers of masses of two bodies. Center of mass and center of object are assumed to be same if someone uses "center of object" in place of "center of mass".
Study on the Interaction between Gadolinium(III) Aminopolycarboxlicacid Complex and Bovine Serum Album by Spectroscopic Methods A novel gadolinium diethylenetriamine-N, N-bis (2-acetamide benzoic acid)-N, N-bisacetic acid complex has been synthesized and characterized by elemental analysis, infrared spectrum, ultraviolet spectroscopy and thermal analysis. The interaction between Gd3+ and aminopolycarboxlicacid ligand was investigated by fluorescence titration. The binding constant of this complex is calculated to be 1.2018104 Lmol-1, and binding stoichiometry is 1:1. Fluorescence spectra was also used to study the interaction between Gd (III) complex and bovine serum album (BSA). The results showed that Gd (III) complex can effectively quench the intrinsic fluorescence of BSA via static quenching. According to Stern-Volmer equation and Linewerver-Burk equation, the binding constant is calculated to be 3.7491104 Lmol-1 and binding site is about 1.0.
/** * @author Soren A. Davidsen <[email protected]> */ public class TriangularFunctionTest { @Test public void center() { TriangularFunction f = new TriangularFunction(0, 1, 2); assertEquals(1.0, f.center()); TriangularFunction f2 = new TriangularFunction(0, 10, 11); assertEquals(10.0, f2.center()); } @Test public void simple() { TriangularFunction f = new TriangularFunction(0.0, 1.0, 2.0); assertEquals(0.0, f.apply(-100)); assertEquals(0.0, f.apply(0.0)); assertEquals(0.5, f.apply(0.5)); assertEquals(1.0, f.apply(1.0)); assertEquals(0.5, f.apply(1.5)); assertEquals(0.0, f.apply(2.0)); assertEquals(0.0, f.apply(100.0)); } @Test public void leftOpen() { TriangularFunction f = new TriangularFunction(Double.NEGATIVE_INFINITY, 1.0, 2.0); assertEquals(1.0, f.apply(-100)); assertEquals(1.0, f.apply(0.0)); assertEquals(1.0, f.apply(0.5)); assertEquals(1.0, f.apply(1.0)); assertEquals(0.5, f.apply(1.5)); assertEquals(0.0, f.apply(2.0)); assertEquals(0.0, f.apply(100.0)); } @Test public void rightOpen() { TriangularFunction f = new TriangularFunction(0.0, 1.0, Double.POSITIVE_INFINITY); assertEquals(0.0, f.apply(-100)); assertEquals(0.0, f.apply(0.0)); assertEquals(0.5, f.apply(0.5)); assertEquals(1.0, f.apply(1.0)); assertEquals(1.0, f.apply(1.5)); assertEquals(1.0, f.apply(2.0)); assertEquals(1.0, f.apply(100.0)); } @Test public void testStartMiddleSame() { TriangularFunction f = new TriangularFunction(0, 0, 1); assertEquals(1.0, f.apply(0)); assertEquals(0.0, f.apply(-0.000000001)); f = new TriangularFunction(0, 1, 1); assertEquals(1.0, f.apply(1)); assertEquals(0.0, f.apply(1.00000001)); } }
Health promotion and health education: advancing the concepts. BACKGROUND Health education and health promotion activities are a fundamental requirement for all health professionals. These two paradigms are closely related but are not inter-dependent. Despite this, it is known that many nurses confuse the terms and use them interchangeably. With this in mind, it is necessary to re-conceptualize the terms in an attempt to bring them to a current form of 'maturity'. AIM The aim of the paper is to provide an up-to-date analysis of health promotion and health education that serves as a conceptual and operational foundation for clinicians and researchers. METHOD A concept analysis following the criterion-based methods described by Morse and her colleagues was applied to the terms health education and health promotion, using generic and nursing-related literature. RESULTS The conceptual literature on health education is consistent between generic and nursing-related sources. On the contrary, earlier nursing literature on health promotion is now at odds with more recent socio-political and community action models of health promotion, in that it focuses on individualistic and behavioural forms of 'health promotion'. A significant proportion of later nursing-related literature, however, suggests a maturing of the concept that brings it further in line with a socio-political health promotion agenda. CONCLUSION While the theoretical and conceptual literature surrounding health education has remained relatively constant and unchanged over the last decade or so, the same cannot be said for the health promotion literature. The evolving dominance of socio-political action in health promotion has overtaken individualistic and behaviourally-related forms. While the recent nursing literature addresses and acknowledges the place of socio-political activity as the mainstay of health promotion interventions, this is largely from a theoretical stance and is not applied in practice.
Vibratory feeders and conveyors are installed onto an equipment support structure usually within a building structure. Vibratory feeders and conveyors utilize some form of isolation system to minimize the transmission of unwanted vibratory forces to the equipment support structure, and to the building structure in which it is installed. Without the isolation system, the building and equipment support structures would vibrate from the transmitted forces, creating high noise levels and undesirable working conditions. If a structural member, or structural assembly, associated with the support structure of the vibratory feeder or conveyor has a natural frequency near the operating frequency of the vibratory feeder or conveyor, or near a harmonic of the operating frequency, the amplitude of the vibration could possibly reach detrimental levels. Typical isolation systems consist of a soft spring element to absorb the vibratory energy, and a structural means to support or suspend the equipment from the spring element. Generally, the spring element is a steel coil, steel or reinforced plastic leaf, block of rubber, or an air filled rubber sphere or cylinder. The spring element design is selected depending on the isolation characteristics of the vibratory feeder or conveyor and the economics of the particular design. For example, a steel coil spring is strong, but can be designed to have a soft spring rate in its vertical axis, and thus might be selected as an economical means to isolate vibratory forces that have large vertical components, and where heavy static loads are involved. On the other hand, a coil spring is relatively large, heavy, and because steel is very lightly damped, is sensitive to vibratory motion over a broad frequency range. Such a broad frequency range can be a problem if the frequencies happen to be close to a frequency of one of the natural vibration modes of the coil spring. Rubber springs are often chosen because they are lighter, dimensionally smaller for a given spring rate, and more highly damped. However, it is often more difficult to design a rubber spring block to have an equally low spring rate because of design constraints limiting deflection, particularly in compression. Therefore, the design compromises in using a rubber spring block may be that the vertical isolation is less efficient, for example. Also, the rubber spring isolator tends to be more costly for a given spring rate due to a higher cost manufacturing and quality control process. The problems associated with isolation systems are often compounded by the way in which users select equipment, install the equipment, and then operate their production processes using the equipment. Many processes require frequent stopping and starting of the equipment. This can create a problem for fixed frequency, mechanically excited vibratory equipment, as the frequent switching on and off could cause the electric motor to overheat, and perhaps to prematurely fail. In order to prevent such problems from occurring, rather than turning the machine's electrical supply off to stop the conveying, many users reduce the operating speed of the equipment to a level where the material being fed is no longer conveyed. This reduction in speed might be accomplished with the use of a variable frequency motor controller, the output frequency of which can be switched from the normal line frequency to a lower frequency on demand. This is usually accomplished by an output from a sensor that is monitoring various downstream process parameters such as feed rate, flow depth, etc. In the case of two mass feeders and conveyors, the controller might be a voltage control device, switching voltage output to the motor, between a supply line voltage level, and a lower voltage level, to effectively change the motor speed and thus control the feed rate. Unfortunately, while a two speed operating level reduces process equipment problems, reducing to the lower frequency can create a problem for the isolation system. The reduced frequency may sometime be close in frequency to the natural frequency of the isolation springs, causing large vibration amplitudes of the undamped spring, noise, wear or failure of the isolation system components. It is also possible that such low frequency vibratory forces transmitted through the support structures can cause the isolator springs on adjacent feeders to also resonate through sympathetic excitation, even if their associated vibration equipment is turned off. Very little energy is required to produce high amplitude motion of a typical undamped steel isolator spring, if the transmitted frequencies are close to any of the natural frequencies of the bending mode of the spring. When vibratory equipment is installed, especially cable suspended equipment, it is sometimes difficult to get the trough member to be perfectly level with respect to a horizontal reference plane. While floor mounted isolation support members can be varied in elevation using leveling plates (shimmied-up) to become level, it is more difficult to level suspended equipment without adding tumbuckles or the like in the suspension cable. Turnbuckles, and other cable length adjusting mechanisms, are effective at leveling, but add mass to the cable system, lowering its natural frequency to be within the range of the equipment's operating frequencies, which can make the cable's whip or become noisy.
<gh_stars>1-10 package appwarp; import java.util.HashMap; import com.shephertz.app42.gaming.multiplayer.client.WarpClient; import com.shephertz.app42.gaming.multiplayer.client.command.WarpResponseResultCode; import com.shephertz.app42.gaming.multiplayer.client.events.RoomEvent; public class WarpController { private static WarpController instance; private boolean showLog = true; private final String apiKey = "73b18c94d3d31d473767f6a7964274e1d991e6df0fc4c395a0cc8719f2a13a8d"; private final String secretKey = "2a4f8e2e876ae6d139fa141231f4a217c9a62c1561ba8fcec99f35827154dc8f"; private WarpClient warpClient; private String localUser; private String roomId; private boolean isConnected = false; boolean isUDPEnabled = false; private WarpListener warpListener ; private int STATE; // Game state constants public static final int WAITING = 1; public static final int STARTED = 2; public static final int COMPLETED = 3; public static final int FINISHED = 4; // Game completed constants public static final int GAME_WIN = 5; public static final int GAME_LOOSE = 6; public static final int ENEMY_LEFT = 7; public WarpController() { initAppwarp(); warpClient.addConnectionRequestListener(new ConnectionListener(this)); warpClient.addChatRequestListener(new ChatListener(this)); warpClient.addZoneRequestListener(new ZoneListener(this)); warpClient.addRoomRequestListener(new RoomListener(this)); warpClient.addNotificationListener(new NotificationListener(this)); } public static WarpController getInstance(){ if(instance == null){ instance = new WarpController(); } return instance; } public void startApp(String localUser){ this.localUser = localUser; warpClient.connectWithUserName(localUser); } public void setListener(WarpListener listener){ this.warpListener = listener; } public void stopApp(){ if(isConnected){ warpClient.unsubscribeRoom(roomId); warpClient.leaveRoom(roomId); } warpClient.disconnect(); } private void initAppwarp(){ try { WarpClient.initialize(apiKey, secretKey); warpClient = WarpClient.getInstance(); } catch (Exception e) { e.printStackTrace(); } } public void sendGameUpdate(String msg){ if(isConnected){ if(isUDPEnabled){ warpClient.sendUDPUpdatePeers((localUser+"#@"+msg).getBytes()); }else{ warpClient.sendUpdatePeers((localUser+"#@"+msg).getBytes()); } } } public void updateResult(int code, String msg){ if(isConnected){ STATE = COMPLETED; HashMap<String, Object> properties = new HashMap<String, Object>(); properties.put("result", code); warpClient.lockProperties(properties); } } public void onConnectDone(boolean status){ log("onConnectDone: "+status); if(status){ warpClient.initUDP(); warpClient.joinRoomInRange(1, 1, false); }else{ isConnected = false; handleError(); } } public void onDisconnectDone(boolean status){ } public void onRoomCreated(String roomId){ if(roomId!=null){ warpClient.joinRoom(roomId); }else{ handleError(); } } public void onJoinRoomDone(RoomEvent event){ log("onJoinRoomDone: "+event.getResult()); if(event.getResult()==WarpResponseResultCode.SUCCESS){// success case this.roomId = event.getData().getId(); warpClient.subscribeRoom(roomId); }else if(event.getResult()==WarpResponseResultCode.RESOURCE_NOT_FOUND){// no such room found HashMap<String, Object> data = new HashMap<String, Object>(); data.put("result", ""); warpClient.createRoom("superjumper", "shephertz", 2, data); }else{ warpClient.disconnect(); handleError(); } } public void onRoomSubscribed(String roomId){ log("onSubscribeRoomDone: "+roomId); if(roomId!=null){ isConnected = true; warpClient.getLiveRoomInfo(roomId); }else{ warpClient.disconnect(); handleError(); } } public void onGetLiveRoomInfo(String[] liveUsers){ log("onGetLiveRoomInfo: "+liveUsers.length); if(liveUsers!=null){ if(liveUsers.length==2){ startGame(); }else{ waitForOtherUser(); } }else{ warpClient.disconnect(); handleError(); } } public void onUserJoinedRoom(String roomId, String userName){ /* * if room id is same and username is different then start the game */ if(localUser.equals(userName)==false){ startGame(); } } public void onSendChatDone(boolean status){ log("onSendChatDone: "+status); } public void onGameUpdateReceived(String message){ // log("onMoveUpdateReceived: message"+ message ); String userName = message.substring(0, message.indexOf("#@")); String data = message.substring(message.indexOf("#@")+2, message.length()); if(!localUser.equals(userName)){ warpListener.onGameUpdateReceived(data); } } public void onResultUpdateReceived(String userName, int code){ if(localUser.equals(userName)==false){ STATE = FINISHED; warpListener.onGameFinished(code, true); }else{ warpListener.onGameFinished(code, false); } } public void onUserLeftRoom(String roomId, String userName){ log("onUserLeftRoom "+userName+" in room "+roomId); if(STATE==STARTED && !localUser.equals(userName)){// Game Started and other user left the room warpListener.onGameFinished(ENEMY_LEFT, true); } } public int getState(){ return this.STATE; } private void log(String message){ if(showLog){ System.out.println(message); } } private void startGame(){ STATE = STARTED; warpListener.onGameStarted("Start the Game"); } private void waitForOtherUser(){ STATE = WAITING; warpListener.onWaitingStarted("Waiting for other user"); } private void handleError(){ if(roomId!=null && roomId.length()>0){ warpClient.deleteRoom(roomId); } disconnect(); } public void handleLeave(){ if(isConnected){ warpClient.unsubscribeRoom(roomId); warpClient.leaveRoom(roomId); if(STATE!=STARTED){ warpClient.deleteRoom(roomId); } warpClient.disconnect(); } } private void disconnect(){ warpClient.removeConnectionRequestListener(new ConnectionListener(this)); warpClient.removeChatRequestListener(new ChatListener(this)); warpClient.removeZoneRequestListener(new ZoneListener(this)); warpClient.removeRoomRequestListener(new RoomListener(this)); warpClient.removeNotificationListener(new NotificationListener(this)); warpClient.disconnect(); } }
The Study on a Simplified Model of Photovoltaic Power System As the proportion of photovoltaic power increasing, the impact on the power system is evident. An accurate mathematical model for PV power generation system is necessary. This paper demonstrates the detailed mathematic models for PV power generation system consisted of PV cell, converters, flow model are summarized. This work might provide a generic PV power system models for the research of characteristics of PV generation system and its grid-connected operation.
<gh_stars>1-10 import logging import time import psutil logger = logging.getLogger(__name__) class MemoryCheckCallback: """ Callback to ensure memory usage is safe, otherwise early stops the model to avoid OOM errors. This callback is CatBoost specific. Parameters ---------- period : int, default = 10 Number of iterations between checking memory status. Higher values are less precise but use less compute. verbose : bool, default = False Whether to log information on memory status even if memory usage is low. """ def __init__(self, period: int = 10, verbose=False): self.period = period self.mem_status = psutil.Process() self.init_mem_rss = self.mem_status.memory_info().rss self.init_mem_avail = psutil.virtual_memory().available self.verbose = verbose def after_iteration(self, info): if info.iteration % self.period == 0: not_enough_memory = self.memory_check() if not_enough_memory: logger.log(20, f'\tRan low on memory, early stopping on iteration {info.iteration}.') return False return True def memory_check(self) -> bool: """Checks if memory usage is unsafe. If so, then returns True to signal the model to stop training early.""" available_bytes = psutil.virtual_memory().available cur_rss = self.mem_status.memory_info().rss if cur_rss < self.init_mem_rss: self.init_mem_rss = cur_rss estimated_model_size_mb = (cur_rss - self.init_mem_rss) >> 20 available_mb = available_bytes >> 20 model_size_memory_ratio = estimated_model_size_mb / available_mb early_stop = False if model_size_memory_ratio > 1.0: logger.warning(f'Warning: Large model size may cause OOM error if training continues') early_stop = True if available_mb < 512: # Less than 500 MB logger.warning(f'Warning: Low available memory may cause OOM error if training continues') early_stop = True if early_stop: logger.warning('Warning: Early stopped model prior to optimal result to avoid OOM error. ' 'Please increase available memory to avoid subpar model quality.') logger.warning(f'Available Memory: {available_mb} MB, Estimated Model size: {estimated_model_size_mb} MB') return True elif self.verbose or (model_size_memory_ratio > 0.25): logging.debug(f'Available Memory: {available_mb} MB, Estimated Model size: {estimated_model_size_mb} MB') return False class TimeCheckCallback: """ Callback to ensure time limit is respected, otherwise early stops the model to avoid going over time. This callback is CatBoost specific. Parameters ---------- time_start : float The starting time (usually obtained via `time.time()`) of the training. time_limit : float The time in seconds before stopping training. """ def __init__(self, time_start, time_limit): self.time_end = time_start + time_limit self.time_start = time_start def after_iteration(self, info): time_cur = time.time() time_per_iter = (time_cur - self.time_start) / info.iteration if self.time_end < (time_cur + 2*time_per_iter): logger.log(20, f'\tRan out of time, early stopping on iteration {info.iteration}.') return False return True
Cantwell has a huge lead over her Republican challenger, state Sen. Michael Baumgarter. Baumgarter, who missed the FEC’s April 15 deadline for filing his first-quarter report, released a statement saying that he had pushed his fundraising total past $305,000 in the first three months of the year. And Baumgarter, who lives in Spokane in the eastern part of the state, noted that he has statewide appeal, with most of his donations coming from the state’s west side. Despite the big advantage, Cantwell campaign strategist Rose Kapolczynski, who helped California Democratic Sen. Barbara Boxer win a fourth term in a hotly-contested race in 2010, said that the campaign needs to be ready for a rush of spending later this year by outside groups. In 2010, she said, independent committees spent more than $9 million in an attempt to defeat Democratic Sen. Patty Murray, who won a fourth term. So far, Washington state residents have donated $5 million to presidential candidates, the FEC reports show. Obama leads the pack, with $2.9 million. All of the Republican candidates in this year’s presidential primary raised a combined total of $2.1 million, led by Romney with $950,000. Three House seats are up for grabs in Washington state this year. In the newly-created 10th District, Democrat Dennis Heck said he had $934,000 in cash on hand at the end of March. His Republican challenger, Stanley Flemming reported $107,000 in the bank. In the race to replace veteran Democratic Rep. Norm Dicks in the 6th District, Democrat Derek Kilmer led all challengers, with $346,000 in cash on hand at the end of March. He raised more than his Republican challengers combined: Jesse Young, who had $106,000 in the bank, and Doug Cloud, who had $2,900. In the contest to replace Democratic Rep. Jay Inslee in the 1st District, Suzan DelBene led the pack of Democratic challengers, with more than $318,000 in the bank. Darcy Burner had $115,000 in cash on hand, while Laura Ruderman had $220,000 and Steve Hobbs had $99,000. Darshan Rauniyar, another Democrat, had $124,000 in the bank. Republican John Koster had $103,000 in cash on hand. Elsewhere, in the 9th District, incumbent Democratic Rep. Adam Smith said he had $509,000 in cash on hand at the end of the first quarter. Republican challenger Richard Muri had $64,000 in the bank. And another GOP candidate, James Postma, reported cash in hand of $53,000 at the end of March. In the 3rd District, freshman Republican Rep. Jaime Herrera Beutler said she had $689,000 in the bank at the end of March. Her Democratic opponent, Elizabeth Uelmen, had $2,700, while another Democratic challenger, Jon Haugen, had not filed a first-quarter report. In the 2nd District, Democratic Rep. Rick Larsen had $777,000 in cash at the end of March, while his Republican challenger Dan Matthews had $2,700. In the 4th District, Republican Rep. Doc Hastings had $528,000 in the bank at the end of the quarter, compared to zero for his Democratic challenger, Jerame Clough. And in the 5th District, Republican Rep. Cathy McMorris Rodgers had $916,000 in cash on hand, while her Democratic opponent Rich Cowan had $75,000.
Report: Globalization of Economic Activity: Issues for Tourism Economic activity is not only becoming more internationalized, but, more significantly, it is becoming increasingly globalized. Globalization is always regarded as the product of the liberalization that has been the hallmark of economic policy throughout the world during the past decade. It has also set in motion forces working to accelerate liberalization. One of the distinguishing features of trade at the end of the twentieth century and at the start of the new millennium has been the expansion of regional trade agreements and the multilateral agreements. The internationalization of services is at the core of today's economic globalization. Tourism has become one of the most important industries in the world, and its economic impacts are vital for many countries. It has long supported the idea of services agreements and has become a major component in the globalization of international trade, particularly with respect to services. There is no doubt that the World Trade Organization (WTO) and the General Agreement on Trade in Services (GATS) have assisted the growth of international trade in goods and services. However, the success of such instruments relies upon markets behaving in a Ricardian manner, incorporating the fluidity and transparency that form the substance of those markets.
KADENA AIR BASE, Japan -- Think of taking time off, leave, or going abroad. What comes to mind? Perhaps some time for you, a way to reinvigorate or reenergize? For one staff sergeant, time away from the day-to-day grind was spent reinvigorating a children's home in Thailand. As Staff Sgt. Eric Gargus, a 18th Civil Engineer Squadron structural craftsman, attended a service at the Kadena AB Chapel one Sunday in January, he learned of a trip to Thailand. The goal of this trip was to make a difference in the lives of children living in homes supported by the organization Remember Nhu, who have been taken off the streets and out of lives that could lead to tragedy. "Remember Nhu deals with the prevention of human trafficking and they have scores of kids to care for," said Capt. Daniel Call, a chaplain with the 18th Wing. Intrigued, Gargus did a little more research and found out more about Remember Nhu. "When I heard about this trip, something inside spoke to me," Gargus said. "(It was) a calling, I had to go." Remember Nhu is a non-profit organization that supports homes for children in Thailand, Myanmar, and Cambodia with the intent of getting them off the streets and sparing them from human trafficking. The organization's namesake, Nhu, was such a child, before being rescued and adopted by Carl and Laurie Ralston from Portland, Ore. Remember Nhu's approach at combating human trafficking is to help one child at a time by creating a loving, educational, peaceful and happy environment with spiritual guidance. After learning all that he could about Nhu and the organization, Gargus reached out to a member of the Kadena AB youth ministry. They began discussing ideas for a brand new playground to be built on the grounds of homes in Northern Thailand. Talk became action, and before long the plans were drawn and the trip was underway. "We came up with plans for the playground that we wanted to build for these kids, something for them to enjoy," Gargus said. The playground went from the drawing board to reality. "We used (about) 10,000 feet of rope and webbing to make the cargo nets that made up the playground. All the nets were hand tied by the teams (thousands of knots). The playground also included a 60-foot zip line," Call said. "Nothing is more satisfying than seeing 30 to 40 children delighted in the gift of the playground through the squeals and laughter that we saw the last day we were in Thailand." Remember Nhu currently supports four homes with about 45 children in each home, with the hope of opening more in the future. Gargus got to spend time and work at these houses in Northern Thailand for a month. "These kids were incredible," Gargus said. "We got to eat with them every day. I sat on the floor with one little boy that I saw eating by himself; the next thing I knew, there were kids surrounding me. The experience was life changing." Since his initial involvement seven months ago, Gargus has decided to increase his participation. "I want to go back someday, and am looking forward to returning soon and fulfilling my calling," Gargus said. He also plans on continuing his support to Nhu, the organization and the children by raising money and volunteering as much time as he can. "God has blessed me with a certain skill set needed for my job, as well as the love to help people," Gargus said. "Doing the job I love and helping people while serving God is a dream come true." © Copyright 2019 Air Force News. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.
/* * Copyright (c) The Shogun Machine Learning Toolbox * Written (w) 2015 <NAME> * 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. * * The views and conclusions contained in the software and documentation are those * of the authors and should not be interpreted as representing official policies, * either expressed or implied, of the Shogun Development Team. * */ #ifndef FIRSTORDERMINIMIZER_H #define FIRSTORDERMINIMIZER_H #include <shogun/optimization/FirstOrderCostFunction.h> #include <shogun/optimization/Minimizer.h> #include <shogun/optimization/Penalty.h> namespace shogun { /** @brief The first order minimizer base class. * * This class gives the interface of a first-order gradient-based unconstrained minimizer * * This kind of minimizers will find optimal target variables based on gradient information wrt target variables. * For example, the gradient descend method is a minimizer. * * A minimizer requires the following objects as input: * a supported cost function object (eg, FirstOrderCostFunction ) * a penalty object if regularization is enabled (eg, Penalty ) * */ class FirstOrderMinimizer: public Minimizer { public: /** Default constructor */ FirstOrderMinimizer():Minimizer() { init(); } /** Constructor * @param fun cost function (user have to manully delete the pointer) */ FirstOrderMinimizer(FirstOrderCostFunction *fun) { init(); set_cost_function(fun); } /** returns the name of the class * * @return name FirstOrderMinimizer */ virtual const char* get_name() const { return "FirstOrderMinimizer"; } /** Destructor */ virtual ~FirstOrderMinimizer(); /** Does minimizer support batch update? * * @return whether minimizer supports batch update */ virtual bool supports_batch_update() const=0; /** Set cost function used in the minimizer * * @param fun the cost function */ virtual void set_cost_function(FirstOrderCostFunction *fun); /** Unset cost function used in the minimizer * */ virtual void unset_cost_function(bool is_unref=true) { if(is_unref) { SG_UNREF(m_fun); } m_fun=NULL; } /** Set the weight of penalty * * @param penalty_weight the weight of penalty, which is positive */ virtual void set_penalty_weight(float64_t penalty_weight); /** Set the type of penalty * For example, L2 penalty * * @param penalty_type the type of penalty. If NULL is given, regularization is not enabled. */ virtual void set_penalty_type(Penalty* penalty_type); protected: /** Get the penalty given target variables * For L2 penalty, * the target variable is \f$w\f$ * and * the value of penalty is \f$\lambda \frac{w^t w}{2}\f$, * where \f$\lambda\f$ is the weight of penalty * * * @param var the variable used in regularization */ virtual float64_t get_penalty(SGVector<float64_t> var); /** Add gradient of the penalty wrt target variables to unpenalized gradient * For least sqaure with L2 penalty, * \f[ * L2f(w)=f(w) + L2(w) \f] * where \f$ f(w)=\sum_i{(y_i-w^T x_i)^2}\f$ is the least sqaure cost function * and \f$L2(w)=\lambda \frac{w^t w}{2}\f$ is the L2 penalty * * Target variables is \f$w\f$ * Unpenalized gradient is \f$\frac{\partial f(w) }{\partial w}\f$ * Gradient of the penalty wrt target variables is \f$\frac{\partial L2(w) }{\partial w}\f$ * * @param gradient unpenalized gradient wrt its target variable * @param var the target variable */ virtual void update_gradient(SGVector<float64_t> gradient, SGVector<float64_t> var); /** Cost function */ FirstOrderCostFunction *m_fun; /** the type of penalty*/ Penalty* m_penalty_type; /** the weight of penalty*/ float64_t m_penalty_weight; private: /** init */ void init(); }; } #endif
At least, that’s the headline you’d get if Upworthy and Ken Ham College had a love child. Under the title “Dinosaur Hoax,” this unnamed young debunker of evolution triumphantly proves in a three-minute video that so-called dinosaur fossils are no more significant than random pieces of smashed-up plaster. You can spackle the bits back together any way you choose, she says; therefore, dinosaurs are a fabrication. Checkmate, Darwin! The whole thing is so comically feeble-minded that I’m not even sure if anyone should debunk the debunking. Maybe this is a Poe? Or an atheist false-flag operation intended to smear Christians as morons? I have a few minutes, and I don’t mind, so let’s just get this over with. One: The allegation at 1:19 is nonsense. The first known dinosaur fossil was described in the 17th century by the English naturalist Robert Plot, and he mistook it for the bone of a giant man. The word dinosaur didn’t even enter the lexicon until more than 150 years later, when Richard Owen, a biologist, coined the term (it means “terrible lizard”). The discovery of dinosaurs and other prehistoric animals is a result of fossil finds, not the other way around. Two: Bones are frequently found in isolation; but many times, there is little or nothing to puzzle together, because prehistoric animals, dinosaurs included, have also been discovered fossilized and intact, or nearly so. Exhibit A Three: Bones (or their fossils) are not some crazy jigsaw equivalent of random pieces of plaster. Unlike arbitrary gypsum fragments, bones have shapes and sizes and hollows and ridges and similar properties that all indicate how they fit together into joints and other skeleton structures. This is obviously true for a mouse, a dog, and a human, including Ms. Einstein up there. Dinosaurs are no different. I’m still holding out hope that she’s just trolling. (via Godless Engineer)
<reponame>ikr4mm/Typescript /* Type Aliases adalah pemberian nama type baru secara kostum jika di Typescript memiliki type seperti string, number, boolean, dll. maka dengan type aliases kita dapat menkombinasikan type-type tersebut menjadi 1 type kostum. */ // Contoh // note: nama untuk type boleh apa saja, suka suka kalian asal masih relevan dengan valuenya type StringOrNumber = string | number; // ------------------- Type Aliases Membuat Code Lebih Readable --------------------- // Selain untuk membuat kostum type, type aliases juga berguna untuk membuat code kita lebih mudah dibaca. // problem: parameter pada function terlalu panjang jadi sulit dibaca function intro1(data: { name: string, age: number, country: string, hobby: string}): string { return ` name: ${data.name}, age: ${data.age} years, country: ${data.country}, hobby: ${data.hobby} `; } // solving: merefactor dengan menggunakan type aliases type Person = { name: string, age: number, country: string, hobby: string } // Pada parameter function kita hanya perlu mengisi nama type yang telah kita buat. function intro2(data: Person): string { return ` name: ${data.name}, age: ${data.age} years, country: ${data.country}, hobby: ${data.hobby} `; } // --------------- Menggabungkan Type Aliases Dengan Type Lain ------------------- // Pada kode diatas kita telah membuat type Person, sekarang kita akan menggabungkan type Person dengan type lainnya. // untuk menggabungkannya hanya perlu menggunakan "&" type PersonWithContact = Person & { phoneNumber: string, email: string } function intro3(data: PersonWithContact): string { return ` name: ${data.name}, age: ${data.age} years, country: ${data.country}, hobby: ${data.hobby}, phone number: ${data.phoneNumber}, email: ${data.email} `; } export { intro1, intro2, intro3, StringOrNumber };
/** * Override the HashHelper's toByteArray method * because we do not want to create a byte representation of this entire object * as it includes a private key, which is a big no-no * @return a byte representation of this entire object, minus the private key */ @Override public byte[] toByteArray(){ ArrayList<Byte> transactionData = new ArrayList<>(); ByteBuffer inputBuffer = ByteBuffer.allocate(Integer.SIZE / 8); ByteBuffer outputBuffer = ByteBuffer.allocate(Double.SIZE / 8); for (Input input : this.getInputs()){ inputBuffer.putInt(input.getOutputIndex()); byte[] outputIndex = inputBuffer.array(); byte[] hash = input.getPrevTxHash(); for (Byte b: outputIndex) { transactionData.add(b); } for (Byte b: hash) { transactionData.add(b); } inputBuffer.clear(); } for (Output output: this.getOutputs()) { outputBuffer.putDouble(output.value); byte[] value = outputBuffer.array(); for (Byte b: value) { transactionData.add(b); } byte[] address = output.publicKey.getEncoded(); for (Byte b: address) { transactionData.add(b); } outputBuffer.clear(); } byte[] returnedSignatureData = new byte[transactionData.size()]; int i = 0; for (Byte b : transactionData){ returnedSignatureData[i] = b; i++; } return returnedSignatureData; }
/* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ import { RulesSchema } from '../../../../common/detection_engine/schemas/response/rules_schema'; import { AlertsClient } from '../../../../../alerts/server'; import { getExportDetailsNdjson } from './get_export_details_ndjson'; import { isAlertType } from '../rules/types'; import { readRules } from './read_rules'; import { transformAlertToRule } from '../routes/rules/utils'; import { transformDataToNdjson } from '../../../utils/read_stream/create_stream_from_ndjson'; interface ExportSuccessRule { statusCode: 200; rule: Partial<RulesSchema>; } interface ExportFailedRule { statusCode: 404; missingRuleId: { rule_id: string }; } type ExportRules = ExportSuccessRule | ExportFailedRule; export interface RulesErrors { exportedCount: number; missingRules: Array<{ rule_id: string }>; rules: Array<Partial<RulesSchema>>; } export const getExportByObjectIds = async ( alertsClient: AlertsClient, objects: Array<{ rule_id: string }> ): Promise<{ rulesNdjson: string; exportDetails: string; }> => { const rulesAndErrors = await getRulesFromObjects(alertsClient, objects); const rulesNdjson = transformDataToNdjson(rulesAndErrors.rules); const exportDetails = getExportDetailsNdjson(rulesAndErrors.rules, rulesAndErrors.missingRules); return { rulesNdjson, exportDetails }; }; export const getRulesFromObjects = async ( alertsClient: AlertsClient, objects: Array<{ rule_id: string }> ): Promise<RulesErrors> => { const alertsAndErrors = await Promise.all( objects.reduce<Array<Promise<ExportRules>>>((accumPromise, object) => { const exportWorkerPromise = new Promise<ExportRules>(async (resolve) => { try { const rule = await readRules({ alertsClient, ruleId: object.rule_id, id: undefined }); if (rule != null && isAlertType(rule) && rule.params.immutable !== true) { const transformedRule = transformAlertToRule(rule); resolve({ statusCode: 200, rule: transformedRule, }); } else { resolve({ statusCode: 404, missingRuleId: { rule_id: object.rule_id }, }); } } catch { resolve({ statusCode: 404, missingRuleId: { rule_id: object.rule_id }, }); } }); return [...accumPromise, exportWorkerPromise]; }, []) ); const missingRules = alertsAndErrors.filter( (resp) => resp.statusCode === 404 ) as ExportFailedRule[]; const exportedRules = alertsAndErrors.filter( (resp) => resp.statusCode === 200 ) as ExportSuccessRule[]; return { exportedCount: exportedRules.length, missingRules: missingRules.map((mr) => mr.missingRuleId), rules: exportedRules.map((er) => er.rule), }; };