text
stringlengths
1
22.8M
```xml /** * Wechaty Chatbot SDK - path_to_url * * @copyright 2016 Huan LI () <path_to_url and * Wechaty Contributors <path_to_url * * * path_to_url * * Unless required by applicable law or agreed to in writing, software * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * */ import type * as PUPPET from 'wechaty-puppet' import type { FileBoxInterface } from 'file-box' import { concurrencyExecuter } from 'rx-queue' import type { Constructor, } from 'clone-class' import { FOUR_PER_EM_SPACE, log, } from '../config.js' import { wechatyCaptureException, } from '../raven.js' import { guardQrCodeValue, } from '../pure-functions/guard-qr-code-value.js' import { isTemplateStringArray, } from '../pure-functions/is-template-string-array.js' import { RoomEventEmitter } from '../schemas/mod.js' import { poolifyMixin, wechatifyMixin, validationMixin, } from '../user-mixins/mod.js' import { deliverSayableConversationPuppet, } from '../sayable/mod.js' import type { SayableSayer, Sayable, } from '../sayable/mod.js' import { stringifyFilter } from '../helper-functions/stringify-filter.js' import { ContactInterface, ContactImpl, } from './contact.js' import type { MessageInterface, } from './message.js' const MixinBase = wechatifyMixin( poolifyMixin( RoomEventEmitter, )<RoomImplInterface>(), ) /** * All WeChat rooms(groups) will be encapsulated as a Room. * * [Examples/Room-Bot]{@link path_to_url} * */ class RoomMixin extends MixinBase implements SayableSayer { /** * Create a new room. * * @static * @param {ContactInterface[]} contactList * @param {string} [topic] * @returns {Promise<RoomInterface>} * @example <caption>Creat a room with 'lijiarui' and 'huan', the room topic is 'ding - created'</caption> * const helperContactA = await Contact.find({ name: 'lijiarui' }) // change 'lijiarui' to any contact in your WeChat * const helperContactB = await Contact.find({ name: 'huan' }) // change 'huan' to any contact in your WeChat * const contactList = [helperContactA, helperContactB] * console.log('Bot', 'contactList: %s', contactList.join(',')) * const room = await Room.create(contactList, 'ding') * console.log('Bot', 'createDingRoom() new ding room created: %s', room) * await room.topic('ding - created') * await room.say('ding - created') */ static async create ( contactList : ContactInterface[], topic? : string, ): Promise<RoomInterface> { log.verbose('Room', 'create(%s, %s)', contactList.join(','), topic) if (contactList.length < 2) { throw new Error('contactList need at least 2 contact to create a new room') } try { const contactIdList = contactList.map(contact => contact.id) const roomId = await this.wechaty.puppet.roomCreate(contactIdList, topic) const room = this.load(roomId) return room } catch (e) { this.wechaty.emitError(e) log.error('Room', 'create() exception: %s', (e && (e as Error).stack) || (e as Error).message || (e as Error)) throw e } } /** * The filter to find the room: {topic: string | RegExp} * * @typedef RoomQueryFilter * @property {string} topic */ /** * Find room by filter: {topic: string | RegExp}, return all the matched room. * * NOTE: The returned list would be limited by the underlying puppet * implementation of `puppet.roomList`. Some implementation (i.e. * wechaty-puppet-wechat) would only return rooms which have received messges * after a log-in. * * @static * @param {RoomQueryFilter} [query] * @returns {Promise<RoomInterface[]>} * @example * const bot = new Wechaty() * await bot.start() * // after logged in * const roomList = await bot.Room.findAll() // get the room list of the bot * const roomList = await bot.Room.findAll({topic: 'wechaty'}) // find all of the rooms with name 'wechaty' */ static async findAll ( query? : PUPPET.filters.Room, ): Promise<RoomInterface[]> { log.verbose('Room', 'findAll(%s)', JSON.stringify(query, stringifyFilter) || '') try { const roomIdList = await this.wechaty.puppet.roomSearch(query) const idToRoom = async (id: string) => this.wechaty.Room.find({ id }) .catch(e => this.wechaty.emitError(e)) /** * we need to use concurrencyExecuter to reduce the parallel number of the requests */ const CONCURRENCY = 17 const roomIterator = concurrencyExecuter(CONCURRENCY)(idToRoom)(roomIdList) const roomList: RoomInterface[] = [] for await (const room of roomIterator) { if (room) { roomList.push(room) } } return roomList } catch (e) { this.wechaty.emitError(e) log.verbose('Room', 'findAll() rejected: %s', (e as Error).message) return [] as RoomInterface[] // fail safe } } /** * Try to find a room by filter: {topic: string | RegExp}. If get many, return the first one. * * NOTE: The search space is limited by the underlying puppet * implementation of `puppet.roomList`. Some implementation (i.e. * wechaty-puppet-wechat) would only return rooms which have received messges * after a log-in. * * @param {RoomQueryFilter} query * @returns {Promise<undefined | RoomInterface>} If can find the room, return Room, or return null * @example * const bot = new Wechaty() * await bot.start() * // after logged in... * const roomList = await bot.Room.find() * const roomList = await bot.Room.find({topic: 'wechaty'}) */ static async find ( query : string | PUPPET.filters.Room, ): Promise<undefined | RoomInterface> { log.silly('Room', 'find(%s)', JSON.stringify(query, stringifyFilter)) if (typeof query === 'string') { query = { topic: query } } if (query.id) { const room = (this.wechaty.Room as any as typeof RoomImpl).load(query.id) try { await room.ready() } catch (e) { this.wechaty.emitError(e) return undefined } return room } const roomList = await this.findAll(query) // if (!roomList) { // return null // } if (roomList.length < 1) { return undefined } if (roomList.length > 1) { log.warn('Room', 'find() got more than one(%d) result', roomList.length) } for (const [ idx, room ] of roomList.entries()) { // use puppet.roomValidate() to confirm double confirm that this roomId is valid. // path_to_url // path_to_url const valid = await this.wechaty.puppet.roomValidate(room.id) if (valid) { log.verbose('Room', 'find() room<id=%s> is valid: return it', idx, room.id) return room } else { log.verbose('Room', 'find() room<id=%s> is invalid: skip it', idx, room.id) } } log.warn('Room', 'find() all %d rooms are invalid', roomList.length) return undefined } /** const roomList: RoomInterface[] = [] * @ignore * * Instance Properties * * */ payload?: PUPPET.payloads.Room /** * @hideconstructor * @property {string} id - Room id. * This function is depending on the Puppet Implementation, see [puppet-compatible-table](path_to_url#3-puppet-compatible-table) */ constructor ( public readonly id: string, ) { super() log.silly('Room', `constructor(${id})`) } /** * @ignore */ override toString () { if (!this.payload) { return this.constructor.name } return `Room<${this.payload.topic || 'loading...'}>` } async * [Symbol.asyncIterator] (): AsyncIterableIterator<ContactInterface> { const memberList = await this.memberList() for (const contact of memberList) { yield contact } } /** * Proposal: add a handle field to RoomPayload #181 * @link path_to_url */ handle (): undefined | string { return this.payload?.handle } /** * Force reload data for Room, Sync data from puppet API again. * * @returns {Promise<void>} * @example * await room.sync() */ async sync (): Promise<void> { await this.wechaty.puppet.roomPayloadDirty(this.id) await this.wechaty.puppet.roomMemberPayloadDirty(this.id) await this.ready(true) } /** * Warning: `ready()` is for the framework internally use ONLY! * * Please not to use `ready()` at the user land. * If you want to sync data, use `sync()` instead. * * @ignore */ async ready ( forceSync = false, ): Promise<void> { log.silly('Room', 'ready()') if (!forceSync && this.isReady()) { return } this.payload = await this.wechaty.puppet.roomPayload(this.id) /** * Sync all room member contacts */ const memberIdList = await this.wechaty.puppet.roomMemberList(this.id) const doReady = async (id: string): Promise<void> => { try { await this.wechaty.Contact.find({ id }) } catch (e) { this.wechaty.emitError(e) } } /** * we need to use concurrencyExecuter to reduce the parallel number of the requests */ const CONCURRENCY = 17 const contactIterator = concurrencyExecuter(CONCURRENCY)(doReady)(memberIdList) for await (const contact of contactIterator) { void contact // just a empty loop to wait all iterator finished } } /** * @ignore */ isReady (): boolean { return !!(this.payload) } say (sayable: Sayable) : Promise<void | MessageInterface> say (text: string, ...mentionList: ContactInterface[]) : Promise<void | MessageInterface> say (textList: TemplateStringsArray, ...varList: any[]) : Promise<void | MessageInterface> // Huan(202006): allow fall down to the defination to get more flexibility. // public say (...args: never[]): never /** * Send message inside Room, if set [replyTo], wechaty will mention the contact as well. * > Tips: * This function is depending on the Puppet Implementation, see [puppet-compatible-table](path_to_url#3-puppet-compatible-table) * * @param {(string | ContactInterface | FileBox)} textOrContactOrFileOrUrlOrMini - Send `text` or `media file` inside Room. <br> * You can use {@link path_to_url|FileBox} to send file * @param {(ContactInterface | ContactInterface[])} [mention] - Optional parameter, send content inside Room, and mention @replyTo contact or contactList. * @returns {Promise<void | MessageInterface>} * * @example * const bot = new Wechaty() * await bot.start() * // after logged in... * const room = await bot.Room.find({topic: 'wechaty'}) * * // 1. Send text inside Room * * await room.say('Hello world!') * const msg = await room.say('Hello world!') // only supported by puppet-padplus * * // 2. Send media file inside Room * import { FileBox } from 'wechaty' * const fileBox1 = FileBox.fromUrl('path_to_url * const fileBox2 = FileBox.fromLocal('/tmp/text.txt') * await room.say(fileBox1) * const msg1 = await room.say(fileBox1) // only supported by puppet-padplus * await room.say(fileBox2) * const msg2 = await room.say(fileBox2) // only supported by puppet-padplus * * // 3. Send Contact Card in a room * const contactCard = await bot.Contact.find({name: 'lijiarui'}) // change 'lijiarui' to any of the room member * await room.say(contactCard) * const msg = await room.say(contactCard) // only supported by puppet-padplus * * // 4. Send text inside room and mention @mention contact * const contact = await bot.Contact.find({name: 'lijiarui'}) // change 'lijiarui' to any of the room member * await room.say('Hello world!', contact) * const msg = await room.say('Hello world!', contact) // only supported by puppet-padplus * * // 5. Send text inside room and mention someone with Tagged Template * const contact2 = await bot.Contact.find({name: 'zixia'}) // change 'zixia' to any of the room member * await room.say`Hello ${contact}, here is the world ${contact2}` * const msg = await room.say`Hello ${contact}, here is the world ${contact2}` // only supported by puppet-padplus * * // 6. send url link in a room * * const urlLink = new UrlLink ({ * description : 'WeChat Bot SDK for Individual Account, Powered by TypeScript, Docker, and Love', * thumbnailUrl: 'path_to_url * title : 'Welcome to Wechaty', * url : 'path_to_url * }) * await room.say(urlLink) * const msg = await room.say(urlLink) // only supported by puppet-padplus * * // 7. send mini program in a room * * const miniProgram = new MiniProgram ({ * username : 'gh_xxxxxxx', //get from mp.weixin.qq.com * appid : '', //optional, get from mp.weixin.qq.com * title : '', //optional * pagepath : '', //optional * description : '', //optional * thumbnailurl : '', //optional * }) * await room.say(miniProgram) * const msg = await room.say(miniProgram) // only supported by puppet-padplus * * // 8. send location in a room * const location = new Location ({ * accuracy : 15, * address : '45 Chengfu Rd', * latitude : 39.995120999999997, * longitude : 116.334154, * name : '(45)', * }) * await room.say(location) * const msg = await room.say(location) */ async say ( sayable : Sayable | TemplateStringsArray, ...varList : unknown[] ): Promise<void | MessageInterface> { log.verbose('Room', 'say(%s, %s)', sayable, varList.join(', '), ) let msgId let text: string if (isTemplateStringArray(sayable)) { msgId = await this.sayTemplateStringsArray( sayable as TemplateStringsArray, ...varList, ) } else if (typeof sayable === 'string') { /** * 1. string */ let mentionList: ContactInterface[] = [] if (varList.length > 0) { const allIsContact = varList.every(c => ContactImpl.valid(c)) if (!allIsContact) { throw new Error('mentionList must be contact when not using TemplateStringsArray function call.') } mentionList = [ ...varList as any ] const AT_SEPARATOR = FOUR_PER_EM_SPACE const mentionAlias = await Promise.all(mentionList.map(async contact => '@' + (await this.alias(contact) || contact.name()), )) const mentionText = mentionAlias.join(AT_SEPARATOR) text = mentionText + ' ' + sayable } else { text = sayable } // const receiver = { // contactId : (mentionList.length && mentionList[0].id) || undefined, // roomId : this.id, // } msgId = await this.wechaty.puppet.messageSendText( this.id, text, mentionList.map(c => c.id), ) } else { msgId = await deliverSayableConversationPuppet(this.wechaty.puppet)(this.id)(sayable) } if (msgId) { const msg = await this.wechaty.Message.find({ id: msgId }) return msg } } private async sayTemplateStringsArray ( textList: TemplateStringsArray, ...varList: unknown[] ) { const mentionList = varList.filter(c => ContactImpl.valid(c)) as ContactInterface[] // const receiver = { // contactId : (mentionList.length && mentionList[0].id) || undefined, // roomId : this.id, // } if (varList.length === 0) { /** * No mention in the string */ return this.wechaty.puppet.messageSendText( this.id, textList[0]!, ) // TODO(huan) 20191222 it seems the following code will not happen, // because it's equal the mentionList.length === 0 situation? // // XXX(huan) 20200101: See issue path_to_url // This is an anti-pattern usage. // // } else if (textList.length === 1) { // /** // * Constructed mention string, skip inserting @ signs // */ // return this.wechaty.puppet.messageSendText( // receiver, // textList[0], // mentionList.map(c => c.id), // ) } else { // mentionList.length > 0 /** * Mention in the string */ const textListLength = textList.length const varListLength = varList.length if (textListLength - varListLength !== 1) { throw new Error('Can not say message, invalid Template String Array.') } let finalText = '' let i = 0 for (; i < varListLength; i++) { if (ContactImpl.valid(varList[i])) { const mentionContact: ContactInterface = varList[i] as any const mentionName = await this.alias(mentionContact) || mentionContact.name() finalText += textList[i] + '@' + mentionName } else { finalText += textList[i]! + varList[i]! } } finalText += textList[i] return this.wechaty.puppet.messageSendText( this.id, finalText, mentionList.map(c => c.id), ) } } /** * @desc Room Class Event Type * @typedef RoomEventName * @property {string} join - Emit when anyone join any room. * @property {string} topic - Get topic event, emitted when someone change room topic. * @property {string} leave - Emit when anyone leave the room.<br> * If someone leaves the room by themselves, WeChat will not notice other people in the room, so the bot will never get the "leave" event. */ /** * @desc Room Class Event Function * @typedef RoomEventFunction * @property {Function} room-join - (this: Room, inviteeList: Contact[] , inviter: Contact) => void * @property {Function} room-topic - (this: Room, topic: string, oldTopic: string, changer: Contact) => void * @property {Function} room-leave - (this: Room, leaver: Contact) => void */ /** * @listens Room * @param {RoomEventName} event - Emit WechatyEvent * @param {RoomEventFunction} listener - Depends on the WechatyEvent * @return {this} - this for chain * * @example <caption>Event:join </caption> * const bot = new Wechaty() * await bot.start() * // after logged in... * const room = await bot.Room.find({topic: 'topic of your room'}) // change `event-room` to any room topic in your WeChat * if (room) { * room.on('join', (room, inviteeList, inviter) => { * const nameList = inviteeList.map(c => c.name()).join(',') * console.log(`Room got new member ${nameList}, invited by ${inviter}`) * }) * } * * @example <caption>Event:leave </caption> * const bot = new Wechaty() * await bot.start() * // after logged in... * const room = await bot.Room.find({topic: 'topic of your room'}) // change `event-room` to any room topic in your WeChat * if (room) { * room.on('leave', (room, leaverList) => { * const nameList = leaverList.map(c => c.name()).join(',') * console.log(`Room lost member ${nameList}`) * }) * } * * @example <caption>Event:message </caption> * const bot = new Wechaty() * await bot.start() * // after logged in... * const room = await bot.Room.find({topic: 'topic of your room'}) // change `event-room` to any room topic in your WeChat * if (room) { * room.on('message', (message) => { * console.log(`Room received new message: ${message}`) * }) * } * * @example <caption>Event:topic </caption> * const bot = new Wechaty() * await bot.start() * // after logged in... * const room = await bot.Room.find({topic: 'topic of your room'}) // change `event-room` to any room topic in your WeChat * if (room) { * room.on('topic', (room, topic, oldTopic, changer) => { * console.log(`Room topic changed from ${oldTopic} to ${topic} by ${changer.name()}`) * }) * } * * @example <caption>Event:invite </caption> * const bot = new Wechaty() * await bot.start() * // after logged in... * const room = await bot.Room.find({topic: 'topic of your room'}) // change `event-room` to any room topic in your WeChat * if (room) { * room.on('invite', roomInvitation => roomInvitation.accept()) * } * */ // public on (event: RoomEventName, listener: (...args: any[]) => any): this { // log.verbose('Room', 'on(%s, %s)', event, typeof listener) // super.on(event, listener) // Room is `Sayable` // return this // } /** * Add contact in a room * * > Tips: * This function is depending on the Puppet Implementation, see [puppet-compatible-table](path_to_url#3-puppet-compatible-table) * > * > see {@link path_to_url|Web version of WeChat closed group interface} * * @param {ContactInterface} contact * @returns {Promise<void>} * @example * const bot = new Wechaty() * await bot.start() * // after logged in... * const contact = await bot.Contact.find({name: 'lijiarui'}) // change 'lijiarui' to any contact in your WeChat * const room = await bot.Room.find({topic: 'WeChat'}) // change 'WeChat' to any room topic in your WeChat * if (room) { * try { * await room.add(contact) * } catch(e) { * console.error(e) * } * } */ async add (contact: ContactInterface): Promise<void> { log.verbose('Room', 'add(%s)', contact) await this.wechaty.puppet.roomAdd(this.id, contact.id) } /** * Remove a contact from the room * It works only when the bot is the owner of the room * * > Tips: * This function is depending on the Puppet Implementation, see [puppet-compatible-table](path_to_url#3-puppet-compatible-table) * > * > see {@link path_to_url|Web version of WeChat closed group interface} * * @param {ContactInterface} contact * @returns {Promise<void>} * @example * const bot = new Wechaty() * await bot.start() * // after logged in... * const room = await bot.Room.find({topic: 'WeChat'}) // change 'WeChat' to any room topic in your WeChat * const contact = await bot.Contact.find({name: 'lijiarui'}) // change 'lijiarui' to any room member in the room you just set * if (room) { * try { * await room.remove(contact) * } catch(e) { * console.error(e) * } * } */ async remove (contact: ContactInterface): Promise<void> { log.verbose('Room', 'del(%s)', contact) await this.wechaty.puppet.roomDel(this.id, contact.id) // this.delLocal(contact) } /** * Huan(202106): will be removed after Dec 31, 2023 * @deprecated use remove(contact) instead. */ async del (contact: ContactImpl): Promise<void> { log.warn('Room', 'del() is DEPRECATED, use remove() instead.\n%s', new Error().stack) return this.remove(contact) } // private delLocal(contact: Contact): void { // log.verbose('Room', 'delLocal(%s)', contact) // const memberIdList = this.payload && this.payload.memberIdList // if (memberIdList && memberIdList.length > 0) { // for (let i = 0; i < memberIdList.length; i++) { // if (memberIdList[i] === contact.id) { // memberIdList.splice(i, 1) // break // } // } // } // } /** * Bot quit the room itself * * > Tips: * This function is depending on the Puppet Implementation, see [puppet-compatible-table](path_to_url#3-puppet-compatible-table) * * @returns {Promise<void>} * @example * await room.quit() */ async quit (): Promise<void> { log.verbose('Room', 'quit() %s', this) await this.wechaty.puppet.roomQuit(this.id) } async topic () : Promise<string> async topic (newTopic: string): Promise<void> /** * SET/GET topic from the room * * @param {string} [newTopic] If set this para, it will change room topic. * @returns {Promise<string | void>} * * @example <caption>When you say anything in a room, it will get room topic. </caption> * const bot = new Wechaty() * bot * .on('message', async m => { * const room = m.room() * if (room) { * const topic = await room.topic() * console.log(`room topic is : ${topic}`) * } * }) * .start() * * @example <caption>When you say anything in a room, it will change room topic. </caption> * const bot = new Wechaty() * bot * .on('message', async m => { * const room = m.room() * if (room) { * const oldTopic = await room.topic() * await room.topic('change topic to wechaty!') * console.log(`room topic change from ${oldTopic} to ${room.topic()}`) * } * }) * .start() */ async topic (newTopic?: string): Promise<void | string> { log.verbose('Room', 'topic(%s)', newTopic || '') if (!this.isReady()) { log.warn('Room', 'topic() room not ready') throw new Error('not ready') } if (typeof newTopic === 'undefined') { if (this.payload && this.payload.topic) { return this.payload.topic } else { const memberIdList = await this.wechaty.puppet.roomMemberList(this.id) const memberListFuture = memberIdList .filter(id => id !== this.wechaty.puppet.currentUserId) .map(id => this.wechaty.Contact.find({ id })) const memberList = (await Promise.all(memberListFuture)) .filter(Boolean) as ContactInterface[] let defaultTopic = (memberList[0] && memberList[0].name()) || '' for (let i = 1; i < 3 && memberList[i]; i++) { defaultTopic += ',' + memberList[i]!.name() } return defaultTopic } } const future = this.wechaty.puppet .roomTopic(this.id, newTopic) .catch(e => { log.warn('Room', 'topic(newTopic=%s) exception: %s', newTopic, (e && e.message) || e, ) wechatyCaptureException(e) }) return future } async announce () : Promise<string> async announce (text: string) : Promise<void> /** * SET/GET announce from the room * > Tips: It only works when bot is the owner of the room. * > * > This function is depending on the Puppet Implementation, see [puppet-compatible-table](path_to_url#3-puppet-compatible-table) * * @param {string} [text] If set this para, it will change room announce. * @returns {(Promise<void | string>)} * * @example <caption>When you say anything in a room, it will get room announce. </caption> * const bot = new Wechaty() * await bot.start() * // after logged in... * const room = await bot.Room.find({topic: 'your room'}) * const announce = await room.announce() * console.log(`room announce is : ${announce}`) * * @example <caption>When you say anything in a room, it will change room announce. </caption> * const bot = new Wechaty() * await bot.start() * // after logged in... * const room = await bot.Room.find({topic: 'your room'}) * const oldAnnounce = await room.announce() * await room.announce('change announce to wechaty!') * console.log(`room announce change from ${oldAnnounce} to ${room.announce()}`) */ async announce (text?: string): Promise<void | string> { log.verbose('Room', 'announce(%s)', typeof text === 'undefined' ? '' : `"${text || ''}"`, ) if (typeof text === 'undefined') { const announcement = await this.wechaty.puppet.roomAnnounce(this.id) return announcement } else { await this.wechaty.puppet.roomAnnounce(this.id, text) } } /** * Get QR Code Value of the Room from the room, which can be used as scan and join the room. * > Tips: * 1. This function is depending on the Puppet Implementation, see [puppet-compatible-table](path_to_url#3-puppet-compatible-table) * 2. The return should be the QR Code Data, instead of the QR Code Image. (the data should be less than 8KB. See: path_to_url ) * @returns {Promise<string>} */ async qrCode (): Promise<string> { log.verbose('Room', 'qrCode()') const qrcodeValue = await this.wechaty.puppet.roomQRCode(this.id) return guardQrCodeValue(qrcodeValue) } /** * Return contact's roomAlias in the room * @param {ContactInterface} contact * @returns {Promise<string | null>} - If a contact has an alias in room, return string, otherwise return null * @example * const bot = new Wechaty() * bot * .on('message', async m => { * const room = m.room() * const contact = m.from() * if (room) { * const alias = await room.alias(contact) * console.log(`${contact.name()} alias is ${alias}`) * } * }) * .start() */ async alias (contact: ContactInterface): Promise<undefined | string> { const memberPayload = await this.wechaty.puppet.roomMemberPayload(this.id, contact.id) if (memberPayload.roomAlias) { return memberPayload.roomAlias } return undefined } async readMark (hasRead: boolean): Promise<void> async readMark (): Promise<boolean> /** * Mark the conversation as read * @param { undefined | boolean } hasRead * * @example * const bot = new Wechaty() * const room = await bot.Room.find({topic: 'xxx'}) * await room.readMark() */ async readMark (hasRead?: boolean): Promise<void | boolean> { try { if (typeof hasRead === 'undefined') { return this.wechaty.puppet.conversationReadMark(this.id) } else { await this.wechaty.puppet.conversationReadMark(this.id, hasRead) } } catch (e) { this.wechaty.emitError(e) log.error('Room', 'readMark() exception: %s', (e as Error).message) } } /** * Check if the room has member `contact`, the return is a Promise and must be `await`-ed * * @param {ContactInterface} contact * @returns {Promise<boolean>} Return `true` if has contact, else return `false`. * @example <caption>Check whether 'lijiarui' is in the room 'wechaty'</caption> * const bot = new Wechaty() * await bot.start() * // after logged in... * const contact = await bot.Contact.find({name: 'lijiarui'}) // change 'lijiarui' to any of contact in your WeChat * const room = await bot.Room.find({topic: 'wechaty'}) // change 'wechaty' to any of the room in your WeChat * if (contact && room) { * if (await room.has(contact)) { * console.log(`${contact.name()} is in the room wechaty!`) * } else { * console.log(`${contact.name()} is not in the room wechaty!`) * } * } */ async has (contact: ContactInterface): Promise<boolean> { const memberIdList = await this.wechaty.puppet.roomMemberList(this.id) // if (!memberIdList) { // return false // } return memberIdList .filter(id => id === contact.id) .length > 0 } async memberAll () : Promise<ContactInterface[]> async memberAll (name: string) : Promise<ContactInterface[]> async memberAll (filter: PUPPET.filters.RoomMember) : Promise<ContactInterface[]> /** * The way to search member by Room.member() * * @typedef RoomMemberQueryFilter * @property {string} name -Find the contact by WeChat name in a room, equal to `Contact.name()`. * @property {string} roomAlias -Find the contact by alias set by the bot for others in a room. * @property {string} contactAlias -Find the contact by alias set by the contact out of a room, equal to `Contact.alias()`. * [More Detail]{@link path_to_url} */ /** * Find all contacts in a room * * #### definition * - `name` the name-string set by user-self, should be called name, equal to `Contact.name()` * - `roomAlias` the name-string set by user-self in the room, should be called roomAlias * - `contactAlias` the name-string set by bot for others, should be called alias, equal to `Contact.alias()` * @param {(RoomMemberQueryFilter | string)} [query] -Optional parameter, When use memberAll(name:string), return all matched members, including name, roomAlias, contactAlias * @returns {Promise<ContactInterface[]>} * @example * const roomList:Contact[] | null = await room.findAll() * if(roomList) * console.log(`room all member list: `, roomList) * const memberContactList: Contact[] | null =await room.findAll(`abc`) * console.log(`contact list with all name, room alias, alias are abc:`, memberContactList) */ async memberAll ( query?: string | PUPPET.filters.RoomMember, ): Promise<ContactInterface[]> { log.silly('Room', 'memberAll(%s)', JSON.stringify(query) || '', ) if (!query) { return this.memberList() } const contactIdList = await this.wechaty.puppet.roomMemberSearch(this.id, query) const contactListAll = await Promise.all( contactIdList.map(id => this.wechaty.Contact.find({ id })), ) const contactList = contactListAll.filter(c => !!c) as ContactInterface[] return contactList } async member (name : string) : Promise<undefined | ContactInterface> async member (filter: PUPPET.filters.RoomMember): Promise<undefined | ContactInterface> /** * Find all contacts in a room, if get many, return the first one. * * @param {(RoomMemberQueryFilter | string)} queryArg -When use member(name:string), return all matched members, including name, roomAlias, contactAlias * @returns {Promise<undefined | ContactInterface>} * * @example <caption>Find member by name</caption> * const bot = new Wechaty() * await bot.start() * // after logged in... * const room = await bot.Room.find({topic: 'wechaty'}) // change 'wechaty' to any room name in your WeChat * if (room) { * const member = await room.member('lijiarui') // change 'lijiarui' to any room member in your WeChat * if (member) {load * @example <caption>Find member by MemberQueryFilter</caption> * const bot = new Wechaty() * await bot.start() * // after logged in... * const room = await bot.Room.find({topic: 'wechaty'}) // change 'wechaty' to any room name in your WeChat * if (room) { * const member = await room.member({name: 'lijiarui'}) // change 'lijiarui' to any room member in your WeChat * if (member) { * console.log(`wechaty room got the member: ${member.name()}`) * } else { * console.log(`cannot get member in wechaty room!`) * } * } */ async member ( queryArg: string | PUPPET.filters.RoomMember, ): Promise<undefined | ContactInterface> { log.verbose('Room', 'member(%s)', JSON.stringify(queryArg)) let memberList: ContactInterface[] // ISSUE #622 // error TS2345: Argument of type 'string | MemberQueryFilter' is not assignable to parameter of type 'MemberQueryFilter' #622 if (typeof queryArg === 'string') { memberList = await this.memberAll(queryArg) } else { memberList = await this.memberAll(queryArg) } if (memberList.length <= 0) { return undefined } if (memberList.length > 1) { log.warn('Room', 'member(%s) get %d contacts, use the first one by default', JSON.stringify(queryArg), memberList.length) } return memberList[0]! } /** * Huan(202110): * - Q: why this method marked as `privated` before? * - A: it is for supporting the `memberAll()` API * * Get all room member from the room * * @returns {Promise<ContactInterface[]>} * @example * await room.memberList() */ protected async memberList (): Promise<ContactInterface[]> { log.verbose('Room', 'memberList()') const memberIdList = await this.wechaty.puppet.roomMemberList(this.id) // if (!memberIdList) { // log.warn('Room', 'memberList() not ready') // return [] // } const contactListAll = await Promise.all( memberIdList.map( id => this.wechaty.Contact.find({ id }), ), ) const contactList = contactListAll.filter(c => !!c) as ContactInterface[] return contactList } /** * Get room's owner from the room. * > Tips: * This function is depending on the Puppet Implementation, see [puppet-compatible-table](path_to_url#3-puppet-compatible-table) * @returns {(ContactInterface | undefined)} * @example * const owner = room.owner() */ owner (): undefined | ContactInterface { log.verbose('Room', 'owner()') const ownerId = this.payload && this.payload.ownerId if (!ownerId) { return undefined } const owner = (this.wechaty.Contact as typeof ContactImpl).load(ownerId) return owner } /** * Get avatar from the room. * @returns {FileBox} * @example * const fileBox = await room.avatar() * const name = fileBox.name * fileBox.toFile(name) */ async avatar (): Promise<FileBoxInterface> { log.verbose('Room', 'avatar()') return this.wechaty.puppet.roomAvatar(this.id) } } class RoomImpl extends validationMixin(RoomMixin)<RoomImplInterface>() {} interface RoomImplInterface extends RoomImpl {} type RoomProtectedProperty = | 'ready' type RoomInterface = Omit<RoomImplInterface, RoomProtectedProperty> type RoomConstructor = Constructor< RoomImplInterface, Omit<typeof RoomImpl, 'load'> > export type { RoomConstructor, RoomProtectedProperty, RoomInterface, } export { RoomImpl, } ```
```java /** * <p> * <p> * path_to_url * <p> * Unless required by applicable law or agreed to in writing, software * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */ package io.jpress.commons.email; public interface EmailSender { public boolean send(Email email); } ```
The Institute of the Czech Language (, ÚJČ) is a scientific institution dedicated to the study of the Czech language. It is one of the institutes of the Academy of Sciences of the Czech Republic. Its headquarters are in Prague and it has a branch in Brno. The institute was created in 1946, by transformation of the former Office for the Czech Lexicon (), founded in 1911 by the former Czech Academy of Sciences and Arts. In 1953 it became a part of the Czechoslovak Academy of Sciences and became a public research institution in 2007. In the Czech Republic, the institute is widely accepted as the regulatory body of the Czech language. Its recommendations on standard Czech () are viewed as binding by the educational system, newspapers and others, although this has no legal basis. The institute's rich publishing activity has two main branches, firstly scientific monographies, magazines (, ) and articles, that could be viewed as conversation between bohemists themselves, discussing matters of the Czech language. Secondly, what could be considered output of these discussions, is a consistent set of rules on vocabulary, grammar and orthography. Of the recommendations published most weight carry those, to which the institute itself assigns "codification status": monolingual dictionaries of the Czech language, Slovník spisovného jazyka českého and Slovník spisovné češtiny pro školu a veřejnost, and the orthography manual Pravidla českého pravopisu. The recommendations published in new editions of these are usually subsequently accepted by a ministry of education to be used in schools. The publication of new editions has often been a source of heated debate and national controversy, as recently as 1993. There have been unsuccessful attempts to enshrine the position of the Czech language and its minders in legislation, akin to the Language law of Slovakia. See also List of language regulators References External links Institute of the Czech Language of the AS CR – official site Slovník spisovného jazyka českého – Institute's online dictionary Language regulators 1946 establishments in Czechoslovakia Organizations established in 1946 Czech Academy of Sciences Czech language
Philippe Nkiere Keana is a retired Roman Catholic bishop in the Democratic Republic of the Congo. He was born on 21 February 1938 in Bokoro. He was ordained as a priest in 1965 and as Coadjutor Bishop of Bondo in January 1992, becoming Bishop of Bondo in November 1992. Keana was appointed Bishop of Inongo in 2005 and retired in 2018. He was succeeded as Bishop of Inongo by Donatien Bafuidinsoni Maloko-Mana. References 1938 births Roman Catholic bishops of Inongo Roman Catholic bishops of Bondo Democratic Republic of the Congo Roman Catholic bishops Living people
```objective-c // // // path_to_url // // Unless required by applicable law or agreed to in writing, software // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #ifndef _GENIE_EVENT_H_ #define _GENIE_EVENT_H_ #ifdef __cplusplus extern "C" { #endif /**< __cplusplus */ typedef enum { /* START--- Don't add new ID before this one */ GENIE_EVT_START = 0, /* Reset Related Operation */ GENIE_EVT_SW_RESET = GENIE_EVT_START, /* triggered from cloud */ GENIE_EVT_HW_RESET_START, /* triggered from user */ GENIE_EVT_HW_RESET_DONE, /*triggered by reset by repeat module */ /* SDK triggered event, with prefix of GENIE_EVT_SDK_MESH_ */ GENIE_EVT_SDK_START, GENIE_EVT_SDK_MESH_INIT = GENIE_EVT_SDK_START, GENIE_EVT_SDK_MESH_PBADV_START, GENIE_EVT_SDK_MESH_PBADV_TIMEOUT, GENIE_EVT_SDK_MESH_SILENT_START, GENIE_EVT_SDK_MESH_PROV_START, GENIE_EVT_SDK_MESH_PROV_TIMEOUT, GENIE_EVT_SDK_MESH_PROV_SUCCESS, GENIE_EVT_SDK_MESH_PROV_FAIL, GENIE_EVT_SDK_APPKEY_ADD, GENIE_EVT_SDK_APPKEY_DEL, GENIE_EVT_SDK_APPKEY_UPDATE, GENIE_EVT_SDK_NETKEY_ADD, GENIE_EVT_SDK_NETKEY_DEL, GENIE_EVT_SDK_NETKEY_UPDATE, GENIE_EVT_SDK_SUB_ADD, GENIE_EVT_SDK_SUB_DEL, GENIE_EVT_SDK_HB_SET, GENIE_EVT_SDK_SEQ_UPDATE, GENIE_EVT_SDK_STATE_SYNC, GENIE_EVT_SDK_IVI_UPDATE, GENIE_EVENT_SUB_SET, GENIE_EVENT_HB_SET, GENIE_EVT_SDK_ANALYZE_MSG, GENIE_EVT_SDK_AIS_DISCON, GENIE_EVT_SDK_DELAY_START, GENIE_EVT_SDK_DELAY_END, GENIE_EVT_SDK_TRANS_START, GENIE_EVT_SDK_TRANS_CYCLE, GENIE_EVT_SDK_TRANS_END, GENIE_EVT_SDK_ACTION_DONE, GENIE_EVT_SDK_MESH_PWRON_INDC, GENIE_EVT_SDK_INDICATE, GENIE_EVT_SDK_VENDOR_MSG, /* APP triggered event, with prefix of GENIE_EVT_APP_ */ GENIE_EVT_APP_START, GENIE_EVT_APP_FAC_QUIT = GENIE_EVT_APP_START, GENIE_EVT_TIME_OUT, /* Board */ GENIE_EVT_BUTTON_TAP, GENIE_EVT_SDK_COLOR_ACTION, GENIE_EVT_RESET_BY_REPEAT_NOTIFY, /* triggered by reset */ /* END --- Don't add new ID after this one */ GENIE_EVT_END } genie_event_t; /** * @brief The handler for the underlying events. If necessary * this handler dispatch the user events to applications. * * @param event refers to the event details. * @param args refers to the additional information for the event. */ void genie_event(genie_event_t event, void *args); #ifdef __cplusplus } #endif /**< __cplusplus */ #endif /* _GENIE_EVENT_H_ */ ```
```c /* $OpenBSD: failedlogin.c,v 1.19 2021/10/24 21:24:16 deraadt Exp $ */ /* * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ /* * failedlogin.c * Log to failedlogin file and read from it, reporting the number of * failed logins since the last good login and when/from where * the last failed login was. */ #include <sys/stat.h> #include <sys/time.h> #include <fcntl.h> #include <stdio.h> #include <string.h> #include <unistd.h> #include <utmp.h> #include "pathnames.h" struct badlogin { char bl_line[UT_LINESIZE]; /* tty used */ char bl_name[UT_NAMESIZE]; /* remote username */ char bl_host[UT_HOSTSIZE]; /* remote host */ time_t bl_time; /* time of the login attempt */ size_t count; /* number of bad logins */ }; void log_failedlogin(uid_t, char *, char *, char *); int check_failedlogin(uid_t); /* * Log a bad login to the failedlogin file. */ void log_failedlogin(uid_t uid, char *host, char *name, char *tty) { struct badlogin failedlogin; int fd; /* Add O_CREAT if you want to create failedlogin if it doesn't exist */ if ((fd = open(_PATH_FAILEDLOGIN, O_RDWR)) >= 0) { (void)lseek(fd, (off_t)uid * sizeof(failedlogin), SEEK_SET); /* Read in last bad login so can get the count */ if (read(fd, (char *)&failedlogin, sizeof(failedlogin)) != sizeof(failedlogin) || failedlogin.bl_time == 0) memset((void *)&failedlogin, 0, sizeof(failedlogin)); (void)lseek(fd, (off_t)uid * sizeof(failedlogin), SEEK_SET); /* Increment count of bad logins */ ++failedlogin.count; (void)time(&failedlogin.bl_time); strncpy(failedlogin.bl_line, tty, sizeof(failedlogin.bl_line)); if (host) strncpy(failedlogin.bl_host, host, sizeof(failedlogin.bl_host)); else *failedlogin.bl_host = '\0'; /* NULL host field */ if (name) strncpy(failedlogin.bl_name, name, sizeof(failedlogin.bl_name)); else *failedlogin.bl_name = '\0'; /* NULL name field */ (void)write(fd, (char *)&failedlogin, sizeof(failedlogin)); (void)close(fd); } } /* * Check the failedlogin file and report about the number of unsuccessful * logins and info about the last one in lastlogin style. * NOTE: zeros the count field since this is assumed to be called after the * user has been validated. */ int check_failedlogin(uid_t uid) { struct badlogin failedlogin; int fd, was_bad = 0; (void)memset((void *)&failedlogin, 0, sizeof(failedlogin)); if ((fd = open(_PATH_FAILEDLOGIN, O_RDWR)) >= 0) { (void)lseek(fd, (off_t)uid * sizeof(failedlogin), SEEK_SET); if (read(fd, (char *)&failedlogin, sizeof(failedlogin)) == sizeof(failedlogin) && failedlogin.count > 0 ) { /* There was a bad login */ was_bad = 1; if (failedlogin.count > 1) (void)printf("There have been %lu unsuccessful " "login attempts to your account.\n", (u_long)failedlogin.count); (void)printf("Last unsuccessful login: %.*s", 24-5, (char *)ctime(&failedlogin.bl_time)); (void)printf(" on %.*s", (int)sizeof(failedlogin.bl_line), failedlogin.bl_line); if (*failedlogin.bl_host != '\0') { if (*failedlogin.bl_name != '\0') (void)printf(" from %.*s@%.*s", (int)sizeof(failedlogin.bl_name), failedlogin.bl_name, (int)sizeof(failedlogin.bl_host), failedlogin.bl_host); else (void)printf(" from %.*s", (int)sizeof(failedlogin.bl_host), failedlogin.bl_host); } (void)putchar('\n'); /* Reset since this is a good login and write record */ failedlogin.count = 0; (void)lseek(fd, (off_t)uid * sizeof(failedlogin), SEEK_SET); (void)write(fd, (char *)&failedlogin, sizeof(failedlogin)); } (void)close(fd); } return(was_bad); } ```
```yaml subject: "Block" description: "Arity / with optional keyword arguments" notes: > Block parameters are described (as Arity object) in the following way: - preRequired=0 - optional=0 - hasRest=false - postRequired=0 - keywordArguments=[a, c, b, d] - requiredKeywordArgumentsCount=2 - hasKeywordsRest=false So the optional keyword arguments are reflected in the `requiredKeywordArgumentsCount=2` attribute. Note that in keywordArguments the required keywords (a and c) are put first and optional keywords are at the end. focused_on_node: "org.truffleruby.language.methods.BlockDefinitionNode" ruby: | proc do |a:, b: 42, c:, d: 100500| end ast: | BlockDefinitionNodeGen attributes: breakID = org.truffleruby.language.control.BreakID@... callTargets = ProcCallTargets(callTargetForProc = block in <top (required)>, callTargetForLambda = null, altCallTargetCompiler = ...$$Lambda$.../0x...@...) flags = 0 frameOnStackMarkerSlot = 2 sharedMethodInfo = SharedMethodInfo(staticLexicalScope = :: Object, arity = Arity{preRequired = 0, optional = 0, hasRest = false, isImplicitRest = false, postRequired = 0, keywordArguments = [a, c, b, d], requiredKeywordArgumentsCount = 2, hasKeywordsRest = false}, originName = block in <top (required)>, blockDepth = 1, parseName = block in <top (required)>, notes = <top (required)>, argumentDescriptors = [ArgumentDescriptor(name = a, type = keyreq), ArgumentDescriptor(name = b, type = key), ArgumentDescriptor(name = c, type = keyreq), ArgumentDescriptor(name = d, type = key)]) sourceCharIndex = 5 sourceLength = 33 type = PROC call targets: RubyProcRootNode attributes: callTarget = block in <top (required)> frameDescriptor = FrameDescriptor@...{#0:(self), #1:a, #2:b, #3:c, #4:d} instrumentationBits = 0 lock = java.util.concurrent.locks.ReentrantLock@...[Unlocked] nextProfile = false polyglotRef = org.truffleruby.RubyLanguage@... redoProfile = false retryProfile = false returnID = org.truffleruby.language.control.ReturnID@... sharedMethodInfo = SharedMethodInfo(staticLexicalScope = :: Object, arity = Arity{preRequired = 0, optional = 0, hasRest = false, isImplicitRest = false, postRequired = 0, keywordArguments = [a, c, b, d], requiredKeywordArgumentsCount = 2, hasKeywordsRest = false}, originName = block in <top (required)>, blockDepth = 1, parseName = block in <top (required)>, notes = <top (required)>, argumentDescriptors = [ArgumentDescriptor(name = a, type = keyreq), ArgumentDescriptor(name = b, type = key), ArgumentDescriptor(name = c, type = keyreq), ArgumentDescriptor(name = d, type = key)]) sourceSection = SourceSection(source=<parse_ast> [1:6 - 2:3], index=5, length=33, characters=do |a:, b: 42, c:, d: 100500|\nend) split = HEURISTIC children: body = SequenceNode attributes: flags = 12 sourceCharIndex = 5 sourceLength = 33 children: body = [ WriteLocalVariableNode attributes: flags = 0 frameSlot = 0 # (self) sourceCharIndex = -1 sourceLength = 0 children: valueNode = ProfileArgumentNodeGen attributes: flags = 0 sourceCharIndex = -1 sourceLength = 0 children: childNode_ = ReadSelfNode attributes: flags = 0 sourceCharIndex = -1 sourceLength = 0 WriteLocalVariableNode attributes: flags = 0 frameSlot = 1 # a sourceCharIndex = -1 sourceLength = 0 children: valueNode = ReadKeywordArgumentNodeGen attributes: flags = 0 name = :a sourceCharIndex = -1 sourceLength = 0 children: readUserKeywordsHashNode = ReadUserKeywordsHashNode WriteLocalVariableNode attributes: flags = 0 frameSlot = 2 # b sourceCharIndex = -1 sourceLength = 0 children: valueNode = ReadKeywordArgumentNodeGen attributes: flags = 0 name = :b sourceCharIndex = -1 sourceLength = 0 children: defaultValue = IntegerFixnumLiteralNode attributes: flags = 0 sourceCharIndex = 16 sourceLength = 2 value = 42 readUserKeywordsHashNode = ReadUserKeywordsHashNode WriteLocalVariableNode attributes: flags = 0 frameSlot = 3 # c sourceCharIndex = -1 sourceLength = 0 children: valueNode = ReadKeywordArgumentNodeGen attributes: flags = 0 name = :c sourceCharIndex = -1 sourceLength = 0 children: readUserKeywordsHashNode = ReadUserKeywordsHashNode WriteLocalVariableNode attributes: flags = 0 frameSlot = 4 # d sourceCharIndex = -1 sourceLength = 0 children: valueNode = ReadKeywordArgumentNodeGen attributes: flags = 0 name = :d sourceCharIndex = -1 sourceLength = 0 children: defaultValue = IntegerFixnumLiteralNode attributes: flags = 0 sourceCharIndex = 27 sourceLength = 6 value = 100500 readUserKeywordsHashNode = ReadUserKeywordsHashNode NilLiteralNode attributes: flags = 0 sourceCharIndex = -1 sourceLength = 0 ] checkKeywordArityNode = CheckKeywordArityNode attributes: arity = Arity{preRequired = 0, optional = 0, hasRest = false, isImplicitRest = false, postRequired = 0, keywordArguments = [a, c, b, d], requiredKeywordArgumentsCount = 2, hasKeywordsRest = false} children: readUserKeywordsHashNode = ReadUserKeywordsHashNode ```
is a song by Japanese composer Go Shiina featuring Nami Nakagawa, released on August 30, 2019. It was used as an insert song of the TV anime series Demon Slayer: Kimetsu no Yaiba by Ufotable. Composition and lyrics The composer Go Shiina, who is also involved in the production of anime gekitomo music, composed the song. Nami Nakagawa, who is in charge of vocals, participates as a chorus in various scenes in the animation, including the voice that flows in the subtitle of "Kimetsu no Yaiba". The lyrics were written by Ufotable. It expresses the determination of the main character, Tanjiro Kamado, who stands up from despair and struggles to protect his younger sister Nezuko. Manga.Tokyo praised the song, commenting "it was a good way to finish the narrative about the Kamado siblings." The song was used in the climax scene and ending of episode 19 "Hinokami". In general, most of the inserted songs are only soundtrack collections that summarize BGM, but after the main animation broadcast, many voices requesting the full version of the single song reached the production side, and it became an unusual download sale of the inserted song. Live performances "Kamado Tanjiro no Uta" was performed for the first time on TBS TV "CDTV Live! Live! Christmas 4 Hours Special" which was broadcast live on December 21, 2020. On December 30 of the same year, it was performed live at the same station's "62nd Shining! Japan Record Awards" and as a special project because Demon Slayer: Kimetsu no Yaiba won a special prize. Charts Certifications References External links "Kamado Tanjiro no Uta" on Official Website 2019 singles Anime songs Demon Slayer: Kimetsu no Yaiba
Raymond Charles New (14 November 1926 – 27 May 2001) is a former motorcycle speedway rider and promoter from New Zealand. During his United Kingdom career he was known as Charlie New. Career New started racing in the British leagues during the 1950 Speedway National League Division Two season, when riding for the Sheffield Tars. He joined Coventry Bees in 1951 and stayed with them for seven years. In 1960 and 1961, New became two times champion of New Zealand after winning the New Zealand Solo Championship. References Living people 1926 births New Zealand speedway riders Coventry Bees riders Oxford Cheetahs riders
```php <?php /* * * * path_to_url * * Unless required by applicable law or agreed to in writing, software * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the */ namespace Google\Service\Vision; class WebDetectionParams extends \Google\Model { /** * @var bool */ public $includeGeoResults; /** * @param bool */ public function setIncludeGeoResults($includeGeoResults) { $this->includeGeoResults = $includeGeoResults; } /** * @return bool */ public function getIncludeGeoResults() { return $this->includeGeoResults; } } // Adding a class alias for backwards compatibility with the previous class name. class_alias(WebDetectionParams::class, 'Google_Service_Vision_WebDetectionParams'); ```
```java /* * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * * path_to_url * * Unless required by applicable law or agreed to in writing, software * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */ package org.apache.carbondata.processing.loading.sort; import org.apache.carbondata.processing.loading.exception.CarbonDataLoadingException; import org.apache.carbondata.processing.loading.sort.impl.ThreadStatusObserver; /** * The class defines the common methods used in across various type of sort */ public abstract class AbstractMergeSorter implements Sorter { /** * instance of thread status observer */ protected ThreadStatusObserver threadStatusObserver; /** * Below method will be used to check error in exception */ public void checkError() { if (threadStatusObserver.getThrowable() != null) { if (threadStatusObserver.getThrowable() instanceof CarbonDataLoadingException) { throw (CarbonDataLoadingException) threadStatusObserver.getThrowable(); } else { throw new CarbonDataLoadingException(threadStatusObserver.getThrowable()); } } } } ```
The R488 road is a regional road in Ireland, located in County Clare. References Regional roads in the Republic of Ireland Roads in County Clare
Youssouf Oumarou Alio (born 16 February 1993) is a Nigerien professional footballer who plays for Tunisian Ligue Professionnelle 1 club Espérance de Tunis and the Niger national team. International career Oumarou debuted internationally for the Niger national team on 13 November 2015 in a friendly match against Nigeria in a 2–0 loss. On 16 October 2018, he scored his first goal for Niger against Tunisia in a 2–1 defeat during the 2019 Africa Cup of Nations qualification to be held in Cameroon. On 8 October 2021, during the 2022 FIFA World Cup qualifying match against Algeria, he scored an own goal which resulted in a 6–1 defeat. References 1993 births Living people Nigerien men's footballers Men's association football midfielders Niger men's international footballers Tunisian Ligue Professionnelle 1 players Sahel SC players AS FAN players US Bitam players MC Oujda players Kénitra AC players US GN players FC San Pédro players US Monastir (football) players Espérance Sportive de Tunis players Nigerien expatriate men's footballers Nigerien expatriate sportspeople in Gabon Expatriate men's footballers in Gabon Nigerien expatriate sportspeople in Morocco Expatriate men's footballers in Morocco Nigerien expatriate sportspeople in Ivory Coast Expatriate men's footballers in Ivory Coast Nigerien expatriate sportspeople in Tunisia Expatriate men's footballers in Tunisia Niger men's A' international footballers 2016 African Nations Championship players
```c /****************************************************************************** * * THIS SOURCE CODE IS HEREBY PLACED INTO THE PUBLIC DOMAIN FOR THE GOOD OF ALL * * This is a simple and straightforward implementation of the AES Rijndael * 128-bit block cipher designed by Vincent Rijmen and Joan Daemen. The focus * of this work was correctness & accuracy. It is written in 'C' without any * particular focus upon optimization or speed. It should be endian (memory * byte order) neutral since the few places that care are handled explicitly. * * This implementation of Rijndael was created by Steven M. Gibson of GRC.com. * * It is intended for general purpose use, but was written in support of GRC's * reference implementation of the SQRL (Secure Quick Reliable Login) client. * * See: path_to_url * * NO COPYRIGHT IS CLAIMED IN THIS WORK, HOWEVER, NEITHER IS ANY WARRANTY MADE * REGARDING ITS FITNESS FOR ANY PARTICULAR PURPOSE. USE IT AT YOUR OWN RISK. * *******************************************************************************/ #include "aes.h" static int aes_tables_inited = 0; // run-once flag for performing key // expasion table generation (see below) /* * The following static local tables must be filled-in before the first use of * the GCM or AES ciphers. They are used for the AES key expansion/scheduling * and once built are read-only and thread safe. The "gcm_initialize" function * must be called once during system initialization to populate these arrays * for subsequent use by the AES key scheduler. If they have not been built * before attempted use, an error will be returned to the caller. * * NOTE: GCM Encryption/Decryption does NOT REQUIRE AES decryption. Since * GCM uses AES in counter-mode, where the AES cipher output is XORed with * the GCM input, we ONLY NEED AES encryption. Thus, to save space AES * decryption is typically disabled by setting AES_DECRYPTION to 0 in aes.h. */ // We always need our forward tables static uchar FSb[256]; // Forward substitution box (FSb) static uint32_t FT0[256]; // Forward key schedule assembly tables static uint32_t FT1[256]; static uint32_t FT2[256]; static uint32_t FT3[256]; #if AES_DECRYPTION // We ONLY need reverse for decryption static uchar RSb[256]; // Reverse substitution box (RSb) static uint32_t RT0[256]; // Reverse key schedule assembly tables static uint32_t RT1[256]; static uint32_t RT2[256]; static uint32_t RT3[256]; #endif /* AES_DECRYPTION */ static uint32_t RCON[10]; // AES round constants /* * Platform Endianness Neutralizing Load and Store Macro definitions * AES wants platform-neutral Little Endian (LE) byte ordering */ #define GET_UINT32_LE(n,b,i) { \ (n) = ( (uint32_t) (b)[(i) ] ) \ | ( (uint32_t) (b)[(i) + 1] << 8 ) \ | ( (uint32_t) (b)[(i) + 2] << 16 ) \ | ( (uint32_t) (b)[(i) + 3] << 24 ); } #define PUT_UINT32_LE(n,b,i) { \ (b)[(i) ] = (uchar) ( (n) ); \ (b)[(i) + 1] = (uchar) ( (n) >> 8 ); \ (b)[(i) + 2] = (uchar) ( (n) >> 16 ); \ (b)[(i) + 3] = (uchar) ( (n) >> 24 ); } /* * AES forward and reverse encryption round processing macros */ #define AES_FROUND(X0,X1,X2,X3,Y0,Y1,Y2,Y3) \ { \ X0 = *RK++ ^ FT0[ ( Y0 ) & 0xFF ] ^ \ FT1[ ( Y1 >> 8 ) & 0xFF ] ^ \ FT2[ ( Y2 >> 16 ) & 0xFF ] ^ \ FT3[ ( Y3 >> 24 ) & 0xFF ]; \ \ X1 = *RK++ ^ FT0[ ( Y1 ) & 0xFF ] ^ \ FT1[ ( Y2 >> 8 ) & 0xFF ] ^ \ FT2[ ( Y3 >> 16 ) & 0xFF ] ^ \ FT3[ ( Y0 >> 24 ) & 0xFF ]; \ \ X2 = *RK++ ^ FT0[ ( Y2 ) & 0xFF ] ^ \ FT1[ ( Y3 >> 8 ) & 0xFF ] ^ \ FT2[ ( Y0 >> 16 ) & 0xFF ] ^ \ FT3[ ( Y1 >> 24 ) & 0xFF ]; \ \ X3 = *RK++ ^ FT0[ ( Y3 ) & 0xFF ] ^ \ FT1[ ( Y0 >> 8 ) & 0xFF ] ^ \ FT2[ ( Y1 >> 16 ) & 0xFF ] ^ \ FT3[ ( Y2 >> 24 ) & 0xFF ]; \ } #define AES_RROUND(X0,X1,X2,X3,Y0,Y1,Y2,Y3) \ { \ X0 = *RK++ ^ RT0[ ( Y0 ) & 0xFF ] ^ \ RT1[ ( Y3 >> 8 ) & 0xFF ] ^ \ RT2[ ( Y2 >> 16 ) & 0xFF ] ^ \ RT3[ ( Y1 >> 24 ) & 0xFF ]; \ \ X1 = *RK++ ^ RT0[ ( Y1 ) & 0xFF ] ^ \ RT1[ ( Y0 >> 8 ) & 0xFF ] ^ \ RT2[ ( Y3 >> 16 ) & 0xFF ] ^ \ RT3[ ( Y2 >> 24 ) & 0xFF ]; \ \ X2 = *RK++ ^ RT0[ ( Y2 ) & 0xFF ] ^ \ RT1[ ( Y1 >> 8 ) & 0xFF ] ^ \ RT2[ ( Y0 >> 16 ) & 0xFF ] ^ \ RT3[ ( Y3 >> 24 ) & 0xFF ]; \ \ X3 = *RK++ ^ RT0[ ( Y3 ) & 0xFF ] ^ \ RT1[ ( Y2 >> 8 ) & 0xFF ] ^ \ RT2[ ( Y1 >> 16 ) & 0xFF ] ^ \ RT3[ ( Y0 >> 24 ) & 0xFF ]; \ } /* * These macros improve the readability of the key * generation initialization code by collapsing * repetitive common operations into logical pieces. */ #define ROTL8(x) ( ( x << 8 ) & 0xFFFFFFFF ) | ( x >> 24 ) #define XTIME(x) ( ( x << 1 ) ^ ( ( x & 0x80 ) ? 0x1B : 0x00 ) ) #define MUL(x,y) ( ( x && y ) ? pow[(log[x]+log[y]) % 255] : 0 ) #define MIX(x,y) { y = ( (y << 1) | (y >> 7) ) & 0xFF; x ^= y; } #define CPY128 { *RK++ = *SK++; *RK++ = *SK++; \ *RK++ = *SK++; *RK++ = *SK++; } /****************************************************************************** * * AES_INIT_KEYGEN_TABLES * * Fills the AES key expansion tables allocated above with their static * data. This is not "per key" data, but static system-wide read-only * table data. THIS FUNCTION IS NOT THREAD SAFE. It must be called once * at system initialization to setup the tables for all subsequent use. * ******************************************************************************/ void aes_init_keygen_tables(void) { int i, x, y, z; // general purpose iteration and computation locals int pow[256]; int log[256]; if (aes_tables_inited) return; // fill the 'pow' and 'log' tables over GF(2^8) for (i = 0, x = 1; i < 256; i++) { pow[i] = x; log[x] = i; x = (x ^ XTIME(x)) & 0xFF; } // compute the round constants for (i = 0, x = 1; i < 10; i++) { RCON[i] = (uint32_t)x; x = XTIME(x) & 0xFF; } // fill the forward and reverse substitution boxes FSb[0x00] = 0x63; #if AES_DECRYPTION // whether AES decryption is supported RSb[0x63] = 0x00; #endif /* AES_DECRYPTION */ for (i = 1; i < 256; i++) { x = y = pow[255 - log[i]]; MIX(x, y); MIX(x, y); MIX(x, y); MIX(x, y); FSb[i] = (uchar)(x ^= 0x63); #if AES_DECRYPTION // whether AES decryption is supported RSb[x] = (uchar)i; #endif /* AES_DECRYPTION */ } // generate the forward and reverse key expansion tables for (i = 0; i < 256; i++) { x = FSb[i]; y = XTIME(x) & 0xFF; z = (y ^ x) & 0xFF; FT0[i] = ((uint32_t)y) ^ ((uint32_t)x << 8) ^ ((uint32_t)x << 16) ^ ((uint32_t)z << 24); FT1[i] = ROTL8(FT0[i]); FT2[i] = ROTL8(FT1[i]); FT3[i] = ROTL8(FT2[i]); #if AES_DECRYPTION // whether AES decryption is supported x = RSb[i]; RT0[i] = ((uint32_t)MUL(0x0E, x)) ^ ((uint32_t)MUL(0x09, x) << 8) ^ ((uint32_t)MUL(0x0D, x) << 16) ^ ((uint32_t)MUL(0x0B, x) << 24); RT1[i] = ROTL8(RT0[i]); RT2[i] = ROTL8(RT1[i]); RT3[i] = ROTL8(RT2[i]); #endif /* AES_DECRYPTION */ } aes_tables_inited = 1; // flag that the tables have been generated } // to permit subsequent use of the AES cipher /****************************************************************************** * * AES_SET_ENCRYPTION_KEY * * This is called by 'aes_setkey' when we're establishing a key for * subsequent encryption. We give it a pointer to the encryption * context, a pointer to the key, and the key's length in bytes. * Valid lengths are: 16, 24 or 32 bytes (128, 192, 256 bits). * ******************************************************************************/ int aes_set_encryption_key(aes_context *ctx, const uchar *key, uint keysize) { uint i; // general purpose iteration local uint32_t *RK = ctx->rk; // initialize our RoundKey buffer pointer for (i = 0; i < (keysize >> 2); i++) { GET_UINT32_LE(RK[i], key, i << 2); } switch (ctx->rounds) { case 10: for (i = 0; i < 10; i++, RK += 4) { RK[4] = RK[0] ^ RCON[i] ^ ((uint32_t)FSb[(RK[3] >> 8) & 0xFF]) ^ ((uint32_t)FSb[(RK[3] >> 16) & 0xFF] << 8) ^ ((uint32_t)FSb[(RK[3] >> 24) & 0xFF] << 16) ^ ((uint32_t)FSb[(RK[3]) & 0xFF] << 24); RK[5] = RK[1] ^ RK[4]; RK[6] = RK[2] ^ RK[5]; RK[7] = RK[3] ^ RK[6]; } break; case 12: for (i = 0; i < 8; i++, RK += 6) { RK[6] = RK[0] ^ RCON[i] ^ ((uint32_t)FSb[(RK[5] >> 8) & 0xFF]) ^ ((uint32_t)FSb[(RK[5] >> 16) & 0xFF] << 8) ^ ((uint32_t)FSb[(RK[5] >> 24) & 0xFF] << 16) ^ ((uint32_t)FSb[(RK[5]) & 0xFF] << 24); RK[7] = RK[1] ^ RK[6]; RK[8] = RK[2] ^ RK[7]; RK[9] = RK[3] ^ RK[8]; RK[10] = RK[4] ^ RK[9]; RK[11] = RK[5] ^ RK[10]; } break; case 14: for (i = 0; i < 7; i++, RK += 8) { RK[8] = RK[0] ^ RCON[i] ^ ((uint32_t)FSb[(RK[7] >> 8) & 0xFF]) ^ ((uint32_t)FSb[(RK[7] >> 16) & 0xFF] << 8) ^ ((uint32_t)FSb[(RK[7] >> 24) & 0xFF] << 16) ^ ((uint32_t)FSb[(RK[7]) & 0xFF] << 24); RK[9] = RK[1] ^ RK[8]; RK[10] = RK[2] ^ RK[9]; RK[11] = RK[3] ^ RK[10]; RK[12] = RK[4] ^ ((uint32_t)FSb[(RK[11]) & 0xFF]) ^ ((uint32_t)FSb[(RK[11] >> 8) & 0xFF] << 8) ^ ((uint32_t)FSb[(RK[11] >> 16) & 0xFF] << 16) ^ ((uint32_t)FSb[(RK[11] >> 24) & 0xFF] << 24); RK[13] = RK[5] ^ RK[12]; RK[14] = RK[6] ^ RK[13]; RK[15] = RK[7] ^ RK[14]; } break; default: return -1; } return(0); } #if AES_DECRYPTION // whether AES decryption is supported /****************************************************************************** * * AES_SET_DECRYPTION_KEY * * This is called by 'aes_setkey' when we're establishing a * key for subsequent decryption. We give it a pointer to * the encryption context, a pointer to the key, and the key's * length in bits. Valid lengths are: 128, 192, or 256 bits. * ******************************************************************************/ int aes_set_decryption_key(aes_context *ctx, const uchar *key, uint keysize) { int i, j; aes_context cty; // a calling aes context for set_encryption_key uint32_t *RK = ctx->rk; // initialize our RoundKey buffer pointer uint32_t *SK; int ret; cty.rounds = ctx->rounds; // initialize our local aes context cty.rk = cty.buf; // round count and key buf pointer if ((ret = aes_set_encryption_key(&cty, key, keysize)) != 0) return(ret); SK = cty.rk + cty.rounds * 4; CPY128 // copy a 128-bit block from *SK to *RK for (i = ctx->rounds - 1, SK -= 8; i > 0; i--, SK -= 8) { for (j = 0; j < 4; j++, SK++) { *RK++ = RT0[FSb[(*SK) & 0xFF]] ^ RT1[FSb[(*SK >> 8) & 0xFF]] ^ RT2[FSb[(*SK >> 16) & 0xFF]] ^ RT3[FSb[(*SK >> 24) & 0xFF]]; } } CPY128 // copy a 128-bit block from *SK to *RK memset(&cty, 0, sizeof(aes_context)); // clear local aes context return(0); } #endif /* AES_DECRYPTION */ /****************************************************************************** * * AES_SETKEY * * Invoked to establish the key schedule for subsequent encryption/decryption * ******************************************************************************/ int aes_setkey(aes_context *ctx, // AES context provided by our caller int mode, // ENCRYPT or DECRYPT flag const uchar *key, // pointer to the key uint keysize) // key length in bytes { // since table initialization is not thread safe, we could either add // system-specific mutexes and init the AES key generation tables on // demand, or ask the developer to simply call "gcm_initialize" once during // application startup before threading begins. That's what we choose. if (!aes_tables_inited) return (-1); // fail the call when not inited. ctx->mode = mode; // capture the key type we're creating ctx->rk = ctx->buf; // initialize our round key pointer switch (keysize) // set the rounds count based upon the keysize { case 16: ctx->rounds = 10; break; // 16-byte, 128-bit key case 24: ctx->rounds = 12; break; // 24-byte, 192-bit key case 32: ctx->rounds = 14; break; // 32-byte, 256-bit key default: return(-1); } #if AES_DECRYPTION if (mode == DECRYPT) // expand our key for encryption or decryption return(aes_set_decryption_key(ctx, key, keysize)); else /* ENCRYPT */ #endif /* AES_DECRYPTION */ return(aes_set_encryption_key(ctx, key, keysize)); } /****************************************************************************** * * AES_CIPHER * * Perform AES encryption and decryption. * The AES context will have been setup with the encryption mode * and all keying information appropriate for the task. * ******************************************************************************/ int aes_cipher(aes_context *ctx, const uchar input[16], uchar output[16]) { int i; uint32_t *RK, X0, X1, X2, X3, Y0, Y1, Y2, Y3; // general purpose locals RK = ctx->rk; GET_UINT32_LE(X0, input, 0); X0 ^= *RK++; // load our 128-bit GET_UINT32_LE(X1, input, 4); X1 ^= *RK++; // input buffer in a storage GET_UINT32_LE(X2, input, 8); X2 ^= *RK++; // memory endian-neutral way GET_UINT32_LE(X3, input, 12); X3 ^= *RK++; #if AES_DECRYPTION // whether AES decryption is supported if (ctx->mode == DECRYPT) { for (i = (ctx->rounds >> 1) - 1; i > 0; i--) { AES_RROUND(Y0, Y1, Y2, Y3, X0, X1, X2, X3); AES_RROUND(X0, X1, X2, X3, Y0, Y1, Y2, Y3); } AES_RROUND(Y0, Y1, Y2, Y3, X0, X1, X2, X3); X0 = *RK++ ^ \ ((uint32_t)RSb[(Y0) & 0xFF]) ^ ((uint32_t)RSb[(Y3 >> 8) & 0xFF] << 8) ^ ((uint32_t)RSb[(Y2 >> 16) & 0xFF] << 16) ^ ((uint32_t)RSb[(Y1 >> 24) & 0xFF] << 24); X1 = *RK++ ^ \ ((uint32_t)RSb[(Y1) & 0xFF]) ^ ((uint32_t)RSb[(Y0 >> 8) & 0xFF] << 8) ^ ((uint32_t)RSb[(Y3 >> 16) & 0xFF] << 16) ^ ((uint32_t)RSb[(Y2 >> 24) & 0xFF] << 24); X2 = *RK++ ^ \ ((uint32_t)RSb[(Y2) & 0xFF]) ^ ((uint32_t)RSb[(Y1 >> 8) & 0xFF] << 8) ^ ((uint32_t)RSb[(Y0 >> 16) & 0xFF] << 16) ^ ((uint32_t)RSb[(Y3 >> 24) & 0xFF] << 24); X3 = *RK++ ^ \ ((uint32_t)RSb[(Y3) & 0xFF]) ^ ((uint32_t)RSb[(Y2 >> 8) & 0xFF] << 8) ^ ((uint32_t)RSb[(Y1 >> 16) & 0xFF] << 16) ^ ((uint32_t)RSb[(Y0 >> 24) & 0xFF] << 24); } else /* ENCRYPT */ { #endif /* AES_DECRYPTION */ for (i = (ctx->rounds >> 1) - 1; i > 0; i--) { AES_FROUND(Y0, Y1, Y2, Y3, X0, X1, X2, X3); AES_FROUND(X0, X1, X2, X3, Y0, Y1, Y2, Y3); } AES_FROUND(Y0, Y1, Y2, Y3, X0, X1, X2, X3); X0 = *RK++ ^ \ ((uint32_t)FSb[(Y0) & 0xFF]) ^ ((uint32_t)FSb[(Y1 >> 8) & 0xFF] << 8) ^ ((uint32_t)FSb[(Y2 >> 16) & 0xFF] << 16) ^ ((uint32_t)FSb[(Y3 >> 24) & 0xFF] << 24); X1 = *RK++ ^ \ ((uint32_t)FSb[(Y1) & 0xFF]) ^ ((uint32_t)FSb[(Y2 >> 8) & 0xFF] << 8) ^ ((uint32_t)FSb[(Y3 >> 16) & 0xFF] << 16) ^ ((uint32_t)FSb[(Y0 >> 24) & 0xFF] << 24); X2 = *RK++ ^ \ ((uint32_t)FSb[(Y2) & 0xFF]) ^ ((uint32_t)FSb[(Y3 >> 8) & 0xFF] << 8) ^ ((uint32_t)FSb[(Y0 >> 16) & 0xFF] << 16) ^ ((uint32_t)FSb[(Y1 >> 24) & 0xFF] << 24); X3 = *RK++ ^ \ ((uint32_t)FSb[(Y3) & 0xFF]) ^ ((uint32_t)FSb[(Y0 >> 8) & 0xFF] << 8) ^ ((uint32_t)FSb[(Y1 >> 16) & 0xFF] << 16) ^ ((uint32_t)FSb[(Y2 >> 24) & 0xFF] << 24); #if AES_DECRYPTION // whether AES decryption is supported } #endif /* AES_DECRYPTION */ PUT_UINT32_LE(X0, output, 0); PUT_UINT32_LE(X1, output, 4); PUT_UINT32_LE(X2, output, 8); PUT_UINT32_LE(X3, output, 12); return(0); } /* end of aes.c */ ```
Pakuh-e Sefid (, also Romanized as Pākūh-e Sefīd) is a village in Dalfard Rural District, Sarduiyeh District, Jiroft County, Kerman Province, Iran. At the 2006 census, its population was 43, in 10 families. References Populated places in Jiroft County
```python from re import search from unittest import mock from boto3 import client from moto import mock_aws from moto.core.utils import unix_time_millis from tests.providers.aws.utils import ( AWS_REGION_EU_WEST_1, AWS_REGION_US_EAST_1, set_mocked_aws_provider, ) class Test_cloudwatch_log_group_no_secrets_in_logs: def test_cloudwatch_no_log_groups(self): from prowler.providers.aws.services.cloudwatch.cloudwatch_service import Logs aws_provider = set_mocked_aws_provider( [AWS_REGION_EU_WEST_1, AWS_REGION_US_EAST_1] ) from prowler.providers.common.models import Audit_Metadata aws_provider.audit_metadata = Audit_Metadata( services_scanned=0, # We need to set this check to call __describe_log_groups__ expected_checks=["cloudwatch_log_group_no_secrets_in_logs"], completed_checks=0, audit_progress=0, ) with mock.patch( "prowler.providers.common.provider.Provider.get_global_provider", return_value=aws_provider, ), mock.patch( "prowler.providers.aws.services.cloudwatch.cloudwatch_log_group_no_secrets_in_logs.cloudwatch_log_group_no_secrets_in_logs.logs_client", new=Logs(aws_provider), ): # Test Check from prowler.providers.aws.services.cloudwatch.cloudwatch_log_group_no_secrets_in_logs.cloudwatch_log_group_no_secrets_in_logs import ( cloudwatch_log_group_no_secrets_in_logs, ) check = cloudwatch_log_group_no_secrets_in_logs() result = check.execute() assert len(result) == 0 @mock_aws def test_cloudwatch_log_group_without_secrets(self): # Generate Logs Client logs_client = client("logs", region_name=AWS_REGION_US_EAST_1) # Request Logs group logs_client.create_log_group(logGroupName="test") logs_client.create_log_stream(logGroupName="test", logStreamName="test stream") logs_client.put_log_events( logGroupName="test", logStreamName="test stream", logEvents=[ { "timestamp": int(unix_time_millis()), "message": "non sensitive message", } ], ) from prowler.providers.aws.services.cloudwatch.cloudwatch_service import Logs aws_provider = set_mocked_aws_provider( [AWS_REGION_EU_WEST_1, AWS_REGION_US_EAST_1] ) from prowler.providers.common.models import Audit_Metadata aws_provider.audit_metadata = Audit_Metadata( services_scanned=0, # We need to set this check to call __describe_log_groups__ expected_checks=["cloudwatch_log_group_no_secrets_in_logs"], completed_checks=0, audit_progress=0, ) with mock.patch( "prowler.providers.common.provider.Provider.get_global_provider", return_value=aws_provider, ), mock.patch( "prowler.providers.aws.services.cloudwatch.cloudwatch_log_group_no_secrets_in_logs.cloudwatch_log_group_no_secrets_in_logs.logs_client", new=Logs(aws_provider), ): # Test Check from prowler.providers.aws.services.cloudwatch.cloudwatch_log_group_no_secrets_in_logs.cloudwatch_log_group_no_secrets_in_logs import ( cloudwatch_log_group_no_secrets_in_logs, ) check = cloudwatch_log_group_no_secrets_in_logs() result = check.execute() assert len(result) == 1 assert result[0].status == "PASS" assert result[0].status_extended == "No secrets found in test log group." assert result[0].resource_id == "test" @mock_aws def test_cloudwatch_log_group_with_secrets(self): # Generate Logs Client logs_client = client("logs", region_name=AWS_REGION_US_EAST_1) # Request Logs group logs_client.create_log_group(logGroupName="test") logs_client.create_log_stream(logGroupName="test", logStreamName="test stream") logs_client.put_log_events( logGroupName="test", logStreamName="test stream", logEvents=[ { "timestamp": int(unix_time_millis()), "message": "password = password123", } ], ) from prowler.providers.aws.services.cloudwatch.cloudwatch_service import Logs aws_provider = set_mocked_aws_provider( [AWS_REGION_EU_WEST_1, AWS_REGION_US_EAST_1] ) from prowler.providers.common.models import Audit_Metadata aws_provider.audit_metadata = Audit_Metadata( services_scanned=0, # We need to set this check to call __describe_log_groups__ expected_checks=["cloudwatch_log_group_no_secrets_in_logs"], completed_checks=0, audit_progress=0, ) with mock.patch( "prowler.providers.common.provider.Provider.get_global_provider", return_value=aws_provider, ), mock.patch( "prowler.providers.aws.services.cloudwatch.cloudwatch_log_group_no_secrets_in_logs.cloudwatch_log_group_no_secrets_in_logs.logs_client", new=Logs(aws_provider), ): # Test Check from prowler.providers.aws.services.cloudwatch.cloudwatch_log_group_no_secrets_in_logs.cloudwatch_log_group_no_secrets_in_logs import ( cloudwatch_log_group_no_secrets_in_logs, ) check = cloudwatch_log_group_no_secrets_in_logs() result = check.execute() assert len(result) == 1 assert result[0].status == "FAIL" assert search( "Potential secrets found in log group", result[0].status_extended ) assert result[0].resource_id == "test" @mock_aws def test_access_denied(self): from prowler.providers.aws.services.cloudwatch.cloudwatch_service import Logs aws_provider = set_mocked_aws_provider( [AWS_REGION_EU_WEST_1, AWS_REGION_US_EAST_1] ) from prowler.providers.common.models import Audit_Metadata aws_provider.audit_metadata = Audit_Metadata( services_scanned=0, # We need to set this check to call __describe_log_groups__ expected_checks=["cloudwatch_log_group_no_secrets_in_logs"], completed_checks=0, audit_progress=0, ) with mock.patch( "prowler.providers.common.provider.Provider.get_global_provider", return_value=aws_provider, ), mock.patch( "prowler.providers.aws.services.cloudwatch.cloudwatch_log_group_no_secrets_in_logs.cloudwatch_log_group_no_secrets_in_logs.logs_client", new=Logs(aws_provider), ) as logs_client: # Test Check from prowler.providers.aws.services.cloudwatch.cloudwatch_log_group_no_secrets_in_logs.cloudwatch_log_group_no_secrets_in_logs import ( cloudwatch_log_group_no_secrets_in_logs, ) logs_client.log_groups = None check = cloudwatch_log_group_no_secrets_in_logs() result = check.execute() assert len(result) == 0 ```
```xml <Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0" xmlns="path_to_url"> <PropertyGroup> <TargetFramework>netstandard1.5</TargetFramework> </PropertyGroup> </Project> ```
```ruby require_relative '../../../spec_helper' require_relative 'shared/constants' require_relative 'shared/length' describe "Digest::SHA512#size" do it_behaves_like :sha512_length, :size end ```
```yaml zh-CN: activemodel: attributes: oauth_application: name: OAuth organization_logo: () organization_name: organization_url: redirect_uri: URI organization_file_uploads: allowed_content_types: admin: MIME default: MIME allowed_file_extensions: admin: default: image: maximum_file_size: avatar: default: errors: models: oauth_application: attributes: redirect_uri: must_be_ssl: URI SSL URI decidim: system: actions: confirm_destroy: destroy: edit: save: title: admins: create: error: edit: title: update: index: title: new: create: title: update: error: default_pages: placeholders: content: %{page} title: '%{page} ' menu: admins: dashboard: oauth_applications: OAuth organizations: models: admin: fields: created_at: email: validations: email_uniqueness: oauth_application: fields: created_at: name: OAuth organization_name: organization: actions: save_and_invite: fields: created_at: file_upload_settings: name: omniauth_settings: Omniauth smtp_settings: SMTP oauth_applications: create: error: success: destroy: error: success: edit: save: title: form: select_organization: index: confirm_delete: title: OAuth new: save: title: update: error: success: organizations: create: error: edit: secondary_hosts_hint: file_upload_settings: content_types: admin_hint: MIME default_hint: MIME intro_html: MIME <code>/*</code> title: MIME file_extensions: admin_hint: default_hint: image_hint: title: file_sizes: avatar_hint: Megabytes (MB). default_hint: Megabytes (MB). title: intro: | MIME index: title: new: title: omniauth_settings: decidim: client_id: ID client_secret: site_url: enabled: enabled_by_default: facebook: app_id: ID app_secret: google_oauth2: client_id: ID client_secret: icon: icon_path: twitter: api_key: API api_secret: API smtp_settings: placeholder: from_email: Your-organization@example.org from_label: update: error: success: users_registration_mode: disabled: shared: notices: no_organization_warning_html: %{guide} our_getting_started_guide: titles: dashboard: ```
```javascript import { getKnex } from "../../knex"; export default async function handler(req, res) { const knex = getKnex(); const todos = await knex("todos"); res.status(200).json(todos); } ```
```kotlin package mega.privacy.android.data.mapper.account.business import mega.privacy.android.domain.entity.account.business.BusinessAccountStatus import javax.inject.Inject /** * Business account status mapper */ internal class BusinessAccountStatusMapper @Inject constructor() { /** * Invoke * * @param accountStatusInteger * @return BusinessAccountStatus */ internal operator fun invoke(accountStatusInteger: Int): BusinessAccountStatus = when (accountStatusInteger) { -1 -> BusinessAccountStatus.Expired 0 -> BusinessAccountStatus.Inactive 1 -> BusinessAccountStatus.Active 2 -> BusinessAccountStatus.GracePeriod else -> throw IllegalArgumentException("Business account status of $accountStatusInteger is not a valid value.") } } ```
Jayantha Kularathna is a Sri Lankan admiral who is the incumbent Chief of Staff of the Sri Lanka Navy. Prior to this, he was the Commander, Eastern Naval Area. Early life and education Kularathna completed his high school from Mahanama College and then joined the Sri Lanka Navy in 1987 as an Officer Cadet of the 16th intake, in the Executive branch. Career KJ Kularatne assumed office as Commander Eastern Naval Area at the Command Headquarters in Trincomalee 8 March 2022. Before that, he served as Commander of Northwestern Naval Area. Prior to his promotion to the rank of Rear Admiral on 7 August 2020, Commodore Kularathna served as Deputy Area Commander at Eastern Naval Area. From Deputy chief of staff he promoted to Chief of staff on 18 December, 2022. References Sri Lankan rear admirals Sinhalese military personnel Living people Year of birth missing (living people)
Iosif Culineac (13 August 1941 – 26 July 2022) was a Romanian water polo player. He competed at the 1964 Summer Olympics and the 1972 Summer Olympics. References External links 1941 births 2022 deaths Romanian male water polo players Olympic water polo players for Romania Water polo players at the 1964 Summer Olympics Water polo players at the 1972 Summer Olympics Water polo players from Bucharest
WUUU (98.9 FM, "Cat Country 98.9") is a United States country music-formatted radio station with offices in Covington, Louisiana and Hammond, Louisiana. The station, which is owned by Pittman Broadcasting Services, LLC., operates with an ERP of 25 kW. History The station signed on the air in 1995 as a class A station playing country music owned by Gaco Broadcasting Corp. In May 2002, the station was sold to Marcus Pittman, III. On December 18, 2013, the station was relocated to a new transmitter site just north of Folsom, Louisiana, and upgraded to a Class C3 operating at 25,000 watts. Callsign history The WUUU call sign once belonged to WNFZ/94.3 of Powell, Tennessee, in the 1970s. They were also used from 1982 to 1993 by WUMX/102.5 of Utica, New York, and from 1993 to 1996 by WARW/93.5 in Remsen, New York. References External links Station Website Station Facebook Radio stations in Louisiana Country radio stations in the United States Radio stations established in 1995 1995 establishments in Louisiana
```kotlin package de.westnordost.streetcomplete.screens.about import androidx.compose.animation.slideInHorizontally import androidx.compose.animation.slideOutHorizontally import androidx.compose.runtime.Composable import androidx.compose.ui.platform.LocalLayoutDirection import androidx.navigation.compose.NavHost import androidx.navigation.compose.composable import androidx.navigation.compose.rememberNavController import de.westnordost.streetcomplete.screens.about.logs.LogsScreen import de.westnordost.streetcomplete.ui.ktx.dir import org.koin.androidx.compose.koinViewModel @Composable fun AboutNavHost(onClickBack: () -> Unit) { val navController = rememberNavController() val dir = LocalLayoutDirection.current.dir fun goBack() { if (!navController.popBackStack()) onClickBack() } NavHost( navController = navController, startDestination = AboutDestination.About, enterTransition = { slideInHorizontally(initialOffsetX = { +it * dir }) }, exitTransition = { slideOutHorizontally(targetOffsetX = { -it * dir }) }, popEnterTransition = { slideInHorizontally(initialOffsetX = { -it * dir }) }, popExitTransition = { slideOutHorizontally(targetOffsetX = { +it * dir }) } ) { composable(AboutDestination.About) { AboutScreen( onClickChangelog = { navController.navigate(AboutDestination.Changelog) }, onClickCredits = { navController.navigate(AboutDestination.Credits) }, onClickPrivacyStatement = { navController.navigate(AboutDestination.PrivacyStatement) }, onClickLogs = { navController.navigate(AboutDestination.Logs) }, onClickBack = ::goBack ) } composable(AboutDestination.Changelog) { ChangelogScreen( viewModel = koinViewModel(), onClickBack = ::goBack ) } composable(AboutDestination.Credits) { CreditsScreen( viewModel = koinViewModel(), onClickBack = ::goBack ) } composable(AboutDestination.PrivacyStatement) { PrivacyStatementScreen( onClickBack = ::goBack ) } composable(AboutDestination.Logs) { LogsScreen( viewModel = koinViewModel(), onClickBack = ::goBack ) } } } object AboutDestination { const val About = "about" const val Credits = "credits" const val Changelog = "changelog" const val PrivacyStatement = "privacy_statement" const val Logs = "logs" } ```
```ruby class Kubecolor < Formula desc "Colorize your kubectl output" homepage "path_to_url" url "path_to_url" sha256 your_sha256_hash license "MIT" bottle do sha256 cellar: :any_skip_relocation, arm64_sonoma: your_sha256_hash sha256 cellar: :any_skip_relocation, arm64_ventura: your_sha256_hash sha256 cellar: :any_skip_relocation, arm64_monterey: your_sha256_hash sha256 cellar: :any_skip_relocation, sonoma: your_sha256_hash sha256 cellar: :any_skip_relocation, ventura: your_sha256_hash sha256 cellar: :any_skip_relocation, monterey: your_sha256_hash sha256 cellar: :any_skip_relocation, x86_64_linux: your_sha256_hash end depends_on "go" => :build depends_on "kubernetes-cli" => :test def install ldflags = "-s -w -X main.Version=v#{version}" system "go", "build", *std_go_args(output: bin/"kubecolor", ldflags:) end test do assert_match "v#{version}", shell_output("#{bin}/kubecolor --kubecolor-version 2>&1") # kubecolor should consume the '--plain' flag assert_match "get pods -o yaml", shell_output("KUBECTL_COMMAND=echo #{bin}/kubecolor get pods --plain -o yaml") end end ```
```python from web3.manager import ( RequestManager, ) from web3.middleware import ( AttributeDictMiddleware, BufferedGasEstimateMiddleware, ENSNameToAddressMiddleware, GasPriceStrategyMiddleware, ValidationMiddleware, ) def test_default_sync_middleware(w3): expected_middleware = [ (GasPriceStrategyMiddleware, "gas_price_strategy"), (ENSNameToAddressMiddleware, "ens_name_to_address"), (AttributeDictMiddleware, "attrdict"), (ValidationMiddleware, "validation"), (BufferedGasEstimateMiddleware, "gas_estimate"), ] default_middleware = RequestManager.get_default_middleware() assert default_middleware == expected_middleware ```
SABC Africa was the international television service of the South African Broadcasting Corporation, which ceased to broadcast on 1 August 2008 after poor performance on the DStv satellite television platform. The channel broadcast a variety of news and entertainment shows. The SABC's similar radio service Channel Africa continues to operate. External links SABC Africa official website Defunct television channels Television stations in South Africa Television channels and stations disestablished in 2008 Defunct mass media in South Africa
```cap'n proto @0xdbb9ad1f14bf0b36; struct Message { int128 @0 :Data; uint128 @1 :Data; int256 @2 :Data; uint256 @3 :Data; decimal128 @4 :Data; decimal256 @5 :Data; } ```
USS Flagler (AK-181) was an acquired by the U.S. Navy during the final months of World War II. She served the Pacific Ocean theatre of operations for a short period of time before being decommissioned at Okinawa and returned to the U.S. Maritime Administration for dispositioning. Construction Flagler was launched 24 March 1945 by Kaiser Cargo Co., Inc., Richmond, California, under a Maritime Commission contract, MC hull 2377; sponsored by Mrs. T. B. Smith; and commissioned 18 May 1945. Service history World War II-related service Flagler sailed from San Francisco, California, 5 July 1945 with cargo for Ulithi and Leyte Gulf, where she discharged the last of her load 6 August. Here she loaded supplies and men for Okinawa, from which she sailed 29 August for Guam and Saipan. Grounded during a typhoon Okinawa-bound again 12 September, Flagler sailed through a raging typhoon Ursula, which caused some damage to the ship, but arrived safely 18 September. Twice while at Okinawa she put to sea to avoid typhoons, evading the firsttyphoon Jean. During the second, typhoon Louise, on 9 October, she was grounded. Success in a difficult salvage operation refloated her 26 October. Decommissioning and disposal Flagler was decommissioned at Okinawa 24 December 1945. She was returned to the Maritime Commission 29 March 1946 and laid up at Subic Bay. On 3 March 1948 she was sold for scrap to the Asia Development Corporation, Shanghai, China, along with 14 other vessels, for $271,000. Notes Citations Bibliography Online resources External links Alamosa-class cargo ships Flagler County, Florida Ships built in Richmond, California 1945 ships World War II auxiliary ships of the United States
```java /* * * * path_to_url * * Unless required by applicable law or agreed to in writing, software * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */ package github.nisrulz.easydeviceinfo.base; import android.support.annotation.IntDef; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; @IntDef({ DeviceType.WATCH, DeviceType.PHONE, DeviceType.PHABLET, DeviceType.TABLET, DeviceType.TV }) @Retention(RetentionPolicy.CLASS) public @interface DeviceType { int WATCH = 0; int PHONE = 1; int PHABLET = 2; int TABLET = 3; int TV = 4; } ```
St. Michael () is a church of the Roman Catholic Archdiocese of Chicago. The current church is located at E. 83rd Street and S. South Shore Drive in South Chicago, a neighborhood of Chicago, Illinois. It is a prime example of the so-called "Polish Cathedral style" of churches in both its opulence and grand scale. Along with Immaculate Conception, it is one of the two monumental Polish churches dominating over the South Chicago neighborhood. History Founded in 1892 as a Polish parish in Chicago to relieve overcrowding at Immaculate Conception. Bishop Paul Rhode, the first Polish auxiliary bishop in Chicago, served as pastor from 1897 until he was named bishop of Green Bay in 1915. The parish continued to serve Polish steel workers until the steel mills closed in the 1980s. Today the parish as well as the neighborhood are predominantly Latino. Bishop Thomas J. Paprocki served as a priest at St. Michael's and then served as associate pastor from the time he was ordained to the priesthood by John Cardinal Cody on May 10, 1978, until 1983. The church closed down in 2021. Architecture The church was built between 1907 through 1909 designed by William J. Brinkmann. The Neogothic edifice is one of only three Polish churches in the Archdiocese of Chicago built in this style. The Gothic Revival façade, the choice of brick as well as the uneven steeples are an architectural homage to the Marian Basilica in Cracow. U.S. Steel donated the steel for the structure since 90% of the parishioners worked at the mills. The main altar reredos is constructed of butternut and bird's eye maple wood, as are the two side altars. The central statue of Michael the Archangel defeating Lucifer, the two incensing angels and the statues on the side altars were sculpted and painted by hand. The beautiful and rare communion rail is carved in oak with a white marble top. The interior of the church can seat approximately 2,000 people. Interesting to music enthusiasts is the grand piano which belonged to famed composer, Ignace Jan Paderewski. A shrine to the Black Madonna of Częstochowa, the National Patron of the people of Poland, is located in the sanctuary and was constructed in Poland in the early 1960s. The magnificent stained glass windows were made by F. X. Zettler of Munich, Germany. Of special note are the two transept windows on the East and West sides of the church. They are the largest and according to some also the most beautiful stained glass windows in the Archdiocese of Chicago. The eastern transept window depicts the Pentecost event, while the western transept window depicts Saint Michael the Archangel at the last judgement. Church in architecture books See also Tadeusz Żukotyński, Catholic fine art painter and mural artist Sr. Maria Stanisia, Polish-American fine art painter and restoration artist Jozef Mazur, Polish-American painter and stained glass artist Polish Cathedral style churches of Chicago Polish Americans Poles in Chicago Polish Roman Catholic Union of America Roman Catholicism in Poland Saint Michael (Roman Catholic) References External links St. Michael Church History — Polish Genealogical Society of America website Roman Catholic churches in Chicago Polish-American culture in Chicago Religious organizations established in 1892 Polish Cathedral style architecture Roman Catholic churches completed in 1909 20th-century Roman Catholic church buildings in the United States
```c++ #include <gtest/gtest.h> #include <gmock/gmock.h> #include "mocking.h" using namespace testing; extern "C" { #include <tilck/kernel/process.h> #include <tilck/kernel/test/fork.h> } class vfs_mock : public KernelSingleton { public: MOCK_METHOD(int, vfs_dup, (fs_handle h, fs_handle *dup_h), (override)); MOCK_METHOD(void, vfs_close, (fs_handle h), (override)); }; TEST(fork_dup_all_handles, trigger_inside_path) { vfs_mock mock; process pi = {}; fs_handle_base handles[3] = {}, dup_handles[2] = {}; pi.handles[0] = &handles[0]; pi.handles[1] = &handles[1]; pi.handles[2] = &handles[2]; EXPECT_CALL(mock, vfs_dup(&handles[0], _)) .WillOnce( DoAll( SetArgPointee<1>(&dup_handles[0]), Return(0) ) ); EXPECT_CALL(mock, vfs_dup(&handles[1], _)) .WillOnce( DoAll( SetArgPointee<1>(&dup_handles[1]), Return(0) ) ); EXPECT_CALL(mock, vfs_dup(&handles[2], _)) .WillOnce(Return(-1)); EXPECT_CALL(mock, vfs_close(&dup_handles[0])); EXPECT_CALL(mock, vfs_close(&dup_handles[1])); ASSERT_EQ(fork_dup_all_handles(&pi), -ENOMEM); } ```
The Evelyn effect is defined as the phenomena in which the product ratios in a chemical reaction change as the reaction proceeds. This phenomenon contradicts the fundamental principle in organic chemistry by reactions always go by the lowest energy pathway. The favored product should remain so throughout a reaction run at constant conditions. However, the ratio of alkenes before the synthesis is complete shows that the favored product to is not the favored product. The basic idea here is that the proportions of the various alkene products changes as a function of time with a change in mechanism. Background on discovery Professor David Todd at Pomona College was testing the dehydration of 2-methylcyclohexanol or 4-methylcyclohexanol and unexpectedly interrupted the alkene distillation midway to have lunch with his secretary, Evelyn Jacoby. After lunch, he continued his distillation but kept the early products separate from the completed ones. The analysis showed two different alkene ratios. The reaction products and pathways to the products seem to have changed over time. Dr. Todd called this phenomenon the “Evelyn effect.” Dehydration of 2-methylcyclohexanol or 4-methylcyclohexanol -A simple example of the Evelyn effect is the sophomore level chemistry lab experiment involving two popular examples that are listed below. a) Dehydration of 4-methylcyclohexanol b) Dehydration of 2-Methylcyclohexanol c) Mechanism for the dehydration of 2-methylcyclohexanol Possible explanations of different ratio formations In general, if more than one alkene can be formed during dehalogenation by an elimination reaction, the more stable alkene is the major product. There are two types of elimination reactions, E1 and E2. An E2 reaction is a One step mechanism in which carbon-hydrogen and carbon-halogen bonds break to form a double bond. C=C Pi bond. An E1 reaction is the Ionization of the carbon-halogen bond breaking to give a carbocation intermediate, then the Deprotonation of the carbocation. For these two reactions, there are 3 possible products, 3-methyl-cyclohexene,1-methyl-cyclohexene, methylene-cyclohexane. The production of each of these occurs at different rates and the ratios of these also change over time. It is well known that the dehydration of the cis isomer is 30 times faster than the trans isomer. It then appears that the reaction proceeds mainly by a trans mechanism and, following the Zaitsev rule, 1-methylcyclohexene is preferentially formed in the early stages of the reaction. Indeed, if only about 10% of the total distillate is collected as the first fraction, one finds that the alkene is about 93% l-methylcyclohexene: at the end of the distillation one finds a value as low as 55% of l-methyl isomer. From these results, the phenomenon of the Evelyn effect can be observed and a conclusion can be drawn that a change of mechanism occurs somewhere during the synthesis. Additional study on the Evelyn effect A kinetic and regional chemical study of the Evelyn effect has been described. The results, in the Journal of Chemical Education, made claims involving the mechanism by which the dehydrations occurred. The article looks into the claim of having E1 and E2 mechanisms occur in the reaction. The researchers measured the kinetics of the formation of a 3 degree carbocation’s and compared them to theoretical calculations that would occur if the experiment ran as an E2 reaction. Instead, the reaction showed a mechanism that initially formed a 2 degree carbocation, utilizing an E1 pathway. Their conclusion was that the mechanism is neither E1 or E2 but rather “E-2 like”, exhibiting first order kinetics. References Alkenes Physical organic chemistry
Luzer Twersky (born July 26, 1985) is an American film and television actor. He is best known for his role in the film Felix and Meira, for which he garnered a Jutra Award nomination as Best Supporting Actor at the 18th Jutra Awards and won the Best Actor award at the Amiens International Film Festival and the Torino International Film Festival. Born and raised in Brooklyn as a Hasidic Jew, Twersky left the community in 2008, after struggling with his faith. He later met fashion designer Duncan Quinn, becoming a model and a retail manager for Quinn's store in Los Angeles, until taking his first acting role in 2010. By 2012, he was cast in his first leading role, in the film Where Is Joel Baum?. In 2015, he also had a recurring role in the television series Transparent. He appeared in the second season of the HBO show High Maintenance. In September 2017, he appeared as one of the main characters in the Netflix documentary One of Us, where directors Heidi Ewing and Rachel Grady follow him years after he leaves his Hasidic community in Brooklyn, New York, and how he deals with his ostracization. In 2023 Luzer Twersky has played a role of Hasidic Judaism founder, holy man Baal Shem Tov (the Besht) in Ukrainian film «Dovbush» directed by Oles Sanin. Twersky is a cousin of rabbi and transgender activist Abby Stein. Twersky is mentioned in Penn Jillette's book "God, No!". References External links 1985 births American male film actors American male television actors Former Orthodox Jews Male actors from New York City Jewish American male actors Living people Yiddish-speaking people 21st-century American Jews
Dalma Gálfi and Fanny Stollár were the defending champions, but chose not to participate this year. Usue Maitane Arconada and Claire Liu won the title, defeating Mariam Bolkvadze and Caty McNally in the final, 6–2, 6–3. Seeds Draw Finals Top half Bottom half External links Girls' Doubles Draw Girls' Doubles Wimbledon Championship by year – Girls' doubles Wimbledon
```java /** * created by jiang, 16/2/28 * * # # * # _oo0oo_ # * # o8888888o # * # 88" . "88 # * # (| -_- |) # * # 0\ = /0 # * # ___/`---'\___ # * # .' \\| |# '. # * # / \\||| : |||# \ # * # / _||||| -:- |||||- \ # * # | | \\\ - #/ | | # * # | \_| ''\---/'' |_/ | # * # \ .-\__ '-' ___/-. / # * # ___'. .' /--.--\ `. .'___ # * # ."" '< `.___\_<|>_/___.' >' "". # * # | | : `- \`.;`\ _ /`;.`/ - ` : | | # * # \ \ `_. \_ __\ /__ _/ .-` / / # * # =====`-.____`.___ \_____/___.-`___.-'===== # * # `=---=' # * # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # * # # * # BUG # * # # */ package com.jiang.android.rxjavaapp.adapter.fragmentadapter; import android.database.DataSetObservable; import android.database.DataSetObserver; import android.os.Parcelable; import android.view.View; import android.view.ViewGroup; /** * Created by jiang on 16/2/28. */ public abstract class PagerAdapter { private DataSetObservable mObservable = new DataSetObservable(); public static final int POSITION_UNCHANGED = -1; public static final int POSITION_NONE = -2; /** * Return the number of views available. */ public abstract int getCount(); /** * Called when a change in the shown pages is going to start being made. * * @param container The containing View which is displaying this adapter's * page views. */ public void startUpdate(ViewGroup container) { startUpdate((View) container); } /** * Create the page for the given position. The adapter is responsible * for adding the view to the container given here, although it only * must ensure this is done by the time it returns from * {@link #finishUpdate(ViewGroup)}. * * @param container The containing View in which the page will be shown. * @param position The page position to be instantiated. * @return Returns an Object representing the new page. This does not * need to be a View, but can be some other container of the page. */ public Object instantiateItem(ViewGroup container, int position) { return instantiateItem((View) container, position); } /** * Remove a page for the given position. The adapter is responsible * for removing the view from its container, although it only must ensure * this is done by the time it returns from {@link #finishUpdate(ViewGroup)}. * * @param container The containing View from which the page will be removed. * @param position The page position to be removed. * @param object The same object that was returned by * {@link #instantiateItem(View, int)}. */ public void destroyItem(ViewGroup container, int position, Object object) { destroyItem((View) container, position, object); } /** * Called to inform the adapter of which item is currently considered to * be the "primary", that is the one show to the user as the current page. * * @param container The containing View from which the page will be removed. * @param position The page position that is now the primary. * @param object The same object that was returned by * {@link #instantiateItem(View, int)}. */ public void setPrimaryItem(ViewGroup container, int position, Object object) { setPrimaryItem((View) container, position, object); } /** * Called when the a change in the shown pages has been completed. At this * point you must ensure that all of the pages have actually been added or * removed from the container as appropriate. * * @param container The containing View which is displaying this adapter's * page views. */ public void finishUpdate(ViewGroup container) { finishUpdate((View) container); } /** * Called when a change in the shown pages is going to start being made. * * @param container The containing View which is displaying this adapter's * page views. * @deprecated Use {@link #startUpdate(ViewGroup)} */ public void startUpdate(View container) { } /** * Create the page for the given position. The adapter is responsible * for adding the view to the container given here, although it only * must ensure this is done by the time it returns from * {@link #finishUpdate(ViewGroup)}. * * @param container The containing View in which the page will be shown. * @param position The page position to be instantiated. * @return Returns an Object representing the new page. This does not * need to be a View, but can be some other container of the page. * @deprecated Use {@link #instantiateItem(ViewGroup, int)} */ public Object instantiateItem(View container, int position) { throw new UnsupportedOperationException( "Required method instantiateItem was not overridden"); } /** * Remove a page for the given position. The adapter is responsible * for removing the view from its container, although it only must ensure * this is done by the time it returns from {@link #finishUpdate(View)}. * * @param container The containing View from which the page will be removed. * @param position The page position to be removed. * @param object The same object that was returned by * {@link #instantiateItem(View, int)}. * @deprecated Use {@link #destroyItem(ViewGroup, int, Object)} */ public void destroyItem(View container, int position, Object object) { throw new UnsupportedOperationException("Required method destroyItem was not overridden"); } /** * Called to inform the adapter of which item is currently considered to * be the "primary", that is the one show to the user as the current page. * * @param container The containing View from which the page will be removed. * @param position The page position that is now the primary. * @param object The same object that was returned by * {@link #instantiateItem(View, int)}. * @deprecated Use {@link #setPrimaryItem(ViewGroup, int, Object)} */ public void setPrimaryItem(View container, int position, Object object) { } /** * Called when the a change in the shown pages has been completed. At this * point you must ensure that all of the pages have actually been added or * removed from the container as appropriate. * * @param container The containing View which is displaying this adapter's * page views. * @deprecated Use {@link #finishUpdate(ViewGroup)} */ public void finishUpdate(View container) { } /** * Determines whether a page View is associated with a specific key object * as returned by {@link #instantiateItem(ViewGroup, int)}. This method is * required for a PagerAdapter to function properly. * * @param view Page View to check for association with <code>object</code> * @param object Object to check for association with <code>view</code> * @return true if <code>view</code> is associated with the key object <code>object</code> */ public abstract boolean isViewFromObject(View view, Object object); /** * Save any instance state associated with this adapter and its pages that should be * restored if the current UI state needs to be reconstructed. * * @return Saved state for this adapter */ public Parcelable saveState() { return null; } /** * Restore any instance state associated with this adapter and its pages * that was previously saved by {@link #saveState()}. * * @param state State previously saved by a call to {@link #saveState()} * @param loader A ClassLoader that should be used to instantiate any restored objects */ public void restoreState(Parcelable state, ClassLoader loader) { } /** * Called when the host view is attempting to determine if an item's position * has changed. Returns {@link #POSITION_UNCHANGED} if the position of the given * item has not changed or {@link #POSITION_NONE} if the item is no longer present * in the adapter. * <p> * <p>The default implementation assumes that items will never * change position and always returns {@link #POSITION_UNCHANGED}. * * @param object Object representing an item, previously returned by a call to * {@link #instantiateItem(View, int)}. * @return object's new position index from [0, {@link #getCount()}), * {@link #POSITION_UNCHANGED} if the object's position has not changed, * or {@link #POSITION_NONE} if the item is no longer present. */ public int getItemPosition(Object object) { return POSITION_UNCHANGED; } /** * This method should be called by the application if the data backing this adapter has changed * and associated views should update. */ public void notifyDataSetChanged() { mObservable.notifyChanged(); } /** * Register an observer to receive callbacks related to the adapter's data changing. * * @param observer The {@link DataSetObserver} which will receive callbacks. */ public void registerDataSetObserver(DataSetObserver observer) { mObservable.registerObserver(observer); } /** * Unregister an observer from callbacks related to the adapter's data changing. * * @param observer The {@link DataSetObserver} which will be unregistered. */ public void unregisterDataSetObserver(DataSetObserver observer) { mObservable.unregisterObserver(observer); } /** * This method may be called by the ViewPager to obtain a title string * to describe the specified page. This method may return null * indicating no title for this page. The default implementation returns * null. * * @param position The position of the title requested * @return A title for the requested page */ public CharSequence getPageTitle(int position) { return null; } /** * Returns the proportional width of a given page as a percentage of the * ViewPager's measured width from (0.f-1.f] * * @param position The position of the page requested * @return Proportional width for the given page position */ public float getPageWidth(int position) { return 1.f; } } ```
```c++ // // // path_to_url // // Unless required by applicable law or agreed to in writing, software // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #include "test/cpp/inference/api/tester_helper.h" #include "paddle/common/enforce.h" PD_DEFINE_bool(with_precision_check, true, "turn on test"); namespace paddle { namespace inference { using namespace framework; // NOLINT struct DataRecord { std::vector<std::vector<std::vector<float>>> link_step_data_all; std::vector<std::vector<float>> week_data_all, minute_data_all; std::vector<size_t> lod1, lod2, lod3; std::vector<std::vector<float>> rnn_link_data, rnn_week_datas, rnn_minute_datas; size_t num_samples; // total number of samples size_t batch_iter{0}; size_t batch_size{1}; DataRecord() = default; explicit DataRecord(const std::string &path, int batch_size = 1) : batch_size(batch_size) { Load(path); } DataRecord NextBatch() { DataRecord data; size_t batch_end = batch_iter + batch_size; // NOTE skip the final batch, if no enough data is provided. if (batch_end <= link_step_data_all.size()) { data.link_step_data_all.assign(link_step_data_all.begin() + batch_iter, link_step_data_all.begin() + batch_end); data.week_data_all.assign(week_data_all.begin() + batch_iter, week_data_all.begin() + batch_end); data.minute_data_all.assign(minute_data_all.begin() + batch_iter, minute_data_all.begin() + batch_end); // Prepare LoDs data.lod1.push_back(0); data.lod2.push_back(0); data.lod3.push_back(0); PADDLE_ENFORCE_EQ(!data.link_step_data_all.empty(), true, phi::errors::InvalidArgument( "link_step_data_all should not be empty.")); PADDLE_ENFORCE_EQ( !data.week_data_all.empty(), true, phi::errors::InvalidArgument("week_data_all should not be empty.")); PADDLE_ENFORCE_EQ( !data.minute_data_all.empty(), true, phi::errors::InvalidArgument("minute_data_all should not be empty.")); PADDLE_ENFORCE_EQ( data.link_step_data_all.size(), data.week_data_all.size(), platform::errors::InvalidArgument( "The value of data.link_step_data_all.size() is not equal to the " "value of data.week_data_all.size().")) PADDLE_ENFORCE_EQ( data.minute_data_all.size(), data.link_step_data_all.size(), platform::errors::InvalidArgument( "The value of data.minute_data_all.size() is not equal to the " "value of data.link_step_data_all.size().")) for (size_t j = 0; j < data.link_step_data_all.size(); j++) { for (const auto &d : data.link_step_data_all[j]) { data.rnn_link_data.push_back(d); } data.rnn_week_datas.push_back(data.week_data_all[j]); data.rnn_minute_datas.push_back(data.minute_data_all[j]); // calculate lod data.lod1.push_back(data.lod1.back() + data.link_step_data_all[j].size()); data.lod3.push_back(data.lod3.back() + 1); for (size_t i = 1; i < data.link_step_data_all[j].size() + 1; i++) { data.lod2.push_back(data.lod2.back() + data.link_step_data_all[j].size()); } } } batch_iter += batch_size; return data; } void Load(const std::string &path) { std::ifstream file(path); std::string line; int num_lines = 0; while (std::getline(file, line)) { num_lines++; std::vector<std::string> data; split(line, ':', &data); std::vector<std::vector<float>> link_step_data; std::vector<std::string> link_datas; split(data[0], '|', &link_datas); for (auto &step_data : link_datas) { std::vector<float> tmp; split_to_float(step_data, ',', &tmp); link_step_data.push_back(tmp); } // load week data std::vector<float> week_data; split_to_float(data[2], ',', &week_data); // load minute data std::vector<float> minute_data; split_to_float(data[1], ',', &minute_data); link_step_data_all.push_back(std::move(link_step_data)); week_data_all.push_back(std::move(week_data)); minute_data_all.push_back(std::move(minute_data)); } num_samples = num_lines; } }; void PrepareInputs(std::vector<PaddleTensor> *input_slots, DataRecord *data, int batch_size) { PaddleTensor lod_attention_tensor, init_zero_tensor, lod_tensor_tensor, week_tensor, minute_tensor; lod_attention_tensor.name = "data_lod_attention"; init_zero_tensor.name = "cell_init"; lod_tensor_tensor.name = "data"; week_tensor.name = "week"; minute_tensor.name = "minute"; auto one_batch = data->NextBatch(); std::vector<int> rnn_link_data_shape( {static_cast<int>(one_batch.rnn_link_data.size()), static_cast<int>(one_batch.rnn_link_data.front().size())}); lod_attention_tensor.shape.assign({1, 2}); lod_attention_tensor.lod.assign({one_batch.lod1, one_batch.lod2}); init_zero_tensor.shape.assign({batch_size, 15}); init_zero_tensor.lod.assign({one_batch.lod3}); lod_tensor_tensor.shape = rnn_link_data_shape; lod_tensor_tensor.lod.assign({one_batch.lod1}); week_tensor.shape.assign( {static_cast<int>(one_batch.rnn_week_datas.size()), static_cast<int>(one_batch.rnn_week_datas.front().size())}); week_tensor.lod.assign({one_batch.lod3}); minute_tensor.shape.assign( {static_cast<int>(one_batch.rnn_minute_datas.size()), static_cast<int>(one_batch.rnn_minute_datas.front().size())}); minute_tensor.lod.assign({one_batch.lod3}); // assign data TensorAssignData<float>(&lod_attention_tensor, std::vector<std::vector<float>>({{0, 0}})); std::vector<float> tmp_zeros(batch_size * 15, 0.); TensorAssignData<float>(&init_zero_tensor, {tmp_zeros}); TensorAssignData<float>(&lod_tensor_tensor, one_batch.rnn_link_data); TensorAssignData<float>(&week_tensor, one_batch.rnn_week_datas); TensorAssignData<float>(&minute_tensor, one_batch.rnn_minute_datas); // Set inputs. auto init_zero_tensor1 = init_zero_tensor; init_zero_tensor1.name = "hidden_init"; input_slots->assign({week_tensor, init_zero_tensor, minute_tensor, init_zero_tensor1, lod_attention_tensor, lod_tensor_tensor}); for (auto &tensor : *input_slots) { tensor.dtype = PaddleDType::FLOAT32; } } void PrepareZeroCopyInputs(ZeroCopyTensor *lod_attention_tensor, ZeroCopyTensor *cell_init_tensor, ZeroCopyTensor *data_tensor, ZeroCopyTensor *hidden_init_tensor, ZeroCopyTensor *week_tensor, ZeroCopyTensor *minute_tensor, DataRecord *data_record, int batch_size) { auto one_batch = data_record->NextBatch(); std::vector<int> rnn_link_data_shape( {static_cast<int>(one_batch.rnn_link_data.size()), static_cast<int>(one_batch.rnn_link_data.front().size())}); lod_attention_tensor->Reshape({1, 2}); lod_attention_tensor->SetLoD({one_batch.lod1, one_batch.lod2}); cell_init_tensor->Reshape({batch_size, 15}); cell_init_tensor->SetLoD({one_batch.lod3}); hidden_init_tensor->Reshape({batch_size, 15}); hidden_init_tensor->SetLoD({one_batch.lod3}); data_tensor->Reshape(rnn_link_data_shape); data_tensor->SetLoD({one_batch.lod1}); week_tensor->Reshape( {static_cast<int>(one_batch.rnn_week_datas.size()), static_cast<int>(one_batch.rnn_week_datas.front().size())}); week_tensor->SetLoD({one_batch.lod3}); minute_tensor->Reshape( {static_cast<int>(one_batch.rnn_minute_datas.size()), static_cast<int>(one_batch.rnn_minute_datas.front().size())}); minute_tensor->SetLoD({one_batch.lod3}); // assign data std::array<float, 2> arr0 = {0, 0}; std::vector<float> zeros(batch_size * 15, 0); std::copy_n(arr0.data(), 2, lod_attention_tensor->mutable_data<float>(PaddlePlace::kCPU)); std::copy_n( arr0.data(), 2, data_tensor->mutable_data<float>(PaddlePlace::kCPU)); std::copy_n(zeros.begin(), zeros.size(), cell_init_tensor->mutable_data<float>(PaddlePlace::kCPU)); std::copy_n(zeros.begin(), zeros.size(), hidden_init_tensor->mutable_data<float>(PaddlePlace::kCPU)); ZeroCopyTensorAssignData(data_tensor, one_batch.rnn_link_data); ZeroCopyTensorAssignData(week_tensor, one_batch.rnn_week_datas); ZeroCopyTensorAssignData(minute_tensor, one_batch.rnn_minute_datas); } void SetConfig(AnalysisConfig *cfg) { cfg->SetModel(FLAGS_infer_model + "/__model__", FLAGS_infer_model + "/param"); cfg->DisableGpu(); cfg->SwitchSpecifyInputNames(); cfg->SwitchIrOptim(); } void SetInput(std::vector<std::vector<PaddleTensor>> *inputs) { DataRecord data(FLAGS_infer_data, FLAGS_batch_size); std::vector<PaddleTensor> input_slots; int epoch = FLAGS_test_all_data ? data.num_samples / FLAGS_batch_size : 1; // NOLINT LOG(INFO) << "number of samples: " << epoch * FLAGS_batch_size; for (int bid = 0; bid < epoch; ++bid) { PrepareInputs(&input_slots, &data, FLAGS_batch_size); (*inputs).emplace_back(input_slots); } } // Easy for profiling independently. TEST(Analyzer_rnn1, profile) { AnalysisConfig cfg; SetConfig(&cfg); cfg.DisableGpu(); cfg.SwitchIrDebug(); std::vector<std::vector<PaddleTensor>> outputs; std::vector<std::vector<PaddleTensor>> input_slots_all; SetInput(&input_slots_all); TestPrediction(reinterpret_cast<const PaddlePredictor::Config *>(&cfg), input_slots_all, &outputs, FLAGS_num_threads); } // Check the fuse status TEST(Analyzer_rnn1, fuse_statis) { AnalysisConfig cfg; SetConfig(&cfg); int num_ops; auto predictor = CreatePaddlePredictor<AnalysisConfig>(cfg); auto fuse_statis = GetFuseStatis( static_cast<AnalysisPredictor *>(predictor.get()), &num_ops); ASSERT_TRUE(fuse_statis.count("fc_fuse")); EXPECT_EQ(fuse_statis.at("fc_fuse"), 1); EXPECT_EQ(fuse_statis.at("fc_nobias_lstm_fuse"), 2); // bi-directional LSTM EXPECT_EQ(fuse_statis.at("seq_concat_fc_fuse"), 1); } // Compare result of NativeConfig and AnalysisConfig TEST(Analyzer_rnn1, compare) { AnalysisConfig cfg; SetConfig(&cfg); std::vector<std::vector<PaddleTensor>> input_slots_all; SetInput(&input_slots_all); CompareNativeAndAnalysis( reinterpret_cast<const PaddlePredictor::Config *>(&cfg), input_slots_all); } // Compare Deterministic result TEST(Analyzer_rnn1, compare_determine) { AnalysisConfig cfg; SetConfig(&cfg); std::vector<std::vector<PaddleTensor>> input_slots_all; SetInput(&input_slots_all); CompareDeterministic(reinterpret_cast<const PaddlePredictor::Config *>(&cfg), input_slots_all); } // Test Multi-Thread. TEST(Analyzer_rnn1, multi_thread) { AnalysisConfig cfg; SetConfig(&cfg); std::vector<std::vector<PaddleTensor>> outputs; std::vector<std::vector<PaddleTensor>> input_slots_all; SetInput(&input_slots_all); TestPrediction(reinterpret_cast<const PaddlePredictor::Config *>(&cfg), input_slots_all, &outputs, 2 /* multi_thread */); } // Compare result of AnalysisConfig and AnalysisConfig + ZeroCopy TEST(Analyzer_rnn1, compare_zero_copy) { AnalysisConfig cfg; SetConfig(&cfg); AnalysisConfig cfg1; SetConfig(&cfg1); std::vector<std::vector<PaddleTensor>> input_slots_all; SetInput(&input_slots_all); std::vector<std::string> outputs_name; outputs_name.emplace_back("final_output.tmp_1"); CompareAnalysisAndZeroCopy(reinterpret_cast<PaddlePredictor::Config *>(&cfg), reinterpret_cast<PaddlePredictor::Config *>(&cfg1), input_slots_all, outputs_name); } } // namespace inference } // namespace paddle ```
Moine, French for "monk", may refer to: A' Mhòine, a peninsula in northern Scotland Le Moine, a mountain of the Pennine Alps La Moine River, a tributary of the Illinois River in western Illinois in the United States Moine Thrust Belt, a major geological feature in the north-west of Scotland Moine Supergroup, metamorphic rocks that form the dominant outcrop of the Scottish Highlands People with the surname Antonin Moine (1796–1849), French sculptor Claude Moine or Eddy Mitchell (born 1942), French singer and actor Jean-Jacques Moine (born 1954), French swimmer Mario Moine (born 1949), Argentine politician Michel Moine (1920–2005), French journalist and parapsychologist Roger Moine, an SC Bastia player See also Des Moines, Iowa Tête de Moine a Swiss cheese Lemoine, a surname Moina (disambiguation)
The College of Europe (; ) is a post-graduate institute of European studies with its main campus in Bruges, Belgium and a second campus in Warsaw, Poland. The College of Europe in Bruges was founded in 1949 by leading historical European figures and founding fathers of the European Union, including Salvador de Madariaga, Winston Churchill, Paul-Henri Spaak and Alcide De Gasperi as one of the results of the 1948 Congress of Europe in The Hague to promote "a spirit of solidarity and mutual understanding between all the nations of Western Europe and to provide elite training to individuals who will uphold these values" and "to train an elite of young executives for Europe". It has the status of Institution of Public Interest, operating according to Belgian law. The second campus in Natolin (Warsaw), Poland opened in 1992. The College of Europe is historically linked to the establishment of the European Union and its predecessors, and to the creation of the European Movement International, of which the college is a supporting member. Federica Mogherini, former High Representative of the Union for Foreign Affairs and Security Policy, was appointed as the Rector to start in September 2020; former President of the European Council Herman, Count Van Rompuy is chairman of the board. Each academic year is named after a patron and referred to as a promotion. The academic year is opened by a leading European politician. Alumni of the College of Europe include the former Prime Minister of Denmark Helle Thorning-Schmidt, the former Prime Minister of Finland Alexander Stubb, the former British Deputy Prime Minister Nick Clegg as well as the Minister of Foreign Affairs of Italy Enzo Moavero Milanesi. Many of its alumni go on to serve as diplomats and senior civil servants in European institutions. The College of Europe was the most represented alma mater (university attended) among senior EU civil servants, based on a sample compiled by Politico in 2021. Politico even dedicated a section of their website to news related to the College of Europe. History Hague Congress initiative to create a College of Europe The College of Europe was the world's first university institute of postgraduate studies and training in European affairs. It was founded in 1949 by leading European figures, such as Salvador de Madariaga, Winston Churchill, Paul-Henri Spaak and Alcide De Gasperi, in the wake of the Hague Congress of 1948, that led to the creation of the European Movement. At the Congress, the Spanish statesman Salvador de Madariaga strongly advocated for the creation of a College of Europe, where graduates from different European states could study together as a way to heal the wounds of the World War II. Although the cultural resolution adopted at the end of the Congress did not include explicit references to the establishment of a College of Europe and only advocated for the creation of a "European Cultural Centre and a European Institute for Childhood and Youth Questions", the idea of establishing a European University was put forward by Congress attendees immediately after the Congress. A group of Bruges citizens led by the Reverend Karel Verleye succeeded in attracting the college to Bruges. Professor Hendrik Brugmans, one of the intellectual leaders of the European Movement and the President of the Union of European Federalists, became its first Rector (1950–1972). John Bowie, Professor of Modern History at Oxford University, was appointed Director of the first session held by the college, in 1949. Henri van Effenterre, who was a Professor of Ancient History at Caen University and Alphonse de Vreese, International Law professor at the University of Ghent, also contributed to that first session. The topic of that first session taught to the first promotion of the college (frequently called , for it is the only promotion not named after any prominent figure) was "Teaching history and the development of a European spirit in universities". In the decades that followed the establishment of the institution, students were hosted at the Navarra Hotel in the historic centre of Bruges until 1981. The College consolidated itself as an institution specialized in studies focused on the newly established European Communities (the college was founded in 1949, before the communities were established). Bruges speech by Margaret Thatcher In 1988, British Prime Minister Margaret Thatcher delivered a speech that became known as the Bruges speech at the College of Europe as part of the opening ceremony for that academic year. The Bruges speech is considered by observers as the cornerstone of the Eurosceptic movement that eventually led to Brexit. Thatcher laid down her vision for Europe, claiming that the European Community should remain an economic union, refusing the claims for a closer political integration made by Commission President Jacques Delors. Thatcher outlined her opposition to any attempts to create "a European superstate exercising a new dominance from Brussels." The speech was perceived as not only an attack on European federalism but an attack on the European project, as such. Post-Cold War history After the fall of communism and changes in Central and Eastern Europe, the College of Europe campus at Natolin (Warsaw, Poland), was founded in 1992 with the support of the European Commission and the Polish government. According to former President of the European Commission Jacques Delors, "this College of Europe at Natolin is more than the symbol of Europe found once again, it is the hope represented in this beautiful historic place. The hope that exchanges can multiply for greater mutual understanding and fraternity". The establishment of a second campus in eastern has been frequently regarded as part of an effort aiming to train young students from eastern countries under the auspices of eastern enlargement. Since the establishment of that second campus in Poland, the college operates as "one College – two campuses," and what was once referred to as the "", is now known as the "". In 2012, the College of Europe became a supporting member of the European Movement International. The academic year 2018–2019 marked the first time in which a promotion was named after a College alumnus, Manuel Marín, Spanish Statesman, EU Commissioner and acting President of the Commission (known as the "father of the Erasmus Programme"), who had passed away early that year. In 2015, three years before the election of Marín as Patron, former Finnish Prime Minister Alexander Stubb was the first College alumnus to be invited to be the Orateur at the opening ceremony of that academic year. Former Spanish Minister and Cabinet Spokesperson Íñigo Méndez de Vigo, 9th Baron of Claret, served as chairman of the board from 2009 to 2019; in 2019 former Prime Minister of Belgium and President of the European Council Herman, Count Van Rompuy was appointed the new chairman of the board. In May 2020 Federica Mogherini, former High Representative of the Union for Foreign Affairs and Security Policy and Vice-President of the European Commission, was appointed rector of the College, the first high ranking political figure from the European Commission to hold the post. Campuses Bruges campus The Bruges campus is situated in the centre of Bruges since its establishment in 1949, which was appointed European Capital of Culture in 2002. Bruges is located in the Flemish Region of Belgium, a Dutch-speaking area, although the college does not use Dutch as one of its working languages. The college has a system of residences in the centre of Bruges and not far from the Dijver, where the main administrative and academic building and the library are situated. None of the residences lodges more than 60 students so that each residence in fact has its own small multinational and multicultural environment. It consists of the following campus buildings: Dijver The Paul Henri Spaak Building (named after the Belgian socialist politician, and popularly known as Dijver) is the College's main administrative building on the Bruges campus. It hosts the college's main reception, some of its offices, classrooms and the library. It is located on the Dijver Canal. A white classic façade stands at the front of the main building (where the European, Belgian, Flemish and Brugeois flags hang together), while there is a garden in its back side. The garden is used by the students, who frequently spare their break time there due to its proximity to the library (which is connected to the main building by a corridor). Signed portraits of all the orateurs hang in the walls of the main corridor of the building. The library building was built in 1965. Princess Beatrix of the Netherlands (later Queen Beatrix) laid the first stone of the library in a special commemorative event. Almost three decades after its completion, the library was reformed and enlarged (the works were completed in 1992). Most of the library funds are devoted to European Studies, together with law, economics, and political and administrative sciences. Access to the library is restricted to College students and academic staff. A bust of Salvador de Madariaga presides over the library main reading hall. Verversdijk Following the increase in the number of students attending the College each year, the College of Europe (with the support of different entities and institutions, including the Flemish Government and the City of Bruges) reformed the 17th century protected monument of Verversdijk to provide additional lecture theatres (auditoria), teaching rooms and offices for academics, research fellows and staff; and to extend its activities. The reform was led by the office of Xaveer De Geyter Architects (XDGA), and the project was nominated for the Mies van de Rohe award in 2009. The Verversdijk premises began to be used by College students in 2007. Besides its academic and administrative use throughout the course, a cocktail is served in its garden to each promotion, following their graduation ceremony at St. Walburga Church (Bruges). The historical site of Verversdijk owes its name to fact that the owners of the houses standing there at medieval times were dyers who used wool traded with Scotland, as the area was populated by several Englishmen during the Middle Ages. During the Spanish rule, it hosted the schooling houses and the monastery established by the Jesuits in the 17th century. In 1792, the monastery auditorium was used as a meeting place by the Jacobin Club. The main monastery wing (dating back to 1701, and whose façade was plastered in 1865) was built along the canal, and was used as an athenaeum since 1851. its long inner corridor is an outstanding example of the rococo style in Bruges, whereas, the ashlar staircase is also an element of artistic relevance. The attic of the building, with a total length of 45 meters and a surprisingly well-preserved oak canopy, is currently used as a study room. During the First World War occupation of Belgium, the attic was used as a sleeping room for soldiers of the German Marine. The monastery wing was also home to the Museum of Modern Painting from 1898 to 1931 (when they were transferred to the newly established Groeninge Museum). Since 2008, following and agreement between the College and the Groeninge Museum, the college hosts the 'Extraordinary Groeninghe Art Collection', an installation of contemporary works of art featuring international artists at Verversdijk's hallways. Members of the Groeninghe Art Collection meet every two months at the College to discuss art, attend lectures by art experts and consider possible purchases. In March 2014, the so-called China Library was established at the Verversdijk compound. A project sponsored by the Information Office of the State Council of the Chinese Government, the library (decorated in Chinese style) is home to ten thousand books and documents in more than six languages, as frequently hosts events related with Sino-European relations or the Chinese culture. Garenmarkt The Hotel Portinari in Garenmarkt 15 with its classical façade was formerly home to Tommaso Portinari, the administrator of the Florentine "Loggia de Medici" in the 15th century in Bruges. It contains eleven apartments for professors and forty student rooms, two "salons" in 19th-century style, the "salon du Recteur" with 18th-century wall paintings and a modern "Mensa" for students. A room dedicated to Winston Churchill (who was among the voices calling for the establishment of the College during The Hague Congress in 1948 and was one of its founders the year after) was inaugurated by his grandson, Sir Nicholas Soames, and the British ambassador in 2017. Garenmarkt also hosts the canteen for all College students. Biskajer The residence is located in a home built in classicist style during the 19th century. The building is located in Biskajersplein, a small square named after the Spanish region of Biscay (the square is located on the side the dock where ships coming in from that region unloaded their merchandise in the 15th and 16th centuries). The actual residence is located on the lot occupied by the Mareminne house, which hosted the consulate of Biscay in the past, although the original building was demolished. Traces of the old consulate building can be found in the inner garden of the residence, which kept the shape of the consulate's horse stable. The residence hosts 53 students every year. Gouden Hand The Gouden Hand residence is housed in a Bruges-style building dating back to the 17th century. It is a listed monument. It was renovated during the 2005–2006 academic year. The name of the residence, directly translates from Dutch to "Golden Hand", after a Medieval legend about the canal bordering the residence. Gouden Hand is also the name of two streets along the same canal. The 15th century painter Jan Van Eyck lived and owned a studio in the Gouden-Handstraat nr. 6, behind the current residence. The Gouden Hand student bar is situated in the cellar. The building has been a backdrop for many films and documentaries. Natolin campus The Natolin Warsaw campus of the college was established in 1992 responding to the revolutions of 1989 and ahead of Poland's accession negotiations with the EU. The Natolin Campus is located in a historic palace, part of a 120-hectare park and nature reserve—formerly the Royal hunting palace of Natolin—situated in the southern part of Warsaw about 20 minutes by metro from the city centre. The Natolin European Centre Foundation takes care of the complex and has conducted restoration of the former Potocki palace, making it available for the college. The old historical buildings, including the manor house, the stables and the coach house, were converted to the needs of modern times and new buildings were constructed in a style preserving the harmony of the palace and its outlying park. In 2022, the Natolin campus of the College of Europe hosted one of the four European citizens’ panels, organised as part of the EU's Conference on the Future of Europe. Albania Campus In 2023, the College announced the opening of a new campus in Albania Student life The College of Europe is bilingual. Students are expected to be proficient in English and French. Students receive an advanced master's degree following a one-year programme. Students specialise in either European Political and Administrative Studies, EU International Relations and Diplomacy Studies, European Law, European Economic Studies, or European Interdisciplinary Studies (at the Natolin campus). For much of its history, the college only admitted a few students, the number has increased since the 1990s. Admissions Application may be made to national selection committees or by direct application to the College of Europe for individuals from a country where no selection committee exists. As of 2014, there are 28 national selection committees. Regarding scholarships, the national selection committees can grant a scholarship; approximately 70% of students receive a scolarship from either national governements or other public and private institutions. Students have the choice between four masters at Bruges campus: European Economic Studies EU International Relations and Diplomacy Studies European Legal Studies European Political and Governance Studies Master in Transatlantic Affairs, which is a 2 year program unlike the other degrees. In Natolin Campus, there is only one degree which is the European Interdisciplinary Studies. Traditions The College of Europe has developed several traditions. Some are shared with the École nationale d'administration (ENA) in France. Both the College and ENA name their promotions after a historical figure, being in the College of Europe an outstanding European figure, which is called "patron". Besides the choice of a prominent historical figure to name each promotion, each academical year is traditionally inaugurated by a prominent European figure. Furthermore, each year, College of Europe students are named honorary citizens of Bruges prior to their departure. Another tradition dating back to the first years of existence of the college is the visit to Flanders fields during the first weeks of the academic year. During that visit, students lay a floral tribute at the Menin Gate war memorial in Ypres. Promotions Academic years at the College are known as promotions. Each promotion is named after an outstanding European, referred to as the promotion's patron. The opening ceremony each year is presided over by a prominent politician, referred to as the Orateur; they have included Angela Merkel, David Miliband, Jean-Claude Juncker, Javier Solana, José Manuel Barroso, Valéry Giscard d'Estaing, Juan Carlos I of Spain, Margaret Thatcher and François Mitterrand. Being invited as the college's Orateur is considered a high honour. Notable alumni Many former students of the college, referred to as anciens (French for alumni), have gone on to serve as government ministers, members of various parliaments, diplomats and high-ranking civil servants and executives. A list of all alumni from 1949 to 1999 is included in the book The College of Europe. Fifty Years of Service to Europe (1999), edited by Dieter Mahncke, Léonce Bekemans and Robert Picht. Alumni of note of the College of Europe (from 1949) include Gaetano Adinolfi, former Deputy Secretary General of the Council of Europe Alberto Alemanno, Professor of Law at New York University School of Law and HEC Paris, CEO of eLabEurope Frans Alphons Maria Alting von Geusau, Dutch legal scholar and diplomat Bernadette Andreosso-O'Callaghan, French-Irish economist, Jean Monnet Professor of Economics at the University of Limerick Peter Arbo, Norwegian academic Árni Páll Árnason, Icelandic Minister of Economic Affairs. Promotion Mozart. Ioanna Babassika, Greek human rights lawyer, member of the Committee for the Prevention of Torture Yuriko Backes, Luxembourgish diplomat and politician, Minister for Finances María Angeles Benítez Salas, Spanish European civil servant, director-general of the Directorate-General for Agriculture and Rural Development Ledi Bianku, judge at the European Court of Human Rights Margunn Bjørnholt, Norwegian sociologist Iwo Byczewski, former Polish Deputy Foreign Minister (1991–1995), Ambassador to Belgium and Permanent Representative to the European Union Geert Van Calster, Belgian lawyer and legal scholar Sofie Carsten Nielsen, Danish Minister for Higher Education and Science. Promotion Aristotle Franz Ceska, Austrian Ambassador to Belgium and France, Permanent Representative to the United Nations in Geneva Poul Skytte Christoffersen, Danish Permanent Representative to the European Institutions, Special Advisor to The Right Honourable Catherine Ashton, Baroness Ashton of Upholland, the High Representative of the Union for Foreign Affairs and Security Policy Nick Clegg, British politician, former Deputy Prime Minister of the United Kingdom, leader of the Liberal Democrats and member of the European Parliament Luc Coene, Belgian economist and Governor of the National Bank of Belgium (NBB) Karl Cox, Vice President of the Oracle Corporation Martin Donnelly, British civil servant Niels Egelund, Danish diplomat, former Permanent Representative to NATO and Ambassador to France Jonathan Faull, Director General for the Internal Market and Services Monique Pariat, Director-General for the Directorate-General for Migration and Home Affairs and previously Director-General for the Directorate-General for European Civil Protection and Humanitarian Aid Operations. Mary Finlay Geoghegan, Justice of the Supreme Court of Ireland. Nigel Forman, British MP and Minister of Higher Education (1992), a member of the Conservative Party Gabriel Fragnière, Swiss academic Louise Fréchette, Deputy Secretary-General of the United Nations Francesco Paolo Fulci, former Permanent Representative of Italy to the United Nations (1993–1999), currently serving as President of Ferrero SpA Otto von der Gablentz, German diplomat and academic Luis Garicano, Professor of Economics and Strategy at the London School of Economics Miriam González Durántez, Spanish lawyer and wife of Nick Clegg Fiona Hayes-Renshaw, Irish academic, visiting professor at the college since 2001 Chris Hoornaert, Ambassador of Belgium to the Netherlands Simon Hughes, British politician and Liberal Democrat Member of Parliament Marc Jaeger, judge at the General Court of the EU Josef Joffe, German editor and publisher of Die Zeit and adjunct professor of political science at Stanford University Claudia Kahr, judge at the Austrian Constitutional Court Alison Kelly, Irish ambassador to Israel Stephen Kinnock, Director at the World Economic Forum Berno Kjeldsen, Danish ambassador Lars-Jacob Krogh, journalist Sabino Fornies Martinez, European Commission Civil Servant, Head of task force at DG FISMA and EU Diplomat in Beijing Brigid Laffan, Director of the Robert Schuman Centre for Advanced Studies at the European University Institute Jo Leinen, German member of the European Parliament, former president of the Union of European Federalists Christian Lequesne, Professor of European Politics at Sciences Po, the College of Europe and the London School of Economics Leif Terje Løddesøl, former Chair of Statoil Sylvie Lucas, Luxembourg's ambassador to the United Nations and president of the United Nations Economic and Social Council (ECOSOC) (2009–2010) Aude Maio-Coliche, Ambassador, Head of the EU Delegation to Venezuela Helena Malikova, EU civil servant and academic Manuel Marín, former President of the European Commission Thomas Mayr-Harting, Ambassador, Head of the Delegation of the European Union to the United Nations Ian McIntyre, British journalist David McWilliams, Irish economist, journalist and documentary-maker Holger Michael, German ambassador Enzo Moavero Milanesi, Minister of Foreign Affairs of Italy Goenawan Mohamad, Indonesian poet Juan Moscoso del Prado, Spanish socialist Member of Parliament, spokesman in the European Union Committee Jon Ola Norbom, former Minister of Finance of Norway Jim Oberstar, member of the United States House of Representatives Mary O'Rourke, barrister David O'Sullivan (civil servant), Chief Operating Officer of the European Union's diplomatic corps, former Secretary-General of the European Commission and Director General for Trade Valerie Plame, former United States CIA Operations Officer Ursula Plassnik, former Foreign Minister of Austria, a member of Austrian People's Party (European People's Party) Nikola Poposki, Macedonian Minister for Foreign Affairs and former Ambassador of the Permanent Mission of the Republic of Macedonia to the European Union Xavier Prats Monné, EU official Torolf Raa, former Norwegian ambassador Carine Van Regenmortel, Belgian corporate lawyer Philippe Régnier, Professor at the Graduate Institute of International and Development Studies and the University of Ottawa Prince Albert Rohan, former Permanent Secretary of the Austrian Foreign Ministry, UN envoy Margaritis Schinas, Vice-President of the European Commission György Schöpflin, a Hungarian academic and politician, Member of the European Parliament for Fidesz and the European People's Party Guy Spitaels, Belgian politician and Minister-President of Wallonia Alexander Stubb, Finnish Minister for Foreign Affairs, a member of politician of the National Coalition Party (European People's Party) Helle Thorning-Schmidt, Prime Minister of Denmark and leader of the Social Democrats (Denmark) Didrik Tønseth, former Norwegian ambassador Count Ferdinand Trauttmansdorff, Austria's ambassador to Prague Loukas Tsoukalis, Jean Monnet Professor of European Integration at the University of Athens and President of the Hellenic Foundation for European and Foreign Policy Andrew Tyrie, Member of Parliament (MP) for Chichester and Chairman of the Treasury Select Committee, a member of Conservative Party Helmut Türk, judge at the International Tribunal for the Law of the Sea, former Ambassador of Austria to the United States Werner Ungerer, German diplomat, Permanent Representative to the European Communities from 1985 to 1990 and rector of the college from 1990 to 1993 Robert Verrue, Director-General for Employment of the European Commission Alexander Walker, British film critic Helen Wallace, Lady Wallace of Saltaire, British expert in European studies and Emeritus Professor at the London School of Economics and Political Science Bruno de Witte, Professor of EU Law at the European University Institute Marc van der Woude, judge at the European Court of Justice Adrien Zeller, former French minister in the second Jacques Chirac government (1986–1988), former President of Alsace Regional Council, a member of the Union for a Popular Movement Jaap de Zwaan, Dutch diplomat and negotiator of several European treaties, Professor of EU Law at the Erasmus University Rotterdam Alexander Stubb, prime minister of Finland Alumni of note of the College of Europe in Natolin, Poland (from 1993) include: Gert Antsu, Ambassador Extraordinary and Plenipotentiary of the Republic of Estonia to Ukraine Jarosław Domański, Ambassador Extraordinary and Plenipotentiary of the Republic of Poland to the Islamic Republic of Iran Marija Pejčinović Burić, Deputy Prime Minister of Croatia, Minister of Foreign and European Affairs Alyn Smith, Scottish member of the European Parliament Olesea Stamate, Minister of Justice of the Republic of Moldova Rafał Trzaskowski, Mayor of Warsaw, former member of the Polish Sejm, former Polish member of the European Parliament, former Polish Minister of Administration and Digitization, former Secretary of State in the Polish Ministry of Foreign Affairs Faculty and organisation The College of Europe originally had no permanent teaching staff; the courses were taught by prominent academics and sometimes government officials from around Europe. Especially in the last couple of decades, the college has increasingly employed professors and other teaching staff on a permanent basis. Academics Dominique Moïsi, co-founder and is a senior advisor of the Paris-based Institut Français des Relations Internationales (IFRI), Pierre Keller Visiting Professor at Harvard University, and the Chairholder for Geopolitics at the College of Europe. Bronisław Geremek, Chairholder of the Chair of European Civilisation until his death Leszek Balcerowicz, economist, the former chairman of the National Bank of Poland and Deputy Prime Minister in Tadeusz Mazowiecki's government. He implemented the Polish economic transformation program in the 1990s, a shock therapy commonly referred to as the Balcerowicz Plan Andrea Biondi, co-Director of the Centre for European Law at King's College London Aleš Debeljak, cultural critic, poet, and essayist Alyson Bailes, a former English diplomat and British Ambassador to Finland who lives in Iceland Valentine Korah, Emeritus Professor of Competition Law at University College London Jacques Rupnik, professor at Institut d'Études Politiques de Paris i.e. Sciences Po Stefan Collignon, professor of political economy, International Chief Economist of the Centro Europa Ricerche, founder of Euro Asia Forum at Sant'Anna School of Advanced Studies, Pisa, Italy, he served as Deputy Director General for Europe in the Federal Ministry of Finance (Germany) 1999–2000. John Usher, legal scholar Guy Haarscher, legal and political philosopher Geoffrey R. Denton, head of economics Jan de Meyer (1958–1970) Dieter Mahncke Léonce Bekemans Fiona Hayes-Renshaw Gerhard Stahl Shada Islam Christian Lequesne Enzo Moavero Milanesi, Italian Minister for Europe and Professor in the Legal Studies Department Alexander Stubb, Finnish Minister for Europe, former Foreign Minister, and Professor at the college since 2000 Norman Davies, Historian; Honorary fellow, St Antony's College, Oxford, Oxford University; Professor, Jagiellonian University Jean de Ruyt, Ambassador; Senior European Policy Advisor, Covington & Burling ; Professor, Université catholique de Louvain (UCL); ex-Belgian Permanent representative to the European Union Organisation Rectors The rector directs and coordinates the college's activities. Hendrik Brugmans (1906–1997) (1949–1971) Jerzy Łukaszewski (°1924) (1972–1990) Werner Ungerer (°1927) (1990–1993) Gabriel Fragnière (1934-2015) (1993–1995) Otto von der Gablentz (1930–2007) (1996–2001) Piet Akkermans (1942–2002) (2001–2002) Robert Picht (1937–2008) (a.i. 2002–2003) Paul Demaret (2003–2013) Jörg Monar (2013–2020) Federica Mogherini (2020–present) Vice rectors The vice rector is responsible for the day-to-day administration of the Natolin (Warsaw) campus. Ettore Deodato (1993) David W. P. Lewis (1994–1996) Jacek Saryusz-Wolski (1996–1999) Piotr Nowina-Konopka (1999–2004) Robert Picht (a.i. 2004–2005) Robert Picht (2005–2007) Ewa Ośniecka-Tamecka (2007– present) Presidents of the Administrative Council Salvador de Madariaga (1950–1964) Jean Rey (1964–1974) François-Xavier Ortoli (1974–1975) Daniel Coens (1985–1990) Manuel Marín (1990–1995) Jacques Delors (1995–2000) Jean-Luc Dehaene (2000–2009) Íñigo Méndez de Vigo (2009 – 2019) Herman Van Rompuy (2019–present) Controversies Controversy concerning Saudi Arabia In February 2019, a series of press pieces published by EUobserver revealed that the Bruges-based institute was paid by the Saudi government to set up private meetings between Saudi ambassadors, EU officials, and MEPs. Although EU lobby transparency rules say that academic institutions should register if they "deal with EU activities and policies and are in touch with the EU institutions", the College of Europe is not listed in the EU joint-transparency register. On 13 February, MEP Alyn Smith of Greens/EFA wrote to ask Jörg Monar, Rector of the College of Europe, to provide assurances that the institute has not received "financial contributions from the Saudi authorities in any form" in its efforts to set up meetings with the EU institutions. On 20 February, Marietje Schaake of the ALDE group presented a written question to the European Commission on this issue. This written question was the subject of a response from the European Commission published on 17 May in which it explained not having any direct evidence as to the facts reported, nor being able to comment on the sources of revenue of the College of Europe beyond European subsidies. A group of College alumni collected signatures to demand the institution to stop organising private meetings between MEPs and the Saudi government. In a letter to the President of the European Parliament's Budget Control Committee Ingeborg Gräßle, Jörg Monar, Rector of the College of Europe, confirmed the organization of trainings for Saudi officials and criticized the media for reporting them as lobbying. The rector indicated that these meetings had no lobbying dimension but sought to show to the Saudis the reasons why the Union defended certain values, privileging communication over isolation to defend European values. Inside Arabia Online, an online publication, characterised the lobbying by Saudi Arabia as part of a concerted effort to reverse the Kingdom's inclusion on the EU's "blacklist", which intends to penalize countries failing to combat terrorism financing and money laundering. Allegations of sexual harassment and misogyny The French language weekly news magazine Le Vif/L'Express published an article on 21 February 2019 based on the testimony of former students from recent years. The article reported a culture of sexual harassment and misogyny at the College of Europe. Cases of sexual harassment and inappropriate behaviour were described in the magazine, including frotteurism, forced kisses and groping. Various students reported to Le Vif/L’Express that the administration observes a code of silence on this issue. Cases of inappropriate behaviours by the academic staff were also reported. Contacted by Le Vif/L’Express magazine, the administration replied that: "In some occasions in the past, some students have crossed the personal barriers of other students". On 5 March 2019, a former student of the College of Europe, published an opinion in Le Vif/L’Express magazine, stating that a culture of sexual harassment and misogyny existed at the College of Europe when she was studying there. Jungle comments by Josep Borrell In October 2022, EU's High Representative of the Union for Foreign Affairs and Security Policy Josep Borrell made controversial comments in a speech to the College of Europe's new European Diplomatic Academy in Bruges. In his speech Borrell designated Europe as “a garden” and he called most of the world a “jungle” that “could invade the garden”. Federica Mogherini, the rector of the College of Europe was hosting Josep Borrell, who succeeded her in the function of High Representative of the Union for Foreign Affairs and Security Policy of the EU did not express any disagreement. See also École nationale d'administration Europa-Institut of Saarland University European Academy of Sciences and Arts European University Institute List of College of Europe presidents List of College of Europe rectors and vice-rectors List of Jesuit sites References Further reading Karel Verleye, De stichting van het Europacollege te Brugge, Stichting Ryckevelde, 1989. Dieter Mahncke, Léonce Bekemans, Robert Picht, The College of Europe. Fifty Years of Service to Europe, College of Europe, Bruges, 1999. . Includes a list of all graduates 1949–1999. Paul Demaret, Inge Govaere, Dominik Hanf (eds), Dynamiques juridiques européennes. Edition revue et mise à jour de 30 ans d'études juridiques européennes au Collège d'Europe, Cahiers du Collège d'Europe, P. I. E. Peter Lang, Brussels, 2007. External links Politico – College of Europe section Alumni Association – College of Europe The Madariaga – College of Europe Foundation Behind the Walls, article by a College alumnus – Europe&Me Magazine Universities and colleges established in 1949 Buildings and structures in Bruges Universities and colleges in Warsaw Universities in Belgium Schools of international relations Education in Bruges 1949 establishments in Belgium
```javascript import Hogan from "hogan.js"; import LunrSearchAdapter from "./lunar-search"; import autocomplete from "autocomplete.js"; import templates from "./templates"; import utils from "./utils"; import $ from "./zepto"; /** * Adds an autocomplete dropdown to an input field * @function DocSearch * @param {Object} options.searchData Read-only API key * @param {string} options.inputSelector CSS selector that targets the input * value. * @param {Object} [options.autocompleteOptions] Options to pass to the underlying autocomplete instance * @return {Object} */ const usage = `Usage: documentationSearch({ searchData, inputSelector, [ appId ], [ autocompleteOptions.{hint,debug} ] })`; class DocSearch { constructor({ searchData, inputSelector, debug = false, queryDataCallback = null, autocompleteOptions = { debug: false, hint: false, autoselect: true }, transformData = false, queryHook = false, handleSelected = false, enhancedSearchInput = false, layout = "collumns" }) { DocSearch.checkArguments({ searchData, inputSelector, }); this.searchData = searchData; this.input = DocSearch.getInputFromSelector(inputSelector); this.queryDataCallback = queryDataCallback || null; const autocompleteOptionsDebug = autocompleteOptions && autocompleteOptions.debug ? autocompleteOptions.debug : false; // eslint-disable-next-line no-param-reassign autocompleteOptions.debug = debug || autocompleteOptionsDebug; this.autocompleteOptions = autocompleteOptions; this.autocompleteOptions.cssClasses = this.autocompleteOptions.cssClasses || {}; this.autocompleteOptions.cssClasses.prefix = this.autocompleteOptions.cssClasses.prefix || "ds"; const inputAriaLabel = this.input && typeof this.input.attr === "function" && this.input.attr("aria-label"); this.autocompleteOptions.ariaLabel = this.autocompleteOptions.ariaLabel || inputAriaLabel || "search input"; this.isSimpleLayout = layout === "simple"; this.client = new LunrSearchAdapter(this.searchData); if (enhancedSearchInput) { this.input = DocSearch.injectSearchBox(this.input); } this.autocomplete = autocomplete(this.input, autocompleteOptions, [ { source: this.getAutocompleteSource(transformData, queryHook), templates: { suggestion: DocSearch.getSuggestionTemplate(this.isSimpleLayout), footer: templates.footer, empty: DocSearch.getEmptyTemplate() } } ]); const customHandleSelected = handleSelected; this.handleSelected = customHandleSelected || this.handleSelected; // We prevent default link clicking if a custom handleSelected is defined if (customHandleSelected) { $(".algolia-autocomplete").on("click", ".ds-suggestions a", event => { event.preventDefault(); }); } this.autocomplete.on( "autocomplete:selected", this.handleSelected.bind(null, this.autocomplete.autocomplete) ); this.autocomplete.on( "autocomplete:shown", this.handleShown.bind(null, this.input) ); if (enhancedSearchInput) { DocSearch.bindSearchBoxEvent(); } } /** * Checks that the passed arguments are valid. Will throw errors otherwise * @function checkArguments * @param {object} args Arguments as an option object * @returns {void} */ static checkArguments(args) { if (!args.searchData) { throw new Error(usage); } if (typeof args.inputSelector !== "string") { throw new Error( `Error: inputSelector:${args.inputSelector} must be a string. Each selector must match only one element and separated by ','` ); } if (!DocSearch.getInputFromSelector(args.inputSelector)) { throw new Error( `Error: No input element in the page matches ${args.inputSelector}` ); } } static injectSearchBox(input) { input.before(templates.searchBox); const newInput = input .prev() .prev() .find("input"); input.remove(); return newInput; } static bindSearchBoxEvent() { $('.searchbox [type="reset"]').on("click", function () { $("input#docsearch").focus(); $(this).addClass("hide"); autocomplete.autocomplete.setVal(""); }); $("input#docsearch").on("keyup", () => { const searchbox = document.querySelector("input#docsearch"); const reset = document.querySelector('.searchbox [type="reset"]'); reset.className = "searchbox__reset"; if (searchbox.value.length === 0) { reset.className += " hide"; } }); } /** * Returns the matching input from a CSS selector, null if none matches * @function getInputFromSelector * @param {string} selector CSS selector that matches the search * input of the page * @returns {void} */ static getInputFromSelector(selector) { const input = $(selector).filter("input"); return input.length ? $(input[0]) : null; } /** * Returns the `source` method to be passed to autocomplete.js. It will query * the Algolia index and call the callbacks with the formatted hits. * @function getAutocompleteSource * @param {function} transformData An optional function to transform the hits * @param {function} queryHook An optional function to transform the query * @returns {function} Method to be passed as the `source` option of * autocomplete */ getAutocompleteSource(transformData, queryHook) { return (query, callback) => { if (queryHook) { // eslint-disable-next-line no-param-reassign query = queryHook(query) || query; } this.client.search(query).then(hits => { if ( this.queryDataCallback && typeof this.queryDataCallback == "function" ) { this.queryDataCallback(hits); } if (transformData) { hits = transformData(hits) || hits; } callback(DocSearch.formatHits(hits)); }); }; } // Given a list of hits returned by the API, will reformat them to be used in // a Hogan template static formatHits(receivedHits) { const clonedHits = utils.deepClone(receivedHits); const hits = clonedHits.map(hit => { if (hit._highlightResult) { // eslint-disable-next-line no-param-reassign hit._highlightResult = utils.mergeKeyWithParent( hit._highlightResult, "hierarchy" ); } return utils.mergeKeyWithParent(hit, "hierarchy"); }); // Group hits by category / subcategory let groupedHits = utils.groupBy(hits, "lvl0"); $.each(groupedHits, (level, collection) => { const groupedHitsByLvl1 = utils.groupBy(collection, "lvl1"); const flattenedHits = utils.flattenAndFlagFirst( groupedHitsByLvl1, "isSubCategoryHeader" ); groupedHits[level] = flattenedHits; }); groupedHits = utils.flattenAndFlagFirst(groupedHits, "isCategoryHeader"); // Translate hits into smaller objects to be send to the template return groupedHits.map(hit => { const url = DocSearch.formatURL(hit); const category = utils.getHighlightedValue(hit, "lvl0"); const subcategory = utils.getHighlightedValue(hit, "lvl1") || category; const displayTitle = utils .compact([ utils.getHighlightedValue(hit, "lvl2") || subcategory, utils.getHighlightedValue(hit, "lvl3"), utils.getHighlightedValue(hit, "lvl4"), utils.getHighlightedValue(hit, "lvl5"), utils.getHighlightedValue(hit, "lvl6") ]) .join( '<span class="aa-suggestion-title-separator" aria-hidden="true"> </span>' ); const text = utils.getSnippetedValue(hit, "content"); const isTextOrSubcategoryNonEmpty = (subcategory && subcategory !== "") || (displayTitle && displayTitle !== ""); const isLvl1EmptyOrDuplicate = !subcategory || subcategory === "" || subcategory === category; const isLvl2 = displayTitle && displayTitle !== "" && displayTitle !== subcategory; const isLvl1 = !isLvl2 && (subcategory && subcategory !== "" && subcategory !== category); const isLvl0 = !isLvl1 && !isLvl2; return { isLvl0, isLvl1, isLvl2, isLvl1EmptyOrDuplicate, isCategoryHeader: hit.isCategoryHeader, isSubCategoryHeader: hit.isSubCategoryHeader, isTextOrSubcategoryNonEmpty, category, subcategory, title: displayTitle, text, url }; }); } static formatURL(hit) { const { url, anchor } = hit; if (url) { const containsAnchor = url.indexOf("#") !== -1; if (containsAnchor) return url; else if (anchor) return `${hit.url}#${hit.anchor}`; return url; } else if (anchor) return `#${hit.anchor}`; /* eslint-disable */ console.warn("no anchor nor url for : ", JSON.stringify(hit)); /* eslint-enable */ return null; } static getEmptyTemplate() { return args => Hogan.compile(templates.empty).render(args); } static getSuggestionTemplate(isSimpleLayout) { const stringTemplate = isSimpleLayout ? templates.suggestionSimple : templates.suggestion; const template = Hogan.compile(stringTemplate); return suggestion => template.render(suggestion); } handleSelected(input, event, suggestion, datasetNumber, context = {}) { // Do nothing if click on the suggestion, as it's already a <a href>, the // browser will take care of it. This allow Ctrl-Clicking on results and not // having the main window being redirected as well if (context.selectionMethod === "click") { return; } input.setVal(""); window.location.assign(suggestion.url); } handleShown(input) { const middleOfInput = input.offset().left + input.width() / 2; let middleOfWindow = $(document).width() / 2; if (isNaN(middleOfWindow)) { middleOfWindow = 900; } const alignClass = middleOfInput - middleOfWindow >= 0 ? "algolia-autocomplete-right" : "algolia-autocomplete-left"; const otherAlignClass = middleOfInput - middleOfWindow < 0 ? "algolia-autocomplete-right" : "algolia-autocomplete-left"; const autocompleteWrapper = $(".algolia-autocomplete"); if (!autocompleteWrapper.hasClass(alignClass)) { autocompleteWrapper.addClass(alignClass); } if (autocompleteWrapper.hasClass(otherAlignClass)) { autocompleteWrapper.removeClass(otherAlignClass); } } } export default DocSearch; ```
John Dennis Hastert (; born January 2, 1942) is an American former politician, educator, convicted felon and sex offender who represented from 1987 to 2007 and served as the 51st Speaker of the United States House of Representatives from 1999 to 2007. Hastert was the longest-serving Republican Speaker of the House in history. After Democrats gained a majority in the House in 2007, Hastert resigned and began work as a lobbyist. In 2016, he was sentenced to 15 months in prison for financial offenses related to the sexual abuse of teenage boys. From 1965 to 1981, Hastert was a high school teacher and coach at Yorkville High School in Yorkville, Illinois. He lost a 1980 bid for the Illinois House of Representatives but ran again and won a seat in 1981. He was first elected to the United States House of Representatives in 1986 and was re-elected every two years until he retired in 2007. Hastert rose through the Republican ranks in the House, becoming chief deputy whip in 1995 and speaker in 1999. As Speaker of the House, Hastert supported the George W. Bush administration's foreign and domestic policies. After Democrats took control of the House in 2007 following the 2006 elections, Hastert declined to seek the position of minority leader, resigned his House seat, and became a lobbyist at the firm of Dickstein Shapiro. In May 2015, Hastert was indicted on federal charges of structuring bank withdrawals to evade bank reporting requirements and making false statements to federal investigators. Federal prosecutors said that the funds withdrawn by Hastert were used as hush money to conceal his past sexual misconduct. In October 2015, Hastert entered into a plea agreement with prosecutors. Under the agreement, Hastert pleaded guilty to the structuring charge (a felony); the charge of making false statements was dropped. In court submissions filed in April 2016, federal prosecutors alleged that Hastert had molested at least four boys as young as 14 years of age during his time as a high school wrestling coach. At a sentencing hearing, Hastert admitted that he had sexually abused boys whom he had coached. Referring to Hastert as a "serial child molester", a federal judge imposed a sentence of 15 months in prison, two years' supervised release, and a $250,000 fine. Hastert was imprisoned in 2016 and was released 13 months later; he became the highest-ranking elected official in U.S. history to serve a prison sentence. Early life and early career Hastert was born on January 2, 1942, in Aurora, Illinois, the eldest of two sons of Naomi (née Nussle) and Jack Hastert. Hastert is of Luxembourgish and Norwegian descent on his father's side, and of German descent on his mother's. Hastert grew up in a rural Illinois farming community. His middle-class family owned a farm supply business and a family farm; Hastert bagged and hauled feed and performed farm chores. As a young man, Hastert also worked shifts in the family's Plainfield restaurant, The Clock Tower, where he was a fry cook. Hastert became a born-again Christian as a teenager, during his sophomore year of high school. Hastert attended Oswego High School, where he was a star wrestler and football player. Hastert briefly attended North Central College, but later transferred to Wheaton College, a Christian liberal arts college. Jim Parnalee, Hastert's roommate at North Central who transferred with him to Wheaton, was a Marine Corps Reserve member who in 1965 became the school's first student to be killed in Vietnam. Hastert continued to visit Parnalee's family each year in Michigan. Because of a wrestling injury, Hastert never served in the military. In 1964, Hastert graduated from Wheaton with a B.A. in economics. In 1967, he received his M.S. in philosophy of education from Northern Illinois University (NIU). In his first year of graduate school, Hastert spent three months in Japan as part of the People to People Student Ambassador Program. One of Hastert's fellow group members was Tony Podesta (then the president of the Young Democrats at University of Illinois at Chicago Circle). Hastert was employed by Yorkville Community Unit School District 115 for 16 years, from 1965 to 1981. Hastert began working there, at age 23, while still attending NIU. Throughout that time, Hastert worked as a teacher at Yorkville High School (teaching government, history, economics, and sociology), where he also served as a football and wrestling coach. Hastert led the school's wrestling team to the 1976 state title and was later named Illinois Coach of the Year. According to federal prosecutors, during the time that he coached wrestling, Hastert sexually abused at least four of his students. Hastert was a Boy Scout volunteer with Explorer Post 540 of Yorkville for 17 years, during his time as a schoolteacher and coach. Hastert reportedly traveled with the Explorers on trips to the Grand Canyon, the Bahamas, Minnesota, and the Green River in Utah. In 1973, Hastert married a fellow teacher at the high school, Jean Kahl, with whom he had two sons. Illinois House of Representatives Hastert considered applying to become an assistant principal at the school, but then decided to enter politics, although at the time "he knew nothing about politics." Hastert approached Phyllis Oldenburg, a Republican operative in Kendall County, seeking advice on running for a seat in the Illinois Legislature. Hastert lost a 1980 Republican primary for the Illinois House of Representatives, but showed a talent for campaigning, and after the election, volunteered for an influential state senator, John E. Grotberg. In the summer of 1980, however, State Representative Al Schoeberiein had become terminally ill, and local Republican party officials selected Hastert as the successor over two major rivals, lawyer Tom Johnson of West Chicago and Mayor Richard Verbic of Elgin. The first round of balloting resulted in a tie, but Hastert was chosen after Grotberg interceded on Hastert's behalf. Hastert, fellow Republican Suzanne Deuchler and Democratic incumbent Lawrence Murphy were elected that year. Hastert served three terms in the state House from the 82nd district, where he served on the Appropriations Committee. According to a 1999 Chicago Tribune profile, in the state House "Hastert quickly staked out a place on the far right of the political spectrum, once earning a place on the 'Moral Majority Honor Roll.' Yet, he also displayed yeoman-like work habits and an ability to put aside partisanship." He gained a reputation as a dealmaker and party leader known for "asking his colleagues to write their spending requests on a notepad so he could carry them into negotiating sessions" and holding early-morning pre-meetings to organize talking points. One of his first moves in the House was to help block passage of the Equal Rights Amendment; the state House Speaker George Ryan appointed Hastert to a committee that worked to prevent the ERA from coming to the House floor. In the state House, Hastert opposed bills barring discrimination against gays; supported (unsuccessfully) proposals to raise the driving age to 18; and voted for a mandatory seat belt law, although he later voted to repeal it. In 1986, at the urging of Governor James R. Thompson, Hastert developed a plan to deregulate Illinois utility companies. Under the plan developed by Hastert and Republican staffers, property and gross-receipts taxes that utilities paid would be eliminated and replaced with a "state service tax" that service-industry businesses (ranging from insurers to funeral homes) would pay. Critics of the plan said that it was too favorable to utility companies, and the proposal was not adopted. U.S. House of Representatives Meanwhile, Hastert's political mentor Grotberg had been elected to Congress as the representative from Illinois's 14th district, which covered a swath of exurban territory west of Chicago. Grotberg was diagnosed with cancer in 1986, and was unable to run for a second term. Hastert was nominated to replace him; in the general election in November 1986, he defeated Democratic candidate Mary Lou Kearns, the Kane County coroner, in a relatively close race. Hastert was then reelected in his Fox Valley-centered district several times, by wider margins, aided by his role in redistricting following the 1990 Census. Following the House banking scandal, which broke in 1992, it was revealed that Hastert had bounced 44 checks during the period under investigation. A Justice Department special counsel said there was no reason to believe Hastert had committed any crime in overdrawing his accounts. As a protégé of House Minority Leader Robert H. Michel, Hastert rose through the Republican ranks in the House, and in 1995 (after the Republicans gained control of the House and Newt Gingrich became Speaker), Hastert became chief deputy whip. Michel appointed Hastert to the Republicans' health care task force, where Hastert became a "prominent voice" in helping defeat the Clinton health care plan of 1993. Hastert developed a close relationship with Tom DeLay, the House majority whip, and was widely seen as DeLay's deputy. Hastert and DeLay first worked together in 1989, on Edward Madigan's unsuccessful race against Gingrich for minority whip. Hastert later managed DeLay's successful campaign to become whip. In September 1998, the two added an extra $250,000 to the Defense Department appropriations bill for "pharmacokinetics research" which paid for an Army experiment with nicotine chewing gum manufactured by the Amurol Confections Company in Yorkville, in Hastert's district. On the House floor, Democratic Representative Peter DeFazio criticized the insertion of the provision; Hastert defended it. Hastert played "good cop" to DeLay's "bad cop." On the eve of his elevation to Speaker, Hastert was described as "deeply conservative at heart" by the Associated Press. The AP reported: "He is an evangelical Christian who opposes abortion and advocates lower taxes, a balanced-budget amendment to the Constitution and the death penalty. He spearheaded the GOP's fight against using sampling techniques to take the next census. Such groups as the National Right to Life Committee, the Christian Coalition, the Chamber of Commerce and the National Rifle Association all gave his voting record perfect scores of 100. The American Conservative Union gave him an 88. Meanwhile, the liberal Americans for Democratic Action, the American Civil Liberties Union and labor organizations such as the AFL–CIO and the Teamsters each gave Hastert zero points. The League of Conservation Voters rated him a 13." Hastert criticized the Clinton administration's plans to conduct the 2000 Census using sampling techniques. Hastert was a supporter of the North American Free Trade Agreement (NAFTA), and in 1993 voted to approve the trade pact. He was a gun rights supporter who voted against the Brady Handgun Violence Prevention Act and Federal Assault Weapons Ban. Hastert was the "House Republicans' leader on anti-narcotics efforts" and was a strong supporter of the War on Drugs. In this role, he campaigned to bar needle-exchange programs from receiving federal funds, and criticized the Clinton administration for what he believed was insufficient funding for drug interdiction efforts. In redistricting following the 2000 census, Hastert brokered a deal with Democratic Representative William Lipinski, also from Illinois, that "protected the reelection prospects of almost every Illinois incumbent." The deal easily passed the divided Illinois Legislature. Committee assignments and House positions Hastert served on the following House committees and in the following House positions. (This list does not include subcommittee assignments or positions within the Republican Conference). 100th Congress (1987–1989) – Government Operations; Public Works and Transportation 101st Congress (1989–1991) – Government Operations; Public Works and Transportation; Select Committee on Children, Youth, and Families 102nd Congress (1991–1993) – Energy and Commerce; Government Operations; Hunger 103rd Congress (1993–1995) – Energy and Commerce; Government Operations 104th Congress (1995–1997) – Chief Deputy Majority Whip; Commerce; Government Reform and Oversight 105th Congress (1997–1999) – Chief Deputy Majority Whip; Commerce; Government Reform and Oversight 106th Congress (1999–2001) – The Speaker; Joint Committee on Inaugural Ceremonies 107th Congress (2001–2003) – The Speaker 108th Congress (2003–2005) – The Speaker; Intelligence (ex officio) 109th Congress (2005–2007) – The Speaker; Intelligence (ex officio) Speaker of the House In the aftermath of the 1998 midterm elections, where the GOP lost five House seats and failed to make a net gain of seats in the Senate, House Speaker Newt Gingrich of Georgia stepped down from the speakership and declined to take his seat for an 11th term. In mid-December, Representative Robert L. Livingston of Louisiana—the former chairman of the House Appropriations Committee and the Speaker-designate—stated in a dramatic surprise announcement on the House floor that he would not become Speaker, following widely publicized revelations of his extramarital affairs. Although he reportedly had no warning of Livingston's decision to step aside, Hastert "began lobbying on the House floor within moments" of Livingston's announcement, and by the afternoon of that day had secured the public backing of the House Republican leadership, including Gingrich, DeLay (who was "viewed as too partisan to step into the role of Speaker") and Dick Armey (who was "viewed as too weak" and was damaged by party infighting). On that day, Hastert was endorsed by about 100 Republican representatives, ranging from conservatives such as Steve Largent to moderates such as Mike Castle, for the speakership. Representative Christopher Cox of California, viewed as a potential rival, decided by evening not to challenge Hastert for the speakership. Hastert became known as "the Accidental Speaker." In accepting the position, Hastert broke the tradition that the new speaker deliver his first address from the speaker's chair, instead delivering his seventeen-minute acceptance speech from the floor. Hastert adopted a conciliatory tone and pledged to work for bipartisanship, saying that: "Solutions to problems cannot be found in a pool of bitterness." Nevertheless, in November 2004, Hastert instituted what became known as the Hastert Rule (or "majority of the majority" rule), which was an informal, self-imposed political practice of allowing the House to vote on only those bills that were supported by the majority of its Republican members. The practice received criticism as an unduly partisan measure both at the time it was adopted and in the subsequent years. The same year, the Hastert aide who coined the phrase also stated that the structure was not workable. In any case, a number of bills subsequently passed the House without the support of a majority of the majority party in the House, as shown by a list compiled by The New York Times. In 2013, after leaving office, Hastert disowned the policy, saying that "there is no Hastert Rule" and that the "rule" was more of a principle that the majority party should follow its own policies. Congressional expert Norm Ornstein writes that Hastert "blew up" the House's "regular order," which is "a mix of rules and norms that allows debate, deliberation, and amendments in committees and on the House floor, that incorporates and does not shut out the minority (even if it still loses most of the time), that takes bills that pass both houses to a conference committee to reconcile differences, [and] that allows time for members and staff to read, digest, and analyze bills." Ornstein commented that "no speaker did more to relegate the regular order to the sidelines than Hastert. ... The House is a very partisan institution, with rules structured to give even tiny majorities enormous leverage. But Hastert took those realities to a new and more tribalized, partisan plane." Despite this shift, Hastert was widely seen as "affable" and low-key; he did not seek the limelight, "become a regular on Sunday talk shows or anything close to a household word or figure," or "openly exhibit the kind of snarling or mean partisan demeanor that made Tom DeLay such a mark of hatred for Democrats." Hastert adopted a much lower profile in the media than conventional wisdom would suggest for a Speaker. This led to accusations that he was only a figurehead for DeLay. In 2005, DeLay was indicted by a Texas grand jury on charges of campaign-finance violations. DeLay stepped down as majority leader and was replaced in that post by Roy Blunt; DeLay resigned from Congress the following year. Throughout his term, Hastert was a strong supporter of the George W. Bush administration's foreign and domestic policies. Hastert was described as a Bush loyalist who worked closely with the White House to shepherd Bush's agenda through Congress, The two frequently praised each other, expressed mutual respect, and had a close working relationship, even during the controversy over Representative Mark Foley sending sexually explicit text messages to teenage male pages. Hastert even provided Vice President Dick Cheney office space inside the House in the United States Capitol. In 2003, Hastert and Bush met privately at the White House about twice a month to discuss congressional developments. Earmarks—line-item projects inserted into appropriations bills at the request of individual members, and often referred to as "pork-barrel" spending—"exploded under [Hastert's] leadership," growing from $12 billion in 1999 (at the beginning of Hastert's term) to an all-time high of $29 billion in 2006 (Hastert's last year as speaker). Hastert himself made earmarks a personal trademark; from 1999 to May 2005, Hastert obtained $24 million in federal earmarked grant funds to groups and institutions in Aurora, Illinois, Hastert's birthplace and his district's largest city. 106th Congress In March 1999, soon after Hastert's elevation to the speakership, the Washington Post, in a front-page story, reported that Hastert "has begun offering industry lobbyists the kind of deal they like: private audiences where, for a price, they can voice their views on what kind of agenda the 106th Congress should pursue." Hastert's style and extensive fundraising led Common Cause to critique the "pay-to-play system" in Congress. Hastert was known as a frequent critic of Bill Clinton, and immediately upon assuming the speakership, he "played a lead role" in the impeachment of the president. Nevertheless, Hastert and the Clinton administration did work together on several initiatives, including the New Markets Tax Credit Program and Plan Colombia. In 2000, Hastert announced he would support an Armenian genocide resolution. Analysts noted that at the time there was a tight congressional race in California, in which might be important to have the large Armenian community in favor of the Republican incumbent. The resolution, vehemently opposed by Turkey, had passed the Human Rights Subcommittee of the House and the International Relations Committee, but Hastert, although first supporting it, withdrew the resolution on the eve of the full House vote. He explained this by saying that he had received a letter from Clinton asking him to withdraw it because it would harm U.S. interests. Even though there is no evidence that a payment was made, an official at the Turkish Consulate is said to have claimed in a recording that was translated by Sibel Edmonds that the price for Hastert to withdraw the Armenian genocide resolution would have been at least $500,000. 107th Congress "Hastert and the senior Republican leadership in the House were able to maintain party discipline to a great degree", which allowed them to regularly enact legislation, despite a narrow majority (less than 12 seats) in the 106th and 107th Congresses. Hastert was a strong supporter of the Iraq War Resolution and the ensuing 2003 invasion of Iraq and the Iraq War. Hastert stated in the House in October 2002 that he believed there was "a direct connection between Iraq and al-Qaeda" and that the U.S. should "do all that we can to disarm Saddam Hussein's regime before they provide al-Qaeda with weapons of mass destruction." In a February 2003 interview with the Chicago Tribune, Hastert "launched into a lengthy and passionate denunciation" of France's resistance to the Iraq war and stated that he wanted to go "nose-to-nose" with the country. In 2006, Hastert visited Iraq at Bush's request and supported a supplemental Iraq War spending bill. As Speaker, Hastert shepherded the USA Patriot Act in October 2001 to passage in the House on a 357–66 vote. In a 2011 interview, Hastert claimed credit for its passage over the misgivings of many members. Fourteen years later, federal prosecutors used the Patriot Act's expansion of currency transaction reporting requirements to indict Hastert on federal charges. As speaker, Hastert also oversaw the passage of the No Child Left Behind Act of 2001, a major education bill; the Bush tax cuts in 2001 and 2003 legislation; and the Homeland Security Act of 2002, which reorganized the government and created the Department of Homeland Security. Although Hastert was successful in implementing Bush policy priorities, during his tenure the House also "regularly passed conservative bills only to have them blocked in the more moderate Senate." One such bill was an energy bill, backed by the Bush administration, which would have authorized drilling in the Arctic National Wildlife Refuge; this provision was killed in the Senate. Hastert opposed the Bipartisan Campaign Reform Act (McCain-Feingold), the landmark campaign finance reform law. In 2001, during the debate on the bill, Hastert criticized Republican Senator John McCain, the bill's cosponsor, saying that McCain had "bullied" House Republicans by sending them letters in support of his campaign-finance reform proposals. Hastert called the legislation "the worst thing that ever happened to Congress" and expressed the view that there were "constitutional flaws" in the legislation. Supporters of campaign-finance reform circumvented Hastert by means of a discharge petition, a seldom-used procedural mechanism in which a measure may be brought to a floor vote (over the objections of the speaker) if an absolute majority of Representatives sign a petition in support of doing so. The discharge petition was not successfully used again until 2015. 108th Congress In 2004, Hastert again feuded with McCain amid conflict between the House and the Senate over the 2005 budget. After "McCain gave a speech excoriating both political parties for refusing to sacrifice their tax cutting and spending agendas in wartime," Hastert publicly questioned McCain's "credentials as a Republican and suggested that the decorated Vietnam War veteran did not understand the meaning of sacrifice." Hastert was key to the passage in November 2003 of key Medicare legislation which created Medicare Part D, a prescription-drug benefit. Hastert's push to pass the legislation—culminating in a three-hour House vote in which the Speaker, "an imposing former wrestling coach, was literally leaning on recalcitrant lawmakers to win their support"—raised the Speaker's profile and contributed to a shift of his image from amiable and low-key to more forceful. The extension of the vote for hours and the arm-twisting of members brought condemnation of Hastert from Democrats, with House Minority Whip Steny H. Hoyer saying: "They are corrupting the practices of the House." The bill passed on a narrow vote of 220 to 215. In 2004, Hoyer called upon Hastert to initiate a House Ethics Committee investigation into statements by Representative Nick Smith, a Republican of Michigan, who stated that groups and lawmakers had offered support for his son's campaign for Congress in exchange for Smith's support of the Medicare bill. In October 2004, the House Ethics Committee admonished DeLay for pressuring Smith on the Medicare prescription-drug bill, but stated that DeLay did not break the law or House ethics rules. Hastert issued a statement supporting DeLay, but the admonishment was viewed as harming DeLay's chances of succeeding Hastert as Speaker. 109th Congress On October 27, 2005, Hastert became the first Speaker to author a blog. On "Speaker's Journal" on his official U.S. House website, Hastert wrote in his first post: "This is Denny Hastert and welcome to my blog. This is new to me. I can't say I'm much of a techie. I guess you could say my office is teaching the old guy new tricks. But I'm excited. This is the future. And it is a new way for us to get our message out." On June 1, 2006, Hastert became the longest-serving Republican Speaker of the House in history, surpassing the record previously held by fellow Illinoisan Joseph Gurney Cannon, who held the post from November 1903 to March 1911. In 2005, following Hurricane Katrina, Hastert told an Illinois newspaper that "It looks like a lot of that place [referring to New Orleans] could be bulldozed" and stated that spending billions of dollars to rebuild the devastated city "doesn't make sense to me." The remarks enraged Governor Kathleen Blanco of Louisiana, who stated that Hastert's comments were "absolutely unthinkable for a leader in his position" and demanded an immediate apology. Former President Bill Clinton, responding to the remarks, stated that had they been in the same place when the remarks were made, "I'm afraid I would have assaulted him." After the remarks caused a furor, Hastert issued a statement saying he was not "advocating that the city be abandoned or relocated" and later issued another statement saying that "Our prayers and sympathies continue to be with the victims of Hurricane Katrina." Hastert was also criticized for being absent from the Capitol during the approval of a $10.5 billion Katrina relief plan; Hastert was in Indiana attending a colleague's fundraiser and an antique car auction. Hastert later said that he donated the proceeds from one of the antique cars he sold at the auction to hurricane relief efforts. Ethics When the United States House Committee on Ethics recommended a series of reprimands against Majority Leader Tom DeLay, Hastert fired committee Chairman Joel Hefley, (R-CO), as well as committee members Kenny Hulshof, (R-MO) and Steve LaTourette, (R-OH). After DeLay's associates were indicted, Hastert enacted a new rule allowing DeLay to keep the majority leadership even if DeLay himself was indicted. A September 2005 article in Vanity Fair revealed that during her work, former FBI translator Sibel Edmonds had heard Turkish wiretap targets boast of covert relations with Hastert. The article states, "the targets reportedly discussed giving Hastert tens of thousands of dollars in surreptitious payments in exchange for political favors and information." A spokesman for Hastert later denied the claims, relating them to the Jennifer Aniston–Brad Pitt breakup. Following his congressional career, Hastert received a $35,000 per month contract lobbying on behalf of Turkey. In December 2006, the House Ethics Committee determined that Hastert and other congressional leaders were "willfully ignorant" in responding to early warnings of the Mark Foley congressional page scandal, but did not violate any House rules. In a committee statement, Kirk Fordham, who was Foley's chief of staff until 2005, said that he had alerted Scott B. Palmer, Hastert's chief of staff, to Foley's inappropriate advances toward congressional pages in 2002 or 2003, asking congressional leadership to intervene. Then-House Majority Leader John Boehner and National Republican Congressional Committee chair Thomas M. Reynolds stated that they told Hastert about Foley's conduct in spring 2005. A Hastert spokesman stated that "what Kirk Fordham said did not happen." Hastert also stated that he could not recall conversations with Boehner and Reynolds, and that he did not learn of Foley's conduct until late September 2006, when the affair became public. In 2006, Hastert became embroiled in controversy over his championing of a $207 million earmark (inserted in the 2005 omnibus highway bill) for the Prairie Parkway, a proposed expressway running through his district. The Sunlight Foundation accused Hastert of failing to disclose that the construction of the highway would benefit a land investment that Hastert and his wife made in nearby land in 2004 and 2005. Hastert took an unusually active role advancing the bill, even though it was opposed by a majority of area residents and by the Illinois Department of Transportation. When he became frustrated by negotiations with White House staff, Hastert began working on the bill directly with President Bush. After passage, Bush traveled to Hastert's district for the law's signing ceremony. Four months later Hastert sold the land for a 500% profit. Hastert's net worth went from $300,000 to at least $6.2 million. Hastert received five-eighths of the proceeds of the sale of the land, turning a $1.8 million profit in under two years. Hastert's ownership interest in the tract was not a public record because the land was held by a blind land trust, Little Rock Trust No. 225. There were three partners in the trust: Hastert, Thomas Klatt, and Dallas Ingemunson. However, public documents only named Ingemunson, who was the Kendall County Republican Party chairman and Hastert's personal attorney and longtime friend. Hastert denied any wrongdoing. In October 2006, Norman Ornstein and Scott Lilly wrote that the Prairie Parkway affair was "worse than FoleyGate" and called for Hastert's resignation. In 2012, after Hastert had departed from Congress, the highway project was killed after federal regulators retracted the 2008 approval of an environmental impact statement for the project and agreed to an Illinois Department of Transportation request to redirect the funds for other projects. Environmentalists, who opposed the project, celebrated its cancellation. In 2006, Hastert (along with then-Minority Leader Nancy Pelosi) criticized an FBI search of Representative William J. Jefferson's Capitol Hill office in connection with a corruption investigation. Hastert issued a lengthy statement saying that the raid violated the separation of powers, and later complained directly to President Bush about the matter. Departure from Congress Before the 2006 elections, Hastert expressed his intent to seek reelection as Speaker if the Republicans maintained control of the House. Hastert was reelected for an eleventh term to his seat in the House with nearly 60 percent of the vote, but that year the Republicans lost control of both the Senate and the House to the Democrats following a wave of voter discontent with the Iraq War, the Federal response to Hurricane Katrina, and a series of scandals among congressional Republicans. The day after the November election, Hastert announced he would not seek to become minority leader when the 110th Congress convened in January 2007. Later that month, John Boehner of Ohio defeated Mike Pence of Indiana in a 168–27 vote of the House Republican Conference election to become minority leader for the 110th Congress. The House Democratic Caucus unanimously selected House Minority Leader Nancy Pelosi to be Speaker (succeeding Hastert) for the 110th Congress. In October 2007, following months of rumors that Hastert would not serve out his term, the Capitol Hill newspaper Roll Call reported that Hastert had decided to resign from the House before the end of the year, triggering a special election. On November 15, 2007, Hastert delivered a farewell speech on the House floor, emphasizing the need for civility in politics; Hastert's speech was followed by remarks from Pelosi praising Hastert's service. On November 26, 2007, Hastert submitted his resignation. Financial disclosure documents indicate that Hastert made a fortune from land deals during his time in Congress. Hastert entered Congress in 1987 with a net worth of no more than $270,000. At the time, his most valuable asset was a 104-acre farm in southern Illinois (which his wife had inherited), worth between $50,000 and $100,000. When Hastert left Congress twenty years later, he reported a significantly increased net worth, variously reported as between $4 million and $17 million and between $3.1 million and $11.3 million. Much of this increase in net worth was the result of various real-estate investments during Hastert's time in Congress (including the controversial land deal several miles from the proposed Prairie Parkway site). At the time Hastert left Congress, much of his net worth remained tied up in real-estate holdings. State Senator Chris Lauzen, Geneva Mayor Kevin Burns, and wealthy dairy businessman Jim Oberweis all entered the campaign for the Republican nomination to succeed Hastert. In December 2007, Hastert endorsed Oberweis in the primary, and Burns withdrew from the race. In the contentious February 2008 primary election, Oberweis was chosen as the Republican nominee, and Fermilab scientist Bill Foster was selected as the Democratic nominee. In the special election in March 2008 to fill the rest of Hastert's unexpired term, Foster won a surprise victory over Oberweis. In a rematch in the November 2008 elections for a full two-year term, Foster again defeated Oberweis. Post-congressional career Lobbyist and consultant In May 2008, six months after resigning from Congress, the Washington, D.C.-based law firm and lobbying firm Dickstein Shapiro announced that Hastert was joining the firm as a senior adviser. Hastert waited until the legally required "cooling-off period" had passed in order to register as a lobbyist. Over the next several years, Hastert earned millions of dollars lobbying his former congressional colleagues on a range of issues, mostly involving congressional appropriations. According to Foreign Agents Registration Act filings, Hastert represented foreign governments, including the government of Luxembourg and government of Turkey. During parts of 2009, Hastert also lobbied on behalf of Oak Brook, Illinois-based real estate developer CenterPoint Properties, lobbying for the placement of a major Army Reserve transportation facility. Hastert also represented Lorillard Tobacco Co., which paid Dickstein Shapiro almost $8 million from 2011 to 2014 to lobby on behalf of candy-flavored tobacco and electronic cigarettes; Hastert "was the most prominent member of the lobbying team" on these efforts. In 2013 and 2014, Hastert lobbied on climate change issues on behalf of Peabody Energy, the world's largest private-sector coal company; in 2015, Hastert "switched sides" and lobbied for Fuels America, the ethanol industry group. In the second half of 2011, Hastert monitored legislation on GPS on behalf of LightSquared, which paid Dickstein Shapiro $200,000 for lobbying services. Hastert also lobbied on behalf of FirstLine Transportation Security, Inc. (which sought congressional review of Transportation Security Administration procurement); Naperville, Illinois-based lighting technology company PolyBrite International; the American College of Rheumatology (on annual labor and health spending bill); the San Diego, California-based for-profit education company Bridgepoint Education; REX American Resources Corp.; The ServiceMaster Co.; and the Secure ID Coalition. In 2014, Hastert's firm Dickstein Shapiro and the lobbying firm of former House majority leader-turned lobbyist Dick Gephardt split a $1.4 million annual lobbying contract with the government of Turkey. In April 2013, Hastert and Gephardt traveled with eight members of Congress to Turkey, with all expenses paid by the Turkish government. While members of Congress are generally prohibited from corporate-funded travel abroad with lobbyists (a rule enacted after the Abramoff scandal), the law permits lobbyists to plan and attend trips overseas if paid for by foreign countries. Hastert defended the trip, saying that he had "meticulously" followed the rules and that the involvement of himself and Gephardt "allowed those members of Congress who were there to have a fuller experience." A National Journal investigation highlighted the trip as an example of loopholes creating a situation in which "lobbyists who can't legally buy a lawmaker a sandwich can still escort members on trips all around the world." In March 2015, Hastert along with his associate (accompanied by several lobbyist associates, including former Representative William D. Delahunt of Massachusetts) took advantage of his privilege as a former lawmaker to be present in the Senate Reception Room near the Senate chamber, "lingering" and "bantering with senators and other passersby" during a vote on whether to retain the fuel standard mandating the blending of ethanol and other alternative fuels with gasoline, as advocated by Hastert's client Fuels America (the ethanol industry trade group). Hastert and Delahunt were criticized by watchdog groups who "questioned whether Hastert was violating" these rules, but "allies of Hastert and Delahunt said they made a point of not lobbying lawmakers in the Senate Reception Room, but that they and members of their team used the lobby area as a temporary base, where they could greet lawmakers while they were holding meetings in private rooms." The day the 2015 indictment was unsealed, Hastert resigned his lobbyist position at Dickstein Shapiro, and his biography was removed from the firm's website. In addition to his lobbyist job, Hastert established his own consultancy, Hastert & Associates. In 2008, Hastert also joined the board of directors of Chicago-based futures exchange company CME Group (which had been formed from the merger of the Chicago Mercantile Exchange and Chicago Board of Trade), where he earned more than 205,000 in total compensation in 2014. On May 29, 2015, following his indictment, Hastert resigned from the board, effective immediately. Publicly funded post-speakership office A controversy arose in 2009 regarding Hastert's receipt of federal funds while a lobbyist. Under a 1975 federal law, Hastert, as a former House Speaker, was entitled to a public allowance (about $40,000 a month) for a five-year period to allow him to maintain an office. Hastert accepted the funds, which went toward office space in far-west suburban Yorkville, Illinois; salaries for three staffers (secretary Lisa Post and administrative assistants Bryan Harbin and Tom Jarman, each paid an annual salary of more than $100,000 over 2½ years); lease payments on a 2008 GMC Yukon sport utility vehicle; a satellite TV subscription; office equipment; and legal fees. Jarman later left the office, and Harbin's salary was cut substantially. Hastert's government-funded office closed in late 2012, at the end of the maximum five years for which public funds were provided. The total amount of public funds spent on Hastert's post-speakership office was nearly $1.9 million (not including federal benefits such as health care to which the employees were entitled), of which the majority (about $1.45 million) went toward staff salaries. The federally funded benefits were legally required to be completely separate from Hastert's simultaneous lobbying activities for Dickstein Shapiro. The arrangement was criticized as "really concerning" by Steve Ellis, vice president of Taxpayers for Common Sense, because the exact nature of the two roles was not transparent. A Hastert spokesman stated that the two offices were completely separate. In 2012, however, a Chicago Tribune investigation found that "a secretary in the ex-speaker's government office used email to coordinate some of his private business meetings and travel, and conducted research on one proposed venture" and that "a suburban Chicago businessman who was involved in the business ventures with Hastert said he met with Hastert at least three times in the government office to discuss the projects." Hastert denied that he had engaged in any improper conduct. Civil lawsuit alleging personal use of publicly funded office In 2013, Hastert's former business partner J. David John filed a lawsuit in the federal district court for the Northern District of Illinois, alleging that Hastert misappropriated federal funds for his post-speakership office in Yorkville for personal use, including private lobbying and business projects. This suit was filed under the qui tam provision of the False Claims Act (FCA), an anti-fraud statute that allows a private party to pursue a case on behalf of the federal government. In the suit, John asserts that he told the FBI in 2011 that "he had knowledge that Hastert was using federally funded offices, staff, office supplies and vehicles for personal business ventures." John, a businessman from the Chicago suburb of Burr Ridge, Illinois, also said that he traveled with Hastert and collaborated with him on "a planned Grand Prix racetrack in Southern California and sports events to be organized in the Middle East" as well as other projects. Hastert denies any wrongdoing. The allegations about the use of the former speakers' officer first drew the attention of federal investigators in 2013, leading to the federal indictment in 2015. In April 2017, Judge Kocoras dismissed the suit, finding that John did not qualify as a "whistleblower" under the FCA. John's attorney said that an appeal was possible. The dismissal "did not turn on whether Hastert actually misused the speaker's office, but rather whether John met a prerequisite for [a False Claims Act] suit: that he brought the allegations to the government's attention before anyone else and before they were made public." Kocoras held that John had falsely claimed that he had told the FBI about possible misuse of federal resources by Hastert. Other activities After retiring from Congress, Hastert made occasional public appearances on political programs. He also made some endorsements of political candidates; in the 2012 Republican presidential primaries, he endorsed Mitt Romney instead of his predecessor as Speaker, Newt Gingrich. Sex abuse scandal and federal prosecution Investigation into hush-money scheme According to a 2017 interview with the two special agents leading the investigations—one each from the FBI and the IRS Criminal Investigation Division—"Hastert had been on the FBI's radar as early as November 2012—even before the FBI and IRS began investigating the suspicious cash withdrawals that were Hastert's downfall." The inquiry was first prompted by allegations that Hastert had used his taxpayer-funded Office of the Former Speaker to further his private business ventures, something that Hastert was never charged with. In 2013, the FBI and IRS began investigating Hastert's cash withdrawals, and in early 2015 they had learned about the "hush money" agreement between "Individual A" and Hastert. In a December 8, 2014 interview, Hastert lied to the federal agents about the purpose of the withdrawals, leading to his federal prosecution. Indictment On May 28, 2015, a seven-page indictment of Hastert by a federal grand jury was unsealed in the U.S. District Court for the Northern District of Illinois in Chicago. The indictment charged Hastert with unlawfully structuring the withdrawal of $952,000 in cash in order to evade the requirement that banks report cash transactions over 10,000 (Title 31, United States Code, Section 5324(a)(3)), and making false statements to the FBI about the purpose of his withdrawals (Title 18, United States Code, Section 1001(a)(2)). The indictment alleges that Hastert agreed to make payments of $3.5 million to an unnamed subject (identified in the indictment only as an "Individual A" from Yorkville, Illinois, who was known to Hastert for "most of Individual A's life"). The indictment stated that the payments were to "compensate for and conceal [Hastert's] prior misconduct." Federal authorities began investigating his withdrawals in 2013. In late 2014, after being questioned about the withdrawals, Hastert said that he did not trust banks; shortly afterward, Hastert changed his story, saying that he "was the victim of extortion by Individual A for false molestation accusations." The indictment itself did not specify the exact nature of the "past misconduct" referred to. The U.S. Attorney's Office limited details in the indictment of Hastert, in part because of a request from Hastert's attorneys. On May 29, Hastert was released on his own recognizance on a preliminary bail of $4,500 set by a magistrate judge. In June The New York Times reported that Hastert had approached a business associate, J. David John, in 2010, to look for a financial adviser to come up with an annuity plan that would "generate a substantial cash payout each year." This request was the same year that prosecutors say he agreed to start paying hush money to the person he allegedly committed misconduct against. John told the Times that "I did not think much about it at the time, but looking back at it, it does seem strange. He just said he needed to generate some cash." Sex abuse allegations emerge On May 29, 2015, after Hastert had been indicted for illicitly structuring financial transactions, two people briefed on the evidence from the case stated that "Individual A"—the man to whom Hastert was making payments—had been sexually abused by Hastert during Hastert's time as a teacher and coach at Yorkville High School, and that Hastert had paid $1.7 million out of a total $3.5 million in promised payment. On the same day, the Los Angeles Times reported that investigators had spoken with another former student who made similar allegations that corroborated what the first student said. Hastert admitted to committing sexual abuse during sentencing on the structuring charge. On June 5, 2015, ABC News' Good Morning America aired an interview with Jolene Reinboldt Burdge, the sister of Steve Reinboldt, who was the student equipment manager of the wrestling team at Yorkville High School when Hastert was the wrestling coach. Hastert also ran an Explorers group of which Steve Reinboldt was a member, and led the group on a diving trip to the Bahamas. In the interview, Burdge stated that in 1979, eight years after Reinboldt's high school graduation in 1971, her brother had told her that he had been sexually abused by Hastert throughout his four years of high school. Burdge said that she was "stunned" by this news and that her brother said that he had never told anyone before, because he did not think he would be believed. A message from Hastert appears in Steve Reinboldt's 1970 high school yearbook. In the interview, Burdge said that she believes the abuse stopped when her brother moved away after graduation. Jolene said that Hastert "damaged Steve I think more than any of us will ever know". Reinboldt died of an AIDS-related illness in 1995. Hastert attended his viewing, which angered Burdge. She said: Hastert then got in his car and left. Burdge said Hastert's lack of a response "said everything". Following Reinboldt's death, around the time that the Mark Foley scandal broke in 2006, Burdge unsuccessfully attempted to bring the allegations against Hastert to light. She contacted ABC News and the Associated Press (AP) on an off-the-record basis, and also contacted some advocacy groups. ABC News and the AP could not corroborate Burdge's allegation at the time, and Hastert denied the accusation to ABC News at the time, so the claim was not published. ABC News reported that "for years, Jolene watched helplessly as Hastert basked in fame and power, seated to the left of the president for years in the early 2000s, during the nationally televised State of the Union address". Several days before the indictment was unsealed, Burdge was interviewed by FBI agents who asked her about her brother and informed her Hastert was about to be indicted on federal charges. Neither Reinboldt nor Burdge are "Individual A" named in the indictment, but Burdge believes that "Individual A" is familiar with what happened with her brother. The statements by Burdge "marked the first time that a person [had] been publicly identified as a possible victim of Mr. Hastert". Reactions The emergence of the sexual abuse allegations against Hastert brought renewed attention to the 2006 Mark Foley scandal, and the criticism of Hastert that he failed to take appropriate action in that case. In the wake of the sexual abuse allegations, journalists noted that Hastert was a supporter of measures which sought to enhance punishments for child sexual abuse, such as the Adam Walsh Child Protection and Safety Act and the Child Abuse Prevention and Enforcement Act of 2000. In 2003, Hastert publicly called for legislation to "put repeat child molesters into jail for the rest of their lives". Hastert resigned his lobbyist position at the law and lobbying firm Dickstein Shapiro the day the indictment was unsealed. His biography was quickly removed from the firm's website and the firm purged all mentions of him from its previously posted press releases. According to a report in Politico, Hastert's resignation left the firm "reeling". Following the Hastert indictment, Dickstein Shapiro's biggest domestic client, Fuels America, terminated its lobbying contract with the firm. On May 29, 2015, Yorkville Community Unit School District 115 released a statement reading: James Harnett, who was superintendent of the school district for five of the years that Hastert taught there, told the Chicago Tribune that he was not aware of any complaints of misconduct brought against Hastert at the time. On May 29, 2015, Senator Mark Kirk, Republican of Illinois, who served in the House throughout Hastert's tenure as speaker, released a statement reading: "Anyone who knows Denny is shocked and confused by the recent news. The former speaker should be afforded, like any other American, his day in court to address these very serious accusations. This is a very troubling development that we must learn more about, but I am thinking of his family during this difficult time." On June 4, 2015, Kirk announced that he would donate to charity a $10,000 contribution made to Kirk's 2010 Senate campaign by Hastert's Keep Our Mission PAC. Kirk's announcement was made following the Democratic Senatorial Campaign Committee (DSCC)'s call upon the senator to "return or donate Denny Hastert's money immediately". The DSCC also called upon Republican Senators John Boozman of Arkansas and Roy Blunt of Missouri (who received $11,000 and $5,000, respectively, from Hastert's PAC in recent years) to return or donate the funds. On May 29, 2015, White House Press Secretary Josh Earnest stated in response to a reporter's question that "there is nobody here" at the White House "who derives any pleasure from reading about the former Speaker's legal troubles at this point". On the same day, House Speaker John Boehner, Republican of Ohio, issued a statement saying: "The Denny I served with worked hard on behalf of his constituents and the country. I'm shocked and saddened to learn of these reports." On May 30, 2015, Illinois's other senator, Dick Durbin, a Democrat, stated: On June 2, 2015, former Federal Housing Finance Agency director and former U.S. Representative Mel Watt, Democrat of North Carolina, released a statement saying: The Hastert scandal was named by MSNBC as among the "top political sex scandals of 2015," by the Associated Press as one of the "top 10 Illinois stories of 2015," and by ABC News as one of the "biggest moments on Capitol Hill in 2015." Hastert's sentencing was also named by the Associated Press as one of "top 10 Illinois stories of 2016". Arraignment and pretrial proceedings The case was assigned to U.S. District Judge Thomas M. Durkin. In between the unsealing of the indictment and the arraignment, Hastert made no public appearances and did not release any public statement. However, on May 29, 2015, CBS Chicago reported that Hastert had privately told close friends that "I am a victim, too" and that he was sorry they had to go through the ordeal. Hastert hired attorney Thomas C. Green, a white-collar criminal defense lawyer and senior counsel at the Washington, D.C. office of the law firm Sidley Austin, to defend him. The prosecutors assigned to the case were originally Assistant United States Attorneys Steven Block and Carrie Hamilton. Hamilton left the U.S. Attorney's Office in July 2015 after being appointed as a judge of the Circuit Court of Cook County; Diane MacArthur replaced Hamilton on the Hastert prosecution team. The June 9, 2015 arraignment generated a degree of media interest at the Everett McKinley Dirksen United States Courthouse not seen since the proceedings against Illinois governors Rod Blagojevich and George Ryan on corruption charges. The Chicago Tribune reported: "Hastert's entrance and exit from the courthouse touched off a wild scene as federal Homeland Security agents escorted Hastert and his attorneys to and from a waiting vehicle amid a crush of television news crews and photographers." At the hearing, Hastert entered a plea of not guilty. Durkin set a $4,500 unsecured bond as well as various other conditions of pretrial release, and Hastert surrendered his passport. At the arraignment, Durkin disclosed that he had contributed $500 in 2002 and $1000 in 2004 to the Hastert for Congress campaign; the contributions were made while Durkin was a partner at the law firm Mayer Brown, before he was appointed to the federal bench in 2012. Hastert's son, Ethan, was a partner at Mayer Brown. At the arraignment, Durkin stated that he had never met Hastert and that he believed he could be impartial, but gave the parties time to decide whether to object to his involvement in the case. On June 11, federal prosecutors and Hastert's lawyers filed notices waiving any objection to Durkin presiding over the case. On June 12, federal prosecutors, with the agreement of Hastert's attorneys, filed a motion for a protective order seeking to bar the public disclosure of the identity of "Individual A" and other sensitive information. The motion states that "the discovery to be provided by the government in this case includes sensitive information, the unrestricted dissemination of which could adversely affect law enforcement interests and the privacy interests of third parties." The draft order contained language directing the parties to file any such sensitive information under seal. On June 16, Judge Durkin granted the motion for a protective order but did not sign such an order. At a status hearing on July 14 (which Hastert again did not attend), the parties updated the court on preparations for trial. At the hearing, Green said: "The indictment has effectively been amended by leaks from the government. It is now an 800-pound gorilla in this case. It has been injected in this case I think impermissibly. (The question is) whether I wrestle with that gorilla or I don't wrestle with that gorilla." Green also said that the defense would file a motion to dismiss the indictment, possibly under seal. Judge Durkin "cautioned that even if he allows part or all of the motion to be hidden from the public, his ruling would be public and likely would disclose sealed portions of the motion." At the same hearing, the prosecution said that they expected a trial to last about two weeks. Hastert shut down his "Keep Our Mission" leadership PAC at the end of June 2015 and transferred $10,000 (the vast majority of the PAC's remaining funds) to a new legal defense fund, the J. Dennis Hastert Defense Trust. A Federal Elections Commission report lists the defense fund's address as a Sunapee, New Hampshire property owned by Republican donor and ex-Gerald Ford White House staffer James Rooney. Guilty plea On September 11, 2015, Judge Durkin granted a joint motion by the government and by Hastert to extend the deadline for filing pretrial motions for two weeks, "giving the two sides more time for discussions they have been engaged in." On September 22, the parties filed another joint motion requesting another two-week extension (from September 28 to October 13); the motion said that the parties were discussing issues that Hastert "may raise in pretrial motions" but provided no details. At a hearing on September 28, Hastert's attorneys and the government confirmed that they were discussing a possible plea agreement. Judge Durkin said that if no plea agreement was reached, he wanted the case to go to trial in March or April 2016. Pretrial motions were due on October 13, but none were filed, indicating that Hastert and the government "were nearing a plea deal." On October 15, 2015, it was announced at a court hearing that Hastert and federal prosecutors had reached a plea agreement. On October 28, 2015, under the plea agreement, Hastert appeared in court (the only time Hastert appeared personally in court after the arraignment) and pleaded guilty to the felony structuring charge. The charge of "making false statements" (lying to the FBI) was dismissed. Hastert said in court: "I didn't want them [bank officials] to know how I intended to spend the money. I withdrew the money in less than $10,000 increments." Possible sentences within a preliminary Federal Sentencing Guidelines calculation ranged from probation to six months in prison. The plea agreement allowed Hastert "to avoid a potentially long and embarrassing trial" and was thought to enable him to "keep secret information that he has hidden for years." Sentencing and admission of past sex abuse Soon after pleading guilty, Hastert suffered a stroke, and was hospitalized from November 2015 to January 15, 2016. Hastert remained free on bail pending sentencing. Sentencing was originally set for February 29, 2016. However, in late January 2016, Hastert's attorneys asked the court to delay sentencing due to Hastert's ongoing health problems, and Judge Durkin postponed sentencing until April 8, 2016. In March, Judge Durkin ordered the appointment of a medical expert to review Hastert's health in preparation for sentencing. Later in March, Judge Durkin postponed the sentencing hearing (over the objection of Hastert's attorneys) to April 27 so that a man who alleged sexual abuse by Hastert (identified as "Individual D" in court) could testify at the sentencing. In early April, the parties filed submissions in court ahead of sentencing. The maximum sentence for the offense was five years in prison and a $250,000 fine, although the Federal Sentencing Guidelines range was from probation to six months. Hastert asked for probation. A statement released by Hastert's counsel said: "Mr. Hastert acknowledges that as a young man, he committed transgressions for which he is profoundly sorry. He earnestly apologizes to his former students, family, friends, previous constituents and all others affected by the harm his actions have caused." Hastert did not provide details. Hastert also filed under seal a response to the government's presentence investigation report. In the prosecution's filing ahead of sentencing, federal prosecutors made allegations of sexual misconduct against Hastert (the first time they had done so publicly), saying that he had molested at least four boys as young as 14 (including Steve Reinboldt and others) while he worked as a high school wrestling coach decades earlier. In a 26-page filing, prosecutors detailed "specific, graphic incidents" of sexual acts. Prosecutors asked for a six-month sentence, as called for under federal sentencing guidelines. Prosecutors also requested the court to order Hastert to undergo a sex offender evaluation and comply with any recommended treatment. While Hastert's health problems had the possibility to help him avoid prison, prosecutors noted in their court filing that he could receive medical treatment while incarcerated, if necessary. Sixty letters asking for leniency for Hastert were submitted to the court ahead of sentencing, but 19 of these letters were withdrawn after Judge Durkin said that he would not consider any letters that were not made public. Of the 41 letters that were made public, several were from current or former members of Congress: Tom DeLay, John T. Doolittle, David Dreier, Thomas W. Ewing, and Porter Goss (who also is a former CIA director). The Chicago Tribune noted that DeLay and Doolittle "have had legal troubles of their own" stemming from the Abramoff scandal, although DeLay's conviction in that scandal was later overturned and Doolittle was never charged. Other supporters of Hastert who wrote letters on his behalf included his family members; former Illinois Attorney General Tyrone C. Fahner; "local leaders, board members, police officers and others from his home base in rural Kendall County"; and "several members of Illinois' wrestling community." At the sentencing hearing on April 27, 2016, the government presented two witnesses. Jolene Burdge, the sister of Steve Reinboldt, read a letter that her brother had written shortly before his death in 1995. Addressing Hastert, Burdge stated that she wanted to "hold you accountable for sexually abusing my brother. I knew your secret, and you couldn't bribe or intimidate your way out. ... You think you can deny your abuse of Steve because he can no longer speak for himself – that's why I'm here." The second witness was Scott Cross ("Individual D") who publicly identified himself for the first time. Cross gave emotional testimony, telling the court that Hastert, whom he had trusted, had abused him and caused him to experience "intense pain, shame and guilt." Cross's oldest brother is longtime Illinois House of Representatives Republican leader Tom Cross, a political protégé of Hastert's. Addressing the court, Hastert—who had arrived at court in a wheelchair—read from a written statement, apologizing for having "mistreated athletes." After being pressed by the judge, Hastert admitted to sexually abusing boys whom he coached, saying that he had molested "Individual B" and did not remember some of the others. Hastert said he did not remember abusing Cross, "but I accept his statement." Hastert stated "what I did was wrong and I regret it ... I took advantage of them." Hastert also acknowledged that he had misled the FBI. Judge Durkin referred to Hastert as a "serial child molester" and imposed a sentence of 15 months in prison, two years' supervised release, including sex-offender treatment, and a $250,000 fine. Hastert is "one of the highest-ranking American politicians ever sentenced to prison." Hastert could not be prosecuted for any of the acts of sexual abuse of which he had been accused because the applicable statute of limitations had expired decades earlier. Reactions Following the sentence, the Chicago Tribune editorial board praised "the bravery of the victims and their families who confronted the man who was once second in line to be president" and wrote of the sentence: "The enduring impact is that the truth has been revealed. And for as long as the name Dennis Hastert is recalled, the man once respected as a leader will be known as a criminal, a scoundrel, a child molester." The Washington Post editorial board hailed the sentence, writing that Hastert's victims "should not have had to struggle with what Mr. Hastert did to them all the while they watched him rise in stature and power." The Post called for extending statutes of limitations in sex-abuse cases to give victims more time to come forward and prosecutors more time to pursue perpetrators. New York Times columnist Frank Bruni wrote that Hastert's case underscored the danger that comes with the "quickness and frequency with which so many of us equate displays of religious devotion with actual rectitude," noting that Hastert's public displays of Christian faith during his time in office were "a factor in his colleagues' assessments of him as safe, uncontroversial." Bruni also critiqued the testimonials that prominent Republicans submitted on Hastert's behalf before sentencing, saying that these "affirm the degree to which pacts rather than principle govern partisan politics today." Jacob Sullum of Reason magazine opined that the financial structuring offense to which Hastert pleaded guilty "should not be a crime ... even if it occasionally provides the means for punishing actual criminals who would otherwise escape justice." Conor Friedersdorf of The Atlantic expressed similar views, writing: "The alarming aspect of this case is the fact that an American is ultimately being prosecuted for the crime of evading federal government surveillance." The Hastert scandal was one motivation for the advance of legislation in the Illinois General Assembly to eliminate the statute of limitations for all felony child abuse and sexual assault offenses. The measure unanimously passed the state Senate in March 2017. Incarceration Hastert did not appeal his sentence. Shortly after being sentenced, Hastert paid the $250,000 fine and was ordered to report to prison on June 22, 2016. On that date, Hastert reported to the Federal Medical Center in Rochester, Minnesota to begin his prison term. In July 2017, after serving about 13 months of a 15-month sentence, Hastert was released from federal prison and returned to Chicago under "residential re-entry management" supervision. Abuse-related civil lawsuits "James Doe" lawsuit In April 2016, "Individual A" sued Hastert for breach of contract in Illinois state court, in Kendall County. "Individual A" (suing under pseudonym "James Doe") sought to collect the remaining $1.8 million in "hush money" allegedly promised to him by Hastert. In the complaint, "Individual A" alleged that he was molested at age 14 by Hastert and that he confronted Hastert after speaking with another of Hastert's alleged victims in 2008. Individual A alleged that he suffered panic attacks and other problems for years as a result of the abuse. Hastert counterclaimed for return of the hush money, alleging that "Individual A" violated a verbal agreement with him by disclosing the sexual abuse to federal authorities. In November 2016, the court denied Hastert's motion to dismiss. In September 2019, the court denied motions for summary judgment by each side. In September 2021, days before trial was set to begin, Hastert reached a settlement with the plaintiff for an undisclosed amount. "Richard Doe" lawsuit In May 2016, a second man filed a lawsuit against Hastert. The man alleged that Hastert sexually assaulted him in the bathroom of a community building in Yorkville in the summer of either 1973 or 1974, when the man was nine or ten years old and in the fourth grade. The complaint detailed the alleged violent assault as well as threats allegedly made by Hastert. The man only recognized Hastert as the assailant after Hastert appeared at Yorkville Grade School in gym class. A Kendall County judge granted the man's motion to proceed anonymously under the "Richard Doe" pseudonym. In the complaint, the man stated that when he was 20 or 21 years old, he comprehended what had occurred and reported the crime to the Kendall County State's Attorney's Office, but that then-state's attorney Dallas C. Ingemunson "threatened to charge him with a crime and accused him of slandering Hastert's name." Ingemunson denied this allegation, calling it "bogus." In May 2016, "Richard Doe" filed a report with the Kendall County Sheriff's Office, but the state's attorney's office determined that the statute of limitations barred a complaint against anyone." NBC Chicago obtained a redacted version of the Sheriff's Office police report. In November 2017, this lawsuit was dismissed due to the expiration of the statute of limitations years earlier. Impact upon pensions Soon after sentencing, the Illinois Teachers' Retirement System announced that Hastert would forfeit future teachers' pension benefits, effective immediately. Hastert challenged this decision on the ground that the specific federal crime to which he pleaded guilty was not directly related to his time as a teacher. Hastert's pension for his service in the Illinois General Assembly—about $28,000 a year—was originally unaffected. However, in October 2016, the General Assembly Retirement System board of trustees unanimously voted to suspend Hastert's pension, and in April 2017 the board voted, 5–2, to terminate the pension. As of 2015, Hastert continued to receive his congressional pension, which amounts to approximately $73,000 a year. Honors In December 1999, Northern Illinois University conferred an honorary LL.D. degree upon Hastert. In May 2016, NIU's board of trustees unanimously voted to revoke Hastert's honorary degree. In 2002, Lewis University conferred an honorary degree upon Hastert. In 2015, following his guilty plea, the university said that it was "reviewing the status of the honorary degree." Lewis University no longer shows Dennis Hastert as having earned an honorary degree. The National Wrestling Hall of Fame awarded Hastert its Order of Merit in 1995 and named Hastert to its "Hall of Outstanding Americans" in 2000. In May 2016, a few days after Hastert was sentenced to prison, the Hall of Fame (following a review) revoked all of Hastert's honors, the first time the organization had ever taken such an action. The Three Fires Council of the Boy Scouts of America has honored Hastert with its distinguished service award. In March 2001, President Valdas Adamkus of Lithuania presented Hastert with the Grand Cross of the Order of the Lithuanian Grand Duke Gediminas. In 2004, Hastert was presented the Order of the Oak Crown, Grand Cross by the grand duke of Luxembourg. In 2007, the J. Dennis Hastert Center for Economics, Government and Public Policy was founded at Wheaton College, the former Speaker's alma mater. Hastert resigned from the board of advisers of the center on May 29, 2015, after the indictment against him was released. On May 31, 2015, the college announced that it was removing his name from the center, renaming it the Wheaton College Center for Economics, Government, and Public Policy. In 2009, Hastert's official portrait was unveiled and placed in the Speaker's Lobby adjacent to the House chamber, alongside portraits of other past House speakers. The 5' by 3½' portrait, executed by Westchester County, New York artist Laurel Stern Boeck, cost $35,000 in taxpayer funds. In November 2015, the week after Hastert's guilty plea in his criminal case, the portrait was removed from the Speaker's Lobby on orders of Speaker Paul Ryan. In May 2009, Hastert accepted the Grand Cross of the Order of San Carlos from Álvaro Uribe, the president of Colombia. In May 2010, Hastert accepted the Grand Cordon of the Order of the Rising Sun from Akihito, emperor of Japan. In 2012, a plaque funded by private donors, "bearing Hastert's likeness and a list of his accomplishments," was placed in the historic Kendall County Courthouse in downtown Yorkville. The plaque was taken down in 2015, following Hastert's guilty plea. In early May 2015 (before the indictment was released), a proposal in the Illinois Legislature to spend $500,000 to commission and install a statue of Hastert in the Illinois State Capitol was withdrawn at Hastert's request. Hastert called the measure's sponsor (Michael Madigan, the speaker of the Illinois House of Representatives) and stated that "he appreciated the recognition and honor" but asked that it be deferred given the "fiscal condition" of the state. In 2015, following the unsealing of the indictment against Hastert the previous month, the Denny Hastert Yorkville Invitational, a popular wrestling tournament in Illinois, was renamed the Fighting Foxes Invitational. Personal life Marriage and family Hastert has been married to Jean Hastert (née Kahl) since 1973. They have two children, Ethan and Joshua. Hastert's older son, Joshua, was a lobbyist for the firm PodestaMattoon, representing clients ranging from Amgen, a biotech company, to Lockheed Martin, a defense contractor. This provoked criticism from Congress Watch: "There definitely should be restrictions [on family members registering as lobbyists] ... This is family members cashing in on connections ... [and it] is an ideal opportunity for special interest groups to exploit family relationships for personal gain." Joshua Hastert responded to the allegation by saying that he did not lobby House Republican leaders. Hastert's son Ethan ran in 2010 as a Republican for his father's old congressional seat (Illinois' 14th congressional district), but was defeated in the primary by Illinois State Senator Randy Hultgren. Hultgren received 55 percent of the vote, while Hastert received 45 percent. In 2011, Ethan won a seat on the village board of Elburn, Illinois. Ethan left the Elburn village board in 2014 because he and his family moved to nearby Campton Hills. As of 2015, Ethan was a partner at the Chicago office of the law firm Mayer Brown. Health Hastert suffers from type 2 diabetes and requires daily insulin injections. Because of his condition, he sometimes walked with protective coverings on his feet to avoid foot problems. Hastert has received treatment for kidney stones at least three times. In 2005, he underwent minor surgery at Bethesda Naval Hospital to remove kidney stones. In 2006, Hastert was hospitalized for cellulitis (a type of bacterial skin infection). In November 2015, the week after entering a guilty plea in federal court, Hastert suffered a stroke and was hospitalized until January 15, 2016. According to his attorney, Hastert was additionally treated for sepsis and a blood infection, and underwent two back operations. At a court hearing in February 2016, Hastert's attorney said that Hastert "nearly died" from the blood infection. Electoral history Congressional elections Speaker of the House elections See also List of federal political scandals in the United States References External links Booknotes interview with Hastert on Speaker: Lessons from 40 Years in Coaching and Politics (August 15, 2004) Transcript (PDF) of Hastert sentencing hearing (April 27, 2015), made available by the Chicago Tribune Official biography from Dickstein Shapiro (this profile was removed from the firm's website after Hastert resigned following the announcement of the indictment, but the Internet Archive preserved a copy of the profile as it appeared on March 25, 2015) NewsMeat list of contributors to Hastert's campaigns Hastert Exhibit from Wheaton College Archives and Special Collections; includes archival photo gallery |- |- |- 1942 births 20th-century American educators 20th-century American politicians 21st-century American criminals 21st-century American politicians American evangelicals American lobbyists American male criminals American people of German descent American people of Luxembourgian descent American people of Norwegian descent American wrestling coaches American prisoners and detainees Grand Cordons of the Order of the Rising Sun Illinois politicians convicted of crimes Living people Republican Party members of the Illinois House of Representatives Northern Illinois University alumni Politicians from Aurora, Illinois People from Yorkville, Illinois People stripped of honorary degrees Illinois politicians convicted of corruption Republican Party members of the United States House of Representatives from Illinois Sex scandals in the United States Schoolteachers from Illinois Speakers of the United States House of Representatives Wheaton College (Illinois) alumni Members of Congress who became lobbyists Prisoners and detainees of the United States federal government American politicians convicted of sex offences
Sam Meas (born ) is a Haverhill, Massachusetts-based political candidate who has run as both a Republican and later a Democrat. Meas is the first Cambodian-American in U.S. history to run for Congress. Personal life He was born Meas Sombo, and grew up in Kandal Province, Cambodia. He lost his father to the Khmer Rouge and was subsequently separated from his mother and sisters during the Vietnamese invasion of Cambodia. He fled Cambodia with a cousin and ended up at the Khao-I-Dang refugee camp in Thailand. In 1986 he was sponsored as a refugee by Catholic Charities USA and moved to Virginia, where he lived with a foster family. He did not know his exact date of birth at the time; an examination by an orthodontist engaged by the Immigration and Naturalization Service estimated his year of birth to be between 1970 and 1972. As a result, Meas chose 31 December 1972 as his legal date of birth, not knowing that the date he had chosen, New Year's Eve, was a major holiday in the United States. In 1996, Meas graduated from Virginia Tech with a degree in finance. Meas is married to his wife Leah and together they have two children, Monique and Sydney. Meas and his wife currently reside in Haverhill, Massachusetts. Career In 2010, Meas unsuccessfully ran for a seat in Massachusetts's 5th congressional district, which includes the cities of Haverhill, Lawrence and Lowell. This made him the first Cambodian-American in U.S. history to run for Congress. In 2012, Meas was a Republican candidate for the Massachusetts State Senate (First Essex District). He lost the 6 September primary election to fellow Republican Shaun Toohey, who received 70% of the votes. Meas went on to work as a campaign manager for Rady Mom, but the two men later had a falling-out. He challenged Mom unsuccessfully for the 18th Middlesex District seat in the 2018 Massachusetts general election. Outside of politics, Meas has worked at the State Street Corporation and also owns a grocery store in Lynn, Massachusetts. He has served on the board of directors of the North Suffolk Mental Association. References External links Sam Meas for Congress official website Lowell's Cambodian Leaders Say More Need to Stand Up and Be Counted Perry, Dave. Lowell Sun, 26 October 2009, p. 1 GOP Field for Congress widens Murphy, Matt Lowell Sun 23 November 2009, p. 1 1970s births American people of Cambodian descent Asian-American people in Massachusetts politics Living people Massachusetts Republicans Politicians from Haverhill, Massachusetts People from Kandal province Virginia Tech alumni
James Eugene Long (March 19, 1940 – February 2, 2009) was the North Carolina Commissioner of Insurance from 1985 through 2009 retiring as the senior Democratic member of the North Carolina Council of State. He was the third-longest-serving statewide elected official in North Carolina history as of 2009. Early life James Eugene Long was born on March 19, 1940, in Burlington, North Carolina, to George Attmore Long and Helen Brooks Long. He attended Burlington public school and graduated from Walter M. Williams High School in 1958. From 1958 to 1962 he studied at North Carolina State University, and the following year he attended and graduated from the University of North Carolina at Chapel Hill with a bachelor's degree. He earned a Juris Doctor from the University of North Carolina School of Law in 1966. Political career Long served in the North Carolina House of Representatives (1971–1975) as had his father and grandfather. He also worked as legal counsel to the state house speaker and as Chief Deputy Commissioner of the North Carolina Department of Insurance from 1975 to 1976. Commissioner John R. Ingram fired Long as his deputy in 1976 and Long ran unsuccessfully against his former boss in 1980. Long became the state's insurance commissioner in January 1985 having been elected in November 1984. He won a sixth term in the 2004 statewide elections. In 2008 he chose not to run for a seventh term. Long endorsed Wayne Goodwin to succeed him as Commissioner of Insurance. Personal life Long was married to Peg O'Connell and had two children -Dr.Rebecca Long & James Long, and five grandchildren -Steven Long, Morgan Long, Matthew McNeal, Hannah Englehart and Kristin Mcneal Vatcher. In 2009, less than one month after leaving office as Insurance Commissioner, Long suffered a hemorrhagic stroke leaving him in a coma. He died at Rex Hospital in Raleigh on February 2, aged 68. References Works cited External links News & Observer: Insurance chief modernized state agency News & Observer profile page Democratic Party members of the North Carolina House of Representatives North Carolina Commissioners of Insurance 1940 births 2009 deaths 20th-century American politicians
Agustina De Giovanni (born July 16, 1985) is an Argentine former swimmer, who specialized in breaststroke events. She is a twelve-time Argentine champion and two-time record holder in the breaststroke (both 100 and 200 m): records in her possession for 15 years. She also holds a South American record of 2:26.17 in the 200 m breaststroke at the 2010 Jose Finkel Trophy Meet in Rio de Janeiro, Brazil. De Giovanni won the World Cup in Belo Horizonte 2005 in the 200 m breaststroke and bronze in the 100m breaststroke. De Giovanni was the captain of her National Team when she competed for Argentina. Olympic Career De Giovanni's Olympic debut came as Argentina's youngest swimmer (aged 19) at the 2004 Summer Olympics in Athens, swimming in the 200 m breaststroke. She represented Argentina at the Pan American Games in 2 events: 2003 in Santo Domingo and 2007 in Rio de Janeiro, Brazil, in the 100 and 200 breaststroke. At the 2008 Summer Olympics in Beijing, de Giovanni qualified again for the women's 200 m breaststroke by breaking a new Argentine record with a time of 2:31.15 from the Ohio State Post-NCAA Long Course Invite in Columbus, Ohio. The University of Alabama, USA De Giovanni is also a former member of the swimming team for Alabama Crimson Tide where she was the MVP of the white and crimson team for 3 years in a row. She also held the school record in more than one event, (100 - 200 Breastroke - 400 Individual Medley - 1650 Free - 500 Free - 4 x 100 Individual Medley Relay). Agustina is an All - American student athlete, graduating in International Relations, part of the SEC Honor Roll 4 years in a row and she is a Hall of Fame Member for the University of Alabama Swimming and Diving. On the upcoming years after her graduation, De Giovanni got an MBA at Austral University and Master Program on Mental Performance Training for Elite Athletes. Currently, has worked as a Mental Performance Coach with professional athletes and teams all over the world. TV Hosting As part of her multi- faceted career, Agustina worked as a TV Host and commentator for different TV signals in Argentina - South America from 2014 until 2020. Her most remarkable work was on ESPN for the Olympic Games, swimming tournaments and soccer events. She has also hosted the news on IP Investigacion Periodistica and Telefe Santa Fe, as well had a column on Gol Inclusive, a radio show broadcast on Club 947. References External links ADG Coach website 1985 births Living people Argentine female breaststroke swimmers Olympic swimmers for Argentina Swimmers at the 2004 Summer Olympics Swimmers at the 2008 Summer Olympics Swimmers at the 2007 Pan American Games Pan American Games competitors for Argentina Alabama Crimson Tide women's swimmers South American Games gold medalists for Argentina South American Games silver medalists for Argentina South American Games bronze medalists for Argentina South American Games medalists in swimming Competitors at the 2010 South American Games Sportspeople from Santa Fe Province
```python # # # path_to_url # # Unless required by applicable law or agreed to in writing, software # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # ============================================================================== """Decorator to overrides the gradient for a function.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from tensorflow.python.eager import context from tensorflow.python.eager import tape from tensorflow.python.framework import ops as tf_ops from tensorflow.python.ops import array_ops from tensorflow.python.util import nest from tensorflow.python.util import tf_decorator def custom_gradient(f): """Decorator to define a function with a custom gradient. The input function is expected to return the tuple (results, gradient_function). The output function will return results while possibly recording the gradient_function and inputs in the tape. Args: f: function to be decorated. Returns: decorated function. """ def decorated(*args, **kwargs): """Decorated function with custom gradient.""" if context.in_graph_mode(): if kwargs: raise ValueError( "custom_gradient in graph mode doesn't support keyword arguments.") name = "CustomGradient-%s" % tf_ops.uid() args = [tf_ops.convert_to_tensor(x) for x in args] result, grad_fn = f(*args) flat_result = nest.flatten(result) all_tensors = flat_result + args @tf_ops.RegisterGradient(name) def internal_grad_fn(unused_op, *result_grads): # pylint: disable=unused-variable gradients = nest.flatten(grad_fn(*result_grads[:len(flat_result)])) # Need to return one value per input to the IdentityN, so pad the # gradients of the inputs of the custom_gradient function with the # gradients of the outputs as well. return ([None] * len(flat_result)) + gradients with tf_ops.get_default_graph().gradient_override_map( {"IdentityN": name}): all_tensors = array_ops.identity_n(all_tensors) return nest.pack_sequence_as( structure=result, flat_sequence=all_tensors[:len(flat_result)]) input_tensors = [x for x in args if isinstance(x, tf_ops.Tensor)] with tape.stop_recording(): result, grad_fn = f(*args, **kwargs) # TODO(apassos): naive uses of custom_gradient will not get the correct # second derivative this way if they capture any output tensors. Change the # signature of custom_gradient. def actual_grad_fn(*outputs): return nest.flatten(grad_fn(*outputs)) flat_result = nest.flatten(result) tape.record_operation( f.__name__, flat_result, input_tensors, [], actual_grad_fn) flat_result = list(flat_result) return result return tf_decorator.make_decorator(f, decorated) ```
Fra' Philippe de Villiers de L'Isle-Adam (1464 – 21 August 1534) was a prominent member of the Knights Hospitaller at Rhodes and later Malta. Having risen to the position of Prior of the Langue of Auvergne, he was elected 44th Grand Master of the Order in 1521. He commanded the Order during Sultan Suleiman's long and bloody Siege of Rhodes in 1522, when 600 knights and 4500 soldiers resisted an invading force of about 100,000 men for six months, but eventually negotiated the capitulation and the departure of the knights on New Year's Day 1523 to Crete. He then led the Order during several years without a permanent domicile—first Kandi on Crete, then successively Messina, Viterbo and finally Nice (1527–1529). In 1530 de L'Isle-Adam obtained the islands of Malta and Gozo and the North African port city of Tripoli as fief for the Order from Emperor Charles V and established the Order, henceforth known as the Maltese Knights, in their new base. The Order arrived on the island on 26 October 1530 on their flagship, the Santa Anna. L'Isle-Adam took formal possession of the islands on 13 November, when the silver key of the capital Mdina was given to the Grand Master. Despite this, the Order settled in the coastal town of Birgu and made it their capital city. They settled in Fort Saint Angelo, which served as both a fortification and as a palace. The city was fortified and eventually Auberges for each of the Langues were built. Despite this, the Grand Master and the Order still hoped that one day they would recapture Rhodes (in fact the Order decided to make Malta their permanent home only after the Great Siege 35 years later). L'Isle-Adam died at the Our Lady of Jesus convent (ta' Ġieżu) in Rabat, Malta on 21 August 1534. He was buried in the Chapel of St Anne within Fort Saint Angelo, but was reburied in the crypt of Saint John's Co-Cathedral in Valletta in the late 16th century. See also Grand Master Philippe Villiers de l'Isle Adam Taking Possession of Mdina, 18th century painting of L'Isle-Adam References External links Coins of Grandmaster Philippe Villiers de L'Isle-Adam Grand Masters of the Knights Hospitaller Knights of Malta 1464 births 1534 deaths People from Beauvais 15th-century French people 16th-century French people 16th-century soldiers Rhodes under the Knights Hospitaller Burials at Saint John's Co-Cathedral
```c /* * */ #define DT_DRV_COMPAT nuvoton_numaker_pinctrl #include <zephyr/drivers/pinctrl.h> #include <NuMicro.h> /* Get mfp_base, it should be == (&SYS->GPA_MFP0) */ #define MFP_BASE DT_INST_REG_ADDR_BY_NAME(0, mfp) #define MFOS_BASE DT_INST_REG_ADDR_BY_NAME(0, mfos) #define GPA_BASE DT_REG_ADDR(DT_NODELABEL(gpioa)) #define GPIO_SIZE DT_REG_SIZE(DT_NODELABEL(gpioa)) #define SLEWCTL_PIN_SHIFT(pin_idx) ((pin_idx) * 2) #define SLEWCTL_MASK(pin_idx) (3 << SLEWCTL_PIN_SHIFT(pin_idx)) #define DINOFF_PIN_SHIFT(pin_idx) (pin_idx + GPIO_DINOFF_DINOFF0_Pos) #define DINOFF_MASK(pin_idx) (1 << DINOFF_PIN_SHIFT(pin_idx)) static void gpio_configure(const pinctrl_soc_pin_t *pin, uint8_t port_idx, uint8_t pin_idx) { GPIO_T *port; port = (GPIO_T *)(GPA_BASE + port_idx * GPIO_SIZE); port->SMTEN = (port->SMTEN & ~BIT(pin_idx)) | ((pin->schmitt_enable ? 1 : 0) << pin_idx); port->SLEWCTL = (port->SLEWCTL & ~SLEWCTL_MASK(pin_idx)) | (pin->slew_rate << SLEWCTL_PIN_SHIFT(pin_idx)); port->DINOFF = (port->DINOFF & ~DINOFF_MASK(pin_idx)) | ((pin->digital_disable ? 1 : 0) << DINOFF_PIN_SHIFT(pin_idx)); } /** * Configure pin multi-function */ static void configure_pin(const pinctrl_soc_pin_t *pin) { uint32_t pin_mux = pin->pin_mux; uint8_t pin_index = PIN_INDEX(pin_mux); uint8_t port_index = PORT_INDEX(pin_mux); uint32_t mfp_cfg = MFP_CFG(pin_mux); uint32_t *GPx_MFPx = ((uint32_t *)MFP_BASE) + port_index * 4 + (pin_index / 4); uint32_t *GPx_MFOSx = ((uint32_t *)MFOS_BASE) + port_index; uint32_t pinMask = NU_MFP_MASK(pin_index); /* * E.g.: SYS->GPA_MFP0 = (SYS->GPA_MFP0 & (~SYS_GPA_MFP0_PA0MFP_Msk) ) | * SYS_GPA_MFP0_PA0MFP_SC0_CD; */ *GPx_MFPx = (*GPx_MFPx & (~pinMask)) | mfp_cfg; if (pin->open_drain != 0) { *GPx_MFOSx |= BIT(pin_index); } else { *GPx_MFOSx &= ~BIT(pin_index); } gpio_configure(pin, port_index, pin_index); } /* Pinctrl API implementation */ int pinctrl_configure_pins(const pinctrl_soc_pin_t *pins, uint8_t pin_cnt, uintptr_t reg) { ARG_UNUSED(reg); /* Configure all peripheral devices' properties here. */ for (uint8_t i = 0U; i < pin_cnt; i++) { configure_pin(&pins[i]); } return 0; } ```
```go package joinedguildsupdater import ( "context" "sync/atomic" "time" "github.com/botlabs-gg/yagpdb/v2/bot/eventsystem" "github.com/botlabs-gg/yagpdb/v2/bot/models" "github.com/botlabs-gg/yagpdb/v2/common" "github.com/botlabs-gg/yagpdb/v2/lib/discordgo" "github.com/volatiletech/sqlboiler/v4/boil" ) var logger = common.GetFixedPrefixLogger("joinedguildsupdater") type updater struct { flushInterval time.Duration Incoming chan *eventsystem.EventData waiting []*QueuedAction processing []*QueuedAction flushInProgress *int32 } func NewUpdater() *updater { u := &updater{ flushInterval: time.Second * 3, Incoming: make(chan *eventsystem.EventData, 100), flushInProgress: new(int32), } go u.run() return u } type QueuedAction struct { GuildID int64 Guild *discordgo.GuildCreate MemberCountMod int } func (u *updater) run() { t := time.NewTicker(u.flushInterval) for { select { case <-t.C: if atomic.LoadInt32(u.flushInProgress) != 0 { logger.Error("last flush took too long, waiting...") continue } if len(u.waiting) == 0 && len(u.processing) == 0 { continue } logger.Infof("Joined guilds, len:%d, leftovers:%d", len(u.waiting), len(u.processing)) // merge the leftovers form last run into the main queue OUTER: for _, pv := range u.processing { for _, wv := range u.waiting { if wv.GuildID == pv.GuildID { wv.MemberCountMod += wv.MemberCountMod continue OUTER } } u.waiting = append(u.waiting, pv) } if len(u.waiting) > 25 { u.processing = u.waiting[:25] u.waiting = u.waiting[25:] } else { u.processing = u.waiting u.waiting = nil } atomic.StoreInt32(u.flushInProgress, 1) go u.flush() case evt := <-u.Incoming: u.handleIncEvent(evt) } } } func (u *updater) handleIncEvent(evt *eventsystem.EventData) { q := QueuedAction{} switch evt.Type { case eventsystem.EventGuildCreate: e := evt.GuildCreate() q.GuildID = e.ID q.Guild = e case eventsystem.EventGuildMemberAdd: q.GuildID = evt.GS.ID q.MemberCountMod = 1 case eventsystem.EventGuildMemberRemove: q.GuildID = evt.GS.ID q.MemberCountMod = -1 } for _, v := range u.waiting { if v.GuildID == q.GuildID { v.MemberCountMod += q.MemberCountMod if q.Guild != nil { // reset pending member change writes v.MemberCountMod = 0 v.Guild = q.Guild } return } } u.waiting = append(u.waiting, &q) } func (u *updater) flush() { const qCountOnly = `UPDATE joined_guilds SET member_count = member_count + $2 WHERE id = $1` leftOver := make([]*QueuedAction, 0) defer func() { u.processing = leftOver atomic.StoreInt32(u.flushInProgress, 0) }() tx, err := common.PQ.Begin() if err != nil { leftOver = u.processing logger.WithError(err).Error("failed creating tx") return } // update all the stats for _, q := range u.processing { if q.Guild != nil { gm := &models.JoinedGuild{ ID: q.Guild.ID, MemberCount: int64(q.Guild.MemberCount + q.MemberCountMod), OwnerID: q.Guild.OwnerID, JoinedAt: time.Now(), Name: q.Guild.Name, Avatar: q.Guild.Icon, } err = gm.Upsert(context.Background(), tx, true, []string{"id"}, boil.Whitelist("member_count", "name", "avatar", "owner_id", "left_at"), boil.Infer()) } else { _, err = tx.Exec(qCountOnly, q.GuildID, q.MemberCountMod) } if err != nil { leftOver = u.processing tx.Rollback() logger.WithError(err).Error("failed updating joined guild, rollbacking...") return } } err = tx.Commit() if err != nil { logger.WithError(err).Error("failed comitting updating joined guild results") leftOver = u.processing tx.Rollback() return } } ```
Agron refers to two surnames with the same spelling, one Jewish and one Hispanic. Etymology As such, there are two origins, the Hebrew Agron (אגרון) and (with Slavic suffix) Agronsky, and the Spanish and Galician Agrón. The Jewish names are patronymics of the biblical Aaron, first high priest of the Jews and brother of Moses, and are two of many Jewish surnames related to him. In the United States, the surname is transliterated from "Ahron" in Eastern Europe usage, though "Agron" and "Ogron" were commonly used in Russia. The Hispanic name is a habitational surname, directly meaning "by the dry ground" and deriving from two towns of the same name, one in A Coruña and one in Granada. People Notable people with the surname include: Agron journalism family Gershon Agron (born Agronsky; 1894–1959), American-Israeli journalist and mayor of Jerusalem Hassia Levy-Agron (1923–2001), Israeli dancer (daughter-in-law of Gershon) Martin Agronsky (born Agrons; 1915–1999), American journalist (nephew of Gershon) Alfredo Agron, Filipino-American WWII veteran, centenarian, and Congressional Gold Medal recipient Bernie Agrons (died 2015), American politician (related to Gershon et al above) Charles Agron, American filmmaker Dianna Agron (born 1986), American actress (distantly related to Gershon et al above) Evsei Agron (died 1985), Russian-American mob boss Gary Agron, retired United States Army Alaska Chief of Staff (son of Alfredo) Kimberly Agron, 2015 Miss Alaska USA Salvador Agron (1943–1986), Puerto Rican gang member See also Other surnames derived from Aaron, including: Aaron (surname) Aarons (surname) Baron-Cohen Cohen (surname) Goren (surname) References Galician-language surnames Hebrew-language surnames Patronymic surnames Russian-Jewish surnames Spanish-language surnames Toponymic surnames
```javascript //your_sha256_hash--------------------------------------- //your_sha256_hash--------------------------------------- // Functional WeakMap tests -- verifies the APIs work correctly // Note however this does not verify the GC semantics of WeakMap WScript.LoadScriptFile("..\\UnitTestFramework\\UnitTestFramework.js"); var tests = [ { name: "WeakMap constructor called on undefined or WeakMap.prototype returns new WeakMap object (and throws on null, non-extensible object)", body: function () { // WeakMap is no longer allowed to be called as a function unless the object it is given // for its this argument already has the [[WeakMapData]] property on it. // // For IE11 we simply throw if WeakMap() is called as a function instead of in a new expression assert.throws(function () { WeakMap.call(undefined); }, TypeError, "WeakMap.call() throws TypeError given undefined"); assert.throws(function () { WeakMap.call(null); }, TypeError, "WeakMap.call() throws TypeError given null"); assert.throws(function () { WeakMap.call(WeakMap.prototype); }, TypeError, "WeakMap.call() throws TypeError given WeakMap.prototype"); /* var weakmap1 = WeakMap.call(undefined); assert.isTrue(weakmap1 !== null && weakmap1 !== undefined && weakmap1 !== WeakMap.prototype, "WeakMap constructor creates new WeakMap object when this is undefined"); var weakmap2 = WeakMap.call(WeakMap.prototype); assert.isTrue(weakmap2 !== null && weakmap2 !== undefined && weakmap2 !== WeakMap.prototype, "WeakMap constructor creates new WeakMap object when this is equal to WeakMap.prototype"); var o = { }; Object.preventExtensions(o); assert.throws(function () { WeakMap.call(null); }, TypeError, "WeakMap constructor throws on null"); assert.throws(function () { WeakMap.call(o); }, TypeError, "WeakMap constructor throws on non-extensible object"); */ } }, { name: "WeakMap constructor throws when called on already initialized WeakMap object", body: function () { var weakmap = new WeakMap(); assert.throws(function () { WeakMap.call(weakmap); }, TypeError); // WeakMap is no longer allowed to be called as a function unless the object it is given // for its this argument already has the [[WeakMapData]] property on it. /* var obj = {}; WeakMap.call(obj); assert.throws(function () { WeakMap.call(obj); }, TypeError); function MyWeakMap() { WeakMap.call(this); } MyWeakMap.prototype = new WeakMap(); MyWeakMap.prototype.constructor = MyWeakMap; var myweakmap = new MyWeakMap(); assert.throws(function () { WeakMap.call(myweakmap); }, TypeError); assert.throws(function () { MyWeakMap.call(myweakmap); }, TypeError); */ } }, { name: "WeakMap constructor populates the weakmap with key-values pairs from given optional iterable argument", body: function () { var keys = [ { }, { }, { }, { } ]; var wm = new WeakMap([ [keys[0], 1], [keys[1], 2], [keys[2], 3] ]); assert.areEqual(1, wm.get(keys[0]), "wm has key keys[0] mapping to value 1"); assert.areEqual(2, wm.get(keys[1]), "wm has key keys[1] mapping to value 2"); assert.areEqual(3, wm.get(keys[2]), "wm has key keys[2] mapping to value 3"); var customIterable = { [Symbol.iterator]: function () { var i = 0; return { next: function () { return { done: i > 3, value: [ keys[i], ++i * 2 ] }; } }; } }; wm = new WeakMap(customIterable); assert.areEqual(2, wm.get(keys[0]), "wm has key keys[0] mapping to value 2"); assert.areEqual(4, wm.get(keys[1]), "wm has key keys[1] mapping to value 4"); assert.areEqual(6, wm.get(keys[2]), "wm has key keys[2] mapping to value 6"); assert.areEqual(8, wm.get(keys[3]), "wm has key keys[3] mapping to value 8"); } }, { name : "WeakMap constructor caches next method from iterator", body: function () { const keys = [ { }, { }, { } ]; let iterCount = 0; const iter = { [Symbol.iterator]() { return this; }, next() { this.next = function (){ throw new Error ("Next should have been cached so this should not be called") }; return { value : [keys[iterCount], iterCount], done : iterCount++ > 2 } } } const wm = new WeakMap(iter); assert.areEqual(0, wm.get(keys[0]), "wm has key keys[0]"); assert.areEqual(1, wm.get(keys[1]), "wm has key keys[1]"); assert.areEqual(2, wm.get(keys[2]), "wm has key keys[2]"); } }, { name: "WeakMap constructor throws exceptions for non- and malformed iterable arguments", body: function () { var iterableNoIteratorMethod = { [Symbol.iterator]: 123 }; var iterableBadIteratorMethod = { [Symbol.iterator]: function () { } }; var iterableNoIteratorNextMethod = { [Symbol.iterator]: function () { return { }; } }; var iterableBadIteratorNextMethod = { [Symbol.iterator]: function () { return { next: 123 }; } }; var iterableNoIteratorResultObject = { [Symbol.iterator]: function () { return { next: function () { } }; } }; assert.throws(function () { new WeakMap(123); }, TypeError, "new WeakMap() throws on non-object", "Function expected"); assert.throws(function () { new WeakMap({ }); }, TypeError, "new WeakMap() throws on non-iterable object", "Function expected"); assert.throws(function () { new WeakMap(iterableNoIteratorMethod); }, TypeError, "new WeakMap() throws on non-iterable object where @@iterator property is not a function", "Function expected"); assert.throws(function () { new WeakMap(iterableBadIteratorMethod); }, TypeError, "new WeakMap() throws on non-iterable object where @@iterator function doesn't return an iterator", "Object expected"); assert.throws(function () { new WeakMap(iterableNoIteratorNextMethod); }, TypeError, "new WeakMap() throws on iterable object where iterator object does not have next property", "Function expected"); assert.throws(function () { new WeakMap(iterableBadIteratorNextMethod); }, TypeError, "new WeakMap() throws on iterable object where iterator object's next property is not a function", "Function expected"); assert.throws(function () { new WeakMap(iterableNoIteratorResultObject); }, TypeError, "new WeakMap() throws on iterable object where iterator object's next method doesn't return an iterator result", "Object expected"); } }, { name: "APIs throw TypeError where specified", body: function () { function MyWeakMapImposter() { } MyWeakMapImposter.prototype = new WeakMap(); MyWeakMapImposter.prototype.constructor = MyWeakMapImposter; var o = new MyWeakMapImposter(); assert.throws(function () { o.delete(o); }, TypeError, "delete should throw if this doesn't have WeakMapData property"); assert.throws(function () { o.get(o); }, TypeError, "get should throw if this doesn't have WeakMapData property"); assert.throws(function () { o.has(o); }, TypeError, "has should throw if this doesn't have WeakMapData property"); assert.throws(function () { o.set(o, o); }, TypeError, "set should throw if this doesn't have WeakMapData property"); assert.throws(function () { WeakMap.prototype.delete.call(); }, TypeError, "delete should throw if called with no arguments"); assert.throws(function () { WeakMap.prototype.get.call(); }, TypeError, "get should throw if called with no arguments"); assert.throws(function () { WeakMap.prototype.has.call(); }, TypeError, "has should throw if called with no arguments"); assert.throws(function () { WeakMap.prototype.set.call(); }, TypeError, "set should throw if called with no arguments"); assert.throws(function () { WeakMap.prototype.delete.call(null, o); }, TypeError, "delete should throw if this is null"); assert.throws(function () { WeakMap.prototype.get.call(null, o); }, TypeError, "get should throw if this is null"); assert.throws(function () { WeakMap.prototype.has.call(null, o); }, TypeError, "has should throw if this is null"); assert.throws(function () { WeakMap.prototype.set.call(null, o, o); }, TypeError, "set should throw if this is null"); assert.throws(function () { WeakMap.prototype.delete.call(undefined, o); }, TypeError, "delete should throw if this is undefined"); assert.throws(function () { WeakMap.prototype.get.call(undefined, o); }, TypeError, "get should throw if this is undefined"); assert.throws(function () { WeakMap.prototype.has.call(undefined, o); }, TypeError, "has should throw if this is undefined"); assert.throws(function () { WeakMap.prototype.set.call(undefined, o, o); }, TypeError, "set should throw if this is undefined"); var weakmap = new WeakMap(); assert.throws(function () { weakmap.set(null, o); }, TypeError, "set should throw if key is not an object, e.g. null"); assert.throws(function () { weakmap.set(undefined, o); }, TypeError, "set should throw if key is not an object, e.g. undefined"); assert.throws(function () { weakmap.set(true, o); }, TypeError, "set should throw if key is not an object, e.g. a boolean"); assert.throws(function () { weakmap.set(10, o); }, TypeError, "set should throw if key is not an object, e.g. a number"); assert.throws(function () { weakmap.set("hello", o); }, TypeError, "set should throw if key is not an object, e.g. a string"); } }, { name: "Non-object key argument silent fails delete, get, and has", body: function () { var weakmap = new WeakMap(); assert.isTrue(weakmap.get(null) === undefined, "null is not an object and cannot be a key in a WeakMap; get returns undefined"); assert.isTrue(weakmap.get(undefined) === undefined, "undefined is not an object and cannot be a key in a WeakMap; get returns undefined"); assert.isTrue(weakmap.get(true) === undefined, "boolean is not an object and cannot be a key in a WeakMap; get returns undefined"); assert.isTrue(weakmap.get(10) === undefined, "number is not an object and cannot be a key in a WeakMap; get returns undefined"); assert.isTrue(weakmap.get("hello") === undefined, "string is not an object and cannot be a key in a WeakMap; get returns undefined"); assert.isFalse(weakmap.has(null), "null is not an object and cannot be a key in a WeakMap; has returns false"); assert.isFalse(weakmap.has(undefined), "undefined is not an object and cannot be a key in a WeakMap; has returns false"); assert.isFalse(weakmap.has(true), "boolean is not an object and cannot be a key in a WeakMap; has returns false"); assert.isFalse(weakmap.has(10), "number is not an object and cannot be a key in a WeakMap; has returns false"); assert.isFalse(weakmap.has("hello"), "string is not an object and cannot be a key in a WeakMap; has returns false"); assert.isFalse(weakmap.delete(null), "null is not an object and cannot be a key in a WeakMap; delete returns false"); assert.isFalse(weakmap.delete(undefined), "undefined is not an object and cannot be a key in a WeakMap; delete returns false"); assert.isFalse(weakmap.delete(true), "boolean is not an object and cannot be a key in a WeakMap; delete returns false"); assert.isFalse(weakmap.delete(10), "number is not an object and cannot be a key in a WeakMap; delete returns false"); assert.isFalse(weakmap.delete("hello"), "string is not an object and cannot be a key in a WeakMap; delete returns false"); var booleanObject = new Boolean(true); var numberObject = new Number(10); var stringObject = new String("hello"); weakmap.set(booleanObject, null); weakmap.set(numberObject, null); weakmap.set(stringObject, null); assert.isTrue(weakmap.get(true) === undefined, "boolean is not an object and cannot be a key in a WeakMap; get returns undefined"); assert.isTrue(weakmap.get(10) === undefined, "number is not an object and cannot be a key in a WeakMap; get returns undefined"); assert.isTrue(weakmap.get("hello") === undefined, "string is not an object and cannot be a key in a WeakMap; get returns undefined"); assert.isFalse(weakmap.has(true), "boolean is not an object and cannot be a key in a WeakMap; has returns false"); assert.isFalse(weakmap.has(10), "number is not an object and cannot be a key in a WeakMap; has returns false"); assert.isFalse(weakmap.has("hello"), "string is not an object and cannot be a key in a WeakMap; has returns false"); assert.isFalse(weakmap.delete(true), "boolean is not an object and cannot be a key in a WeakMap; delete returns false"); assert.isFalse(weakmap.delete(10), "number is not an object and cannot be a key in a WeakMap; delete returns false"); assert.isFalse(weakmap.delete("hello"), "string is not an object and cannot be a key in a WeakMap; delete returns false"); } }, { name: "Basic usage, delete, get, has, set", body: function () { var weakmap = new WeakMap(); var o = { }; var p = { }; var q = { }; weakmap.set(o, 10); weakmap.set(p, o); weakmap.set(q, q); assert.isTrue(weakmap.has(o), "Should contain key o"); assert.isTrue(weakmap.has(p), "Should contain key p"); assert.isTrue(weakmap.has(q), "Should contain key q"); assert.isFalse(weakmap.has(weakmap), "Should not contain other keys, 'weakmap'"); assert.isFalse(weakmap.has({ }), "Should not contain other keys, '{ }'"); assert.isTrue(weakmap.get(o) === 10, "Should weakmap o to 10"); assert.isTrue(weakmap.get(p) === o, "Should weakmap p to o"); assert.isTrue(weakmap.get(q) === q, "Should weakmap q to q"); assert.isTrue(weakmap.get(weakmap) === undefined, "Should return undefined for non-existant key, 'weakmap'"); assert.isTrue(weakmap.get({ }) === undefined, "Should return undefined for non-existant key, '{ }'"); assert.isTrue(weakmap.delete(p), "Should return true after deleting key p"); assert.isTrue(weakmap.has(o), "Should still contain key o"); assert.isFalse(weakmap.has(p), "Should no longer contain key p"); assert.isTrue(weakmap.has(q), "Should still contain key q"); assert.isFalse(weakmap.delete(p), "Should return false, p is no longer a key"); assert.isTrue(weakmap.delete(o), "Should return true after deleting key o"); assert.isTrue(weakmap.delete(q), "Should return true after deleting key q"); assert.isFalse(weakmap.has(o), "Should no longer contain key o"); assert.isFalse(weakmap.has(p), "Should still not contain key p"); assert.isFalse(weakmap.has(q), "Should no longer contain key q"); } }, { name: "Not specifying arguments should default them to undefined", body: function () { var weakmap = new WeakMap(); assert.isFalse(weakmap.has(), "Should return false for implicit undefined; has"); assert.isTrue(weakmap.get() === undefined, "Should return undefined for implicit undefined; get"); assert.isFalse(weakmap.delete(), "Should return false for implicit undefined; delete"); assert.throws(function () { weakmap.set(); }, TypeError, "Should throw TypeError for implicit undefined; set"); } }, { name: "Extra arguments should be ignored", body: function () { var weakmap = new WeakMap(); var o = { }; var p = { }; var q = { }; assert.isFalse(weakmap.has(o, p, q), "Looks for o, ignores p and q, weak weakmap is empty and has should return false"); assert.isTrue(weakmap.get(o, p, q) === undefined, "Looks for o, ignores p and q, weak weakmap is empty and get should return false"); assert.isFalse(weakmap.delete(o, p, q), "Looks for o, ignores p and q, weak weakmap is empty and delete should return false"); weakmap.set(o, p, q); assert.isTrue(weakmap.has(o), "Should contain o"); assert.isFalse(weakmap.has(p), "Should not contain p"); assert.isFalse(weakmap.has(q), "Should not contain q"); assert.isTrue(weakmap.has(o, p, q), "Ignores p and q, does have o"); assert.isTrue(weakmap.has(o, q, p), "Order of extra arguments has no affect, still has o"); assert.isFalse(weakmap.has(p, o), "Ignores o, does not have p"); assert.isTrue(weakmap.get(o) === p, "Should contain o and return p"); assert.isTrue(weakmap.get(p) === undefined, "Should not contain p and return undefined"); assert.isTrue(weakmap.get(q) === undefined, "Should not contain q and return undefined"); assert.isTrue(weakmap.get(o, p, q) === p, "Ignores p and q, does have o, returns p"); assert.isTrue(weakmap.get(o, q, p) === p, "Order of extra arguments has no affect, still has o, still returns p"); assert.isTrue(weakmap.get(p, o) === undefined, "Ignores o, does not have p and returns undefined"); assert.isFalse(weakmap.delete(p, o, q), "p is not found so should return false, ignores o and q"); assert.isFalse(weakmap.delete(q, o), "q is not found so should return false, ignores o"); assert.isTrue(weakmap.delete(o, p, q), "o is found and deleted, so should return true, ignores p and q"); } }, { name: "Delete should return true if item was in the WeakMap, false if not", body: function () { var weakmap = new WeakMap(); var o = { }; var p = { }; weakmap.set(o, p); assert.isFalse(weakmap.delete(p), "p is not a key in the weakmap, delete should return false"); assert.isTrue(weakmap.delete(o), "o is a key in the weakmap, delete should remove it and return true"); assert.isFalse(weakmap.delete(o), "o is no longer a key in the weakmap, delete should now return false"); } }, { name: "Setting the same key twice is valid, and should modify the value", body: function () { var weakmap = new WeakMap(); var o = { }; var p = { }; weakmap.set(o); weakmap.set(o); weakmap.set(p); weakmap.delete(o); weakmap.set(p); weakmap.set(o); weakmap.set(o); weakmap.delete(o); weakmap.delete(p); weakmap.set(o, 3); assert.isTrue(weakmap.get(o) === 3, "o maps to 3"); weakmap.set(o, 4); assert.isTrue(weakmap.get(o) === 4, "o maps to 4"); weakmap.set(p, 5); assert.isTrue(weakmap.get(o) === 4, "o still maps to 4"); assert.isTrue(weakmap.get(p) === 5, "p maps to 5"); weakmap.delete(o); assert.isTrue(weakmap.get(o) === undefined, "o is no longer in the weakmap"); assert.isTrue(weakmap.get(p) === 5, "p still maps to 5"); weakmap.set(p, 6); assert.isTrue(weakmap.get(p) === 6, "p maps to 6"); } }, { name: "set returns the weakmap instance itself", body: function () { var weakmap = new WeakMap(); var o = { }; assert.areEqual(weakmap, weakmap.set(o, o), "Setting new key should return WeakMap instance"); assert.areEqual(weakmap, weakmap.set(o, o), "Setting existing key should return WeakMap instance"); } }, { name: "Adding and removing keys from one WeakMap shouldn't affect other WeakMaps", body: function () { var wm1 = new WeakMap(); var wm2 = new WeakMap(); var wm3 = new WeakMap(); var o = { }; var p = { }; var q = { }; wm1.set(o, o); wm1.set(p, q); wm2.set(q, o); assert.isTrue(wm1.has(o), "wm1 has o"); assert.isFalse(wm2.has(o), "wm2 does not have o"); assert.isFalse(wm3.has(o), "wm3 does not have o"); assert.isTrue(wm1.get(o) === o, "wm1 has o map to o"); assert.isTrue(wm2.get(o) === undefined, "wm2 does not have o and get returns undefined"); assert.isTrue(wm3.get(o) === undefined, "wm3 does not have o and get returns undefined"); assert.isTrue(wm1.has(p), "wm1 has p"); assert.isTrue(wm2.has(q), "wm2 has q"); assert.isFalse(wm1.has(q), "wm1 does not have q"); assert.isFalse(wm2.has(p), "wm2 does not have p"); assert.isFalse(wm3.has(p), "wm3 does not have p"); assert.isFalse(wm3.has(q), "wm3 does not have q"); assert.isTrue(wm1.get(p) === q, "wm1 has p map to q"); assert.isTrue(wm2.get(q) === o, "wm2 has q map to o"); assert.isTrue(wm1.get(q) === undefined, "wm1 does not have q and get returns undefined"); assert.isTrue(wm2.get(p) === undefined, "wm2 does not have p and get returns undefined"); assert.isTrue(wm3.get(p) === undefined, "wm3 does not have p and get returns undefined"); assert.isTrue(wm3.get(q) === undefined, "wm3 does not have q and get returns undefined"); wm3.set(p, o); wm3.set(q, p); assert.isTrue(wm3.has(p), "wm3 now has p"); assert.isTrue(wm3.has(q), "wm3 now has q"); assert.isTrue(wm1.has(p), "wm1 still has p"); assert.isFalse(wm2.has(p), "wm2 still does not have p"); assert.isFalse(wm1.has(q), "wm1 still does not have q"); assert.isTrue(wm2.has(q), "wm2 still has q"); assert.isTrue(wm1.delete(p), "p is removed from wm1"); assert.isFalse(wm1.has(p), "wm1 no longer has p"); assert.isTrue(wm3.has(p), "wm3 still has p"); wm3.delete(p); wm3.delete(q); assert.isFalse(wm3.has(p), "wm3 no longer has p"); assert.isFalse(wm3.has(q), "wm3 no longer has q"); assert.isTrue(wm1.has(o), "wm1 still has o"); assert.isTrue(wm2.has(q), "wm2 still has q"); } }, { name: "Number, Boolean, and String and other special objects should all as keys", body: function () { var weakmap = new WeakMap(); var n = new Number(1); var b = new Boolean(2); var s = new String("Hi"); var ab = new ArrayBuffer(32); weakmap.set(n, 1); weakmap.set(b, 2); weakmap.set(s, 3); weakmap.set(ab, 4); assert.isTrue(weakmap.has(n), "weakmap has key n which is a Number instance"); assert.isTrue(weakmap.has(b), "weakmap has key b which is a Boolean instance"); assert.isTrue(weakmap.has(s), "weakmap has key s which is a String instance"); assert.isTrue(weakmap.has(ab), "weakmap has key ab which is an ArrayBuffer instance"); assert.isTrue(weakmap.get(n) === 1, "weakmap has key n which is a Number instance and maps it to 1"); assert.isTrue(weakmap.get(b) === 2, "weakmap has key b which is a Boolean instance and maps it to 2"); assert.isTrue(weakmap.get(s) === 3, "weakmap has key s which is a String instance and maps it to 3"); assert.isTrue(weakmap.get(ab) === 4, "weakmap has key ab which is an ArrayBuffer instance and maps it to 4"); assert.isTrue(weakmap.delete(n), "Successfully delete key n which is a Number instance from weakmap"); assert.isTrue(weakmap.delete(b), "Successfully delete key b which is a Boolean instance from weakmap"); assert.isTrue(weakmap.delete(s), "Successfully delete key s which is a String instance from weakmap"); assert.isTrue(weakmap.delete(ab), "Successfully delete key ab which is an ArrayBuffer instance from weakmap"); assert.isFalse(weakmap.has(n), "weakmap no longer has key n"); assert.isFalse(weakmap.has(b), "weakmap no longer has key b"); assert.isFalse(weakmap.has(s), "weakmap no longer has key s"); assert.isFalse(weakmap.has(ab), "weakmap no longer has key ab"); } }, { name: "WeakMap can add keys that are sealed and frozen (testworthy because WeakMap implementation sets internal property on key objects)", body: function () { var wm = new WeakMap(); var sealedObj = Object.seal({ }); var frozenObj = Object.freeze({ }); wm.set(sealedObj, 1248); wm.set(frozenObj, 3927); assert.isTrue(wm.has(sealedObj), "WeakMap has sealed object as key"); assert.isTrue(wm.has(frozenObj), "WeakMap has frozen object as key"); assert.areEqual(1248, wm.get(sealedObj), "WeakMap maps sealed object key to corresponding mapped value"); assert.areEqual(3927, wm.get(frozenObj), "WeakMap maps frozen object key to corresponding mapped value"); var wm2 = new WeakMap(); assert.isFalse(wm2.has(sealedObj), "Second WeakMap does not have sealed object key"); assert.isFalse(wm2.has(frozenObj), "Second WeakMap does not have frozen object key"); wm2.set(sealedObj, 42); wm2.set(frozenObj, 68); assert.isTrue(wm2.has(sealedObj), "Second WeakMap now has sealed object key"); assert.isTrue(wm2.has(frozenObj), "Second WeakMap now has frozen object key"); assert.isTrue(wm.has(sealedObj), "First WeakMap still has sealed object as key"); assert.isTrue(wm.has(frozenObj), "First WeakMap still has frozen object as key"); wm.delete(sealedObj); wm2.delete(frozenObj); assert.isTrue(wm2.has(sealedObj), "Second WeakMap still has sealed object key"); assert.isFalse(wm2.has(frozenObj), "Second WeakMap no longer has frozen object key"); assert.isFalse(wm.has(sealedObj), "First WeakMap no longer has sealed object as key"); assert.isTrue(wm.has(frozenObj), "First WeakMap still has frozen object as key"); } }, { name: "WeakMap internal property data is not copied by Object.assign", body: function () { var key1 = {}; var key2 = {}; var map = new WeakMap(); map.set(key1, 1); map.delete(Object.assign(key2, key1)); assert.isFalse(map.has(key2)); key1 = {}; key2 = {}; map = new WeakMap(); map.set(key1, 1); key1.a = 1; map.delete(Object.assign(key2, key1)); assert.isFalse(map.has(key2)); } } ]; testRunner.runTests(tests, { verbose: WScript.Arguments[0] != "summary" }); ```
```xml import { INTERNAL_LAYER_PREFIX } from '../../core/Constants'; import { isNil, isNumber, sign, removeFromArray, UID, isFunction } from '../../core/util'; import { lowerSymbolOpacity } from '../../core/util/style'; import Class from '../../core/Class'; import Eventable from '../../core/Eventable'; import Point from '../../geo/Point'; import Coordinate from '../../geo/Coordinate'; import { Marker, TextBox, LineString, Polygon, Circle, Ellipse, Sector, Rectangle } from '../'; import EditHandle from '../../renderer/edit/EditHandle'; import EditOutline from '../../renderer/edit/EditOutline'; import { loadFunctionTypes } from '../../core/mapbox'; import * as Symbolizers from '../../renderer/geometry/symbolizers'; import { GeometryEditOptionsType, GeometryEditSymbolType } from '../ext/Geometry.Edit'; const EDIT_STAGE_LAYER_PREFIX = INTERNAL_LAYER_PREFIX + '_edit_stage_'; type GeometryEvents = { 'symbolchange': any, // prevent _exeAndReset when dragging geometry in gl layers 'dragstart': any, 'dragend': any, 'positionchange shapechange': any, } function createHandleSymbol(markerType: string, opacity: number): GeometryEditSymbolType { return { 'markerType': markerType, 'markerFill': '#fff', 'markerLineColor': '#000', 'markerLineWidth': 2, 'markerWidth': 10, 'markerHeight': 10, 'opacity': opacity }; } const options: GeometryEditOptionsType = { //fix outline's aspect ratio when resizing 'fixAspectRatio': false, // geometry's symbol when editing 'symbol': null, 'removeVertexOn': 'contextmenu', //symbols of edit handles 'centerHandleSymbol': createHandleSymbol('ellipse', 1), 'vertexHandleSymbol': createHandleSymbol('square', 1), 'newVertexHandleSymbol': createHandleSymbol('square', 0.4), 'collision': false, 'collisionBufferSize': 0, 'vertexZIndex': 0, 'newVertexZIndex': 0 }; /** * * @english * Geometry editor used internally for geometry editing. * @category geometry * @protected * @extends Class * @mixes Eventable */ class GeometryEditor extends Eventable(Class) { //@internal _geometry: any; //@internal _originalSymbol: any //@internal _shadowLayer: any //@internal _shadow: any //@internal _geometryDraggble: boolean //@internal _history: any //@internal _historyPointer: any //@internal _editOutline: any //@internal _refreshHooks: Array<any> //@internal _updating: boolean editing: boolean; options: GeometryEditOptionsType; /** * @param {Geometry} geometry geometry to edit * @param {Object} [opts=null] options * @param {Object} [opts.symbol=null] symbol of being edited. */ constructor(geometry, opts: GeometryEditOptionsType) { super(opts); this._geometry = geometry; if (!this._geometry) { return; } } /** * * @english * Get map * @return {Map} map */ getMap(): any { return this._geometry.getMap(); } /** * * @english * Prepare to edit */ prepare(): void { const map = this.getMap(); if (!map) { return; } map.on('drawtopstart', this._refresh, this); /** * reserve the original symbol */ if (this.options['symbol']) { this._originalSymbol = this._geometry.getSymbol(); this._geometry.setSymbol(this.options['symbol']); } this._prepareEditStageLayer(); } //@internal _prepareEditStageLayer(): void { const layer = this._geometry.getLayer(); if (layer.options['renderer'] !== 'canvas') { // doesn't need shadow if it's webgl or gpu renderer return; } const map = this.getMap(); const uid = UID(); const shadowId = EDIT_STAGE_LAYER_PREFIX + uid + '_shadow'; this._shadowLayer = map.getLayer(shadowId); if (!this._shadowLayer) { const LayerType = layer.constructor; this._shadowLayer = new LayerType(shadowId); map.addLayer(this._shadowLayer); } } /** * * @english * Start to edit */ start(): void { if (!this._geometry || !this._geometry.getMap() || this._geometry.editing) { return; } this.editing = true; this.prepare(); const geometry = this._geometry; let shadow; const layer = this._geometry.getLayer(); const needShadow = layer.options['renderer'] === 'canvas'; this._geometryDraggble = geometry.options['draggable']; if (needShadow) { geometry.config('draggable', false); //edits are applied to a shadow of geometry to improve performance. shadow = geometry.copy(); shadow.setSymbol(geometry._getInternalSymbol()); //geometry copyeventgeometry, //geometryclick/dragging,. shadow.copyEventListeners(geometry); if (geometry._getParent()) { shadow.copyEventListeners(geometry._getParent()); } shadow._setEventTarget(geometry); //drag shadow by center handle instead. shadow.setId(null).config({ 'draggable': false }); this._shadow = shadow; geometry.hide(); } else if (geometry instanceof Marker) { geometry.config('draggable', true); } this._switchGeometryEvents('on'); if (geometry instanceof Marker || geometry instanceof Circle || geometry instanceof Rectangle || geometry instanceof Ellipse) { //ouline has to be added before shadow to let shadow on top of it, otherwise shadow's events will be overrided by outline this._createOrRefreshOutline(); } if (this._shadowLayer) { this._shadowLayer.bringToFront().addGeometry(shadow); } if (!(geometry instanceof Marker)) { this._createCenterHandle(); } else if (shadow) { shadow.config('draggable', true); shadow.on('dragend', this._onMarkerDragEnd, this); } if ((geometry instanceof Marker) && this.options['resize'] !== false) { this.createMarkerEditor(); } else if (geometry instanceof Circle) { this.createCircleEditor(); } else if (geometry instanceof Rectangle) { this.createEllipseOrRectEditor(); } else if (geometry instanceof Ellipse) { this.createEllipseOrRectEditor(); } else if (geometry instanceof Sector) { // TODO: createSectorEditor } else if ((geometry instanceof Polygon) || (geometry instanceof LineString)) { this.createPolygonEditor(); } } /** * * @english * Stop editing */ stop(): void { delete this._history; delete this._historyPointer; delete this._editOutline; this._switchGeometryEvents('off'); const map = this.getMap(); if (!map) { this.fire('remove'); return; } this._geometry.config('draggable', this._geometryDraggble); if (this._shadow) { delete this._shadow; delete this._geometryDraggble; this._geometry.show(); } if (this._shadowLayer) { this._shadowLayer.remove(); delete this._shadowLayer; } this._refreshHooks = []; if (this.options['symbol']) { this._geometry.setSymbol(this._originalSymbol); delete this._originalSymbol; } this.editing = false; this.fire('remove'); } /** * * @english * Whether the editor is editing * @return {Boolean} */ isEditing(): boolean { if (isNil(this.editing)) { return false; } return this.editing; } //@internal _getGeometryEvents(): GeometryEvents { return { 'symbolchange': this._onGeoSymbolChange, // prevent _exeAndReset when dragging geometry in gl layers 'dragstart': this._onDragStart, 'dragend': this._onDragEnd, 'positionchange shapechange': this._exeAndReset, }; } //@internal _switchGeometryEvents(oper: any): void { if (this._geometry) { const events = this._getGeometryEvents(); for (const p in events) { this._geometry[oper](p, events[p], this); } } } //@internal _onGeoSymbolChange(param: any): void { if (this._shadow) { this._shadow.setSymbol(param.target._getInternalSymbol()); } } //@internal _onMarkerDragEnd(): void { this._update('setCoordinates', this._shadow.getCoordinates().toArray()); } /** * * @english * create rectangle outline of the geometry * @private */ //@internal _createOrRefreshOutline(): any { const geometry = this._geometry; const outline = this._editOutline; if (!outline) { this._editOutline = new EditOutline(this, this.getMap()); this._addRefreshHook(this._createOrRefreshOutline); } let points = this._editOutline.points; if (geometry instanceof Marker) { this._editOutline.setPoints(geometry.getContainerExtent().toArray(points)); } else { const map = this.getMap(); const extent = geometry._getPrjExtent(); points = extent.toArray(points); points.forEach(c => map.prjToContainerPoint(c, null, c)); this._editOutline.setPoints(points); } return outline; } //@internal _createCenterHandle(): void { const map = this.getMap(); const symbol = this.options['centerHandleSymbol']; let shadow; const cointainerPoint = map.coordToContainerPoint(this._geometry.getCenter()); const handle = this.createHandle(cointainerPoint, { 'symbol': symbol, 'cursor': 'move', onDown: (): void => { if (this._shadow) { shadow = this._shadow.copy(); const symbol = lowerSymbolOpacity(shadow._getInternalSymbol(), 0.5); shadow.setSymbol(symbol).addTo(this._geometry.getLayer()); } }, onMove: (param): void => { const offset = param['coordOffset']; if (shadow) { shadow.translate(offset); } else { this._geometry.translate(offset); } }, onUp: (): void => { if (shadow) { const shadowFirst = shadow.getFirstCoordinate(); const first = this._geometry.getFirstCoordinate(); const offset = shadowFirst.sub(first); this._update('translate', offset); shadow.remove(); } } }); this._addRefreshHook((): void => { const center = this._geometry.getCenter(); handle.setContainerPoint(map.coordToContainerPoint(center)); }); } //@internal _createHandleInstance(containerPoint: any, opts: any): EditHandle { const map = this.getMap(); const symbol = loadFunctionTypes(opts['symbol'], (): any => { return [ map.getZoom(), { '{bearing}': map.getBearing(), '{pitch}': map.getPitch(), '{zoom}': map.getZoom() } ]; }); const removeVertexOn = this.options['removeVertexOn']; const handle = new EditHandle(this, map, { symbol, cursor: opts['cursor'], events: removeVertexOn as any }); handle.setContainerPoint(containerPoint); return handle; } createHandle(containerPoint: any, opts: any): EditHandle { if (!opts) { opts = {}; } const handle = this._createHandleInstance(containerPoint, opts); const me = this; function onHandleDragstart(param: any): boolean { this._updating = true; if (opts.onDown) { opts.onDown.call(me, param['containerPoint'], param); /** * * @english * change geometry shape start event, fired when drag to change geometry shape. * * @event Geometry#handledragstart * @type {Object} * @property {String} type - handledragstart * @property {Geometry} target - the geometry fires the event */ this._geometry.fire('handledragstart'); } return false; } function onHandleDragging(param: any): boolean { me._hideContext(); if (opts.onMove) { opts.onMove.call(me, param); /** * * @english * changing geometry shape event, fired when dragging to change geometry shape. * * @event Geometry#handledragging * @type {Object} * @property {String} type - handledragging * @property {Geometry} target - the geometry fires the event */ this._geometry.fire('handledragging'); } return false; } function onHandleDragEnd(ev: any): boolean { if (opts.onUp) { //run mouseup code for handle delete etc opts.onUp.call(me, ev); /** * changed geometry shape event, fired when drag end to change geometry shape. * * @event Geometry#handledragend * @type {Object} * @property {String} type - handledragend * @property {Geometry} target - the geometry fires the event */ this._geometry.fire('handledragend'); } this._updating = false; return false; } handle.on('dragstart', onHandleDragstart, this); handle.on('dragging', onHandleDragging, this); handle.on('dragend', onHandleDragEnd, this); // if (opts.onRefresh) { handle.refresh = opts.onRefresh; } return handle; } /** * * @english * create resize handles for geometry that can resize. * @param {Array} blackList handle indexes that doesn't display, to prevent change a geometry's coordinates * @param {fn} onHandleMove callback * @private */ //@internal _createResizeHandles(blackList: Array<any>, onHandleMove: any, onHandleUp: any): any { //cursor styles. const cursors = [ 'nw-resize', 'n-resize', 'ne-resize', 'w-resize', 'e-resize', 'sw-resize', 's-resize', 'se-resize' ]; //defines dragOnAxis of resize handle const axis = [ null, 'y', null, 'x', 'x', null, 'y', null ]; const geometry = this._geometry; //marker const isMarker = geometry instanceof Marker; function getResizeAnchors(): any { if (isMarker) { const ext = geometry.getContainerExtent(); return [ // ext.getMin(), new Point(ext['xmin'], ext['ymin']), new Point((ext['xmax'] + ext['xmin']) / 2, ext['ymin']), new Point(ext['xmax'], ext['ymin']), new Point(ext['xmin'], (ext['ymin'] + ext['ymax']) / 2), new Point(ext['xmax'], (ext['ymin'] + ext['ymax']) / 2), new Point(ext['xmin'], ext['ymax']), new Point((ext['xmax'] + ext['xmin']) / 2, ext['ymax']), new Point(ext['xmax'], ext['ymax']) ]; } const ext = geometry._getPrjExtent(); return [ // ext.getMin(), new Point(ext['xmin'], ext['ymax']), new Point((ext['xmax'] + ext['xmin']) / 2, ext['ymax']), new Point(ext['xmax'], ext['ymax']), new Point(ext['xmin'], (ext['ymax'] + ext['ymin']) / 2), new Point(ext['xmax'], (ext['ymax'] + ext['ymin']) / 2), new Point(ext['xmin'], ext['ymin']), new Point((ext['xmax'] + ext['xmin']) / 2, ext['ymin']), new Point(ext['xmax'], ext['ymin']), ]; } if (!blackList) { blackList = []; } const me = this; const resizeHandles = [], anchorIndexes = {}, map = this.getMap(), handleSymbol = this.options['vertexHandleSymbol']; const fnLocateHandles = (): void => { const anchors = getResizeAnchors(); for (let i = 0; i < anchors.length; i++) { //ignore anchors in blacklist if (Array.isArray(blackList)) { const isBlack = blackList.some(ele => ele === i); if (isBlack) { continue; } } const anchor = anchors[i], point = isMarker ? anchor : map.prjToContainerPoint(anchor); if (resizeHandles.length < (anchors.length - blackList.length)) { const handle = this.createHandle(point, { 'symbol': handleSymbol, 'cursor': cursors[i], 'axis': axis[i], onMove: (function (_index: number): any { return function (e: any): void { me._updating = true; onHandleMove(e.containerPoint, _index); geometry.fire('resizing'); }; })(i), onUp: (): void => { me._updating = false; onHandleUp(); } }); // handle.setId(i); anchorIndexes[i] = resizeHandles.length; resizeHandles.push(handle); } else { resizeHandles[anchorIndexes[i]].setContainerPoint(point); } } }; fnLocateHandles(); //refresh hooks to refresh handles' coordinates this._addRefreshHook(fnLocateHandles); return resizeHandles; } /** * * @english * Create marker editor * @private */ createMarkerEditor(): void { const geometryToEdit = this._shadow || this._geometry, map = this.getMap(); if (!geometryToEdit._canEdit()) { if (console) { console.warn('A marker can\'t be resized with symbol:', geometryToEdit.getSymbol()); } return; } if (!this._history) { this._recordHistory(getUpdates()); } //only image marker and vector marker can be edited now. const symbol = geometryToEdit._getInternalSymbol(); const dxdy = new Point(0, 0); if (isNumber(symbol['markerDx'])) { dxdy.x = symbol['markerDx']; } if (isNumber(symbol['markerDy'])) { dxdy.y = symbol['markerDy']; } let blackList = null; let verticalAnchor = 'middle'; let horizontalAnchor = 'middle'; if (Symbolizers.VectorMarkerSymbolizer.test(symbol)) { const type = symbol['markerType']; if (type === 'pin' || type === 'pie' || type === 'bar') { //as these types of markers' anchor stands on its bottom blackList = [5, 6, 7]; verticalAnchor = 'bottom'; } else if (type === 'rectangle') { blackList = [0, 1, 2, 3, 5]; verticalAnchor = 'top'; horizontalAnchor = 'left'; } } else if (Symbolizers.ImageMarkerSymbolizer.test(symbol) || Symbolizers.VectorPathMarkerSymbolizer.test(symbol)) { verticalAnchor = 'bottom'; blackList = [5, 6, 7]; } //defines what can be resized by the handle //0: resize width; 1: resize height; 2: resize both width and height. const resizeAbilities = [ 2, 1, 2, 0, 0, 2, 1, 2 ]; let aspectRatio; if (this.options['fixAspectRatio']) { const size = geometryToEdit.getSize(); aspectRatio = size.width / size.height; } const resizeHandles = this._createResizeHandles(blackList, (containerPoint: any, i: number): void => { if (blackList && blackList.indexOf(i) >= 0) { //need to change marker's coordinates const newCoordinates = map.containerPointToCoordinate(containerPoint.sub(dxdy)); const coordinates = geometryToEdit.getCoordinates(); newCoordinates.x = coordinates.x; geometryToEdit.setCoordinates(newCoordinates); this._updateCoordFromShadow(true); // geometryToEdit.setCoordinates(newCoordinates); //coordinates changed, and use mirror handle instead to caculate width and height const mirrorHandle = resizeHandles[resizeHandles.length - 1 - i]; const mirror = mirrorHandle.getContainerPoint(); containerPoint = mirror; } //caculate width and height const viewCenter = map.coordToContainerPoint(geometryToEdit.getCoordinates()).add(dxdy), symbol = geometryToEdit._getInternalSymbol(); const wh = containerPoint.sub(viewCenter); if (verticalAnchor === 'bottom' && containerPoint.y > viewCenter.y) { wh.y = 0; } //if this marker's anchor is on its bottom, height doesn't need to multiply by 2. const vr = verticalAnchor === 'middle' ? 2 : 1; const hr = horizontalAnchor === 'left' ? 1 : 2; let width = Math.abs(wh.x) * hr, height = Math.abs(wh.y) * vr; if (aspectRatio) { width = Math.max(width, height * aspectRatio); height = width / aspectRatio; } const ability = resizeAbilities[i]; if (!(geometryToEdit instanceof TextBox)) { if (aspectRatio || ability === 0 || ability === 2) { symbol['markerWidth'] = Math.min(width, this._geometry.options['maxMarkerWidth'] || Infinity); } if (aspectRatio || ability === 1 || ability === 2) { symbol['markerHeight'] = Math.min(height, this._geometry.options['maxMarkerHeight'] || Infinity); } geometryToEdit.setSymbol(symbol); if (geometryToEdit !== this._geometry) { this._geometry.setSymbol(symbol); } } else { if (aspectRatio || ability === 0 || ability === 2) { geometryToEdit.setWidth(width); if (geometryToEdit !== this._geometry) { this._geometry.setWidth(width); } } if (aspectRatio || ability === 1 || ability === 2) { geometryToEdit.setHeight(height); if (geometryToEdit !== this._geometry) { this._geometry.setHeight(height); } } } }, (): void => { this._update(getUpdates()); }); function getUpdates(): any { const updates = [ ['setCoordinates', geometryToEdit.getCoordinates().toArray()] ]; if (geometryToEdit instanceof TextBox) { updates.push(['setWidth', geometryToEdit.getWidth()]); updates.push(['setHeight', geometryToEdit.getHeight()]); } else { updates.push(['setSymbol', geometryToEdit.getSymbol()]); } return updates; } } /** * * @english * Create circle editor * @private */ createCircleEditor(): void { const geo = this._shadow || this._geometry; const map = this.getMap(); if (!this._history) { this._recordHistory([ ['setCoordinates', geo.getCoordinates().toArray()], ['setRadius', geo.getRadius()] ]); } this._createResizeHandles(null, handleContainerPoint => { const center = geo.getCenter(); const mouseCoordinate = map.containerPointToCoord(handleContainerPoint); const wline = new LineString([[center.x, center.y], [mouseCoordinate.x, center.y]]); const hline = new LineString([[center.x, center.y], [center.x, mouseCoordinate.y]]); const r = Math.max(map.computeGeometryLength(wline), map.computeGeometryLength(hline)); geo.setRadius(r); if (geo !== this._geometry) { this._geometry.setRadius(r); } }, (): void => { this._update('setRadius', geo.getRadius()); }); } /** * * @english * editor of ellipse or rectangle * @private */ createEllipseOrRectEditor(): void { //defines what can be resized by the handle //0: resize width; 1: resize height; 2: resize both width and height. const resizeAbilities = [ 2, 1, 2, 0, 0, 2, 1, 2 ]; const geometryToEdit = this._shadow || this._geometry; if (!this._history) { this._recordHistory(getUpdates()); } const map = this.getMap(); const isRect = this._geometry instanceof Rectangle; let aspectRatio; if (this.options['fixAspectRatio']) { aspectRatio = geometryToEdit.getWidth() / geometryToEdit.getHeight(); } const resizeHandles = this._createResizeHandles(null, (mouseContainerPoint: any, i: number): void => { //ratio of width and height const r = isRect ? 1 : 2; let pointSub, w, h; const handle = resizeHandles[i]; const targetPoint = handle.getContainerPoint(); //mouseContainerPoint; const ability = resizeAbilities[i]; if (isRect) { const mirror = resizeHandles[7 - i]; const mirrorContainerPoint = mirror.getContainerPoint(); pointSub = targetPoint.sub(mirrorContainerPoint); const absSub = pointSub.abs(); w = map.pixelToDistance(absSub.x, 0); h = map.pixelToDistance(0, absSub.y); const size = geometryToEdit.getSize(); const geoCoord = geometryToEdit.getCoordinates(); const width = geometryToEdit.getWidth(); const height = geometryToEdit.getHeight(); const mouseCoordinate = map.containerPointToCoord(mouseContainerPoint); const mirrorCoordinate = map.containerPointToCoord(mirrorContainerPoint); const wline = new LineString([[mirrorCoordinate.x, mirrorCoordinate.y], [mouseCoordinate.x, mirrorCoordinate.y]]); const hline = new LineString([[mirrorCoordinate.x, mirrorCoordinate.y], [mirrorCoordinate.x, mouseCoordinate.y]]); //fix distance cal error w = map.computeGeometryLength(wline); h = map.computeGeometryLength(hline); if (ability === 0) { // changing width // - - - // 0 0 // - - - // Rectangle's northwest's y is (y - height / 2) if (aspectRatio) { // update rectangle's height with aspect ratio absSub.y = absSub.x / aspectRatio; size.height = Math.abs(absSub.y); h = w / aspectRatio; } targetPoint.y = mirrorContainerPoint.y - size.height / 2; mouseCoordinate.y = geoCoord.y; if (i === 4) { mouseCoordinate.x = Math.min(mouseCoordinate.x, geoCoord.x); } else { // use locate instead of containerPoint to fix precision problem const mirrorCoord = map.locate(geoCoord, width, 0); mouseCoordinate.x = map.locate(new Coordinate(mirrorCoord.x, mouseCoordinate.y), -w, 0).x; } } else if (ability === 1) { // changing height // - 1 - // | | // - 1 - // Rectangle's northwest's x is (x - width / 2) if (aspectRatio) { // update rectangle's width with aspect ratio absSub.x = absSub.y * aspectRatio; size.width = Math.abs(absSub.x); w = h * aspectRatio; } targetPoint.x = mirrorContainerPoint.x - size.width / 2; mouseCoordinate.x = geoCoord.x; mouseCoordinate.y = Math.max(mouseCoordinate.y, mirrorCoordinate.y); } else { // corner handles, relocate the target point according to aspect ratio. if (aspectRatio) { if (w > h * aspectRatio) { h = w / aspectRatio; targetPoint.y = mirrorContainerPoint.y + absSub.x * sign(pointSub.y) / aspectRatio; } else { w = h * aspectRatio; targetPoint.x = mirrorContainerPoint.x + absSub.y * sign(pointSub.x) * aspectRatio; } } // anchor at northwest and south west if (i === 0 || i === 5) { // use locate instead of containerPoint to fix precision problem const mirrorCoord = i === 0 ? map.locate(geoCoord, width, 0) : map.locate(geoCoord, width, -height); mouseCoordinate.x = map.locate(new Coordinate(mirrorCoord.x, mouseCoordinate.y), -w, 0).x; } else { mouseCoordinate.x = Math.min(mouseCoordinate.x, mirrorCoordinate.x); } mouseCoordinate.y = Math.max(mouseCoordinate.y, mirrorCoordinate.y); } //change rectangle's coordinates // const newCoordinates = map.viewPointToCoordinate(new Point(Math.min(targetPoint.x, mirrorContainerPoint.x), Math.min(targetPoint.y, mirrorContainerPoint.y))); geometryToEdit.setCoordinates(mouseCoordinate); this._updateCoordFromShadow(true); // geometryToEdit.setCoordinates(newCoordinates); } else { // const viewCenter = map.coordToViewPoint(geometryToEdit.getCenter()); // pointSub = viewCenter.sub(targetPoint)._abs(); // w = map.pixelToDistance(pointSub.x, 0); // h = map.pixelToDistance(0, pointSub.y); // if (aspectRatio) { // w = Math.max(w, h * aspectRatio); // h = w / aspectRatio; // } const center = geometryToEdit.getCenter(); const mouseCoordinate = map.containerPointToCoord(targetPoint); const wline = new LineString([[center.x, center.y], [mouseCoordinate.x, center.y]]); const hline = new LineString([[center.x, center.y], [center.x, mouseCoordinate.y]]); w = map.computeGeometryLength(wline); h = map.computeGeometryLength(hline); if (aspectRatio) { w = Math.max(w, h * aspectRatio); h = w / aspectRatio; } } if (aspectRatio || ability === 0 || ability === 2) { geometryToEdit.setWidth(w * r); if (geometryToEdit !== this._geometry) { this._geometry.setWidth(w * r); } } if (aspectRatio || ability === 1 || ability === 2) { geometryToEdit.setHeight(h * r); if (geometryToEdit !== this._geometry) { this._geometry.setHeight(h * r); } } }, (): void => { this._update(getUpdates()); }); function getUpdates(): object { return [ ['setCoordinates', geometryToEdit.getCoordinates().toArray()], ['setWidth', geometryToEdit.getWidth()], ['setHeight', geometryToEdit.getHeight()] ]; } } /** * * @english * Editor for polygon * @private */ createPolygonEditor(): void { const map = this.getMap(), geoToEdit = this._shadow || this._geometry, me = this; if (!this._history) { this._recordHistory('setCoordinates', Coordinate.toNumberArrays(geoToEdit.getCoordinates())); } const verticeLimit = geoToEdit instanceof Polygon ? 3 : 2; const propertyOfVertexIndex = 'maptalks--editor-vertex-index'; const { vertexZIndex, newVertexZIndex } = this.options; //{ ringIndex:ring } const vertexHandles = { 0: [] }, newVertexHandles = { 0: [] }; // function getVertexCoordinates(ringIndex: any = 0): any { if (geoToEdit instanceof Polygon) { const coordinates = geoToEdit.getCoordinates()[ringIndex] || []; return coordinates.slice(0, coordinates.length - 1); } else { return geoToEdit.getCoordinates(); } } function getVertexPrjCoordinates(ringIndex: number = 0): any { if (ringIndex === 0) { return geoToEdit._getPrjCoordinates(); } return geoToEdit._getPrjHoles()[ringIndex - 1]; } function onVertexAddOrRemove(): void { //restore index property of each handles. for (const ringIndex in vertexHandles) { for (let i = vertexHandles[ringIndex].length - 1; i >= 0; i--) { vertexHandles[ringIndex][i][propertyOfVertexIndex] = i; } for (let i = newVertexHandles[ringIndex].length - 1; i >= 0; i--) { newVertexHandles[ringIndex][i][propertyOfVertexIndex] = i; } } me._updateCoordFromShadow(); } function removeVertex(param: any): void { me._updating = true; const handle = param['target'], index = handle[propertyOfVertexIndex]; const ringIndex = isNumber(handle._ringIndex) ? handle._ringIndex : 0; const prjCoordinates = getVertexPrjCoordinates(ringIndex); if (prjCoordinates.length <= verticeLimit) { return; } const isEnd = (geoToEdit instanceof LineString) && (index === 0 || index === prjCoordinates.length - 1); prjCoordinates.splice(index, 1); if (ringIndex > 0) { //update hole prj geoToEdit._prjHoles[ringIndex - 1] = prjCoordinates; } else { //update shell prj geoToEdit._setPrjCoordinates(prjCoordinates); } geoToEdit._updateCache(); //remove vertex handle vertexHandles[ringIndex].splice(index, 1)[0].delete(); //remove two neighbor "new vertex" handles if (index < newVertexHandles[ringIndex].length) { newVertexHandles[ringIndex].splice(index, 1)[0].delete(); } let nextIndex; if (index === 0) { nextIndex = newVertexHandles[ringIndex].length - 1; } else { nextIndex = index - 1; } newVertexHandles[ringIndex].splice(nextIndex, 1)[0].delete(); if (!isEnd) { //add a new "new vertex" handle. newVertexHandles[ringIndex].splice(nextIndex, 0, createNewVertexHandle.call(me, nextIndex, ringIndex)); } if (ringIndex > 0) { const coordiantes = geoToEdit.getCoordinates(); //fix hole Vertex delete const ring = coordiantes[ringIndex]; if (ring && Array.isArray(ring) && ring.length > 1) { ring.splice(index, 1); //update shadow coordinates if (geoToEdit !== this._geometry) { geoToEdit.setCoordinates(coordiantes); } } } onVertexAddOrRemove(); me._updating = false; /** * changed geometry shape event, fired when edit control vertex remove * * @event Geometry#handleremove * @type {Object} * @property {String} type - handleremove * @property {Geometry} target - the geometry fires the event */ me._geometry.fire('handleremove', Object.assign({}, param, { coordinate: map.containerPointToCoordinate(param.containerPoint), vertex: param.target })); } function moveVertexHandle(handleConatainerPoint: any, index: number, ringIndex: number = 0): void { //for adsorption effect const snapTo = me._geometry.snapTo; if (snapTo && isFunction(snapTo)) { handleConatainerPoint = me._geometry.snapTo(handleConatainerPoint) || handleConatainerPoint; } const vertice = getVertexPrjCoordinates(ringIndex); const nVertex = map._containerPointToPrj(handleConatainerPoint.sub(getDxDy())); const pVertex = vertice[index]; pVertex.x = nVertex.x; pVertex.y = nVertex.y; geoToEdit._updateCache(); geoToEdit.onShapeChanged(); me._updateCoordFromShadow(true); let nextIndex; if (index === 0) { nextIndex = newVertexHandles[ringIndex].length - 1; } else { nextIndex = index - 1; } //refresh two neighbor "new vertex" handles. if (newVertexHandles[ringIndex][index]) { newVertexHandles[ringIndex][index].refresh(); } if (newVertexHandles[ringIndex][nextIndex]) { newVertexHandles[ringIndex][nextIndex].refresh(); } } const hanldeDxdy = new Point(0, 0); function getDxDy(): any { const compiledSymbol = geoToEdit._getCompiledSymbol(); hanldeDxdy.x = compiledSymbol.lineDx || 0; hanldeDxdy.y = compiledSymbol.lineDy || 0; return hanldeDxdy; } function createVertexHandle(index: number, ringIndex: number = 0, ringCoordinates: any) { //not get geometry coordiantes when ringCoordinates is not null //vertexgeometrycoordinatesvertexringCoordinates let vertex = (ringCoordinates || getVertexCoordinates(ringIndex))[index]; const handle = me.createHandle(map.coordToContainerPoint(vertex)._add(getDxDy()), { 'symbol': me.options['vertexHandleSymbol'], 'cursor': 'pointer', 'axis': null, onMove: function () { moveVertexHandle(handle.getContainerPoint(), handle[propertyOfVertexIndex], ringIndex); }, onRefresh: function (rIndex, ringCoordinates) { vertex = (ringCoordinates || getVertexCoordinates(ringIndex))[handle[propertyOfVertexIndex]]; const containerPoint = map.coordToContainerPoint(vertex); handle.setContainerPoint(containerPoint._add(getDxDy())); }, onUp: function () { me._updateCoordFromShadow(); }, onDown: function (param, e) { if (e && e.domEvent && e.domEvent.button === 2) { return; } } }); handle[propertyOfVertexIndex] = index; handle._ringIndex = ringIndex; handle.on(me.options['removeVertexOn'], removeVertex); handle.setZIndex(vertexZIndex); return handle; } let pauseRefresh = false; function createNewVertexHandle(index: number, ringIndex: number = 0, ringCoordinates: any): any { let vertexCoordinates = ringCoordinates || getVertexCoordinates(ringIndex); let nextVertex; if (index + 1 >= vertexCoordinates.length) { nextVertex = vertexCoordinates[0]; } else { nextVertex = vertexCoordinates[index + 1]; } const vertex = vertexCoordinates[index].add(nextVertex).multi(1 / 2); const handle = me.createHandle(vertex, { 'symbol': me.options['newVertexHandleSymbol'], 'cursor': 'pointer', 'axis': null, onDown: function (param: any, e: any): any { if (e && e.domEvent && e.domEvent.button === 2) { return; } const prjCoordinates = getVertexPrjCoordinates(ringIndex); const vertexIndex = handle[propertyOfVertexIndex]; //add a new vertex const cp = handle.getContainerPoint(); const pVertex = map._containerPointToPrj(cp); //update shadow's vertice prjCoordinates.splice(vertexIndex + 1, 0, pVertex); if (ringIndex > 0) { //update hole geoToEdit._prjHoles[ringIndex - 1] = prjCoordinates; } else { geoToEdit._setPrjCoordinates(prjCoordinates); } geoToEdit._updateCache(); handle.opacity = 1; //add two "new vertex" handles newVertexHandles[ringIndex].splice(vertexIndex, 0, createNewVertexHandle.call(me, vertexIndex, ringIndex), createNewVertexHandle.call(me, vertexIndex + 1, ringIndex)); pauseRefresh = true; }, onMove: function (): void { moveVertexHandle(handle.getContainerPoint(), handle[propertyOfVertexIndex] + 1, ringIndex); }, onUp: function (e: any): void { if (e && e.domEvent && e.domEvent.button === 2) { pauseRefresh = false; return; } const vertexIndex = handle[propertyOfVertexIndex]; //remove this handle removeFromArray(handle, newVertexHandles[ringIndex]); handle.delete(); //add a new vertex handle vertexHandles[ringIndex].splice(vertexIndex + 1, 0, createVertexHandle.call(me, vertexIndex + 1, ringIndex)); onVertexAddOrRemove(); me._updateCoordFromShadow(); pauseRefresh = false; }, onRefresh: function (rIndex, ringCoordinates) { vertexCoordinates = ringCoordinates || getVertexCoordinates(rIndex); const vertexIndex = handle[propertyOfVertexIndex]; let nextIndex; if (vertexIndex === vertexCoordinates.length - 1) { nextIndex = 0; } else { nextIndex = vertexIndex + 1; } const refreshVertex = vertexCoordinates[vertexIndex].add(vertexCoordinates[nextIndex]).multi(1 / 2); const containerPoint = map.coordToContainerPoint(refreshVertex); handle.setContainerPoint(containerPoint._add(getDxDy())); } }); handle[propertyOfVertexIndex] = index; handle.setZIndex(newVertexZIndex); return handle; } if (geoToEdit instanceof Polygon) { const rings = geoToEdit.getHoles().length + 1; for (let ringIndex = 0; ringIndex < rings; ringIndex++) { vertexHandles[ringIndex] = []; newVertexHandles[ringIndex] = []; const vertexCoordinates = getVertexCoordinates(ringIndex); for (let i = 0, len = vertexCoordinates.length; i < len; i++) { //reuse vertexCoordinates vertexHandles[ringIndex].push(createVertexHandle.call(this, i, ringIndex, vertexCoordinates)); if (i < len - 1) { //reuse vertexCoordinates newVertexHandles[ringIndex].push(createNewVertexHandle.call(this, i, ringIndex, vertexCoordinates)); } } //1 more vertex handle for polygon newVertexHandles[ringIndex].push(createNewVertexHandle.call(this, vertexCoordinates.length - 1, ringIndex, vertexCoordinates)); } } else { const ringIndex = 0; const vertexCoordinates = getVertexCoordinates(ringIndex); for (let i = 0, len = vertexCoordinates.length; i < len; i++) { vertexHandles[ringIndex].push(createVertexHandle.call(this, i, ringIndex, vertexCoordinates)); if (i < len - 1) { newVertexHandles[ringIndex].push(createNewVertexHandle.call(this, i, ringIndex, vertexCoordinates)); } } if (newVertexHandles[ringIndex].length && geoToEdit.getCoordinates().length === 2) { newVertexHandles[ringIndex][0].options.symbol['markerDx'] = 12; } } const renderer = map.getRenderer(); if (renderer) { renderer.sortTopElements(); } this._addRefreshHook((): void => { if (pauseRefresh) { return; } for (const ringIndex in newVertexHandles) { const ringCoordinates = getVertexCoordinates(ringIndex); for (let i = newVertexHandles[ringIndex].length - 1; i >= 0; i--) { //reuse ringCoordinates newVertexHandles[ringIndex][i].refresh(ringIndex, ringCoordinates); } } if (newVertexHandles[0].length && geoToEdit instanceof LineString) { if (geoToEdit.getCoordinates().length === 2) { newVertexHandles[0][0].options.symbol['markerDx'] = 12; } else if (geoToEdit.getCoordinates().length > 2) { newVertexHandles[0][0].options.symbol['markerDx'] = 0; } } for (const ringIndex in vertexHandles) { const ringCoordinates = getVertexCoordinates(ringIndex); for (let i = vertexHandles[ringIndex].length - 1; i >= 0; i--) { //reuse ringCoordinates vertexHandles[ringIndex][i].refresh(ringIndex, ringCoordinates); } } }); } //@internal _refresh(): void { if (this._refreshHooks) { for (let i = this._refreshHooks.length - 1; i >= 0; i--) { this._refreshHooks[i].call(this); } } } //@internal _hideContext(): void { if (this._geometry) { this._geometry.closeMenu(); this._geometry.closeInfoWindow(); } } //@internal _addRefreshHook(fn: any): void { if (!fn) { return; } if (!this._refreshHooks) { this._refreshHooks = []; } this._refreshHooks.push(fn); } //@internal _update(method: any, ...args: any): void { this._exeHistory([method, args]); this._recordHistory(method, ...args); } //@internal _updateCoordFromShadow(ignoreRecord?: any): void { const geoToEdit = this._shadow || this._geometry; const coords = geoToEdit.getCoordinates(); const geo = this._geometry; const updating = this._updating; this._updating = true; geo.setCoordinates(coords); if (!ignoreRecord) { this._recordHistory('setCoordinates', Coordinate.toNumberArrays(geo.getCoordinates())); } this._updating = updating; } //@internal _recordHistory(method: any, ...args: any): void { if (!this._history) { this._history = []; this._historyPointer = 0; } if (this._history.length) { const lastOperation = this._history[this._history.length - 1]; if (lastOperation[0] === method && JSON.stringify(lastOperation[1]) === JSON.stringify(args)) { return; } } if (this._historyPointer < this._history.length - 1) { // remove old 'next views' this._history.splice(this._historyPointer + 1); } this._history.push([method, args]); this._historyPointer = this._history.length - 1; /** * * @english * edit record event, fired when an edit happend and being recorded * * @event Geometry#editrecord * @type {Object} * @property {String} type - editrecord * @property {Geometry} target - the geometry fires the event */ this._geometry.fire('editrecord'); } cancel(): GeometryEditor { if (!this._history || this._historyPointer === 0) { return this; } this._historyPointer = 0; const record = this._history[0]; this._exeAndReset(record); return this; } /** * * @english * Get previous map view in view history * @return {Object} map view */ undo(): any { if (!this._history || this._historyPointer === 0) { return this; } const record = this._history[--this._historyPointer]; this._exeAndReset(record); return this; } /** * * @english * Get next view in view history * @return {Object} map view */ redo(): any { if (!this._history || this._historyPointer === this._history.length - 1) { return this; } const record = this._history[++this._historyPointer]; this._exeAndReset(record); return this; } //@internal _exeAndReset(record: any): void { if (this._updating) { return; } this._exeHistory(record); const history = this._history, pointer = this._historyPointer; this.stop(); this._history = history; this._historyPointer = pointer; this.start(); } //@internal _onDragStart(): void { this._updating = true; } //@internal _onDragEnd(): void { this._updating = false; } //@internal _exeHistory(record: any): void { if (!Array.isArray(record)) { return; } const updating = this._updating; this._updating = true; const geoToEdit = this._shadow || this._geometry; const geo = this._geometry; if (Array.isArray(record[0])) { record[0].forEach(o => { const m = o[0], args = o.slice(1); geoToEdit[m].call(geoToEdit, ...args); if (geoToEdit !== geo) { geo[m].call(geo, ...args); } }); } else { geoToEdit[record[0]].call(geoToEdit, ...record[1]); if (geoToEdit !== geo) { geo[record[0]].call(geo, ...record[1]); } } this._updating = updating; } } GeometryEditor.mergeOptions(options); export default GeometryEditor; ```
Mulligan's is a pub in Dublin, Ireland which opened on Poolbeg Street in 1854. History The first Mulligan's was established on Thomas Street, Dublin in 1782. The Mulligan family moved their business to several different premises, before leasing the present building in 1854 at 8/9 Poolbeg Street, Dublin 2. Mick Smyth bought the pub from John Mulligan in 1932. Ownership later passed to Smyth's nephews, Con and Tommy Cusack, before passing to Tommy Cusack's sons. The former Theatre Royal in Hawkins Street was near Mulligan's, and the pub walls are decorated with associated posters, photographs, and showbills dating back to the early nineteenth century, as well as an autographed photograph of Judy Garland, who performed in the theatre and drank at the pub. The pub is mentioned briefly in James Joyce's short story, Counterparts, and was used as a filming location on a number of occasions. Journalists and writers drank at Mulligan's during the twentieth century, including staff from the Irish Times and from the former Irish Press newspaper - which operated next door until the collapse of the paper in 1995. A number of Dublin musicians also drank there, as several music industry management offices were in the nearby Corn Exchange Building. In his 1969 book Irish Pubs of Character, Roy Bulson describes the establishment thus: "The license is one of the oldest in Dublin, dating from 1782. The late President of the U.S., John F Kennedy, called in for a drink and since then many other famous people have enjoyed a pint which is one of the best in Dublin. There are three bars, all with a genuine old-time atmosphere. As Mulligan's was across from the stage door of the old Theatre Royal, various theatre posters of this period can be seen. The hosts are very friendly and you will be sure of a warm welcome. Television is available." An American tourist named Billy Brooks Carr, for whom Mulligan's was one of his "favourite places to visit in Ireland", reputedly requested that his ashes be kept in the pub's grandfather clock. See also List of pubs in Dublin References Sources Pubs in Dublin (city) Tourist attractions in Dublin (city)
On 2 November 1963, Ngô Đình Diệm, the president of South Vietnam, was arrested and assassinated in a successful CIA-backed coup d'état led by General Dương Văn Minh. The coup was the culmination of nine years of autocratic and nepotistic family rule in the country. Discontent with the Diệm regime had been simmering below the surface and culminated with mass Buddhist protests against longstanding religious discrimination after the government shooting of protesters who defied a ban on the flying of the Buddhist flag. The Army of the Republic of Vietnam (ARVN) had launched a bloody overnight siege on Gia Long Palace in Saigon. When rebel forces entered the palace, Diệm and his adviser and younger brother Ngô Đình Nhu were not present, having escaped to a loyalist shelter in Cholon. The brothers had kept in communication with the rebels through a direct link from the shelter to the palace, and misled them into believing that they were still in the palace. The Ngô brothers soon agreed to surrender and were promised safe exile; after being arrested, they were instead executed in the back of an armoured personnel carrier by ARVN officers on the journey back to military headquarters near Tân Sơn Nhứt Air Base. While no formal inquiry was conducted, the responsibility for the deaths of the Ngô brothers is commonly placed on Minh's bodyguard, Captain Nguyễn Văn Nhung and on Major Dương Hiếu Nghĩa, both of whom guarded the brothers during the trip. Minh's army colleagues and US officials in Saigon agreed that Minh ordered the executions. They postulated various motives, including that the brothers had embarrassed Minh by fleeing the Gia Long Palace, and that the brothers were killed to prevent a later political comeback. The generals initially attempted to cover up the execution by suggesting that the brothers had committed suicide, but this was contradicted when photos of the Ngôs' corpses surfaced in the media. Background Diệm's political career began in July 1954, when he was appointed the Prime Minister of the State of Vietnam by former Emperor Bảo Đại, who was Head of State. At the time, Vietnam had been partitioned at the Geneva Conference after the defeat of the French Union forces at the Battle of Dien Bien Phu, with the State of Vietnam ruling the country south of the 17th parallel north. The partition was intended to be temporary, with national elections scheduled for 1956 to create a government of a reunified nation. In the meantime, Diệm and Bảo Đại were locked in a power struggle. Bảo Đại disliked Diệm but selected him in the hope that he would attract American aid. The issue was brought to a head when Diệm scheduled a referendum for October 1955 on whether South Vietnam should become a republic. Diệm won the rigged referendum and proclaimed himself the President of the newly created Republic of Vietnam. Diệm refused to hold the reunification elections, on the basis that the State of Vietnam was not a signatory to the Geneva Accords. He then proceeded to strengthen his autocratic and nepotistic rule over the country. A constitution was written by a rubber stamp legislature which gave Diệm the power to create laws by decree and arbitrarily give himself emergency powers. Dissidents, both communist and nationalist, were jailed and executed in the thousands and elections were routinely rigged. Opposition candidates were threatened with being charged for conspiring with the Viet Cong, which carried the death penalty, and in many areas, large numbers of ARVN troops were sent to stuff ballot boxes. Diệm kept the control of the nation firmly within the hands of his brothers and their in-laws and promotions in the ARVN were given on the basis of religion and loyalty rather than merit. Two unsuccessful attempts had been made to depose Diệm. In 1960 the uprising of the paratroopers was suppressed. Diem was trapped in his palace, but he managed to buy time with promises of negotiations and concessions until two ARVN divisions arrived in the capital and put down the rebellion. In 1962 two pilots of the Republic of Vietnam Air Force dropped bombs on the presidential palace, but Diem was not injured in the explosions. South Vietnam's Buddhist majority had long been discontented with Diệm's strong favoritism towards Catholics. Public servants and army officers had long been promoted on the basis of religious preference, and government contracts, US economic assistance, business favors and tax concessions were preferentially given to Catholics. The Catholic Church was the largest landowner in the country, and its holdings were exempt from land reform. In the countryside, Catholics were de facto exempt from performing corvée labour. Discontent with Diệm and Nhu exploded into mass protest during the summer of 1963 when nine Buddhists died at the hand of Diệm's army and police on Vesak, the birthday of Gautama Buddha. In May 1963, a law against the flying of religious flags was selectively invoked; the Buddhist flag was banned from display on Vesak while the Vatican flag was displayed to celebrate the anniversary of the consecration of Archbishop Pierre Martin Ngô Đình Thục, Diệm's elder brother. The Buddhists defied the ban and a protest was ended when government forces opened fire. With Diệm remaining intransigent in the face of escalating Buddhist demands for religious equality, sections of society began calling for his removal from power. The key turning point came shortly after midnight on 21 August, when Nhu's Special Forces raided and vandalised Buddhist pagodas across the country, arresting thousands of monks and causing a death toll estimated to be in the hundreds. Numerous coup plans had been explored by the army before, but the plotters intensified their activities with increased confidence after the administration of US President John F. Kennedy authorised the US embassy to explore the possibility of a leadership change. Surrender and debate At 13:30 on 1 November, Generals Dương Văn Minh and Trần Văn Đôn, respectively the Presidential Military Adviser and Army Chief of Staff, led a coup against Diệm. The rebels had carefully devised plans to neutralise loyalist officers to prevent them from saving Diệm. Unknown to Diệm, General Đính, the supposed loyalist who commanded the ARVN III Corps that surrounded the Saigon area, had allied himself with the plotters of the coup. The second of Diệm's most trusted loyalist generals was Huỳnh Văn Cao, who commanded the IV Corps in the Mekong Delta. Diệm and Nhu were aware of the coup plan, and Nhu responded by planning a counter-coup, which he called Operation Bravo. This plan involved Đính and Colonel Tung, the loyalist commander of the Special Forces, staging a phony rebellion before their forces crushed the "uprising" to reaffirm the power of the Ngô family. Unaware that Đính was plotting against him, Nhu allowed Đính to organise troops as he saw fit, and Đính transferred the command of the 7th Division based at Mỹ Tho from Cao's IV Corps to his own III Corps. This allowed Colonel Nguyễn Hữu Có, Đính's deputy, to take command of the 7th Division. The transfer allowed the rebels to completely encircle the capital and denied Cao the opportunity of storming Saigon and protecting Diệm, as he had done during the previous coup attempt in 1960. Minh and Đôn had invited senior Saigon based officers to a meeting at the headquarters of the Joint General Staff (JGS), on the pretext of routine business. Instead, they announced that a coup was underway, with only a few, including Tung, refusing to join. Tung was later forced at gunpoint to order his loyalist Special Forces to surrender. The coup went smoothly as the rebels quickly captured all key installations in Saigon and sealed incoming roads to prevent loyalist forces from entering. This left only the Presidential Guard to defend Gia Long Palace. The rebels attacked government and loyalist army buildings but delayed the attack on the palace, hoping that Diệm would resign and accept the offer of safe passage and exile. Diệm refused, vowing to reassert his control. After sunset, the 5th Division of Colonel Nguyễn Văn Thiệu, who later became the nation's president, led an assault on Gia Long Palace and it fell by daybreak. In the early morning of 2 November, Diệm agreed to surrender. The ARVN officers had intended to exile Diệm and Nhu, having promised the Ngô brothers safe passage out of the country. At 06:00, just before dawn, the officers held a meeting at JGS headquarters to discuss the fate of the Ngô brothers. According to Lucien Conein, the US Army and CIA officer who was the American liaison with the coup, most of the officers, including Minh, wanted Diệm to have an "honorable retirement" from office, followed by exile. Not all of the senior officers attended the meeting, with some having already left to make arrangements for the arrival of Diệm and Nhu at JGS headquarters. General Lê, a former police chief under Diệm in the mid-1950s, strongly lobbied for Diệm's execution. There was no formal vote taken at the meeting, and Lê attracted only minority support. One general was reported to have said "To kill weeds, you must pull them up at the roots". Conein reported that the generals had never indicated that assassination was in their minds, since an orderly transition of power was a high priority in achieving their ultimate aim of gaining international recognition. Minh and Đôn asked Conein to secure an American aircraft to take the brothers out of the country. Two days earlier, US Ambassador to South Vietnam, Henry Cabot Lodge Jr., had alerted Washington that such a request was likely and recommended Saigon as the departure point. This request put the Kennedy administration in a difficult position, as the provision of an airplane would publicly tie it to the coup. When Conein telephoned David Smith, the acting chief of the Saigon CIA station, there was a ten-minute delay. The US government would not allow the aircraft to land in any country, unless that state was willing to grant asylum to Diệm. The United States did not want Diệm and Nhu to form a government in exile and wanted them far away from Vietnam. Assistant Secretary of State Roger Hilsman had written in August that "under no circumstances should the Ngô brothers be permitted to remain in Southeast Asia in close proximity to Vietnam because of the plots they will mount to try to regain power. If the generals decide to exile Diệm, he should also be sent outside Southeast Asia." He further went on to anticipate what he termed a "Götterdämmerung in the palace". After surrendering, Diệm called Lodge by telephone for the last time. Lodge did not report the conversation to Washington, so it was widely assumed that the pair last spoke on the previous afternoon when the coup was just starting. However, after Lodge died in 1985, his aide, Colonel Mike Dunn said that Lodge and Diệm spoke for the last time around 07:00 on 2 November moments after Diệm surrendered. When Diệm called, Lodge "put [him] on hold" and then walked away. Upon his return, the ambassador offered Diệm and Nhu asylum, but would not arrange for transportation to the Philippines until the next day. This contradicted his earlier offer of asylum the previous day when he implored Diệm to not resist the coup. Dunn offered to personally go to the brothers' hideout to escort him so that the generals could not kill him, but Lodge refused, saying, "We just can't get that involved." Dunn said, "I was really astonished that we didn't do more for them." Having refused to help the brothers to leave the country safely, Lodge later said after they had been shot, "What would we have done with them if they had lived? Every Colonel Blimp in the world would have made use of them." Dunn also claimed that Lodge put Diệm on hold in order to inform Conein where the Ngô brothers were so the generals could capture them. When confronted about Dunn's claim by a historian, Conein denied the account. It was also revealed that Conein had phoned the embassy early on the same morning to inquire about the generals' request for a plane to transport Diệm and Nhu out of Saigon. One of Lodge's staff told Conein that the plane would have to go directly to the faraway asylum-offering country, so that the brothers could not disembark at a nearby stopover country and stay there to foment a counter-coup. Conein was told that the nearest plane that was capable of such a long range flight was in Guam, and it would take 24 hours to make the necessary arrangements. Minh was astounded and told Conein that the generals could not hold Diệm for that period. Conein did not suspect a deliberate delay by the American embassy. In contrast, a US Senate investigative commission in the early 1970s raised a provocative thought: "One wonders what became of the US military aircraft that had been dispatched to stand by for Lodge's departure, scheduled for the previous day." The historian Mark Moyar suspected that Lodge could have flown Diệm to Clark Air Force Base in the Philippines, which was under American jurisdiction, before taking him to the final destination. Moyar speculated that "when Lodge had offered the jet the day before, he had done it to induce Diệm to give up at a time when the outcome of the insurrection was very much in doubt. Now that the coup clearly had succeeded, Lodge no longer needed to offer such an incentive." Intended arrest at Gia Long Palace In the meantime, Minh left the JGS headquarters and traveled to Gia Long Palace in a sedan with his aide and bodyguard, Captain Nguyễn Văn Nhung. Minh arrived at the palace at 08:00 in full military ceremonial uniform to supervise the arrest of Diệm and Nhu. Minh had also dispatched an M113 armored personnel carrier and four jeeps to Gia Long Palace to transport an arrested Diệm and Nhu back to JGS headquarters for official surrender. While Minh was on the way to supervise the takeover of the palace, Generals Đôn, Trần Thiện Khiêm and Lê Văn Kim prepared the army headquarters for Diệm's arrival and a ceremonial handover of power to the junta. Diệm's pictures were taken down and his statue was covered up. A large table covered with green felt was brought in with the intention of seating Diệm for the handover to Minh and Vice President Nguyễn Ngọc Thơ, who was to become the civilian Prime Minister. In a nationally televised event witnessed by international media, Diệm would "ask" the generals that he and his brother be granted exile and asylum in a foreign country, which would be granted. The brothers were then to be held in a secure place at JGS headquarters while awaiting deportation. Diệm's escape Minh instead arrived to find that the brothers were not in the palace. In anticipation of a coup, they had ordered the construction of three separate tunnels leading from Gia Long to remote areas outside the palace. Around 20:00 on the night of the coup, with only the Presidential Guard to defend them against mutinous infantry and armor units, Diệm and Nhu hurriedly packed American banknotes into a briefcase. They escaped through one of the tunnels with two loyalists: Air Force Lieutenant Ðỗ Thơ, Diệm's aide-de-camp, who happened to be a nephew of Colonel Đỗ Mậu, the director of military security and a participant in the coup plot, and Xuân Vy, head of Nhu's Republican Youth. After the coup, Military Assistance Command, Vietnam General Paul Harkins, inspected the tunnel and noted that it "was so far down that I didn't want to go down to walk up the thing". The brothers emerged in a wooded area in a park near the Cercle Sportif (), the city's upper class sporting club, where they were picked up by a waiting Land Rover. Ellen Hammer disputes the tunnel escape, asserting that the Ngo brothers simply walked out of the building, which was not yet under siege. Hammer asserts that they walked past the tennis courts and left the palace grounds through a small gate at Le Thanh Ton Street and entered the car. The loyalists traveled through narrow back streets in order to evade rebel checkpoints and changed vehicles to a black Citroën sedan. After leaving the palace, Nhu was reported to have suggested to Diệm that the brothers split up, arguing that this would enhance their chances of survival. Nhu proposed that one of them travel to the Mekong Delta to join Cao's IV Corps, while the other would travel to the II Corps of General Nguyễn Khánh in the Central Highlands. Nhu felt the rebel generals would not dare to kill one of them while the other was free, in case the surviving brother were to regain power. According to one account, Diệm was reported to have turned down Nhu, reasoning that "You cannot leave alone. They hate you too much; they will kill you. Stay with me and I will protect you." Another story holds that Diệm said "We have always been together during these last years. How could we separate during these last years? How could we separate in this critical hour?" Nhu agreed to remain with his brother. The loyalists reached the home of Ma Tuyen in the Chinese business district of Cholon. Ma Tuyen was a Chinese merchant and friend who was reported to be Nhu's main contact with the Chinese syndicates which controlled the opium trade. The brothers sought asylum from the embassy of the Republic of China, but were turned down and stayed in Ma Tuyen's house as they appealed to ARVN loyalists and attempted to negotiate with the coup leaders. Nhu's secret agents had fitted the home with a direct phone line to the palace, so the insurgent generals believed that the brothers were still besieged inside Gia Long. Neither the rebels nor the loyalist Presidential Guard had any idea that at 21:00 they were about to fight for an empty building. Minh was reported to be mortified when he realised that Diệm and Nhu had escaped during the night. Arrest in Cholon After Minh had ordered the rebels to search the areas known to have been frequented by the Ngo family, Colonel Phạm Ngọc Thảo was informed by a captured Presidential Guard officer that the brothers had escaped through the tunnels to a refuge in Cholon. Thảo was told by Khiêm, his superior, to locate Diệm and prevent him from being killed. When Thảo arrived at Ma Tuyen's house, he phoned his superiors. Diệm and Nhu overheard him and Thơ drove them to the nearby Catholic church of St. Francis Xavier (), which they had frequented over the years. Lieutenant Thơ died a few months later in a plane crash, but his diary was not found until 1970. Thơ recorded Diệm's words as they left the house of Ma Tuyen as being "I don't know whether I will live or die and I don't care, but tell Nguyễn Khánh that I have great affection for him and he should avenge me". Soon after the early morning Mass was celebrated for All Souls' Day (the Catholic day of the dead) and after the congregation had left the building, the Ngô brothers walked through the shady courtyard and into the church wearing dark grey suits. It was speculated that they were recognised by an informant as they walked through the yard. Inside the church, the brothers prayed and received Communion. A few minutes later, just after 10:00, an armoured personnel carrier and two jeeps entered the narrow alcove housing the church building. Lieutenant Thơ, who had earlier urged Diệm to surrender, saying that he was sure that his uncle Đỗ Mậu, along with Đính and Khiêm, would guarantee their safety, wrote in his diary later "I consider myself responsible for having led them to their death". Convoy to JGS headquarters The convoy was led by General Mai Hữu Xuân and consisted of Colonels Nguyễn Văn Quan and Dương Ngọc Lắm. Quan was the deputy of Minh and Lắm was the Commander of the Civil Guard. Lắm had joined the coup once a rebel victory seemed assured. Two further officers made up the convoy: Major Dương Hiếu Nghĩa and Captain Nhung, Minh's bodyguard. Diệm requested that the convoy stop at the palace so that he could gather personal items before being exiled. Xuân turned him down, clinically stating that his orders were to take Diệm and Nhu directly to JGS headquarters. Nhu expressed disgust that they were to be transported in an APC, asking, "You use such a vehicle to drive the president?" Lắm assured them that the armour was for their own protection. Xuân said that it was selected to protect them from "extremists". Xuân ordered the brothers' hands be tied behind their backs before shoving them into the carrier. One officer asked to shoot Nhu, but Xuân turned him down. Assassination After the arrest, Nhung and Nghĩa sat with the brothers in the APC, and the convoy departed for Tân Sơn Nhất. Before the convoy had departed for the church, Minh was reported to have gestured to Nhung with two fingers. This was taken to be an order to kill both brothers. The convoy stopped at a railroad crossing on the return trip, where by all accounts the brothers were assassinated. An investigation by Đôn determined that Nghĩa had shot the brothers at point-blank range with a semi-automatic firearm and that Nhung sprayed them with bullets before repeatedly stabbing the bodies with a knife. Nghĩa gave his account of what occurred during the journey back to the military headquarters: "As we rode back to the Joint General Staff headquarters, Diệm sat silently, but Nhu and the captain [Nhung] began to insult each other. I don't know who started it. The name-calling grew passionate. The captain had hated Nhu before. Now he was charged with emotion." Nghĩa said that when the convoy reached a train crossing, "[Nhung] lunged at Nhu with a bayonet and stabbed him again and again, maybe fifteen or twenty times. Still in a rage, he turned to Diệm, took out his revolver and shot him in the head. Then he looked back at Nhu, who was lying on the floor, twitching. He put a bullet into his head too. Neither Diệm nor Nhu ever defended themselves. Their hands were tied." Attempted cover-up When the corpses arrived at JGS headquarters, the generals were shocked. Although they despised and had no sympathy for Nhu, they still respected Diệm. One general broke down and wept while Minh's assistant, Colonel Nguyễn Văn Quan, collapsed on a table. General Đính later declared, "I couldn't sleep that night". Đôn maintained that the generals were "truly grievous" over the deaths, maintaining that they were sincere in their intentions to give Diệm a safe exile. Đôn charged Nhu with convincing Diệm to reject the offer. Lodge later concluded, "Once again, brother Nhu proves to be the evil genius in Diệm's life." ARVN reaction Đôn ordered another general to tell reporters that the Ngô brothers had died in an accident. He went to confront Minh in his office. Đôn: Why are they dead? Minh: And what does it matter that they are dead? At this time, Xuân walked into Minh's office through the open door, unaware of Đôn's presence. Xuân snapped to attention and stated, "Mission accomplished." Shortly after midnight on 2 November 1963 in Washington, D.C. the CIA sent word to the White House that Diệm and Nhu were dead, allegedly by suicide. Vietnam Radio had announced their deaths by poison, and that they had committed suicide while prisoners in an APC transporting them to Tân Sơn Nhứt. Unclear and contradictory stories abounded. General Harkins reported that the suicides had occurred either by gunshot or by a grenade wrestled from the belt of an ARVN officer who was standing guard. Minh tried to explain the discrepancy, saying "Due to an inadvertence, there was a gun inside the vehicle. It was with this gun that they committed suicide." US reaction Kennedy learned of the deaths on the following morning when National Security Council staffer Michael Forrestal rushed into the cabinet room with a telegram reporting the Ngô brothers' alleged suicides. According to General Maxwell Taylor, "Kennedy leaped to his feet and rushed from the room with a look of shock and dismay on his face which I had never seen before." Kennedy had planned that Diệm would be safely exiled and Arthur M. Schlesinger Jr. recalled that Kennedy was "somber and shaken". Kennedy later penned a memo, lamenting that the assassination was "particularly abhorrent" and blaming himself for approving Cable 243, which had authorised Lodge to explore coup options in the wake of Nhu's attacks on the Buddhist pagodas. Forrestal said that "It shook him personally ... bothered him as a moral and religious matter. It shook his confidence, I think, in the kind of advice he was getting about South Vietnam." When Kennedy was consoled by a friend who told him he need not feel sorry for the Ngô brothers on the grounds of despotism, Kennedy replied "No. They were in a difficult position. They did the best they could for their country." Kennedy's reaction did not draw sympathy from his entire administration. Some believed that he should not have supported the coup and that as coups were uncontrollable, assassination was always a possibility. Kennedy was skeptical about the story and suspected that a double assassination had taken place. He reasoned the devoutly Catholic Ngô brothers would not have taken their own lives, but Roger Hilsman rationalised the possibility of suicide by asserting that Diệm and Nhu would have interpreted the coup as Armageddon. US officials soon became aware of the true reasons for the deaths of Diệm and Nhu. Lucien Conein had left the rebel headquarters as the generals were preparing to bring in the Ngô brothers for the press conference which announced the handover of power. Upon returning to his residence, Conein received a phone call from Saigon's CIA station that ordered him to report to the embassy. The embassy informed Conein that Kennedy had instructed him to find Diệm. Conein returned to Tân Sơn Nhứt at around 10:30. The following conversation was reported: Conein: Where were Diem and Nhu? Minh: They committed suicide. They were in the Catholic Church at Cholon, and they committed suicide. C: Look, you're a Buddhist, I'm a Catholic. If they committed suicide at that church and the priest holds mass tonight, that story won't hold water. Where are they? M: Their bodies are behind General Staff Headquarters. Do you want to see them? C: No. M: Why not? C: Well, if by chance one of a million of the people believe you that they committed suicide in church and I see that they have not committed suicide and I know differently, then if it ever leaks out, I am in trouble. Conein knew that if he saw the execution wounds, he would not be able to deny that Diem and Nhu had been assassinated. Conein refused to see the proof, realising that having such knowledge would compromise his cover and his safety. He returned to the embassy and submitted his report to Washington. The CIA in Saigon later secured a set of photos of the brothers that left no doubt that they had been executed. The photos were taken at about 10:00 on 2 November and showed the dead brothers covered in blood on the floor of an APC. They were dressed in the robes of Roman Catholic priests with their hands tied behind their backs. Their faces were bloodied and bruised and they had been repeatedly stabbed. The images appeared to be genuine, discrediting the generals' claims that the brothers had committed suicide. The pictures were distributed around the world, having been sold to media outlets in Saigon. The caption below a picture published in Time read "'Suicide' with no hands." Media reaction After the deaths, the military junta asserted that the Ngô brothers had committed suicide. On 6 November, Information Minister Trần Tự Oai declared at a news conference that Diệm and Nhu had died through "accidental suicide" after a firearm discharged when Nhu had tried to seize it from the arresting officer. This drew immediate skepticism from David Halberstam of The New York Times, who won a Pulitzer Prize for his Vietnam reporting. Halberstam wrote to the US Department of State that "extremely reliable private military sources" had confirmed that the brothers were ordered to be executed upon their return to military headquarters. Neil Sheehan of UPI reported a similar account based on what he described as "highly reliable sources". Father Leger of Saint Francis Xavier Catholic Church asserted that the Ngô brothers were kneeling inside the building when soldiers burst in, took them outside and into the APC. Lodge had been informed by "an unimpeachable source" that both brothers were shot in the nape of the neck and that Diệm's body bore the signs of a beating. Impact and aftermath Once the news of the cause of death of the Ngo brothers began to become public, the United States became concerned at their association with the new junta and their actions during the coup. US Secretary of State Dean Rusk directed Lodge to question Minh about the killings. Lodge cabled back, initially backing the false story disseminated by the generals, saying that their story was plausible because of the supposedly loaded pistol being left on the floor of the vehicle. Rusk was worried about the public relations implications the bloody photographs of the brothers would generate. Lodge showed no alarm in public, congratulating Đôn on the "masterful performance" of the coup and promising diplomatic recognition. Đôn's assertion that the assassinations were unplanned proved sufficient for Lodge, who told the State Department that "I am sure assassination was not at their direction." Minh and Đôn reiterated their position in a meeting with Conein and Lodge on the following day. Several members of the Kennedy administration were appalled by the killings. The Assistant Secretary of State for Far Eastern Affairs W. Averell Harriman declared that "it was a great shock to everybody that they were killed." He postulated that it was an accident and speculated that Nhu may have caused it by insulting the officers who were supervising him. Embassy official Rufus Phillips, who was the US adviser to Nhu's Strategic Hamlet Program, said that "I wanted to sit down and cry", citing the killings as a key factor in the future leadership troubles which beset South Vietnam. According to historian Howard Jones, the fact "that the killings failed to make the brothers into martyrs constituted a vivid testimonial to the depth of popular hatred they had aroused." The assassinations caused a split within the coup leadership, turning the initial harmony among the generals into discord, and further abroad repulsed American and world opinion, exploding the myth that this new regime would constitute a distinct improvement over their predecessors, and ultimately convinced Washington that even though the leaders' names had changed in Saigon, the situation remained the same. The criticism of the killings further caused the officers to distrust and battle one another for positions in the new government. Đôn expressed his abhorrence at the assassinations by caustically remarking that he had organised the armoured car in an effort to protect Diệm and Nhu. Khanh claimed that the only condition he had put on joining the conspiracy was that Diem would not be killed. According to Jones, "when decisions regarding postcoup affairs took priority, resentment over the killings meshed with the visceral competition over government posts to disassemble the new regime before it fully took form." Culpability debate The responsibility for the assassinations was generally placed on Minh. Conein asserted that "I have it on very good authority of very many people, that Big Minh gave the order", as did William Colby, the director of the CIA's Far Eastern division. Đôn was equally emphatic, saying "I can state without equivocation that this was done by General Dương Văn Minh and by him alone." Lodge thought that Xuân was also partly culpable asserting that "Diệm and Nhu had been assassinated, if not by Xuân personally, at least at his direction." Minh placed the blame for the assassinations on Thiệu, after the latter became president. In 1971, Minh claimed that Thiệu was responsible for the deaths by hesitating and delaying the attack by his Fifth Division on Gia Long Palace. Đôn was reported to have pressured Thieu during the night, asking him on the phone "Why are you so slow in doing it? Do you need more troops? If you do, ask Đính to send more troops – and do it quickly because after taking the palace you will be made a general." Thiệu stridently denied responsibility and issued a statement which Minh did not publicly rebut: "Dương Văn Minh has to assume entire responsibility for the death of Ngô Đình Diệm." During the presidency of Richard Nixon, a US government investigation was initiated into American involvement in the assassinations. Nixon was a political foe of Kennedy, having narrowly lost to him in the 1960 Presidential election. Nixon ordered an investigation under E. Howard Hunt into the murders, convinced Kennedy must have secretly ordered the killings but the inquiry was unable to find any such secret order. Motivation Conein asserted that Minh's humiliation by Diệm and Nhu was a major motivation for ordering their executions. Conein reasoned that Diệm and Nhu were doomed once they escaped from Gia Long Palace, instead of surrendering there and accepting the offer of safe exile. Having successfully stormed the palace, Minh had presumed that the brothers would be inside, and arrived at the presidential residence in full ceremonial military uniform "with a sedan and everything else." Conein described Minh as a "very proud man" who had lost face at turning up at the palace for his moment of glory, only to find an empty building. More than a decade after the coup, Conein claimed Diệm and Nhu would not have been killed if they had been in the palace, because there were too many people present. One Vietnamese Diệm loyalist asked friends in the CIA why an assassination had taken place, reasoning that if Diem was deemed to be inefficient, his deposal would suffice. The CIA employees responded that "They had to kill him. Otherwise his supporters would gradually rally and organise and there would be civil war." Some months after the event, Minh was reported to have privately told an American that "We had no alternative. They had to be killed. Diệm could not be allowed to live because he was too much respected among simple, gullible people in the countryside, especially the Catholics and the refugees. We had to kill Nhu because he was so widely feared – and he had created organizations that were arms of his personal power." Trần Văn Hương, a civilian opposition politician who was jailed in 1960 for signing the Caravelle Manifesto that criticised Diệm, and later briefly served as Prime Minister, gave a scathing analysis of the generals' action. He stated that "The top generals who decided to murder Diệm and his brother were scared to death. The generals knew very well that having no talent, no moral virtues, no political support whatsoever, they could not prevent a spectacular comeback of the president and Mr. Nhu if they were alive." Burials of Diệm and Nhu At around 16:00 on 2 November, the bodies of Diệm and Nhu were identified by the wife of former Cabinet minister Trần Trùng Dung. The corpses were taken to St. Paul's Catholic Hospital, where a French doctor made a formal statement of death without conducting an autopsy. The original death certificate did not describe Diệm as Head of State but as "Chief of Province", a post he had held four decades earlier under the French colonial administration. Nhu was described as "Chief of Library Service", a post which he held in the 1940s. This was interpreted as a Vietnamese way of expressing contempt for the two despised leaders. Their place of burial was never disclosed by the junta and rumours regarding it persist to the current day. The speculated burial places include a military prison, a local cemetery, the grounds of the JGS headquarters and there are reports of cremation as well. Nobody was ever prosecuted for the killings. Memorial services The government did not approve a public memorial service for the deaths of Diệm and Nhu until 1968. In 1971, several thousand mourners gathered at Diệm's purported gravesite. Catholic prayers were given in Latin. Banners proclaimed Diệm as a saviour of the south, with some mourners having walked into Saigon from villages outside the capital carrying portraits of Diệm. Madame Thiệu, the First Lady, was seen weeping at a requiem mass at Saigon's basilica. Several cabinet members were also at the grave and a eulogy was given by a general of the ARVN. According to the eulogy, Diệm died because he had resisted the domination of foreigners and their plans to bring great numbers of troops to Vietnam and widen a war which would have destroyed the country. Thiệu sponsored the services, and it was widely seen as a means of associating himself with Diệm's personal characteristics. Diệm frequently refused to follow American advice and was known for his personal integrity, in contrast to Thiệu, who was infamous for corruption and regarded as being too close to the Americans. However, Thiệu's attempts to associate himself with Diệm's relative independence from United States influence was not successful. According to General Maxwell Taylor, Chairman of the US Joint Chiefs of Staff, "there was the memory of Diệm to haunt those of us who were aware of the circumstances of his downfall. By our complicity, we Americans were responsible for the plight in which the South Vietnamese found themselves". Notes References Conflicts in 1963 Assassinations in Vietnam Military coups in South Vietnam 1963 crimes in Vietnam Buddhist crisis Ngo Dinh Diem Vietnam War November 1963 events in Asia 1960s coups d'état and coup attempts 1960s murders in Vietnam 1963 murders in Asia
Bikiran Prasad Barua (11th February 1945 – 17th August 2023) was a Bangladeshi physicist and educationist. He was chairman of the physics department of the University of Chittagong. In recognition of his contribution in education, the government of Bangladesh awarded him the country's second-highest civilian award Ekushey Padak in 2020. Barua was born in Chittagong. He was the President of the Bangabandhu Education and Research Council in the Greater Chittagong area. He published 17 research papers on physics. Until death he served as Secretary general of Bangladesh Bouddha Kristi Prachar Sangha. Bikiran Prasad Barua died of cardiac arrest at Lab Aid Hospital in Dhaka, on 17th August 2023, at the age of 79. References 1943 births 2023 deaths Bangladeshi physicists Bangladeshi Buddhists University of Chittagong people Recipients of the Ekushey Padak People from Chittagong District
UN French Language Day () is observed annually on 20 March. The event was established by UN's Department of Public Information in 2010 "to celebrate multilingualism and cultural diversity as well as to promote equal use of all six official languages throughout the Organization". For the French language, 20 March was chosen as the date since it "coincides with the 40th anniversary of the International Organization of La Francophonie", a group whose members share a common tongue, as well as the humanist values promoted by the French language. Other dates were selected for the celebration of the UN's other five official languages. See also International Mother Language Day International observance Official languages of the United Nations References External links UN French Language Day – Official Site (French) March observances French Francophonie
Fiorenzo Marini (14 March 1914 – 25 January 1991) was an Italian fencer. He won a silver medal in the team épée event at the 1948 Summer Olympics and a gold in the same event at the 1960 Summer Olympics. References External links 1914 births 1991 deaths Italian male fencers Olympic fencers for Italy Fencers at the 1948 Summer Olympics Fencers at the 1960 Summer Olympics Olympic gold medalists for Italy Olympic silver medalists for Italy Olympic medalists in fencing Fencers from Vienna Medalists at the 1948 Summer Olympics Medalists at the 1960 Summer Olympics
```smalltalk // // Klak - Utilities for creative coding with Unity // // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. // using UnityEngine; namespace Klak.Wiring { [AddComponentMenu("Klak/Wiring/Input/Starter")] public class Starter : NodeBase { #region Node I/O [SerializeField, Outlet] VoidEvent _onStartEvent = new VoidEvent(); #endregion #region MonoBehaviour functions void Start() { _onStartEvent.Invoke(); } #endregion } } ```
```objective-c // // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. #import <Foundation/Foundation.h> /** `DBCoreDataFilterOperator` is an object encapsulating the information about the operator used in filtering. */ @interface DBCoreDataFilterOperator : NSObject /** Creates and returns a new instance with given display name and predicate string. @param displayName The name that will be presented to the user. @param predicateString The `NSString` instance that will be used in `NSPredicate` instance creation. */ + (instancetype)filterOperatorWithDisplayName:(NSString *)displayName predicateString:(NSString *)predicateString; /** The operator name that will be presented to the user. */ @property (nonatomic, readonly) NSString *displayName; /** The `NSString` instance used in `NSPredicate` instance creation. */ @property (nonatomic, readonly) NSString *predicateString; @end ```
is a Japanese politician and the current mayor of Matsuyama, the capital city of Ehime Prefecture, Japan. References External links 1967 births Living people Mayors of places in Japan Politicians from Ehime Prefecture
Sir Symon Locard, 2nd of Lee (1300–1371) was a Scottish knight who fought in the Wars of Scottish Independence. According to Lockhart family tradition, he accompanied Sir James Douglas in their curtailed attempt to carry the heart of Robert the Bruce to the Holy Land in 1330. Mission to the Holy Land Following the death of Robert the Bruce in 1329, his companion Sir James Douglas (aka the "Black Douglas"), set out to fulfil the King's last wish, that his heart be taken to the Holy Land, to be deposited in the Holy Sepulchre at Jerusalem. King Robert's heart was placed in a silver casket, which was carried by Sir James. It is claimed by a Lockhart family historian that Sir Symon Locard was entrusted with the key: “In 1329 a band of Scottish knights set out to fulfil the last wish of their dead King. Their leader, Lord James Douglas, carried the King's heart in ‘ane cas of silver fyn, enamilit throu subtilite’ hung about his neck. Beside him rode Sir Symon Locard, carrying the key of the casket. Sir Symon had won fame and distinction in the wars against the English; and now he was entrusted with the key of the precious casket.”. Notes References Sir Robert Douglas, The Baronage of Scotland, 1798 Simon Macdonald Lockhart, Seven Centuries - A History of the Lockharts of Lee and Carnwath, 1976 Forbes Macgregor, Famous Scots - the Pride of a Small Nation External links Lockhart Family History Clan Lockhart First Lockharts of Record 14th-century Scottish people People of the Wars of Scottish Independence 1300 births 1371 deaths
Michael Stuart (born 1975) is a Puerto Rican-American salsa singer and actor. Michael Stuart may also refer to: Michael Stuart (physician), American sports physician and orthopedic surgeon Mike Stuart (born 1980), ice hockey player Michael-Joel David Stuart (born 1997), actor Michael B. Stuart (born 1967), United States Attorney for the Southern District of West Virginia See also Michael Stewart (disambiguation) Stuart (name)
```c #include <stdbool.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <mosquitto.h> #include <mqtt_protocol.h> static int run = -1; static int sent_mid = -1; void on_connect(struct mosquitto *mosq, void *obj, int rc) { int rc2; mosquitto_property *proplist = NULL; if(rc){ exit(1); } } void on_message_v5(struct mosquitto *mosq, void *obj, const struct mosquitto_message *msg, const mosquitto_property *properties) { int rc; char *str; if(properties){ if(mosquitto_property_read_string(properties, MQTT_PROP_CONTENT_TYPE, &str, false)){ rc = strcmp(str, "plain/text"); free(str); if(rc == 0){ if(mosquitto_property_read_string(properties, MQTT_PROP_RESPONSE_TOPIC, &str, false)){ rc = strcmp(str, "msg/123"); free(str); if(rc == 0){ if(msg->qos == 0){ mosquitto_publish(mosq, NULL, "ok", 2, "ok", 0, 0); return; } } } } } } /* No matching message, so quit with an error */ exit(1); } void on_publish(struct mosquitto *mosq, void *obj, int mid) { run = 0; } int main(int argc, char *argv[]) { int rc; int tmp; struct mosquitto *mosq; int port = atoi(argv[1]); mosquitto_lib_init(); mosq = mosquitto_new("prop-test", true, NULL); if(mosq == NULL){ return 1; } mosquitto_connect_callback_set(mosq, on_connect); mosquitto_message_v5_callback_set(mosq, on_message_v5); mosquitto_int_option(mosq, MOSQ_OPT_PROTOCOL_VERSION, MQTT_PROTOCOL_V5); rc = mosquitto_connect(mosq, "localhost", port, 60); while(run == -1){ rc = mosquitto_loop(mosq, -1, 1); } mosquitto_destroy(mosq); mosquitto_lib_cleanup(); return run; } ```
```objective-c #pragma once #include "document_db_flush_config.h" #include <vespa/searchcore/proton/attribute/attribute_usage_filter_config.h> #include <vespa/vespalib/util/time.h> #include <memory> #include <string> namespace proton { class DocumentDBPruneConfig { private: vespalib::duration _delay; vespalib::duration _interval; vespalib::duration _age; public: DocumentDBPruneConfig() noexcept; DocumentDBPruneConfig(vespalib::duration interval, vespalib::duration age) noexcept; bool operator==(const DocumentDBPruneConfig &rhs) const noexcept; vespalib::duration getDelay() const noexcept { return _delay; } vespalib::duration getInterval() const noexcept { return _interval; } vespalib::duration getAge() const noexcept { return _age; } }; using DocumentDBPruneRemovedDocumentsConfig = DocumentDBPruneConfig; class DocumentDBHeartBeatConfig { private: vespalib::duration _interval; public: DocumentDBHeartBeatConfig() noexcept; DocumentDBHeartBeatConfig(vespalib::duration interval) noexcept; bool operator==(const DocumentDBHeartBeatConfig &rhs) const noexcept; vespalib::duration getInterval() const noexcept { return _interval; } }; class DocumentDBLidSpaceCompactionConfig { private: vespalib::duration _delay; vespalib::duration _interval; uint32_t _allowedLidBloat; double _allowedLidBloatFactor; double _remove_batch_block_rate; double _remove_block_rate; bool _disabled; public: DocumentDBLidSpaceCompactionConfig() noexcept; DocumentDBLidSpaceCompactionConfig(vespalib::duration interval, uint32_t allowedLidBloat, double allowwedLidBloatFactor, double remove_batch_block_rate, double remove_block_rate, bool disabled) noexcept; static DocumentDBLidSpaceCompactionConfig createDisabled() noexcept; bool operator==(const DocumentDBLidSpaceCompactionConfig &rhs) const noexcept; vespalib::duration getDelay() const noexcept { return _delay; } vespalib::duration getInterval() const noexcept { return _interval; } uint32_t getAllowedLidBloat() const noexcept { return _allowedLidBloat; } double getAllowedLidBloatFactor() const noexcept { return _allowedLidBloatFactor; } double get_remove_batch_block_rate() const noexcept { return _remove_batch_block_rate; } double get_remove_block_rate() const noexcept { return _remove_block_rate; } bool isDisabled() const noexcept { return _disabled; } }; class BlockableMaintenanceJobConfig { private: double _resourceLimitFactor; uint32_t _maxOutstandingMoveOps; public: BlockableMaintenanceJobConfig() noexcept; BlockableMaintenanceJobConfig(double resourceLimitFactor, uint32_t maxOutstandingMoveOps) noexcept; bool operator==(const BlockableMaintenanceJobConfig &rhs) const noexcept; double getResourceLimitFactor() const noexcept { return _resourceLimitFactor; } uint32_t getMaxOutstandingMoveOps() const noexcept { return _maxOutstandingMoveOps; } }; class BucketMoveConfig { public: BucketMoveConfig() noexcept; BucketMoveConfig(uint32_t _maxDocsToMovePerBucket) noexcept; bool operator==(const BucketMoveConfig &rhs) const noexcept; uint32_t getMaxDocsToMovePerBucket() const noexcept { return _maxDocsToMovePerBucket; } private: uint32_t _maxDocsToMovePerBucket; }; class DocumentDBMaintenanceConfig { public: using SP = std::shared_ptr<DocumentDBMaintenanceConfig>; private: DocumentDBPruneConfig _pruneRemovedDocuments; DocumentDBHeartBeatConfig _heartBeat; vespalib::duration _visibilityDelay; DocumentDBLidSpaceCompactionConfig _lidSpaceCompaction; AttributeUsageFilterConfig _attributeUsageFilterConfig; vespalib::duration _attributeUsageSampleInterval; BlockableMaintenanceJobConfig _blockableJobConfig; DocumentDBFlushConfig _flushConfig; BucketMoveConfig _bucketMoveConfig; public: DocumentDBMaintenanceConfig() noexcept; DocumentDBMaintenanceConfig(const DocumentDBPruneConfig &pruneRemovedDocuments, const DocumentDBHeartBeatConfig &heartBeat, vespalib::duration visibilityDelay, const DocumentDBLidSpaceCompactionConfig &lidSpaceCompaction, const AttributeUsageFilterConfig &attributeUsageFilterConfig, vespalib::duration attributeUsageSampleInterval, const BlockableMaintenanceJobConfig &blockableJobConfig, const DocumentDBFlushConfig &flushConfig, const BucketMoveConfig & bucketMoveconfig) noexcept; DocumentDBMaintenanceConfig(const DocumentDBMaintenanceConfig &) = delete; DocumentDBMaintenanceConfig & operator = (const DocumentDBMaintenanceConfig &) = delete; ~DocumentDBMaintenanceConfig(); bool operator==(const DocumentDBMaintenanceConfig &rhs) const noexcept ; const DocumentDBPruneConfig &getPruneRemovedDocumentsConfig() const noexcept { return _pruneRemovedDocuments; } const DocumentDBHeartBeatConfig &getHeartBeatConfig() const noexcept { return _heartBeat; } vespalib::duration getVisibilityDelay() const noexcept { return _visibilityDelay; } const DocumentDBLidSpaceCompactionConfig &getLidSpaceCompactionConfig() const noexcept { return _lidSpaceCompaction; } const AttributeUsageFilterConfig &getAttributeUsageFilterConfig() const noexcept { return _attributeUsageFilterConfig; } vespalib::duration getAttributeUsageSampleInterval() const noexcept { return _attributeUsageSampleInterval; } const BlockableMaintenanceJobConfig &getBlockableJobConfig() const noexcept { return _blockableJobConfig; } const DocumentDBFlushConfig &getFlushConfig() const noexcept { return _flushConfig; } const BucketMoveConfig & getBucketMoveConfig() const noexcept { return _bucketMoveConfig; } }; } // namespace proton ```
Sphaenothecus trilineatus is a species of beetle in the family Cerambycidae. It was described by Dupont in 1838. References Trachyderini Beetles described in 1838
The Boeing Model 200 Monomail was an American mail plane of the early 1930s. Design and development The aircraft marked a departure from the traditional biplane configuration for a transport aircraft, instead featuring a single, low set, all metal cantilever wing. Retractable landing gear and a streamlined fuselage added to the aerodynamic efficiency of the aircraft. A single example was constructed for evaluation by both Boeing and the US Army (under the designation Y1C-18) but no mass production ensued, and the aircraft eventually joined Boeing's fleet on the San Francisco-Chicago air mail route from July 1931. A second version was developed as the Model 221, with a fuselage stretched by 8 inches (20 cm) that sacrificed some of its cargo capacity to carry six passengers in an enclosed cabin; the single pilot, however, sat in an open cockpit. This version first flew on 18 August 1930. Both the Model 200 and the Model 221 were eventually modified for transcontinental service as the Model 221A, with slight fuselage stretches to give both a cabin for eight passengers. These aircraft were flown on United Air Lines' Cheyenne-Chicago route. The advanced design of the Monomail was hampered by the lack of suitable engine and propeller technology. By the time variable-pitch propellers and more powerful engines were available, the design had been surpassed by multi-engined aircraft, including Boeing's own 247. However, many advancements of the Monomail were incorporated into the designs of the most advanced bomber and fighter aircraft of the early 1930s, the Boeing B-9 and the Model 248 (later developed into the P-26 Peashooter of the USAAC), respectively. Variants Model 200 mailplane (1 built) Model 221 mailplane with capacity for 6 passengers (1 built) Model 221A Model 200 and 221 converted as 8-passenger airliners Model 231 Planned lengthened version of Model 221, not built. Operators Boeing Air Transport United Air Lines Specifications (Model 221) See also References Boeing History - Boeing Monomail Transport Retrieved June 17, 2006. External links Boeing: Historical Snapshot: Monomail Transport Fiddlergreen.net: Monomail Colorado Wreck Chasing: Glendo Crash Site 1930s United States airliners Monomail 1930s United States mailplanes Single-engined tractor aircraft Low-wing aircraft Aircraft first flown in 1930
Adgate is a surname. People with this surname include: Andrew Adgate (died 1793), American musician and author Asa Adgate (1767–1832), American iron manufacturer and congressman Cary Adgate (born 1953), American skier Chester Adgate Congdon (1853–1916), American lawyer and businessman See also Adgate Block, a historic building in Lima, Ohio, United States References
The Schottky effect or field enhanced thermionic emission is a phenomenon in condensed matter physics named after Walter H. Schottky. In electron emission devices, especially electron guns, the thermionic electron emitter will be biased negative relative to its surroundings. This creates an electric field of magnitude F at the emitter surface. Without the field, the surface barrier seen by an escaping Fermi-level electron has height W equal to the local work-function. The electric field lowers the surface barrier by an amount ΔW, and increases the emission current. It can be modeled by a simple modification of the Richardson equation, by replacing W by (W − ΔW). This gives the equation where J is the emission current density, T is the temperature of the metal, W is the work function of the metal, k is the Boltzmann constant, qe is the Elementary charge, ε0 is the vacuum permittivity, and AG is the product of a universal constant A0 multiplied by a material-specific correction factor λR which is typically of order 0.5. Electron emission that takes place in the field-and-temperature-regime where this modified equation applies is often called Schottky emission. This equation is relatively accurate for electric field strengths lower than about 108 V  m−1. For electric field strengths higher than 108 V m−1, so-called Fowler–Nordheim (FN) tunneling begins to contribute significant emission current. In this regime, the combined effects of field-enhanced thermionic and field emission can be modeled by the Murphy–Good equation for thermo-field (T-F) emission. At even higher fields, FN tunneling becomes the dominant electron emission mechanism, and the emitter operates in the so-called "cold field electron emission (CFE)" regime. Thermionic emission can also be enhanced by interaction with other forms of excitation such as light. For example, excited Cs-vapours in thermionic converters form clusters of Cs-Rydberg matter which yield a decrease of collector emitting work function from 1.5 eV to 1.0–0.7 eV. Due to long-lived nature of Rydberg matter this low work function remains low which essentially increases the low-temperature converter’s efficiency. References Condensed matter physics Electron beam
Australphilus is a genus of beetles in the family Dytiscidae, containing the following species: Australphilus montanus Watts, 1978 Australphilus saltus Watts, 1978 References Dytiscidae
The Fürstenenteignung was the proposed expropriation of the dynastic properties of the former ruling houses of the German Empire during the period of the Weimar Republic. These princes had been deposed in the German Revolution of 1918–19. Dispute over the proposed expropriation began in the months of revolution and continued in the following years in the form of negotiations or litigation between individual royal houses and the states (Länder) of the German Reich. The climactic points of the conflict were a successful petition for a referendum in the first half of 1926, followed by the actual referendum for expropriation without compensation, which failed. The petition was initiated by the German Communist Party (KPD), who were then joined, with some reluctance, by the Social Democrats (SPD). It was not only the KPD and SPD voters who supported expropriation without compensation. Many supporters of the Centre Party and the liberal German Democratic Party (DDP) were also in favour. In some regions voters of conservative national parties also supported expropriation. Associations of the aristocracy, the churches of the two major denominations, large-scale farming and industrial interest groups as well as right-wing parties and associations supported the dynastic houses. Their calls for a boycott finally brought about the failure of the referendum. Expropriation without compensation was replaced by individual compensation agreements, which regulated the distribution of the estates among the states and the former ruling families. Politicians and historians have differing interpretations of the events. While the official East German version of history stressed the actions of the Communist Party of the time, West German historians pointed to the substantial burdens that the referendum initiatives put on the cooperation between the SPD and the republican parties of the bourgeoisie. Attention is also drawn to the generational conflicts that emerged in this political dispute. The campaign for expropriation without compensation is also sometimes seen as a positive example of direct democracy. Developments up to the end of 1925 The 1918 November Revolution ended the reign of the ruling dynasties in Germany. These found themselves in a position of having to abdicate power and, given the new overall political situation, did this voluntarily or were deposed. Their property was seized, but they were not immediately dispossessed, in contrast to the situation in Austria. There were no seizures of assets at the national level because there was no corresponding property. The national authorities did not implement a nationwide policy but left it up to the individual states. In addition the Council of the People's Deputies was concerned that any such seizures of property might encourage the victors to lay claim to the confiscated estates for reparations. Article 153 of the Weimar Constitution of 1919 guaranteed property, but the article also provided for the possibility of seizure of assets in the public interest. Such a seizure of assets was permitted only on the basis of a law and the dispossessed were entitled to "reasonable" compensation. The article provided for recourse to the courts in case of disputes. The negotiations between the governments of each state and the royal houses were protracted because of the differing views on the level of compensation. The negotiating parties often struggled with the question of what the former rulers were entitled to as private property, as opposed to those possessions which they held only in their capacity as sovereign. On the basis of Article 153 of the Constitution, some royal houses demanded the return of all their former property and compensation for lost income. The situation was complicated by the decreasing value of money as a result of inflation, which reduced the value of compensation payments. For this reason, some of the royal families subsequently contested agreements that they had previously concluded with the states. The properties concerned were of considerable significance to the economy. The smaller states, especially, depended for their existence on being able to get control of the major assets. In Mecklenburg-Strelitz, for example, the disputed land alone represented 55 per cent of the area of the state. In other, smaller, states the figure was 20 per cent to 30 per cent of the area. In larger states like Prussia or Bavaria, however, the percentage of disputed land was of little significance, but the absolute sizes involved were equivalent to duchies elsewhere. The demands of the royal houses totalled 2.6 billion marks. In the courts, the mostly conservative and monarchist judges repeatedly decided in favour of the royal houses. A Reichsgericht judgment of 18 June 1925, in particular, was the cause of public resentment. It struck down a law which the USPD-dominated State Convention of Saxe-Gotha had passed on 31 July 1919 for the purpose of the confiscation of all the demesne land of the Dukes of Saxe-Coburg and Gotha. The judges held this state law to be unconstitutional. They returned all the land and forest to the former ruling house. The total value of the assets returned amounted to 37.2 million gold marks. At the time, the head of the dynastic house was Charles Edward, Duke of Saxe-Coburg and Gotha, an avowed enemy of the Republic. Prussia also negotiated for a long time with the House of Hohenzollern. The first attempt to reach agreement failed in 1920 against the resistance of the Social Democrats in the Prussian parliament; a second attempt failed in 1924 because of opposition from the House of Hohenzollern. On 12 October 1925, the Prussian Ministry of Finance submitted a new draft agreement, which was heavily criticized by the public, however, because it provided for about three-quarters of the disputed real estate to be returned to the princely house. This settlement was opposed not only by the SPD but also by the DDP, turning against its own finance minister Hermann Hoepker-Aschoff. In this situation, the DPP submitted a bill to the Reichstag on 23 November 1925. This would empower the states to pass state laws regulating property disputes with the former princely houses, against which there would be no legal recourse. The SPD had few objections to this, having previously drafted a similar bill itself. Initiative for a petition for a referendum Two days later, on 25 November 1925, the Communist Party also initiated a bill. This did not provide for any balancing of interests between the states and the royal houses, but instead specified expropriation without compensation. The land was to be handed over to farmers and tenants; palaces were to be converted into convalescent homes or used to alleviate the housing shortage; and the cash was to go to disabled war veterans and surviving dependants of those who had fallen in the War. The bill was addressed less to the parliament, where it was unlikely to gain a majority, as to the populace. The petition for a referendum was meant to allow the people to express its will for a radical change in the ownership of property, first of all with respect to the seized property of the ruling houses. The Communists realised that such a legislative initiative was attractive at a time of rising unemployment, mainly due to the sharp economic downturn since November 1925, as well as what was known as the "rationalisation crisis". Also, the recent hyperinflation was still in people's minds. This had shown the value of real estate, which is what was available for distribution. In line with the united front policy, the Communist Party initiative aimed at regaining lost voters and possibly also appealing to the middle classes, who were among the losers of inflation. As part of this strategy, on 2 December 1925, the Communist Party invited the SPD, the Allgemeiner Deutscher Gewerkschaftsbund; ADGB; General German Trade Union Federation, the Allgemeiner freier Angestelltenbund (English: General Free Federation of Employees), the German Civil Service Federation, the Reichsbanner Schwarz-Rot-Gold and the Rotfrontkämpferbund (Red Front League) to join in starting a petition for a referendum. At first, the SPD reacted negatively. The Communist Party's efforts to drive a wedge between the social-democratic "masses" and the SPD "fat cat" leaders was too transparent. In addition, the SPD leadership still saw the possibility of resolving the disputed issues by parliamentary means. Another reason for reservations about the initiative was the prospect of failure. More than half of all eligible voters in Germany, nearly 20 million voters, would have to vote yes in a referendum if the law had the effect of amending the constitution. However, in the preceding national election of 7 December 1924, the KPD and the SPD had achieved only about 10.6 million votes. In early 1926, the mood within the SPD changed. Discussions on the inclusion of social democrats in the national government finally broke down in January, so the SPD was then able to concentrate more on opposition politics. This was also the reason for rejecting another bill that had been drawn up by the second cabinet of Hans Luther. This bill, which was finally presented on 2 February, provided for a new legal construction to handle the issue. A special court under the chairmanship of the Supreme Court President Walter Simons would have sole responsibility for the assets disputes. There was no provision for review of existing agreements between the states and the former ruling houses. Compared with the parliamentary initiative of the DDP from November 1925, this was a development that was favourable to the former ruling houses. For the SPD leadership, these factors were important but secondary; the main reason for the change of mood in the SPD leadership was something else: at the base of the SPD, there was a clear support for the legislative initiative of the Communist Party, and the party leadership feared significant loss of influence, members and voters if they ignored this sentiment. On 19 January 1926, the chairman of the Communist Party, Ernst Thalmann, called upon the SPD to participate in what was called the Kuczynski Committee. This ad hoc committee, which was formed in mid-December 1925 from people associated with the German Peace Society and the German League for Human Rights, was named after the statistician Robert René Kuczynski and was preparing a petition for a referendum for the expropriation of the former ruling houses. About 40 different pacifist, leftist and communist groups belonged to it. Within the committee, the Communist Party and its affiliated organizations had the greatest importance. As late as 19 January, the SPD still rejected the Communist Party's proposal to join the Kuczynski Committee and, instead, asked the ADGB to mediate talks. These talks were intended to present to the people, in a petition for a referendum, a bill for the expropriation of the former ruling houses that had the support of as many groups as possible. The ADGB acceded to this request. The talks between the KPD, the SPD and the Committee Kuczynski, which were moderated by the ADGB, began on 20 January 1926. Three days later, they agreed on a common bill. The bill provided for the expropriation of the former rulers and their families "for the public good". On 25 January, the bill went to the Ministry of the Interior with the request to quickly set a date for a petition for a referendum. The ministry scheduled the petition for the period for 4–17 March 1926. So far, the united front tactic of the Communists was successful only in the technical sense: the SPD and KPD had drawn up an agreement on the production and distribution of petition lists and posters. A united front in the political sense was still soundly rejected by the SPD. They made a point of carrying out all agitation events alone, not jointly with the Communist Party. Local organizations of the SPD were warned against any such advances from the Communist Party and censured where any such offers had been accepted. The ADGB also made public that there was no united front with the Communists. As well as the workers' parties, the referendum campaign was publicly supported by the ADGB, the Red Front League and a number of prominent figures, such as Albert Einstein, Käthe Kollwitz, John Heartfield and Kurt Tucholsky for the referendum. The opponents of the project, with varying degrees of commitment, were mainly to be found in the bourgeois parties, the Reichslandbund (National Land League), numerous "national" organizations, and the churches. Result of the petition for a referendum The petition for a referendum, carried out in the first half of March 1926, underlined the capacity of the two workers' parties to mobilize people. Of the 39.4 million eligible voters, 12.5 million entered themselves in the official lists. The minimum participation of ten per cent of the voters was thus exceeded by a factor of more than three. The number of votes that the KPD and SPD had achieved in the Reichstag elections in December 1924 was exceeded by almost 18 per cent. Particularly striking was the high level of support in the strongholds of the Centre Party. Here, the number of supporters of the petition was much higher than the total number of votes received by the KPD and SPD.at the previous general election. Even domains of liberalism such as Württemberg exhibited similar trends. Particularly marked were the gains recorded in large cities. Expropriation without compensation was supported not just by supporters of the workers' parties but also by many voters in the centre and right-wing parties. In rural areas, however, there was often strong resistance to the petition. In particular in East Elbia, the KPD and SPD could not achieve the results of the last general election. Administrative obstacles to the referendum and threats by large farming employers towards employees had an effect. In Lower Bavaria in particular, there was a similar below-average participation. Bavaria had the second lowest participation, after the tiny state of Waldeck, The Bavarian People's Party (BVP) and the Catholic Church vigorously and successfully advised against taking part in the petition. Also, a largely uncontroversial agreement with the House of Wittelsbach had been successfully negotiated in 1923. Preparation and outcome of the referendum On 6 May 1926, the bill for expropriation without compensation was voted on by the Reichstag. Because the bourgeois parties were in the majority, it failed by a vote of 236 to 142. Per Article 73, paragraph 3 of the Weimar Constitution, if the bill had been adopted without amendment, a referendum would have been avoided. On 15 March, before the bill failed in the Reichstag, President Hindenburg had already added another hurdle to the success of the referendum. On that day, he informed Justice Minister Wilhelm Marx that the intended expropriations did not serve the public interest but represented nothing more than fraudulent conversion of assets for political reasons. This was not permitted by the Constitution. On 24 April 1926, the Luther government expressly confirmed the President's legal opinion. For this reason, a simple majority was not sufficient for the success of the referendum, and it needed support from 50 per cent of those eligible to vote, about 20 million voters. Because it was not expected that these numbers would be achieved, the government and the parliament began to prepare for further parliamentary discussions on the issue. These talks were also affected by the notification that any laws giving effect to the expropriation would have the intended effect of changing the constitution, meaning that they would require a two-thirds majority. Only a law that could expect the support of parts of the SPD, on the left, and parts of the DNVP, on the right, would have had a chance of succeeding. It was expected that on 20 June 1926 the number of those in favour of expropriation without compensation would be higher. There were a number of reasons to expect that: because the vote in June would be decisive, greater mobilization of the voters on the left could be expected than in the March petition. The failure of all previous attempts at parliamentary compromise had lent support to those voices in the bourgeois parties that were also in favour of such a radical change. For example, youth organizations of the Centre Party and the DDP called for a "yes" vote. The DDP was split into supporters and opponents. The party leadership, therefore, left it to the DDP supporters to choose which side they would vote for. In addition, those organizations that represented the interests of the victims of inflation, now recommended voting for the expropriation. Two additional factors put pressure on the opponents of the referendum, who had united on 15 April 1926 under the umbrella of the "Working Group Against the Referendum". As with the petition, the opponents of the referendum included right-wing associations and parties, agricultural and industrial interest groups, the churches, and the Vereinigung Deutscher Hofkammern, the association representing the interests of the former federal Princes: Firstly, the home of Heinrich Class, the leader of the Pan-German League, had been searched at the behest of the Prussian Interior Ministry. This revealed comprehensive plans for a coup. Similar evidence was turned up by searches involving his employees. Secondly, on 7 June 1926, excerpts of a letter which Hindenburg had written to Friedrich Wilhelm von Loebell, the President of the Reichsbürgerrat, on 22 May 1926 were published. In this letter, Hindenburg called the plebiscite a "grave injustice" that showed a "deplorable lack of sense of tradition" and "gross ingratitude". It was "contrary to the principles of morality and justice". For the background to the correspondence, see Jung 1996, p. 927–940. Hindenburg tolerated the use of his negative words on posters by the expropriation opponents, which laid him open to the accusation that he was not aloof from party politics but was openly supporting the conservatives. The expropriation opponents increased their efforts. Their core message was the claim that the proponents of the referendum were not just interested in the expropriation of the princes' property but intended the abolition of private property as such. The opponents called for a boycott of the referendum. This made sense from their perspective because each abstention (and each invalid vote) had the same effect as a "no" vote. The call for a boycott practically turned the secret ballot into an open one. The opponents of the referendum mobilized substantial financial resources. The DNVP, for instance, deployed significantly more money in the agitation against the referendum than in the election campaigns of 1924 and more than in the general election of 1928. The funds for the agitation against the referendum came from contributions from the dynastic families, from industrialists, and from other donations. As with the petition, especially east of the Elbe, farm workers were threatened with economic and personal sanctions if they participated in the referendum. There were attempts to scare small farmers by saying that it was not just about the expropriation of the princes' property but about livestock, farm equipment and land for all farms. Also, on 20 June 1926, the opponents held festivals with free beer keep people from voting. The National Socialist German Workers' Party (NSDAP) exacerbated the populist dimension by demanding not the expropriation of the Princes' property but of Jewish immigrants' who had entered Germany since 1 August 1914. Initially, the left wing of the NSDAP, centered on Gregor Strasser, favoured the Nazis supporting the expropriation campaign, but Adolf Hitler rejected this demand at the meeting of the party leadership in Bamberg on 14 February 1926. Alluding to a speech by the Emperor in August 1914, he said, "For us there are now no princes, only Germans." On 20 June 1926, of the approximately 39.7 million voters, nearly 15.6 million (39.3 per cent) cast their vote. About 14.5 million voted "yes"; about 0.59 million voted "no" . About 0.56 million votes were invalid The referendum therefore failed because less than the required 50 per cent of voters participated. The expropriation without compensation had again been supported in the strongholds of the Centre Party. The same was true of large urban electoral districts. There too, the referendum had appealed to voters from the middle-class, national, conservative spectrum. Although in some cases, there were more votes cast than in the petition for a referendum, the support from the agricultural parts of the country (especially east of the Elbe) was again below average. The participation rate was also low in Bavaria, compared to other regions, despite the overall increase compared with the petition. After the referendum No lasting trend to the left was associated with this result despite fears by some opponents of the expropriation and hoped for by some sections of the SPD and the KPD. Many traditional voters of the DNVP, for example, voted for the referendum only as a response DNVP's broken electoral promise of 1924 to provide reasonable compensation for inflation losses. Also, the permanent ideological conflicts between the SPD and KPD had also not been overcome by virtue of the joint petition and referendum campaigns. On 22 June 1926, the Communist Party newspaper Die Rote Fahne (The Red Flag) had claimed that the Social Democratic leaders had deliberately sabotaged the referendum campaign. Four days later, the Central Committee of Communist Party were saying that the Social Democrats were now secretly supporting the "shameless robbery" by the princes. That assertion referred to the SPD's willingness to continue seeking a legislative resolution to the dispute in the Reichstag. For two reasons, the SPD expected considerable opportunities for influencing a legislative solution at the national level, even if such a law needed a two-thirds majority. First, they interpreted the referendum as strong support for social democratic positions. Second, Wilhelm Marx's (third) government was flirting with the idea of including the SPD in the government, in other words with the formation of a grand coalition, which would necessitate first entertaining social democratic demands. However, after lengthy negotiations, the changes to the government bill for compensation of the princes were finally rejected: there was to be no strengthening of the lay element in the Reich special courts; the SPD suggestion that the judges of that court should be elected by the Reichstag was also rejected; there was also no provision for resumption of property disputes that had already been settled but on unfavourable terms for the states. On 1 July 1926, the leadership of the SPD parliamentary party nevertheless tried to convince the SPD parliamentarians to accept the bill, which was to be voted on in the Reichstag the next day. But they refused. This price for being included in a new national government was too high for most of them. They could also not be convinced by the arguments of the Prussian government under Otto Braun and the words of the Socialist Group of the Prussian Landtag, who also wanted a national law, so as to be able to settle the disputes with the Hohenzollerns on this basis. On 2 July 1926, the parliamentary parties of the SPD and the DNVP both stated their reasons for rejecting the bill, and the bill was withdrawn by the government without a vote. The individual states now had to reach agreements with the princely houses by direct negotiations. The position of the states was protected up to the end of June 1927 by a so-called blocking law, which prohibited attempts by the royal houses to pursue claims against the states through the civil courts. In Prussia, agreement was reached on 6 October 1926: a draft agreement was signed by the State of Prussia and the Hohenzollern Plenipotentiary, Friedrich von Berg. Of the total seized assets, approximately 63,000 ha went to the State of Prussia; the royal house, including all ancillary lines, retained approximately 96,000 ha Prussia also took ownership of a large number of palaces and other properties. From the point of view of the state government, the settlement was better than what had been envisaged in October 1925. In the vote on 15 October 1926, the SPD abstained even if the majority of the deputies inwardly opposed it. They thought the return of assets to the Hohenzollerns went too far. However, a clear "no" vote in plenary session seemed inexpedient because Braun had threatened to resign if that happened. The SPD's abstention opened the way for the ratification of the agreement by the Prussian parliament. The KPD was unable to prevent the bill being passed although there were tumultuous scenes in the parliament during the second reading on 12 October 1926. Even before the legal settlement between Prussia and the Hohenzollerns, most disputes between the states and the royal families had been settled amicably. However, after October 1926, some states were still in dispute with the royal houses: Thuringia Hesse, Mecklenburg-Schwerin, Mecklenburg-Strelitz, and especially Lippe. Some of these negotiations were to last for many years. A total of 26 agreements for the settlement of these property disputes were concluded between the states and the royal houses. According to these agreements, cost-incurring objects, including palaces, buildings and gardens, usually went to the state. Income-generating properties, such as forests or valuable land, mainly went to the royal houses. In many cases, collections, theatres, museums, libraries and archives were incorporated in newly established foundations and were thus made accessible to the public. On the basis of these agreements, the state also took over the court officials and servants, including the associated pension obligations. Generally, appanages and civil lists: the part of the budget once used for the head of state and his court, were scrapped in exchange for one-off compensation. During the time of the presidential governments, there were a number of attempts in the Reichstag, both from the KPD and the SPD, to revisit the issue of expropriation or reduction in the Princes' compensation. They were intended as a political response to the trend to reduce salaries. None of these initiatives generated much political attention. The Communist Party proposals were rejected out of hand by the other parties. SPD proposals were at best referred to the law committee. There, nothing came of them, partly because there were repeated premature dissolutions of the Reichstag. On 1 February 1939, after initial hesitation, the Nazis passed a law which enabled settled agreements to be revisited. On the whole, however, this instrument was more a preventive measure or threat, intended as a defence against any claims of the royal families against the state (there were a number in the early days of the Third Reich). The threat of a completely new settlement to the benefit of the Nazi state was intended to suppress any complaints and court cases once and for all. It was not intended to include the agreements in the policy of Gleichschaltung. Assessment by historians The Marxist–Leninist historiography of the GDR viewed the expropriation and the actions of the workers' parties primarily from a perspective similar to that of the Communist Party of the time. The united front strategy of the Communist Party was interpreted as the correct step in the class struggle. The plebiscitary projects were "the most powerful unified action of the German working class in the period of relative stabilization of capitalism". It was the SPD leadership and the leadership of the free trade unions that were attacked, particularly where they sought a compromise with the bourgeois parties. The attitude of the leaders of the SPD and the Free Trade Unions, it was said, significantly hampered the development of the popular movement against the Princes. Otmar Jung's post-doctoral dissertation of 1985 is the most comprehensive study of the Princes' expropriation to date. In the first part, he analyzes the historical, economic and legal aspects of all property disputes for each of the German states. This analysis takes up 500 pages of the more than 1200 pages. Jung uses this approach in order to counter the danger of prematurely assuming that the Prussian solution was the typical one. In the second part, Jung details the events. His intention is to show that the absence of elements of direct democracy in the constitution of the Federal Republic of Germany cannot legitimately be justified by "bad experience" in the Weimar Republic as is often done. On closer examination, the Weimar experience was different. According to Jung, the popular legislative initiative of 1926 was a laudable attempt to complement the parliamentary system where it was not able to provide a solution: in the question of a clear and final separation of the assets of the state and the former Princes. Here, the referendum was a legitimate problem-solving process. One of the results of the campaign, according to Jung, was that it brought to light technical defects in the referendum process, for instance because abstentions and "no" votes had exactly the same effect. By correcting misonceptions about elements of direct democracy in the Weimar Republic, Jung wants to pave the way for a less prejudiced discussion of elements of direct democracy in the present. Thomas Kluck examines the positions of German Protestantism. He makes it clear that the majority of theologians and publicists of the Protestant Churches rejected the expropriation of the Princes. The reason given was often Christian precepts. Often, the rejections also exhibited a backward-looking nostalgia for the seemingly harmonious times of the Empire and a desire for a new, strong leadership. Kluck contends that conflicts involving the present, such as the controversy about the property of the former ruling houses, were often interpreted by German Protestantism in terms of demonology: behind these conflicts were seen machinations of the devil that would tempt people to sin. Alongside the devil as a malevolent mastermind, national-conservative elements of Protestantism branded Jews as the cause and beneficiaries of political conflicts. Such an attitude was wide open to the ideology of National Socialism and thus gave it theological support. This ideological support, he claimed, was a basis for Protestant guilt. Ulrich Schüren stresses that in 1918 the question of the expropriation of the former rulers could have been settled without any major problems, legitimised by the power of the revolution. To that extent, this was a failure of the revolution. Despite its failure, the referendum, had a significant indirect effect. After 20 June 1926, the referendum increased the willingness to compromise in the conflict between Prussia and the House of Hohenzollern so that it proved possible to conclude an agreement as early as October. Schüren also makes it clear that there were signs of erosion in the bourgeois parties. Mainly affected were the DDP and the DNVP, but also the Centre Party. Schüren suspects that the increasing lack of cohesion that was manifesting itself among the bourgeois parties contributed to the rise of National Socialism after 1930. A key theme in the assessment by non-Marxist historians is the question of whether the referendum debates put a strain on the Weimar compromise between the moderate labour movement and the moderate middle class. In this context, the focus is on the policy of the SPD. Peter Longerich notes that it was not possible to convert the relative success of the referendum into political capital. In his opinion, the referendum also hampered cooperation between the SPD and the bourgeois parties. This aspect is stressed most by Heinrich August Winkler. It is understandable, he says, that the SPD leadership supported the referendum so as not to lose touch with the Social Democratic base. But the price was very high. The SPD, he says, found it difficult to go back to the familiar path of class compromise after 20 June 1926. The debate about the expropriation of the former rulers shows the dilemma of the SPD in the Weimar Republic. When they showed themselves willing to compromise with the bourgeois parties, they ran the risk of losing supporters and voters to the Communist Party. If the SPD stressed class positions and joined in alliances with the Communist Party, they alienated the moderate bourgeois parties and tolerated that they sought allies on the right of the political spectrum who were not interested in the continued existence of the republic. The referendum had weakened, not strengthened, confidence in the parliamentary system and had created expectations that could not be fulfilled. In Winkler's view, the resulting frustration could be only destabilising for representative democracy. Winkler's position is clearly distinct from that of Otmar Jung. Hans Mommsen on the other hand, draws attention to mentality and generational conflicts in the republic. In his opinion, the referendum of 1926 revealed significant differences and deep divisions between the generations in Germany. A large proportion, perhaps even the majority, of Germans had been on the side of the supporters of the republic in this question and had supported the referendum as a protest against the backward-looking loyalty of bourgeois leaders. Mommsen also draws attention to the mobilization of anti-Bolshevik and anti-Semitic sentiments by the opponents of expropriation. This mobilization anticipated the constellation in which after 1931 "the remains of the parliamentary system would be smashed. Notes References Translation of Kolb 1988 Translation of Mommsen 1989. Further reading Politics of the Weimar Republic Law of the Weimar Republic Monarchy and money Monarchy in Germany
The women's ski slopestyle competition of the FIS Freestyle Ski and Snowboarding World Championships 2015 was held at Kreischberg, Austria on January 20 (qualifying) and January 21 (finals). 15 athletes from 10 countries competed. Qualification The following are the results of the qualification. Final The following are the results of the finals. References ski slopestyle, women's
```c++ /*============================================================================= =============================================================================*/ #include <elements/element/grid.hpp> #include <elements/support/context.hpp> namespace cycfi::elements { //////////////////////////////////////////////////////////////////////////// // Vertical Grids //////////////////////////////////////////////////////////////////////////// view_limits vgrid_element::limits(basic_context const& ctx) const { _num_spans = 0; for (std::size_t i = 0; i != size(); ++i) _num_spans += at(i).span(); view_limits limits{{ 0.0, 0.0}, {full_extent, 0.0}}; std::size_t gi = 0; float prev = 0; float desired_total_min = 0; for (std::size_t i = 0; i != size(); ++i) { auto& elem = at(i); gi += elem.span()-1; auto y = grid_coord(gi++); auto height = y - prev; auto factor = 1.0/height; prev = y; auto el = elem.limits(ctx); auto elem_desired_total_min = el.min.y * factor; if (desired_total_min < elem_desired_total_min) desired_total_min = elem_desired_total_min; limits.max.y += el.max.y; clamp_min(limits.min.x, el.min.x); clamp_max(limits.max.x, el.max.x); } limits.min.y = desired_total_min; clamp_min(limits.max.x, limits.min.x); clamp_max(limits.max.y, full_extent); return limits; } void vgrid_element::layout(context const& ctx) { _positions.resize(size()+1); auto left = ctx.bounds.left; auto right = ctx.bounds.right; auto total_height = ctx.bounds.height(); std::size_t gi = 0; float prev = 0; for (std::size_t i = 0; i != size(); ++i) { auto& elem = at(i); gi += elem.span()-1; auto y = grid_coord(gi++) * total_height; auto height = y - prev; rect ebounds = {left, prev, right, prev+height}; elem.layout(context{ctx, &elem, ebounds}); _positions[i] = prev; prev = y; } _positions[size()] = total_height; } rect vgrid_element::bounds_of(context const& ctx, std::size_t index) const { if (index >= _positions.size() || index >= size()) return {}; auto left = ctx.bounds.left; auto top = ctx.bounds.top; auto right = ctx.bounds.right; return {left, _positions[index]+top, right, _positions[index+1]+top}; } //////////////////////////////////////////////////////////////////////////// // Horizontal Grids //////////////////////////////////////////////////////////////////////////// view_limits hgrid_element::limits(basic_context const& ctx) const { _num_spans = 0; for (std::size_t i = 0; i != size(); ++i) _num_spans += at(i).span(); view_limits limits{{0.0, 0.0}, {0.0, full_extent}}; std::size_t gi = 0; float prev = 0; float desired_total_min = 0; for (std::size_t i = 0; i != size(); ++i) { auto& elem = at(i); gi += elem.span()-1; auto x = grid_coord(gi++); auto width = x - prev; auto factor = 1.0/width; prev = x; auto el = elem.limits(ctx); auto elem_desired_total_min = el.min.x * factor; if (desired_total_min < elem_desired_total_min) desired_total_min = elem_desired_total_min; limits.max.x += el.max.x; clamp_min(limits.min.y, el.min.y); clamp_max(limits.max.y, el.max.y); } limits.min.x = desired_total_min; clamp_min(limits.max.y, limits.min.y); clamp_max(limits.max.x, full_extent); return limits; } void hgrid_element::layout(context const& ctx) { _positions.resize(size()+1); auto top = ctx.bounds.top; auto bottom = ctx.bounds.bottom; auto total_width = ctx.bounds.width(); std::size_t gi = 0; float prev = 0; for (std::size_t i = 0; i != size(); ++i) { auto& elem = at(i); gi += elem.span()-1; auto x = grid_coord(gi++) * total_width; auto width = x - prev; rect ebounds = {prev, top, prev+width, bottom}; elem.layout(context{ctx, &elem, ebounds}); _positions[i] = prev; prev = x; } _positions[size()] = total_width; } rect hgrid_element::bounds_of(context const& ctx, std::size_t index) const { if (index >= _positions.size() || index >= size()) return {}; auto top = ctx.bounds.top; auto left = ctx.bounds.left; auto bottom = ctx.bounds.bottom; return {_positions[index]+left, top, _positions[index+1]+left, bottom}; } } ```
```javascript 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); var _eachLimit = require('./eachLimit'); var _eachLimit2 = _interopRequireDefault(_eachLimit); var _doLimit = require('./internal/doLimit'); var _doLimit2 = _interopRequireDefault(_doLimit); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /** * The same as [`each`]{@link module:Collections.each} but runs only a single async operation at a time. * * @name eachSeries * @static * @memberOf module:Collections * @method * @see [async.each]{@link module:Collections.each} * @alias forEachSeries * @category Collection * @param {Array|Iterable|Object} coll - A collection to iterate over. * @param {AsyncFunction} iteratee - An async function to apply to each * item in `coll`. * The array index is not passed to the iteratee. * If you need the index, use `eachOfSeries`. * Invoked with (item, callback). * @param {Function} [callback] - A callback which is called when all * `iteratee` functions have finished, or an error occurs. Invoked with (err). */ exports.default = (0, _doLimit2.default)(_eachLimit2.default, 1); module.exports = exports['default']; ```
```objective-c #ifndef TOKENMANAGER_H #define TOKENMANAGER_H #include "UIClass.h" #include <QMap> #include <QStringList> namespace DTI { typedef QMap<QString, QString> ColourMap; typedef QMap<QString, ColourMap> FilePathColourMap; class TokenManager { public: enum ObjectNamesID { TOKEN, GUI_WIN, GUI_LINUX, GUI_MAC, CSS_STYLESHEETS, INVALID_ID }; static const QMap<quint32, QString> OBJECT_ID_TO_STRING_MAP; static TokenManager* instance(); void run(); bool didTokenUIOrCSSFilesChange(const QMap<QString, QMap<QString, QString>>& parsedHashMap); QMap<QString, QMap<QString, QString>> readHashFile(); bool writeHashFile(); FilePathColourMap parseTokenJSON(const QStringList& tokenFilePathsList); private: TokenManager(); bool didFilesChange(const QStringList& filePathList, const QMap<QString, QString>& hashMap); bool areHashesMatching(const QStringList& filePathList, const QMap<QString, QString>& hashMap); void parseUiFiles(const QStringList& uiFilePathsList, QVector<QSharedPointer<UIClass>>& UIClasses); QStringList generateStylesheets(const ColourMap& colourMap, const QVector<QSharedPointer<UIClass>>& uiClassList, const QString& saveDirectory); QStringList generateWinApplicationStyleJsonFile(); QStringList mTokenFilePathsList; QStringList mWinUIFilePathsList; QStringList mLinuxUIFilePathsList; QStringList mMacUIFilePathsList; QStringList mCSSFiles; QVector<QSharedPointer<UIClass>> mWinUIClasses; QVector<QSharedPointer<UIClass>> mLinuxUIClasses; QVector<QSharedPointer<UIClass>> mMacUIClasses; }; } // namespace DTI #endif // TOKENMANAGER_H ```
Reesville is an unincorporated community in northwestern Richland Township, Clinton County, Ohio, United States. It has a post office with the ZIP code 45166. It is located along State Route 72. History Reesville was platted in 1857 by Moses Reese, and named for him. A post office has been in operation at Reesville since 1858. Education Reesville is located within the East Clinton Local school district Parks There is a parking lot next to the Post Office for the Clinton-Fayette Friendship Trail . If you travel South on the trail you go to Melvin if you travel North you head to Sabina. Gallery References Unincorporated communities in Ohio Unincorporated communities in Clinton County, Ohio 1857 establishments in Ohio Populated places established in 1857
The following is a list of episodes of the television series The Tonight Show Starring Johnny Carson which aired in 1979: 1979 January February March April May June July August September October November December Notes References Tonight Show Starring Johnny Carson, The Tonight Show Starring Johnny Carson, The The Tonight Show Starring Johnny Carson Tonight Show Starring Johnny Carson, The
```c++ // // Aspia Project // // This program is free software: you can redistribute it and/or modify // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // // along with this program. If not, see <path_to_url // #include "common/ui/status_dialog.h" #include "base/logging.h" #include "ui_status_dialog.h" #include <QAbstractButton> #include <QPushButton> #include <QTime> namespace common { //your_sha256_hash---------------------------------- StatusDialog::StatusDialog(QWidget* parent) : QDialog(parent), ui(std::make_unique<Ui::StatusDialog>()) { LOG(LS_INFO) << "Ctor"; ui->setupUi(this); QPushButton* close_button = ui->buttonbox->button(QDialogButtonBox::StandardButton::Close); if (close_button) close_button->setText(tr("Close")); connect(ui->buttonbox, &QDialogButtonBox::clicked, this, [this](QAbstractButton* button) { if (ui->buttonbox->standardButton(button) == QDialogButtonBox::Close) { LOG(LS_INFO) << "[ACTION] Close button clicked"; close(); } }); } //your_sha256_hash---------------------------------- StatusDialog::~StatusDialog() { LOG(LS_INFO) << "Dtor"; } //your_sha256_hash---------------------------------- void StatusDialog::addMessage(const QString& message) { ui->edit_status->appendPlainText( QTime::currentTime().toString() + QLatin1Char(' ') + message); } //your_sha256_hash---------------------------------- void StatusDialog::addMessageAndActivate(const QString& message) { if (isHidden()) { LOG(LS_INFO) << "Window is hidden. Show and activate"; show(); activateWindow(); } addMessage(message); } //your_sha256_hash---------------------------------- void StatusDialog::retranslateUi() { ui->retranslateUi(this); } //your_sha256_hash---------------------------------- void StatusDialog::closeEvent(QCloseEvent* event) { LOG(LS_INFO) << "Close event detected"; QDialog::closeEvent(event); } } // namespace common ```
```objective-c // // // path_to_url // // Unless required by applicable law or agreed to in writing, software // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #pragma once #include "nlohmann/json.hpp" #include "yaml-cpp/yaml.h" using Json = nlohmann::json; using Yaml = YAML::Node; ```
```objective-c // // I am making my contributions/submissions to this project solely in my // personal capacity and am not conveying any rights to any intellectual // property of any third parties. #ifndef INCLUDE_JET_TRIANGLE3_H_ #define INCLUDE_JET_TRIANGLE3_H_ #include <jet/surface3.h> namespace jet { //! //! \brief 3-D triangle geometry. //! //! This class represents 3-D triangle geometry which extends Surface3 by //! overriding surface-related queries. //! class Triangle3 final : public Surface3 { public: class Builder; //! Three points. std::array<Vector3D, 3> points; //! Three normals. std::array<Vector3D, 3> normals; //! Three UV coordinates. std::array<Vector2D, 3> uvs; //! Constructs an empty triangle. Triangle3( const Transform3& transform = Transform3(), bool isNormalFlipped = false); //! Constructs a triangle with given \p points, \p normals, and \p uvs. Triangle3( const std::array<Vector3D, 3>& points, const std::array<Vector3D, 3>& normals, const std::array<Vector2D, 3>& uvs, const Transform3& transform = Transform3(), bool isNormalFlipped = false); //! Copy constructor Triangle3(const Triangle3& other); //! Returns the area of this triangle. double area() const; //! Returns barycentric coordinates for the given point \p pt. void getBarycentricCoords( const Vector3D& pt, double* b0, double* b1, double* b2) const; //! Returns the face normal of the triangle. Vector3D faceNormal() const; //! Set Triangle3::normals to the face normal. void setNormalsToFaceNormal(); //! Returns builder fox Triangle3. static Builder builder(); protected: Vector3D closestPointLocal(const Vector3D& otherPoint) const override; bool intersectsLocal(const Ray3D& ray) const override; BoundingBox3D boundingBoxLocal() const override; Vector3D closestNormalLocal( const Vector3D& otherPoint) const override; SurfaceRayIntersection3 closestIntersectionLocal( const Ray3D& ray) const override; }; //! Shared pointer for the Triangle3 type. typedef std::shared_ptr<Triangle3> Triangle3Ptr; //! //! \brief Front-end to create Triangle3 objects step by step. //! class Triangle3::Builder final : public SurfaceBuilderBase3<Triangle3::Builder> { public: //! Returns builder with points. Builder& withPoints(const std::array<Vector3D, 3>& points); //! Returns builder with normals. Builder& withNormals(const std::array<Vector3D, 3>& normals); //! Returns builder with uvs. Builder& withUvs(const std::array<Vector2D, 3>& uvs); //! Builds Triangle3. Triangle3 build() const; //! Builds shared pointer of Triangle3 instance. Triangle3Ptr makeShared() const; private: std::array<Vector3D, 3> _points; std::array<Vector3D, 3> _normals; std::array<Vector2D, 3> _uvs; }; } // namespace jet #endif // INCLUDE_JET_TRIANGLE3_H_ ```
```xml import { ShortenPipe } from './shorten'; describe('ShortenPipe Tests', () => { let pipe: ShortenPipe; beforeEach(() => { pipe = new ShortenPipe(); }); it('should not do anything when not a string', () => { expect(pipe.transform(null)).toEqual(null); expect(pipe.transform(undefined)).toEqual(undefined); expect(pipe.transform(42)).toEqual(42); expect(pipe.transform({ foo: 1, bar: 2 })).toEqual({ foo: 1, bar: 2 }); }); it('should not change the string if the length is more than the string size', () => { expect(pipe.transform('lorem ipsum', 20)).toEqual('lorem ipsum'); expect(pipe.transform('lorem ipsum', 20, '..')).toEqual('lorem ipsum'); }); it('should shorten the string', () => { expect(pipe.transform('lorem ipsum', 5)).toEqual('lorem'); expect(pipe.transform('lorem ipsum', 7)).toEqual('lorem i'); }); it('should shorten the string with suffix', () => { expect(pipe.transform('lorem ipsum', 5, '...')).toEqual('lorem...'); expect(pipe.transform('lorem ipsum', 6, 'abc')).toEqual('lorem abc'); }); it('should shorten the string without word breaking', () => { expect(pipe.transform('lorem ipsum', 4, '...', false)).toEqual('lorem...'); expect(pipe.transform('lorem ipsum', 2, '...', false)).toEqual('lorem...'); expect(pipe.transform('lorem ipsum', 7, '...', false)).toEqual('lorem ipsum'); }); }); ```
```javascript 'use strict' const connectStoreController = require('@pnpm/server').connectStoreController main() .then(() => console.log('Done')) .catch(err => console.error(err)) async function main () { const registry = 'path_to_url const prefix = process.cwd() const storeCtrl = await connectStoreController({ remotePrefix: 'path_to_url }) const response = await storeCtrl.requestPackage( { alias: 'is-positive', pref: '1.0.0' }, { downloadPriority: 0, offline: false, prefix, registry, verifyStoreIntegrity: false, } ) console.log(response) console.log(await response.fetchingManifest) console.log(await response['fetchingFiles']) await storeCtrl.updateConnections(prefix, { addDependencies: [response.id], removeDependencies: [] }) await storeCtrl.saveState() await storeCtrl.close() } ```
S.W.O.R.D. (Sentient World Observation and Response Department) is a fictional counterterrorism and intelligence agency appearing in American comic books published by Marvel Comics. Its purpose is to deal with extraterrestrial threats to world security and is the space-based counterpart of S.H.I.E.L.D., which deals with local threats to the world. The organization appears in several forms of media, such as The Avengers: Earth's Mightiest Heroes and the Marvel Cinematic Universe (MCU) / Disney+ miniseries WandaVision. Publication history S.W.O.R.D. was first introduced in Astonishing X-Men vol. 3 #6 and was created by Joss Whedon and John Cassaday. Fictional organization biography In the comics, S.W.O.R.D. was originally an offshoot of S.H.I.E.L.D., but since the departure of Nick Fury as director of S.H.I.E.L.D., relations between the two organizations have become strained. The head of S.W.O.R.D. is Special Agent Abigail Brand. Its primary command-and-control headquarters are aboard the orbital space station known as the Peak. S.W.O.R.D. had an undercover operative in the X-Mansion. In Astonishing X-Men vol. 3, #17, the identity of this undercover operative was revealed to be Lockheed. In "Unstoppable" The Astonishing X-Men, as well as Hisako Ichiki, Ord of the Breakworld, and Danger, are taken to deep space by S.W.O.R.D. and Agent Abigail Brand. S.W.O.R.D. psychics fail to detect Cassandra Nova in Emma Frost's shattered psyche. Though emotionally wounded, Emma recovered fast enough to be present for the team's departure to the Breakworld, where they planned to disable a missile aimed at Earth. Before they reached Breakworld, they were attacked by enemy vessels. After creating a diversion, the X-Men and Agent Brand landed on the planet, where Agent Deems was being tortured in prison. Brand, Cyclops, Emma Frost, and Beast landed together, while Wolverine, Hisako, Colossus, and Kitty Pryde landed elsewhere. Wolverine's spacecraft disintegrated in mid-air and they were forced to abandon ship. Kitty and Colossus phased through the pod to the planet's surface, where they landed unharmed. Hisako and Wolverine landed with the impact burning Wolverine's skin. Another team composed of Lockheed, Sydren, and S.W.O.R.D. troops converged upon a place called "the Palace of the Corpse". Near the end Agent Brand informs Kitty that Lockheed is working for S.W.O.R.D. as their undercover agent. In "Secret Invasion" During the 2008 "Secret Invasion" storyline, S.W.O.R.D.'s headquarters called the Peak is destroyed by a Skrull infiltrator posing as S.H.I.E.L.D.'s Dum Dum Dugan. Many agents die in the initial explosion, though others survive due to hostile-environment suits. Brand, encased in one of the suits, manages to make her way into one of the Skrull ships. In "Dark Reign" During the 2008 - 2009 "Dark Reign" storyline, S.H.I.E.L.D. is reformed as H.A.M.M.E.R. under Norman Osborn. S.W.O.R.D.'s position under H.A.M.M.E.R. has not yet been revealed. In the Beta Ray Bill: Godhunter mini-series, Beta Ray Bill visits Agent Brand aboard the rebuilt Peak in order to obtain information about the whereabouts of Galactus. S.W.O.R.D. volume 1 During the 2009 Chicago Comic Con, it was announced that Kieron Gillen will collaborate with Steven Sanders on a S.W.O.R.D. ongoing series that began in November 2009. The new series starts with Henry Peter Gyrich being assigned as S.W.O.R.D. co-commander alongside Abigail Brand. In the first arc, Gyrich is able to persuade the heads of S.W.O.R.D. to pass legislation to have all aliens currently living on Earth deported from the planet while Brand was distracted with another mission. He manages to take several notable aliens into custody including Noh-Varr, Adam X, Beta Ray Bill, Jazinda, Karolina Dean, and Hepzibah. The series was cancelled with issue #5. The first issue started with estimated direct sales of 21,988, but that had dropped to 15,113 by the second issue. The Peak is later evacuated after it is damaged by the Apocalypse Twins. The debris from the station nearly destroys Rio de Janeiro, but is safely vaporized by Sunfire. The organization is shown as working smoothly and functioning when it sends a capture team to take custody of alien refugees and a paramedic assistance team to the Jean Grey School. Unfortunately, both teams are murdered by the same Brood-based threat. The rebuilt station is overtaken by alien symbiotes and Brood warriors. The station's personnel are taken for hosts. S.W.O.R.D. volume 2 S.W.O.R.D. was relaunched in December 2020 as part of "Reign of X". Written by Al Ewing and drawn by Valerio Schiti, the initial team consisted of Abigail Brand, Cable, Frenzy, Fabian Cortez, Magneto, Manifold and Wiz Kid. S.W.O.R.D. (Sentient World Observation and Response Directorate) was restored when Abigail Brand resigned from Alpha Flight after the Alliance-Cotati conflict feeling that the space program wasn't properly utilized and when the mutant nation repowered the abandoned Peak space station. In cooperation with the Quiet Council of Krakoa, it became the mutant nation's representative to the outer universe. With Abigail Brand as the Station Commander, S.W.O.R.D functions with a six-tier organizational structure: Technology/Engineering Station Technologist – Wiz Kid (Takeshi Matsuya) Logistics Quintician – Manifold (Eden Fesi) Teleport Team Blink (Clarice Ferguson) Lila Cheney Gateway Vanisher (Telford Porter) Voght (Amelia Voght) Medical/Energy Resources Executive Producer – Khora of the Burning Heart; Fabian Cortez (formerly) Diplomacy/Negotiation Amabassador Extraordinary – Frenzy (Joanna Cargill) Ambassador In Training – Armor (Hisako Ikichi) Galactic Ambassador – Paibok (from the Kree/Skrull Alliance) Security Security Director – Cable (Nathan Summers) Security Team Random (Marshall Stone III) Risque (Gloria Muñoz) Forearm (Michael McCain) Slab (Christopher Anderson) Ruckus (Clement Wilson) Thumbelina (Kristina Anderson) Observation/Analysis Psionic Analyst – Mentallo (Marvin Flumm) Analysis Team Peeper (Peter Quinn) S.W.O.R.D. also formed The Six, a multiversal far-retrieval circuit, utilizing mutant technology. There are two stages require for a full retrieval: First Stage – Translocation: a circuit of five mid-to-long range teleporters which acts as the anchor for translocation. [Back-up: Nightcrawler and Magik] Second Stage – Retrieval: a circuit of six mutants with combining their protection and augmentation powers to reach different points in space. The Control – Wiz Kid: unify the first stage circuit of teleporters and adjust the mutant circuits in operation. [Back-up: Forge] The Power – Khora the Burning Heart; Fabian Cortez (formerly): provide the boost required for the circuit operation. The Shield – Armor: generate a protective exoskeleton that extends to the entire circuit. [Back-up: Skids] The Guide – Manifold: trans-locate the entirety of the second stage circuit while saving his energies for the retrieval. The Eye – Peeper: spot specific particles of their target. [Back-up: Doc] The Foundry – Risque: create a small field around their target condensing and containing it to help bring it back to Earth. [Back-up: Zorn] Roster Volume 1 Former Members: Agent Deems – An autistic S.W.O.R.D. agent. Beast Benjamin Deeds – A mutant with transmorphing abilities. Death's Head Henry Peter Gyrich Lockheed Manifold Tyger – A tiger-like technician who secretly worked for the Providian Order. Mindee – An alias of Irma Cuckoo of the Stepford Cuckoos. Reilly Marshall – An ex-S.H.I.E.L.D. and S.W.O.R.D. agent who currently works for the U.N. Security Council. Spider-Woman Volume 2 Reception Accolades In 2019, CBR.com ranked S.W.O.R.D. 3rd in their "10 Most Powerful Secret Organizations In Marvel Comics" list. In 2022, CBR.com ranked S.W.O.R.D. 10th in their "The Avengers' 10 Best Allies In Marvel Comics" list. In other media Television S.W.O.R.D. appears in The Avengers: Earth's Mightiest Heroes. Introduced in the episode "Welcome to the Kree Empire", this version of the organization operates out of Kang the Conqueror's captured spaceship, the Damocles. When Kree soldiers attack, Agents Carol Danvers and Abigail Brand mobilize to fend them off, with assistance from government agent Henry Peter Gyrich and the Kree's slave Sydren. Once S.W.O.R.D. retakes the Damocles, Sydren joins the organization. In the episode "Secret Invasion", a Skrull posing as Gyrich attempts to place a bomb on the Damocles, but Sydren detects it and evacuates the ship in time before it explodes. The creative team behind the Marvel Cinematic Universe (MCU) TV series Agents of S.H.I.E.L.D. intended to incorporate S.W.O.R.D., but were refused permission by Marvel Studios. S.W.O.R.D. appears in the Disney+ / MCU miniseries WandaVision. This version of the organization's full name is the Sentient Weapon Observation and Response Division and was founded by Maria Rambeau. Following the events of the film Avengers: Infinity War, S.W.O.R.D. recovered Vision's body from Wakanda and under acting director Tyler Hayward, investigate Westview, New Jersey after Wanda Maximoff places it under a hex. Under Hayward's orders, they use a drone empowered by Maximoff to reactivate Vision. When she opens the hex to allow Westview's residents to escape, she inadvertently allows Hayward, the original Vision, and several S.W.O.R.D. agents in. However, Wanda's sons Billy and Tommy disarm them while a fictional Vision that Wanda created causes the original Vision to flee. Additionally, former S.W.O.R.D. agent and Maria's daughter, Monica Rambeau, and astrophysicist Dr. Darcy Lewis confront Hayward, who is later arrested by the FBI. Film S.W.O.R.D. was originally intended to appear in the MCU film Thor via a deleted post-credits scene wherein Erik Selvig tells Jane Foster and Darcy Lewis to "cross reference... with the S.W.O.R.D. database". Due to complications with 20th Century Fox, which owned the film rights to S.W.O.R.D. members Lockheed and Abigail Brand at the time however, the scene was cut. Video games An alternate universe incarnation of S.W.O.R.D. appears in Marvel Super Hero Squad. This version of the organization is an evil version of S.H.I.E.L.D. that the Silver Surfer encounters while in an alternate universe. S.W.O.R.D. appears in Marvel Avengers Alliance Tactics. Collected editions Volume 1 Volume 2 See also S.W.O.R.D. (Marvel Cinematic Universe) List of government agencies in Marvel Comics References External links S.W.O.R.D. at Marvel Database Project S.W.O.R.D. at Comic Vine S.W.O.R.D. at Runaways.mergingminds X-Men supporting characters
```go package users import ( "opms/models" "time" "github.com/astaxie/beego" "github.com/astaxie/beego/orm" ) type Notices struct { Id int64 `orm:"pk;column(noticeid);"` Title string Content string Created int64 Status int } func (this *Notices) TableName() string { return models.TableName("notices") } func init() { orm.RegisterModel(new(Notices)) } func GetNotices(id int64) (Notices, error) { var not Notices var err error o := orm.NewOrm() not = Notices{Id: id} err = o.Read(&not) if err == orm.ErrNoRows { return not, nil } return not, err } func UpdateNotices(id int64, upd Notices) error { var not Notices o := orm.NewOrm() not = Notices{Id: id} not.Title = upd.Title not.Content = upd.Content _, err := o.Update(&not, "title", "content") return err } func AddNotices(updDep Notices) error { o := orm.NewOrm() o.Using("default") not := new(Notices) not.Id = updDep.Id not.Title = updDep.Title not.Content = updDep.Content not.Status = 1 not.Created = time.Now().Unix() _, err := o.Insert(not) return err } func ListNotices(condArr map[string]string, page int, offset int) (num int64, err error, dep []Notices) { o := orm.NewOrm() o.Using("default") qs := o.QueryTable(models.TableName("notices")) cond := orm.NewCondition() if condArr["keywords"] != "" { cond = cond.AndCond(cond.And("name__icontains", condArr["keywords"])) } if condArr["status"] != "" { cond = cond.And("status", condArr["status"]) } qs = qs.SetCond(cond) if page < 1 { page = 1 } if offset < 1 { offset, _ = beego.AppConfig.Int("pageoffset") } start := (page - 1) * offset var deps []Notices qs = qs.OrderBy("noticeid") num, err1 := qs.Limit(offset, start).All(&deps) return num, err1, deps } // func CountNotices(condArr map[string]string) int64 { o := orm.NewOrm() qs := o.QueryTable(models.TableName("notices")) cond := orm.NewCondition() if condArr["keywords"] != "" { cond = cond.AndCond(cond.And("name__icontains", condArr["keywords"])) } if condArr["status"] != "" { cond = cond.And("status", condArr["status"]) } num, _ := qs.SetCond(cond).Count() return num } // func ChangeNoticeStatus(id int64, status int) error { o := orm.NewOrm() not := Notices{Id: id} err := o.Read(&not, "noticeid") if nil != err { return err } else { not.Status = status _, err := o.Update(&not) return err } } func DeleteNotice(id int64) error { o := orm.NewOrm() _, err := o.Delete(&Notices{Id: id}) return err } ```
Mark Ronald Holland (born May 6, 1969) is an American pastor, politician, and community leader who served as the 28th mayor of Kansas City, Kansas between 2013 and 2018. A Democrat, he was the party's nominee for U.S. Senator from Kansas in the 2022 election, losing to Republican Jerry Moran in a landslide. Early life and education Holland was born on May 6, 1969, in Kansas City, Kansas (KCK). He is the third child and only son of Rev. Dr. Ronald E. Holland, a Methodist minister, and Marci L. Holland, a public school teacher. After graduating from Shawnee Mission West High School in 1987, he attended Southern Methodist University in Dallas, Texas, where he majored in philosophy and anthropology. He earned a Master of Divinity degree from Iliff School of Theology and a Doctor of Ministry degree from St. Paul School of Theology, both United Methodist schools. Religious work Holland grew up wanting to be a United Methodist pastor. During seminary, he worked as a counselor with youth facing challenges with abuse, neglect, and addiction issues in both intensive outpatient and residential settings. After ordination, Holland served as a student pastor at Washington Park UMC in Denver, Colorado and then as a pastor in both the Elwood Community Church in Elwood, Kansas, and Wathena United Methodist Church in Wathena, Kansas. In 1999, Holland became Senior Pastor at Trinity Community Church in Kansas City, Kansas, where he served until 2018. In July 2018, Holland co-founded Mainstream UMC with Rev. Dr. Nanette Roberts, pastor of Olathe Grace United Methodist Church. The group advocates for the inclusion of the LGBTQ+ community into the church, as well as ordination and marriage. He continues to serve as executive director. Public office According to his father, Holland showed an early interest in politics and public service. His first foray into elected office came when he served on the Unified Government Board of Commissioners of Wyandotte County/Kansas City, Kansas, At-Large District 1 seat. He ran on parks, pools, playgrounds and paths for exercise. The idea was to increase the availability of green space to residents, especially children and families. When "Wyandotte County finished dead last in a 2009 health rankings study" of all counties in Kansas, this plan took on a new level of importance. In 2011, the Board of Commissioners adopted the Complete Streets Resolution. The purpose was to accommodate all road users equally by realizing a balanced road and trail network that safely moves people, not just vehicles. He left his Commissioner seat to pursue the mayor's office. In 2013, Holland became the 28th Mayor of Kansas City, Kansas and the 3rd Mayor/CEO of the Unified Government. His administration priorities were "economic development, innovation, and healthy communities." In his effort to better the health outcomes for KCK residents, Holland lobbied then Governor Brownback to accept Medicaid expansion, as allowed by the Affordable Care Act. Holland called the expansion the single most important thing the state could do to help the uninsured in Wyandotte County and that Brownback's hard stance on work requirements did not consider the employment challenges faced by people with mental health and chronic health conditions. To improve the downtown KCK area, Holland unveiled The Healthy Campus project as a top initiative for his first term in a State of the Government address in 2014. He hoped for it to be a national model for healthy living in an urban area. The project envisioned bringing quality grocery stores to areas in need of access to better food choices, and offering amenities, such as greenhouses and gardens with edible fruit trees, and facilities, like a community center with Olympic-size pool for youth swim meets, that were accessible to all. In 2018, under the leadership of his successor, the plan was abandoned. In Holland's first year in office, the Federal Bureau of Labor Statistics announced Wyandotte County created more jobs than most other counties in the metro area, with many of the new jobs coming out of the manufacturing sector. During his tenure, the unemployment rate fell from 7.6% in May 2013 to 4.5% in December 2017. With the state as a partner, Holland promoted a number of development projects. In July 2016, U.S. Soccer broke ground on a National Training and Coaching Development Center in KCK. A week later, Amazon broke ground on a 855,000-plus-square-foot fulfillment center that would pick, pack, and ship smaller customer items, such as books, electronics and toys. The company planned to employ close to 1000 people. In 2016, a consultant study, commissioned by Holland, found concerns with the fire department's shift allocation and overtime budget. Efforts to address these findings did not have support among Commissioners or the fire department union. In 2017, Holland lost re-election to a second term to David Alvey. 2022 U.S. Senate campaign On October 1, 2021, Holland announced he would be vying for the Democratic Party nomination for the U.S. Senate seat in Kansas. On August 2, 2022, he won the primary with 41% of the vote. In the general election, Holland faced incumbent U.S. Senator Jerry Moran. Moran defeated Holland 60% to 37%. Personal life Holland has four children. References External links Rev. Mark Holland for Kansas campaign website |- 1969 births 21st-century American politicians American United Methodist clergy Candidates in the 2022 United States Senate elections Kansas Democrats Living people Mayors of places in Kansas Politicians from Kansas City, Kansas Southern Methodist University alumni Saint Paul School of Theology alumni
YSNP can refer to: Yellowstone National Park, in Wyoming, United States. Yushan National Park in Taiwan "You Shall Not Pass", a famous quote from Gandalf during his battle with a balrog in The Lord of the Rings
The Return of Doctor X (also billed as The Return of Dr. X) is a 1939 American science fiction-horror film directed by Vincent Sherman and starring Wayne Morris, Rosemary Lane, and Humphrey Bogart as the title character. It was based on the short story "The Doctor's Secret" by William J. Makin. Despite supposedly being a sequel to Doctor X (1932), also produced by Warner Bros., the films are unrelated. This was Bogart's only science fiction or horror film. Plot summary A pair of bizarre murders occur wherein the victims are drained of their rare Type One blood type. Reporter Walter Garrett consults with his friend Dr. Mike Rhodes which leads them to Rhodes' former mentor, hematologist Dr. Francis Flegg. Flegg is initially unhelpful, but Garrett and Rhodes notice a striking resemblance between Flegg's strange assistant, Marshall Quesne and the late Dr. Maurice Xavier in old press cuttings. After opening Xavier's grave and finding it empty, they confront Flegg. Flegg admits using his new scientific methods to bring Xavier back from the dead and has employed synthetic blood to sustain his life. However, the blood cannot replace itself, and therefore, Quesne/Xavier must seek out human victims with the rare Type One blood type contained in the formula in order to stay alive. A hunt begins for Quesne, who has discovered that Joan Vance, a nurse and Rhodes' sweetheart, is a carrier of the rare blood type. He escapes with her in a taxi, professing to be taking her to Rhodes. Barnett and Rhodes, accompanied by the police, track them to their location. Quesne is shot dead, and Joan is saved from the fate of the others. Cast Wayne Morris as Walter Garrett (Barnett in the on-screen credits) Rosemary Lane as Joan Vance Humphrey Bogart as Dr. Maurice Xavier, a.k.a. Marshall Quesne Dennis Morgan as Dr. Mike Rhodes John Litel as Dr. Francis Flegg Lya Lys as Angela Merrova Huntz Hall as Pinky Charles Wilson as Detective Ray Kincaid Vera Lewis as Miss Sweetman Howard Hickman as Chairman (scenes deleted) Olin Howland as Undertaker Arthur Aylesworth as Guide Cliff Saum as Detective Sergeant Moran Creighton Hale as Hotel Manager John Ridgely as Rodgers Joe Crehan as Editor Glen Langan as Interne DeWolf Hopper as Interne See also Vampire film References External links 1939 films 1939 horror films American science fiction horror films American black-and-white films 1930s English-language films Films based on short fiction Films directed by Vincent Sherman American sequel films American vampire films Warner Bros. films 1930s science fiction horror films 1939 directorial debut films 1930s American films Films scored by Bernhard Kaun Resurrection in film
Tumatai Dauphin (born 12 January 1988) is a French Polynesian shot-putter who has represented French Polynesia at the Pacific Games and Pacific Mini Games, and France at the Jeux de la Francophonie. Dauphin has been competing with the shot put since the age of 15. He moved to France in 2006 to pursue his athletics career. After a serious ankle injury ended his Olympic aspirations, he returned to French Polynesia to recover and become a coach. He won gold in shot put at the 2009 Jeux de la Francophonie in Beirut. At the 2011 Pacific Games in Nouméa he won gold in the shot put. He won gold at the 2015 French Indoor Athletics Championships with a record throw of 20.10 meters. At the 2015 Pacific Games in Port Moresby he won gold, and set a Pacific games record of 19.14 meters. At the 2019 Pacific Games in Apia he won silver. At the 2022 Pacific Mini Games in Saipan he won gold. He currently coaches Loveleina Wong-Sang. References Living people 1988 births French Polynesian shot putters
```java package com.jacky.launcher.util; import android.bluetooth.BluetoothDevice; import android.content.Context; import android.content.Intent; import android.content.pm.PackageInfo; import android.content.pm.PackageManager; import android.content.pm.ResolveInfo; import android.os.Environment; import android.os.StatFs; import android.telephony.TelephonyManager; import android.view.View; import android.view.ViewGroup; import android.widget.ListAdapter; import android.widget.ListView; import android.widget.Toast; import org.json.JSONException; import org.json.JSONObject; import java.io.File; import java.lang.reflect.Method; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Date; import java.util.List; import java.util.regex.Matcher; import java.util.regex.Pattern; public final class Tools { private static String TAG = "Tools"; private final static String[] hexDigits = {"0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f"}; private Tools() throws InstantiationException { throw new InstantiationException("This class is not created for instantiaation"); } public static String byteArrayToHexString(byte[] b) { StringBuffer resultSb = new StringBuffer(); for (int i = 0; i < b.length; i++) { resultSb.append(byteToHexString(b[i])); } return resultSb.toString(); } private static String byteToHexString(byte b) { int n = b; if (n < 0) n = 256 + n; int d1 = n / 16; int d2 = n % 16; return hexDigits[d1] + hexDigits[d2]; } /** * @param mobiles * @return */ public static boolean isMobileNO(String mobiles) { Pattern p = Pattern .compile("^((13[0-9])|(15[^4,\\D])|(18[0,1,3,5-9]))\\d{8}$"); Matcher m = p.matcher(mobiles); System.out.println(m.matches() + "-telnum-"); return m.matches(); } /** * @param expression * @param text * @return */ private static boolean matchingText(String expression, String text) { Pattern p = Pattern.compile(expression); Matcher m = p.matcher(text); return m.matches(); } /** * @param zipcode * @return */ public static boolean isZipcode(String zipcode) { Pattern p = Pattern.compile("[0-9]\\d{5}"); Matcher m = p.matcher(zipcode); System.out.println(m.matches() + "-zipcode-"); return m.matches(); } /** * @param email * @return */ public static boolean isValidEmail(String email) { Pattern p = Pattern .compile("^([a-z0-9A-Z]+[-|\\.]?)+[a-z0-9A-Z]@([a-z0-9A-Z]+(-[a-z0-9A-Z]+)?\\.)+[a-zA-Z]{2,}$"); Matcher m = p.matcher(email); System.out.println(m.matches() + "-email-"); return m.matches(); } /** * @param telfix * @return */ public static boolean isTelfix(String telfix) { Pattern p = Pattern.compile("d{3}-d{8}|d{4}-d{7}"); Matcher m = p.matcher(telfix); System.out.println(m.matches() + "-telfix-"); return m.matches(); } /** * @param name * @return */ public static boolean isCorrectUserName(String name) { Pattern p = Pattern.compile("([A-Za-z0-9]){2,10}"); Matcher m = p.matcher(name); System.out.println(m.matches() + "-name-"); return m.matches(); } /** * @param pwd * @return */ public static boolean isCorrectUserPwd(String pwd) { Pattern p = Pattern.compile("\\w{6,18}"); Matcher m = p.matcher(pwd); System.out.println(m.matches() + "-pwd-"); return m.matches(); } /** * @return */ public static boolean hasSdcard() { String state = Environment.getExternalStorageState(); if (state.equals(Environment.MEDIA_MOUNTED)) { return true; } else { return false; } } /** * @param endTime * @param countDown * @return */ public static String calculationRemainTime(String endTime, long countDown) { SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); try { Date now = new Date(System.currentTimeMillis());// Date endData = df.parse(endTime); long l = endData.getTime() - countDown - now.getTime(); long day = l / (24 * 60 * 60 * 1000); long hour = l / (60 * 60 * 1000) - day * 24; long min = (l / (60 * 1000)) - day * 24 * 60 - hour * 60; long s = l / 1000 - day * 24 * 60 * 60 - hour * 60 * 60 - min * 60; return "" + day + "" + hour + "" + min + "" + s + ""; } catch (ParseException e) { e.printStackTrace(); } return ""; } public static void showLongToast(Context act, String pMsg) { Toast toast = Toast.makeText(act, pMsg, Toast.LENGTH_LONG); toast.show(); } public static void showShortToast(Context act, String pMsg) { Toast toast = Toast.makeText(act, pMsg, Toast.LENGTH_SHORT); toast.show(); } /** * @param context * @return */ public static String getImeiCode(Context context) { TelephonyManager tm = (TelephonyManager) context .getSystemService(Context.TELEPHONY_SERVICE); return tm.getDeviceId(); } /** * @param listView * @author sunglasses * @category listview */ public static void setListViewHeightBasedOnChildren(ListView listView) { ListAdapter listAdapter = listView.getAdapter(); if (listAdapter == null) { return; } int totalHeight = 0; for (int i = 0; i < listAdapter.getCount(); i++) { View listItem = listAdapter.getView(i, null, listView); listItem.measure(0, 0); totalHeight += listItem.getMeasuredHeight(); } ViewGroup.LayoutParams params = listView.getLayoutParams(); params.height = totalHeight + (listView.getDividerHeight() * (listAdapter.getCount() - 1)); listView.setLayoutParams(params); } public static PackageInfo getAPKVersionInfo(Context context, String packageName) { PackageManager packageManager = context.getPackageManager(); PackageInfo packInfo = null; try { packInfo = packageManager.getPackageInfo(packageName, 0); } catch (PackageManager.NameNotFoundException e) { e.printStackTrace(); } return packInfo; } /** * sd * * @return */ public static long getSDAvailableSize() { File path = Environment.getExternalStorageDirectory(); StatFs stat = new StatFs(path.getPath()); long blockSize = stat.getBlockSize(); long availableBlocks = stat.getAvailableBlocks(); return blockSize * availableBlocks / 1024; } /** * json */ public static boolean isJson(String value) { try { new JSONObject(value); } catch (JSONException e) { return false; } return true; } public static List<ResolveInfo> findActivitiesForPackage(Context context, String packageName) { final PackageManager packageManager = context.getPackageManager(); final Intent mainIntent = new Intent(Intent.ACTION_MAIN, null); mainIntent.addCategory(Intent.CATEGORY_LAUNCHER); mainIntent.setPackage(packageName); final List<ResolveInfo> apps = packageManager.queryIntentActivities(mainIntent, 0); return apps != null ? apps : new ArrayList<ResolveInfo>(); } static public boolean removeBond(Class btClass, BluetoothDevice btDevice) throws Exception { Method removeBondMethod = btClass.getMethod("removeBond"); Boolean returnValue = (Boolean) removeBondMethod.invoke(btDevice); return returnValue.booleanValue(); } } ```
Regimes of truth is a term coined by philosopher Michel Foucault, referring to a discourse that holds certain things to be "truths". Foucault sought to explore how knowledge and truth were produced by power structures of society. References Michel Foucault Epistemological theories
Javad Marandi (born February 1968) is a British businessman, property developer and Conservative Party donor, with investments in commercial and residential real estate. Early life Marandi was born in February 1968, in Tehran, Iran. He moved to Britain in 1979, and studied Electrical and Electronics Engineering. Marandi then qualified as a UK chartered accountant, at Coopers & Lybrand (now part of PricewaterhouseCoopers). In the 1990s, he worked as a business development manager for The Coca-Cola Company in Central Asia, and the area manager for emerging markets at Philip Morris International, before starting his own businesses in tobacco distribution, advertising and telecommunications, eventually holding the franchise agreement for McDonald's in Azerbaijan. Investments Property Marandi has invested in numerous luxury establishments within the hospitality sector, including hotels such as Soho Farmhouse, Soho House group's country hotel and club in Oxfordshire, England, Chais Monnet, a 92-room luxury hotel, restaurant and retail development in Cognac, France, Sofitel Brussels, and CenterParc in Moselle, France. He has also invested in restaurants such as Shirvan, Michelin starred-chef Akrame Benallal's high-end restaurant on Place d'Alma, in central Paris. Marandi is both an investor and developer in the UK property market. Retail In 2014, Marandi took a majority stake in Wed2B, a UK mid-market wedding apparel retailer, focused on regional UK towns and cities. Since his involvement in the business, the company has expanded from three to over 40 stores. Wed2B ranked in the FT1000 in both 2019 and 2020, and placed in the Sunday Times Virgin Fast Track 100 in both 2017 and 2018” It ranks Britain's fastest-growing privately held companies by sales growth over the preceding three years. In March 2020, the Marandi family acquired 100% of the Conran Shop, the luxury interior design and furniture retailer founded by Sir Terence Conran in 1973. Logistics Marandi held a controlling stake in Roth Gerueste, a Swiss market scaffolding and hi-tech building materials manufacturer until early 2021. Lux Magazine published an interview with him in 2016 on investing in Switzerland. Legal disputes In May 2023, Marandi lost a 19-month legal battle with the BBC to remain anonymous regarding a National Crime Agency (NCA) global money laundering investigation. On 16 May 2023, it was reported that the NCA found some of Marandi's overseas interests had been involved in the Azerbaijani laundromat money-laundering scheme. Philanthropy The Marandi Foundation supports children's health and education; and cultural history and art. Marandi is also chairman of the advisory board of The Watercolour World, a charity working to provide online public access to thousands of documentary watercolours from all over the world. The goal of the charity is to collate a unique visual history of the world. The Prince of Wales and the Duchess of Cornwall are joint patrons of the Watercolour World, which is chaired by Fred Hohler. In March 2021, Marandi was appointed co-chair to the Growth Board of homelessness charity Centrepoint. In 2021, The Marandi Foundation partnered with the Conran Shop on the New Designer of the Future Award, which supports creative talent denoting an accolade and a £40,000 in investment money to further develop the winner's ideas. Personal life In 2013 the Marandi family, one of Azerbaijan's richest, was thought to live in a house in Eaton Square in London's Belgravia sold in 2007 for £3.8 million, and in 2010 for £20.5 million. This led to legal difficulties. Marandi was reported to have "two private jets and a passion for vintage wine". He donates to the Conservative Party. He donated £756,300 between 2014 and 2020 and £250,000 during the 2019 United Kingdom general election campaign. His wife Narmina is the daughter of Ali Alizadeh, an oncologist in Baku, Azerbaijan. Javad and Narmina are investors in Anya Hindmarch and Emilia Wickstead, the London-based fashion houses. Narmina is a co-chair of the British Fashion Council Foundation as well as a patron and board member of the BFC Fashion Trust and co-head of the Cultural and Social Committee of the Serpentine Galleries. Marandi was appointed Officer of the Order of the British Empire (OBE) in the 2020 New Year Honours for services to business and philanthropy. References 1968 births British businesspeople Living people Businesspeople from Tehran Iranian emigrants to the United Kingdom Naturalised citizens of the United Kingdom Officers of the Order of the British Empire Conservative Party (UK) donors
```java package com.base.adapter; import android.util.Log; import com.App; import com.C; import com.base.DbRepository; import com.base.NetRepository; import com.base.util.NetWorkUtil; import java.util.HashMap; import java.util.List; /** * Created by baixiaokang on 16/12/27. */ @SuppressWarnings("unchecked") public class AdapterPresenter<M> { private NetRepository mNetRepository;// private HashMap<String, Object> param = new HashMap<>();// private DbRepository mDbRepository; private int begin = 0; private final IAdapterView<M> view; interface IAdapterView<M> { void setEmpty(); void setNetData(List<M> data, int begin); void setDBData(List<M> data); void reSetEmpty(); } AdapterPresenter(IAdapterView mIAdapterViewImpl) { this.view = mIAdapterViewImpl; } public HashMap<String, Object> getParam() { return param; } public AdapterPresenter setNetRepository(NetRepository netRepository) { this.mNetRepository = netRepository; return this; } public AdapterPresenter setParam(String key, Object value) { this.param.put(key, value); return this; } public AdapterPresenter setDbRepository(DbRepository mDbRepository) { this.mDbRepository = mDbRepository; return this; } public void setBegin(int begin) { this.begin = begin; } public void fetch() { if (!NetWorkUtil.isNetConnected(App.getAppContext())) { getDbData(); return; } begin++; view.reSetEmpty(); if (mNetRepository == null) { Log.e("mNetRepository", "null"); return; } param.put(C.PAGE, begin); mNetRepository .getData(param) .subscribe(res -> view.setNetData(res.results, begin), err -> getDbData()); } private void getDbData() { if (mDbRepository != null) mDbRepository .getData(param) .subscribe( r -> view.setDBData((List<M>) r), e -> view.setEmpty()); else view.setEmpty(); } } ```
Spoilers of the Range is a 1939 American Western film directed by Charles C. Coleman and starring Charles Starrett. Plot Hero Jeff Strong (Starrett) comes to the rescue of a group of victimized ranchers. The villains are a gang of crooked gamblers, who demand a valuable dam as payment for a $50,000 debt. The ranchers hope to earn the money by getting their cattle to market on time, but head bad guy Cash Fenton (Kenneth MacDonald) and his flunkey Lobo (Dick Curtis) intend to prevent this. Cast Charles Starrett as Jeff Strong Iris Meredith as Madge Patterson Sons of the Pioneers as Musicians Dick Curtis as Lobo Savage Kenneth MacDonald as Cash Fenton Hank Bell as Sheriff Hank Bob Nolan as Bob Edward LeSaint as Dan Patterson Forbes Murray as David Rowland Art Mix as Santos - Henchman Edmund Cobb as Kendall - Rancher Edward Peil Sr. as Harper - Rancher References External links 1939 films American Western (genre) films 1939 Western (genre) films Films directed by Charles C. Coleman American black-and-white films Columbia Pictures films 1930s American films
```xml import { Entity } from "../../../../../../src/decorator/entity/Entity" import { PrimaryColumn } from "../../../../../../src/decorator/columns/PrimaryColumn" import { Column } from "../../../../../../src/decorator/columns/Column" import { OneToOne } from "../../../../../../src/decorator/relations/OneToOne" import { JoinColumn } from "../../../../../../src/decorator/relations/JoinColumn" import { Category } from "./Category" @Entity() export class Tag { @Column() code: number @PrimaryColumn() title: string @PrimaryColumn() description: string @OneToOne((type) => Category, (category) => category.tag) @JoinColumn() category: Category @OneToOne((type) => Category, (category) => category.tagWithOptions) @JoinColumn([ { name: "category_name", referencedColumnName: "name" }, { name: "category_type", referencedColumnName: "type" }, ]) categoryWithOptions: Category @OneToOne((type) => Category, (category) => category.tagWithNonPKColumns) @JoinColumn([ { name: "category_code", referencedColumnName: "code" }, { name: "category_version", referencedColumnName: "version" }, { name: "category_description", referencedColumnName: "description" }, ]) categoryWithNonPKColumns: Category } ```
```go package telemetry import ( "time" "github.com/hashicorp/go-metrics" ) // Common metric key constants const ( MetricKeyBeginBlocker = "begin_blocker" MetricKeyEndBlocker = "end_blocker" MetricKeyPrepareCheckStater = "prepare_check_stater" MetricKeyPrecommiter = "precommiter" MetricLabelNameModule = "module" ) // NewLabel creates a new instance of Label with name and value func NewLabel(name, value string) metrics.Label { return metrics.Label{Name: name, Value: value} } // ModuleMeasureSince provides a short hand method for emitting a time measure // metric for a module with a given set of keys. If any global labels are defined, // they will be added to the module label. func ModuleMeasureSince(module string, start time.Time, keys ...string) { if !IsTelemetryEnabled() { return } metrics.MeasureSinceWithLabels( keys, start.UTC(), append([]metrics.Label{NewLabel(MetricLabelNameModule, module)}, globalLabels...), ) } // ModuleSetGauge provides a short hand method for emitting a gauge metric for a // module with a given set of keys. If any global labels are defined, they will // be added to the module label. func ModuleSetGauge(module string, val float32, keys ...string) { if !IsTelemetryEnabled() { return } metrics.SetGaugeWithLabels( keys, val, append([]metrics.Label{NewLabel(MetricLabelNameModule, module)}, globalLabels...), ) } // IncrCounter provides a wrapper functionality for emitting a counter metric with // global labels (if any). func IncrCounter(val float32, keys ...string) { if !IsTelemetryEnabled() { return } metrics.IncrCounterWithLabels(keys, val, globalLabels) } // IncrCounterWithLabels provides a wrapper functionality for emitting a counter // metric with global labels (if any) along with the provided labels. func IncrCounterWithLabels(keys []string, val float32, labels []metrics.Label) { if !IsTelemetryEnabled() { return } metrics.IncrCounterWithLabels(keys, val, append(labels, globalLabels...)) } // SetGauge provides a wrapper functionality for emitting a gauge metric with // global labels (if any). func SetGauge(val float32, keys ...string) { if !IsTelemetryEnabled() { return } metrics.SetGaugeWithLabels(keys, val, globalLabels) } // SetGaugeWithLabels provides a wrapper functionality for emitting a gauge // metric with global labels (if any) along with the provided labels. func SetGaugeWithLabels(keys []string, val float32, labels []metrics.Label) { if !IsTelemetryEnabled() { return } metrics.SetGaugeWithLabels(keys, val, append(labels, globalLabels...)) } // MeasureSince provides a wrapper functionality for emitting a time measure // metric with global labels (if any). func MeasureSince(start time.Time, keys ...string) { if !IsTelemetryEnabled() { return } metrics.MeasureSinceWithLabels(keys, start.UTC(), globalLabels) } // Now return the current time if telemetry is enabled or a zero time if it's not func Now() time.Time { if !IsTelemetryEnabled() { return time.Time{} } return time.Now() } ```
Forest Lake Academy is a private high school outside Orlando, Florida. It is owned and operated by the Florida Conference of Seventh-day Adventists. It is a part of the Seventh-day Adventist education system, the world's second-largest Christian school system. History The Lake Winyah School The first academy established by the Florida Conference of Seventh-day Adventists was Lake Winyah Academy in 1918 in Orlando, Florida. In March, 1918, the Florida Conference Committee and the Sanitarium Board met. William H. Branson, L. H. Wood, J. A. Tucker, and W. E. Abernathy were present. They planned for the opening of the school. This included the construction of two buildings: a main building and a dormitory. Both these buildings were to be built as economically as possible; later on more permanent structures could be built. The conference and sanitarium leadership served on the board of the school. They planned to open in fall 1918. This first school was to be located between Winyah and Estelle Lakes. Adventist University of Health Sciences (formerly Florida Hospital College of Health Sciences) is located there now. Forest Lake Academy The growing school moved outside the city to its current location in 1926 and was renamed Forest Lake Academy. The first classes were held in the farm house of the newly acquired site. Location The campus is located in unincorporated Seminole County, Florida between Apopka and Altamonte Springs. Because of ZIP code assignments, the school is usually referred to as being in Apopka, although it is in a different county. Academic programs Forest Lake Academy was accredited by the Southern Association of Colleges and Schools (SACS) from 1948 to 2011, and is now accredited by Middle States Association of Colleges and Schools. In addition to offering a general diploma and a college preparatory diploma, Forest Lake has an honors program with various concentration tracks including mathematics, humanities, and science. It offers several dual enrollment courses to students with high academic standing. Curriculum The school's curriculum consists primarily of the standard courses taught at college preparatory schools across the world. All students are required to take classes in the core areas of English, basic sciences, mathematics, social sciences, and a foreign language. In addition, religion classes are mandated on a yearly basis. Spiritual aspect All students are required to take religion classes each year that they are enrolled. These classes cover topics in biblical history and Christian and denominational doctrines.. Instructors in other disciplines also begin each class period with prayer or a short devotional thought. Weekly, the entire student body gathers together in the auditorium for an hour-long chapel service. Outside the classrooms there is year-round spiritually oriented programming that relies on student involvement. See also List of Seventh-day Adventist secondary schools Seventh-day Adventist education References External links High schools in Orange County, Florida Private high schools in Florida Educational institutions established in 1918 1918 establishments in Florida Adventist secondary schools in the United States
Yonkers Water Works is a historic public water works located at Yonkers, Westchester County, New York. Three buildings remain extant; two were built in 1876 and one in 1898. They are reflective of the High Victorian style. The Tuckahoe Road Pumping Station was built in 1876 and expanded before 1900. The original section is three bays wide and three bays deep with a central projecting pavilion and pedimented gable roof. The gatehouse at Grassy Sprain Reservoir was also constructed in 1876. It is a small, one story masonry building on a high granite foundation. The Tubewell Station was built in 1898 and expanded in 1922. It is a red brick building, one and one half stories high and five bays wide and 13 bays deep. It was added to the National Register of Historic Places in 1982. See also References Buildings and structures in Yonkers, New York Water supply infrastructure on the National Register of Historic Places Government buildings on the National Register of Historic Places in New York (state) Infrastructure completed in 1876 Infrastructure completed in 1898 Victorian architecture in New York (state) Former pumping stations National Register of Historic Places in Yonkers, New York
Onuoha Ogbonna (born 14 August 1988) is a Nigerian football striker. References 1988 births Living people Nigerian men's footballers US Monastir (football) players Al-Riffa SC players Khor Fakkan Club players Men's association football forwards Tunisian Ligue Professionnelle 1 players Nigerian expatriate men's footballers Expatriate men's footballers in Tunisia Nigerian expatriate sportspeople in Tunisia Expatriate men's footballers in Bahrain Nigerian expatriate sportspeople in Bahrain Expatriate men's footballers in the United Arab Emirates Nigerian expatriate sportspeople in the United Arab Emirates
```javascript const parse_multi_platform_luis_1 = require('./../luis/propertyHelper'); const LuisGenBuilder = require('./../luis/luisGenBuilder') const Writer = require('./helpers/writer') module.exports = { writeFromLuisJson: async function(luisJson, className, outPath) { const app = LuisGenBuilder.build(luisJson); let writer = new Writer(); writer.indentSize = 2; await writer.setOutputStream(outPath); this.header(writer); this.intents(app, writer); this.entities(app, writer); this.classInterface(className, writer); await writer.closeOutputStream(); }, header: function(writer) { writer.writeLine([ '/**', ' * <auto-generated>', ' * Code generated by luis:generate:ts', ' * Tool github: path_to_url ' * Changes may cause incorrect behavior and will be lost if the code is', ' * regenerated.', ' * </auto-generated>', ' */', "import {DateTimeSpec, GeographyV2, InstanceData, IntentData, NumberWithUnits, OrdinalV2} from 'botbuilder-ai'" ]); }, intents: function(app, writer) { writer.writeLine(); writer.writeLineIndented('export interface GeneratedIntents {'); writer.increaseIndentation(); app.intents.forEach((intent) => { writer.writeLineIndented(`${parse_multi_platform_luis_1.normalizeName(intent)}: IntentData`); }); writer.decreaseIndentation(); writer.writeLine('}'); }, entities: function(app, writer) { // Composite instance and data app.composites.forEach((composite) => { let name = parse_multi_platform_luis_1.normalizeName(composite.compositeName); writer.writeLine(); writer.writeLineIndented(`export interface GeneratedInstance${name} {`); writer.increaseIndentation(); composite.attributes.forEach((attribute) => { writer.writeLineIndented(`${parse_multi_platform_luis_1.jsonPropertyName(attribute)}?: InstanceData[]`); }); writer.decreaseIndentation(); writer.writeLineIndented('}'); writer.writeLineIndented(`export interface ${name} {`); writer.increaseIndentation(); composite.attributes.forEach(attribute => { writer.writeLineIndented(this.getEntityWithType(attribute, this.isList(attribute, app))); }); writer.writeLineIndented(`$instance?: GeneratedInstance${name}`); writer.decreaseIndentation(); writer.writeLineIndented('}'); }); writer.writeLine(); // Entity instance writer.writeLineIndented('export interface GeneratedInstance {'); writer.increaseIndentation(); app.getInstancesList().forEach(instance => { writer.writeLineIndented(`${parse_multi_platform_luis_1.jsonPropertyName(instance)}?: InstanceData[]`); }); writer.decreaseIndentation(); writer.writeLineIndented('}'); // Entities writer.writeLine(); writer.writeLineIndented('export interface GeneratedEntities {'); writer.increaseIndentation(); this.writeEntityGroup(app.entities, '// Simple entities', writer); writer.writeLineIndented('// Built-in entities'); app.prebuiltEntities.forEach(builtInEntity => { builtInEntity.forEach(entity => { writer.writeLineIndented(this.getEntityWithType(entity)); }); }); writer.writeLine(); this.writeEntityGroup(app.closedLists, '// Lists', writer, true); this.writeEntityGroup(app.regex_entities, '// Regex entities', writer); this.writeEntityGroup(app.patternAnyEntities, '// Pattern.any', writer); // Composites writer.writeLineIndented('// Composites'); app.composites.forEach(composite => { writer.writeLineIndented(`${composite.compositeName}?: ${composite.compositeName}[]`); }); writer.writeLineIndented('$instance: GeneratedInstance'); writer.decreaseIndentation(); writer.writeLineIndented('}'); }, classInterface: function(className, writer) { writer.writeLine(); writer.writeLineIndented(`export interface ${className} {`); writer.increaseIndentation(); writer.writeLineIndented([ 'text: string', 'alteredText?: string', 'intents: GeneratedIntents', 'entities: GeneratedEntities', '[propName: string]: any' ]); writer.decreaseIndentation(); writer.writeLineIndented('}'); }, writeEntityGroup: function(entityGroup, description, writer, isListType = false) { writer.writeLineIndented(description); entityGroup.forEach(entity => { writer.writeLineIndented(this.getEntityWithType(entity, isListType)); }); writer.writeLine(); }, isList: function(entityName, app) { return app.closedLists.includes(entityName); }, getEntityWithType: function(entityName, isListType = false) { let result = ''; switch (isListType ? 'list' : entityName) { case 'age': case 'dimension': case 'money': case 'temperature': result = '?: NumberWithUnits[]'; break; case 'geographyV2': result = '?: GeographyV2[]'; break; case 'ordinalV2': result = '?: OrdinalV2[]'; break; case 'number': case 'ordinal': case 'percentage': result = '?: number[]'; break; case 'datetimeV2': result = '?: DateTimeSpec[]'; break; case 'list': result = '?: string[][]'; break; default: result = '?: string[]'; } return parse_multi_platform_luis_1.jsonPropertyName(entityName) + result; } } ```
Midway is an unincorporated community in Yazoo County, Mississippi, United States. Midway is located on Mississippi Highway 433 east-northeast of Yazoo City. Residents are within the Yazoo County School District. Residents are zoned to Yazoo County Middle School and Yazoo County High School. References Unincorporated communities in Yazoo County, Mississippi Unincorporated communities in Mississippi
```java package com.laifeng.sopcastsdk.video; import android.annotation.TargetApi; import android.graphics.Bitmap; import android.opengl.EGL14; import android.opengl.EGLContext; import android.opengl.EGLDisplay; import android.opengl.EGLSurface; import android.opengl.GLES20; import android.opengl.GLUtils; import android.opengl.Matrix; import com.laifeng.sopcastsdk.camera.CameraData; import com.laifeng.sopcastsdk.camera.CameraHolder; import com.laifeng.sopcastsdk.entity.Watermark; import com.laifeng.sopcastsdk.entity.WatermarkPosition; import java.nio.ByteBuffer; import java.nio.ByteOrder; import java.nio.FloatBuffer; /** * @Title: RenderSrfTex * @Package com.laifeng.sopcastsdk.video * @Description: * @Author Jim * @Date 16/9/14 * @Time 2:17 * @Version */ @TargetApi(18) public class RenderSrfTex { private final FloatBuffer mNormalVtxBuf = GlUtil.createVertexBuffer(); private final FloatBuffer mNormalTexCoordBuf = GlUtil.createTexCoordBuffer(); private int mFboTexId; private final MyRecorder mRecorder; private final float[] mSymmetryMtx = GlUtil.createIdentityMtx(); private final float[] mNormalMtx = GlUtil.createIdentityMtx(); private int mProgram = -1; private int maPositionHandle = -1; private int maTexCoordHandle = -1; private int muSamplerHandle = -1; private int muPosMtxHandle = -1; private EGLDisplay mSavedEglDisplay = null; private EGLSurface mSavedEglDrawSurface = null; private EGLSurface mSavedEglReadSurface = null; private EGLContext mSavedEglContext = null; private int mVideoWidth = 0; private int mVideoHeight = 0; private FloatBuffer mCameraTexCoordBuffer; private Bitmap mWatermarkImg; private FloatBuffer mWatermarkVertexBuffer; private int mWatermarkTextureId = -1; public RenderSrfTex(int id, MyRecorder recorder) { mFboTexId = id; mRecorder = recorder; } public void setTextureId(int textureId) { mFboTexId = textureId; } public void setWatermark(Watermark watermark) { mWatermarkImg = watermark.markImg; initWatermarkVertexBuffer(watermark.width, watermark.height, watermark.orientation, watermark.vMargin, watermark.hMargin); } private void initWatermarkVertexBuffer(int width, int height, int orientation, int vMargin, int hMargin) { boolean isTop, isRight; if(orientation == WatermarkPosition.WATERMARK_ORIENTATION_TOP_LEFT || orientation == WatermarkPosition.WATERMARK_ORIENTATION_TOP_RIGHT) { isTop = true; } else { isTop = false; } if(orientation == WatermarkPosition.WATERMARK_ORIENTATION_TOP_RIGHT || orientation == WatermarkPosition.WATERMARK_ORIENTATION_BOTTOM_RIGHT) { isRight = true; } else { isRight = false; } float leftX = (mVideoWidth/2.0f - hMargin - width)/(mVideoWidth/2.0f); float rightX = (mVideoWidth/2.0f - hMargin)/(mVideoWidth/2.0f); float topY = (mVideoHeight/2.0f - vMargin)/(mVideoHeight/2.0f); float bottomY = (mVideoHeight/2.0f - vMargin - height)/(mVideoHeight/2.0f); float temp; if(!isRight) { temp = leftX; leftX = -rightX; rightX = -temp; } if(!isTop) { temp = topY; topY = -bottomY; bottomY = -temp; } final float watermarkCoords[]= { leftX, bottomY, 0.0f, leftX, topY, 0.0f, rightX, bottomY, 0.0f, rightX, topY, 0.0f }; ByteBuffer bb = ByteBuffer.allocateDirect(watermarkCoords.length * 4); bb.order(ByteOrder.nativeOrder()); mWatermarkVertexBuffer = bb.asFloatBuffer(); mWatermarkVertexBuffer.put(watermarkCoords); mWatermarkVertexBuffer.position(0); } public void setVideoSize(int width, int height) { mVideoWidth = width; mVideoHeight = height; initCameraTexCoordBuffer(); } private void initCameraTexCoordBuffer() { int cameraWidth, cameraHeight; CameraData cameraData = CameraHolder.instance().getCameraData(); int width = cameraData.cameraWidth; int height = cameraData.cameraHeight; if(CameraHolder.instance().isLandscape()) { cameraWidth = Math.max(width, height); cameraHeight = Math.min(width, height); } else { cameraWidth = Math.min(width, height); cameraHeight = Math.max(width, height); } float hRatio = mVideoWidth / ((float)cameraWidth); float vRatio = mVideoHeight / ((float)cameraHeight); float ratio; if(hRatio > vRatio) { ratio = mVideoHeight / (cameraHeight * hRatio); final float vtx[] = { //UV 0f, 0.5f + ratio/2, 0f, 0.5f - ratio/2, 1f, 0.5f + ratio/2, 1f, 0.5f - ratio/2, }; ByteBuffer bb = ByteBuffer.allocateDirect(4 * vtx.length); bb.order(ByteOrder.nativeOrder()); mCameraTexCoordBuffer = bb.asFloatBuffer(); mCameraTexCoordBuffer.put(vtx); mCameraTexCoordBuffer.position(0); } else { ratio = mVideoWidth/ (cameraWidth * vRatio); final float vtx[] = { //UV 0.5f - ratio/2, 1f, 0.5f - ratio/2, 0f, 0.5f + ratio/2, 1f, 0.5f + ratio/2, 0f, }; ByteBuffer bb = ByteBuffer.allocateDirect(4 * vtx.length); bb.order(ByteOrder.nativeOrder()); mCameraTexCoordBuffer = bb.asFloatBuffer(); mCameraTexCoordBuffer.put(vtx); mCameraTexCoordBuffer.position(0); } } public void draw() { saveRenderState(); { GlUtil.checkGlError("draw_S"); if (mRecorder.firstTimeSetup()) { mRecorder.startSwapData(); mRecorder.makeCurrent(); initGL(); } else { mRecorder.makeCurrent(); } GLES20.glViewport(0, 0, mVideoWidth, mVideoHeight); GLES20.glClearColor(0f, 0f, 0f, 1f); GLES20.glClear(GLES20.GL_DEPTH_BUFFER_BIT | GLES20.GL_COLOR_BUFFER_BIT); GLES20.glUseProgram(mProgram); mNormalVtxBuf.position(0); GLES20.glVertexAttribPointer(maPositionHandle, 3, GLES20.GL_FLOAT, false, 4 * 3, mNormalVtxBuf); GLES20.glEnableVertexAttribArray(maPositionHandle); mCameraTexCoordBuffer.position(0); GLES20.glVertexAttribPointer(maTexCoordHandle, 2, GLES20.GL_FLOAT, false, 4 * 2, mCameraTexCoordBuffer); GLES20.glEnableVertexAttribArray(maTexCoordHandle); GLES20.glUniform1i(muSamplerHandle, 0); // CameraData cameraData = CameraHolder.instance().getCameraData(); if(cameraData != null) { int facing = cameraData.cameraFacing; if(muPosMtxHandle>= 0) { if(facing == CameraData.FACING_FRONT) { GLES20.glUniformMatrix4fv(muPosMtxHandle, 1, false, mSymmetryMtx, 0); }else { GLES20.glUniformMatrix4fv(muPosMtxHandle, 1, false, mNormalMtx, 0); } } } GLES20.glActiveTexture(GLES20.GL_TEXTURE0); GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, mFboTexId); GLES20.glDrawArrays(GLES20.GL_TRIANGLE_STRIP, 0, 4); // drawWatermark(); mRecorder.swapBuffers(); GlUtil.checkGlError("draw_E"); } restoreRenderState(); } private void drawWatermark() { if(mWatermarkImg == null) { return; } GLES20.glUniformMatrix4fv(muPosMtxHandle, 1, false, mNormalMtx, 0); GLES20.glVertexAttribPointer(maPositionHandle, 3, GLES20.GL_FLOAT, false, 4 * 3, mWatermarkVertexBuffer); GLES20.glEnableVertexAttribArray(maPositionHandle); mNormalTexCoordBuf.position(0); GLES20.glVertexAttribPointer(maTexCoordHandle, 2, GLES20.GL_FLOAT, false, 4 * 2, mNormalTexCoordBuf); GLES20.glEnableVertexAttribArray(maTexCoordHandle); if(mWatermarkTextureId == -1) { int[] textures = new int[1]; GLES20.glGenTextures(1, textures, 0); GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, textures[0]); GLUtils.texImage2D(GLES20.GL_TEXTURE_2D, 0, mWatermarkImg, 0); GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_MIN_FILTER, GLES20.GL_LINEAR); GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_MAG_FILTER, GLES20.GL_LINEAR); GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_WRAP_S, GLES20.GL_CLAMP_TO_EDGE); GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_WRAP_T, GLES20.GL_CLAMP_TO_EDGE); mWatermarkTextureId = textures[0]; } GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, mWatermarkTextureId); GLES20.glBlendFunc(GLES20.GL_SRC_ALPHA, GLES20.GL_ONE_MINUS_SRC_ALPHA); GLES20.glEnable(GLES20.GL_BLEND); GLES20.glDrawArrays(GLES20.GL_TRIANGLE_STRIP, 0, 4); GLES20.glDisable(GLES20.GL_BLEND); } private void initGL() { GlUtil.checkGlError("initGL_S"); final String vertexShader = // "attribute vec4 position;\n" + "attribute vec4 inputTextureCoordinate;\n" + "varying vec2 textureCoordinate;\n" + "uniform mat4 uPosMtx;\n" + "void main() {\n" + " gl_Position = uPosMtx * position;\n" + " textureCoordinate = inputTextureCoordinate.xy;\n" + "}\n"; final String fragmentShader = // "precision mediump float;\n" + "uniform sampler2D uSampler;\n" + "varying vec2 textureCoordinate;\n" + "void main() {\n" + " gl_FragColor = texture2D(uSampler, textureCoordinate);\n" + "}\n"; mProgram = GlUtil.createProgram(vertexShader, fragmentShader); maPositionHandle = GLES20.glGetAttribLocation(mProgram, "position"); maTexCoordHandle = GLES20.glGetAttribLocation(mProgram, "inputTextureCoordinate"); muSamplerHandle = GLES20.glGetUniformLocation(mProgram, "uSampler"); muPosMtxHandle = GLES20.glGetUniformLocation(mProgram, "uPosMtx"); Matrix.scaleM(mSymmetryMtx, 0, -1, 1, 1); GLES20.glDisable(GLES20.GL_DEPTH_TEST); GLES20.glDisable(GLES20.GL_CULL_FACE); GLES20.glDisable(GLES20.GL_BLEND); GlUtil.checkGlError("initGL_E"); } private void saveRenderState() { mSavedEglDisplay = EGL14.eglGetCurrentDisplay(); mSavedEglDrawSurface = EGL14.eglGetCurrentSurface(EGL14.EGL_DRAW); mSavedEglReadSurface = EGL14.eglGetCurrentSurface(EGL14.EGL_READ); mSavedEglContext = EGL14.eglGetCurrentContext(); } private void restoreRenderState() { if (!EGL14.eglMakeCurrent( mSavedEglDisplay, mSavedEglDrawSurface, mSavedEglReadSurface, mSavedEglContext)) { throw new RuntimeException("eglMakeCurrent failed"); } } } ```