answer
stringlengths
15
1.25M
def transform(scrabble): return {ch.lower(): v for (v, chs) in scrabble.items() for ch in chs}
class ShoppingCart def <API key>(cancelURL, returnURL, locale, ammount, number = 1) @transaction = <API key>(cancelURL, returnURL, locale, ammount, number) end def get_ec_details(token, payerid = nil) @transaction = get_ec_details_call(token, payerid) end def create_recurring(token, payerid, subscription, ammount, current = 0, video = false) if video user_name = subscription.user else if subscription.user user_name = subscription.user.name elsif subscription.sponsor_user user_name = subscription.sponsor_user.name else user_name = user.name end end start_date = subscription.expiration_date.to_formatted_s(:db) if subscription.expiration_date && (subscription.expiration_date > Date.current) start_date = start_date || Time.current.to_formatted_s(:db) @transaction = <API key>(token, payerid, subscription, current, user_name, start_date, ammount) if @transaction.success? subscription.<API key>(@transaction.response) end return @transaction end def paypal_ec_url Colcentric.config.paypal.EC_URL end def <API key> Colcentric.config.paypal.DEV_CENTRAL_URL end private def <API key>(cancelURL, returnURL, locale, ammount, number) req = { :method => 'SetExpressCheckout', :AMT => ammount, :SOLUTIONTYPE => 'Sole', :paymentaction => 'Sale', :currencycode => 'EUR', :LANDINGPAGE => 'Billing', :LOCALECODE => locale, :cancelurl => cancelURL, :returnurl => returnURL, :brandname => "Colcentric Tecnología e Innovación, SL" #:hdrbordercolor => "b32727", #:hdrbackcolor => "ffffff", #:payflowcolor => "ffffff" } number.times{|i| req[:"L_BILLINGTYPE#{i}"] = 'RecurringPayments' req[:"<API key>#{i}"] = description#'Subscription to Colcentric' #req[:"L_CUSTOM#{i}"] = 'custom' req[:"L_ITEMCATEGORY#{i}"] = 'Physical' } @transaction = <API key>(req) end def get_ec_details_call(token, payerid) req = { :method => '<API key>', :token => token } req[:payerid] = payerid if payerid @transaction = <API key>(req) end def <API key>(token, payerid, subscription, current, user_name, profile_start_date, amt) amt_old, period, frequency, desc = subscription.<API key> # TO DO - Custom description req = { :method => '<API key>', :token => token, :payerid => payerid, :AMT => amt, :currencycode => 'EUR', :countrycode => 'ES', :DESC => description, :PROFILESTARTDATE => profile_start_date, :SUBSCRIBERNAME => user_name, :BILLINGPERIOD => period, :BILLINGFREQUENCY => frequency, :"<API key>#{current}" => description, :"<API key>#{current}" => amt, :"<API key>#{current}" => '1', :"<API key>#{current}" => full_description(user_name), :"<API key>#{current}" => 'Physical' } @transaction = <API key>(req) return @transaction end def <API key>(action) @transaction = <API key>( { :method => '<API key>', :PROFILEID => paypal_profileid, :ACTION => action } ) end def <API key> amt, period, frequency = <API key> @transaction = <API key>( { :method => '<API key>', :PROFILEID => paypal_profileid, :PaymentPeriod => period, :Amount => amt, :<API key> => frequency } ) @transaction end def <API key>(transaction_data) transaction_data[:USER] = paypal_user transaction_data[:PWD] = paypal_pwd transaction_data[:SIGNATURE]= paypal_signature transaction_data[:SUBJECT] = paypal_subject @caller = PayPalSDKCallers::Caller.new(false) @transaction = @caller.call(transaction_data) end def description I18n.t('subscriptions.paypal.description') end def full_description(user_name) I18n.t('subscriptions.paypal.full_description', :user => user_name) end def paypal_user Colcentric.config.paypal.USER end def paypal_pwd Colcentric.config.paypal.PWD end def paypal_signature Colcentric.config.paypal.SIGNATURE end def paypal_subject "" end end
<!DOCTYPE html> <html lang="gl"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>PODEMOS. Plan de reactivación económica para as comarcas do Besaya e de Reinosa</title> <meta property="og:title" content="PODEMOS: Plan de reactivación económica para as comarcas do Besaya e de Reinosa" /> <meta property="og:description" content="Promoveremos un plan de reindustrialización sostible nas comarcas do Besaya e de Reinosa, nas que o desmantelamento da industria ha de ter efectos significativamente negativos sobre a actividade e o emprego. As principais liñas de actuación deste plan serán: * A posta en marcha de axudas para a modernización de industrias en risco de deslocalización, mediante a compra de maquinaria e patentes e a transformación de procesos produtivos que permitan incrementar a produtividade e a competitividade. * O asesoramento na procura de novos mercados, a internacionalización das empresas, o aproveitamento de cadeas globais de valor e o fomento das exportacións de bens e servizos. * A concesión de incentivos para o incremento da eficiencia enerxética e a redución de emisións e residuos procedentes do proceso produtivo. * O fomento do desenvolvemento de novo solo industrial e readaptación do xa existente. * A concesión de incentivos para atraer novas empresas, investimento estranxeiro directo e participación en sociedades mixtas. * Mellora das infraestruturas viais para reducir o custo do transporte de mercadorías. * A implantación dun plano de axudas para atraer o talento e a formación continua dos traballadores." /> <meta property="og:image" content="http://lasonrisadeunpais.es/wp-content/plugins/programa/data/meta-programa.png" /> </head> <body> <script type="text/javascript"> var url_base = '/gl/programa/?medida=358'; window.location = url_base; </script> <h1>Plan de reactivación económica para as comarcas do Besaya e de Reinosa</h1> <div> <p>Promoveremos un plan de reindustrialización sostible nas comarcas do Besaya e de Reinosa, nas que o desmantelamento da industria ha de ter efectos significativamente negativos sobre a actividade e o emprego. As principais liñas de actuación deste plan serán:</p> <ul> <li>A posta en marcha de axudas para a modernización de industrias en risco de deslocalización, mediante a compra de maquinaria e patentes e a transformación de procesos produtivos que permitan incrementar a produtividade e a competitividade. </li> <li>O asesoramento na procura de novos mercados, a internacionalización das empresas, o aproveitamento de cadeas globais de valor e o fomento das exportacións de bens e servizos.</li> <li>A concesión de incentivos para o incremento da eficiencia enerxética e a redución de emisións e residuos procedentes do proceso produtivo.</li> <li>O fomento do desenvolvemento de novo solo industrial e readaptación do xa existente. </li> <li>A concesión de incentivos para atraer novas empresas, investimento estranxeiro directo e participación en sociedades mixtas. </li> <li>Mellora das infraestruturas viais para reducir o custo do transporte de mercadorías.</li> <li>A implantación dun plano de axudas para atraer o talento e a formación continua dos traballadores.</li> </ul> </div> </body> </html>
using System; using System.ComponentModel; using System.Reflection; using System.Threading; using System.Web.UI; using Ext.Net.Utilities; namespace Ext.Net { <summary> </summary> [Description("")] public partial class ControlState : BaseItem { <summary> </summary> <typeparam name="T"></typeparam> <param name="name"></param> <param name="defaultValue"></param> <returns></returns> public virtual T Get<T>(string name, T defaultValue) { return (T)(this[name].IfNull(defaultValue)); } <summary> </summary> <param name="name"></param> <param name="value"></param> public virtual void Set(string name, object value) { this[name] = value; } private readonly BaseControl control; <summary> </summary> [Description("")] public ControlState(BaseControl control, StateBag viewState) { this.control = control; this.ViewState = viewState; } <summary> </summary> [Description("")] public virtual bool Suspend() { bool oldValue = control.<API key>; this.control.<API key> = false; this.control.ScriptSuspended = true; Monitor.Enter(this.control); return oldValue; } <summary> </summary> [Description("")] public virtual void Resume(bool oldValue) { this.control.<API key> = oldValue; this.control.ScriptSuspended = false; Monitor.Exit(this.control); } <summary> </summary> [Description("")] public virtual void Resume() { this.Resume(true); } <summary> </summary> [Description("")] public object this[string key] { get { return this.ViewState[key]; } set { this.ViewState[key] = value; this.<API key>(key, value); } } private void CheckID() { if (((control.IDMode == Ext.Net.IDMode.Explicit || control.IDMode == Ext.Net.IDMode.Static) && !control.IsIdRequired) || control.IDMode == Ext.Net.IDMode.Ignore) { throw new Exception("You have to set widget's ID to call its methods (widget - " + control.GetType().ToString() + ")"); } } <summary> </summary> <param name="key"></param> <param name="value"></param> public void <API key>(string key, object value) { if ((control.IsProxy && !control.ScriptSuspended) || (RequestManager.IsAjaxRequest && control.<API key> && !control.IsDynamic)) { PropertyInfo pi = control.GetType().GetProperty(key); if (pi == null) { return; } object[] attrs = pi.GetCustomAttributes(typeof(<API key>), true); if (attrs.Length > 0) { this.CheckID(); this.control.CallbackValues[key] = value; ((<API key>)attrs[0]).RegisterScript(this.control, pi); } else { <API key> attr = ClientConfig.<API key>(pi); if (attr != null) { this.CheckID(); this.control.CallbackValues[key] = value; this.control.AddScript(string.Format(<API key>.AutoGenerateFormat, this.control.ClientID, JSON.Serialize(value), pi.Name.ToLowerCamelCase())); } } } } } }
# How to hack on One Click Orgs ## Requirements * Ruby 1.9.3 * RubyGems ~> 1.3.7 * bundler gem ~> 1.0.0 (install with gem install bundler) * MySQL, including client libraries (e.g. libmysqlclient-dev on Debian) Optional libraries * [wkhtmltopdf](http://code.google.com/p/wkhtmltopdf/) N.B. One Click Orgs is not compatible with the wkhtmltopdf in Debian/Ubuntu's packages. ## Setup 1. Grab the source: $ git clone git://github.com/oneclickorgs/one-click-orgs.git $ cd one-click-orgs 2. Install the required gems using Bundler: $ bundle install # installs gem system-wide or $ bundle install --path vendor/bundle # vendors everything, no system gems 3. Create your local config files: $ bundle exec rake oco:generate_config 4. Set up your database connection settings, by editing config/database.yml as desired. If your database user doesn't have CREATE DATABASE permissions, create the databases manually, e.g.: $ mysql -u root -p mysql> create database <API key>; mysql> create database one_click_test; mysql> exit; 5. (Create and) migrate the database: $ bundle exec rake db:setup ## Running 1. Start the web server: $ bundle exec rails server 2. (Optional) In another shell, start the job server (which sends emails and closes proposals): $ script/delayed_job run # run in foreground $ script/delayed_job start # start as daemon (check log/delayed_job.log) $ bundle exec rake jobs:work # foreground, from rake $ bundle exec rake jobs:clear # clear queue 3. Visit `http://localhost:3000/`. You can just choose 'single organisation mode', or if you want to test multi-tenancy mode, you'll need lines in your hosts file which point `yourorganisation.localhost`, etc. to `127.0.0.1`. ## Quickly creating an organisation Unless you're working on the founding stage itself, it can be handy to create an active organisation to experiment with, without having to walk through all the founding steps manually. To do this, run the `oco:dev:create_organisation` rake task: $ bundle exec rake oco:dev:create_organisation ## Updating When you pull updates from the repository, you may need to update your gem bundle (if `Gemfile.lock` has changed) and/or migrate your database (if `db/migrate` has changed): $ bundle install $ bundle exec rake db:migrate These commands will safely no-op if no changes are necessary. ## Contributing Before you submit any patches make sure that no tests fail: $ bundle exec rake spec $ bundle exec rake cucumber To submit a patch, you have several options: * Put your changes in a branch with an appropriate name, and push it to your GitHub repository, and send a pull request to `oneclickorgs`. * Open or reply to an issue in the [issue tracker](http://github.com/oneclickorgs/one-click-orgs/issues), and tell us where to find your commits. * Send a patch to the [mailing list](http://groups.google.co.uk/group/<API key>). ## Contact There is a [mailing list](http://groups.google.co.uk/group/<API key>) and an IRC channel, [#oneclickorgs on irc.freenode.net](irc://irc.freenode.net/oneclickorgs).
package com.splicemachine.derby.stream.function; import com.splicemachine.db.iapi.services.io.ArrayUtil; import com.splicemachine.db.iapi.sql.execute.ExecRow; import com.splicemachine.derby.iapi.sql.execute.SpliceOperation; import com.splicemachine.derby.impl.sql.execute.operations.JoinUtils; import com.splicemachine.derby.stream.iapi.OperationContext; import scala.Tuple2; import java.io.IOException; import java.io.ObjectInput; import java.io.ObjectOutput; import java.util.BitSet; import java.util.Iterator; import java.util.LinkedList; import java.util.List; public class <API key><Op extends SpliceOperation> extends <API key><Op, Tuple2<ExecRow,Tuple2<Iterable<ExecRow>,Iterable<ExecRow>>>,ExecRow> { private int[] hashKeys; public <API key>() { super(); } public <API key>(OperationContext<Op> operationContext, int[] hashKeys) { super(operationContext); assert hashKeys!=null && hashKeys.length >0 : "Bad Hash Keys Passed into Null Filter Function"; this.hashKeys = hashKeys; } @Override public Iterator<ExecRow> call(Tuple2<ExecRow,Tuple2<Iterable<ExecRow>, Iterable<ExecRow>>> tuple) throws Exception { ExecRow mergedRow; checkInit(); List<ExecRow> returnRows = new LinkedList<>(); BitSet matchingRights = new BitSet(); for(ExecRow leftRow : tuple._2._1){ Iterator<ExecRow> it = tuple._2._2.iterator(); boolean leftHasMatch = false; // check if hashkey is null or not to prevent null=null to be qualified as true if (!hashKeyIsNull(leftRow)) { int rightIndex = 0; while (it.hasNext()) { ExecRow rightRow = it.next(); mergedRow = JoinUtils.getMergedRow(leftRow, rightRow, op.wasRightOuterJoin, executionFactory.getValueRow(numberOfColumns)); mergedRow.setKey(leftRow.getKey()); op.setCurrentRow(mergedRow); if (op.getRestriction().apply(mergedRow)) { // Has Row, abandon if (!leftHasMatch) leftHasMatch = true; returnRows.add(mergedRow); matchingRights.set(rightIndex); } operationContext.recordFilter(); rightIndex++; } } if (!leftHasMatch) { mergedRow = JoinUtils.getMergedRow(leftRow, op.getRightEmptyRow(), op.wasRightOuterJoin, executionFactory.getValueRow(numberOfColumns)); mergedRow.setKey(leftRow.getKey()); returnRows.add(mergedRow); } } // add the non-matching right rows Iterator<ExecRow> it = tuple._2._2.iterator(); int rightIndex = 0; while (it.hasNext()) { ExecRow rightRow = it.next(); if (!matchingRights.get(rightIndex)) { mergedRow = JoinUtils.getMergedRow(op.getLeftEmptyRow(), rightRow, op.wasRightOuterJoin, executionFactory.getValueRow(numberOfColumns)); // TODO: DB-7810? what is the key? mergedRow.setKey(rightRow.getKey()); returnRows.add(mergedRow); } rightIndex++; } return returnRows.iterator(); } private boolean hashKeyIsNull(ExecRow row) { try { for (int i = 0; i < hashKeys.length; i++) { if (row.getColumn(hashKeys[i] + 1).isNull()) { operationContext.recordFilter(); return true; } } } catch (Exception e) { throw new RuntimeException(e); } return false; } @Override public void writeExternal(ObjectOutput out) throws IOException { super.writeExternal(out); ArrayUtil.writeIntArray(out,hashKeys); } @Override public void readExternal(ObjectInput in) throws IOException, <API key> { super.readExternal(in); hashKeys = ArrayUtil.readIntArray(in); } }
package com.koda.integ.hbase.test; import java.io.IOException; import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.Map; import java.util.NavigableSet; import java.util.TreeMap; import java.util.TreeSet; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.hbase.HColumnDescriptor; import org.apache.hadoop.hbase.HTableDescriptor; import org.apache.hadoop.hbase.KeyValue; import org.apache.hadoop.hbase.client.Append; import org.apache.hadoop.hbase.client.Delete; import org.apache.hadoop.hbase.client.Get; import org.apache.hadoop.hbase.client.Increment; import org.apache.hadoop.hbase.client.Put; import org.apache.hadoop.hbase.filter.Filter; import org.apache.hadoop.hbase.io.TimeRange; //import org.apache.hadoop.hbase.regionserver.StoreFile.BloomType; import org.apache.hadoop.hbase.regionserver.BloomType; import org.apache.hadoop.hbase.util.Bytes; import junit.framework.TestCase; // TODO: Auto-generated Javadoc /** * The Class BaseTest. */ public class BaseTest extends TestCase{ /** The Constant LOG. */ static final Log LOG = LogFactory.getLog(BaseTest.class); /** The table a. */ protected byte[] TABLE_A = "TABLE_A".getBytes(); /** The block size. */ private static int BLOCK_SIZE = 16 * 1024; /* Families */ /** The families. */ protected byte[][] FAMILIES = new byte[][] {"fam_a".getBytes(), "fam_b".getBytes(), "fam_c".getBytes()}; /* Columns */ /** The columns. */ protected byte[][] COLUMNS = {"col_a".getBytes(), "col_b".getBytes(), "col_c".getBytes()}; /** The data. */ static List<List<KeyValue>> data ; /** The versions. */ int VERSIONS = 10; /* All CF are cacheable */ /** The table a. */ static HTableDescriptor tableA; /** * Constract family map. * * @param families the families * @param columns the columns * @return the map */ protected Map<byte[], NavigableSet<byte[]>> constructFamilyMap(List<byte[]> families, List<byte[]> columns) { Map<byte[], NavigableSet<byte[]>> map = new TreeMap<byte[], NavigableSet<byte[]>>(Bytes.BYTES_COMPARATOR); NavigableSet<byte[]> colSet = getColumnSet(columns); for(byte[] f: families){ map.put(f, colSet); } return map; } /** * Gets the row. * * @param i the i * @return the row */ byte[] getRow (int i){ return ("row"+i).getBytes(); } /** * Gets the value. * * @param i the i * @return the value */ byte[] getValue (int i){ return ("value"+i).getBytes(); } /** * Generate row data. * * @param i the i * @return the list */ List<KeyValue> generateRowData(int i){ byte[] row = getRow(i); byte[] value = getValue(i); long startTime = System.currentTimeMillis(); ArrayList<KeyValue> list = new ArrayList<KeyValue>(); int count = 0; for(byte[] f: FAMILIES){ for(byte[] c: COLUMNS){ count = 0; for(; count < VERSIONS; count++){ KeyValue kv = new KeyValue(row, f, c, startTime + (count), value); list.add(kv); } } } Collections.sort(list, KeyValue.COMPARATOR); return list; } /** * Generate data. * * @param n the n * @return the list */ List<List<KeyValue>> generateData(int n) { List<List<KeyValue>> data = new ArrayList<List<KeyValue>>(); for(int i=0; i < n; i++){ data.add(generateRowData(i)); } return data; } /** * Creates the tables. * * @param versions the versions */ protected void createTables(int versions) { HColumnDescriptor famA = new HColumnDescriptor(FAMILIES[0]); famA.setMaxVersions(versions); famA.setCacheDataOnWrite(true); famA.<API key>(true); famA.<API key>(true); famA.setBlocksize(BLOCK_SIZE); famA.setBloomFilterType(BloomType.ROW); HColumnDescriptor famB = new HColumnDescriptor(FAMILIES[1]); famB.setCacheDataOnWrite(true); famB.setMaxVersions(versions); famB.setCacheDataOnWrite(true); famB.<API key>(true); famB.<API key>(true); famB.setBlocksize(BLOCK_SIZE); famB.setBloomFilterType(BloomType.ROW); HColumnDescriptor famC = new HColumnDescriptor(FAMILIES[2]); famC.setMaxVersions(versions); famC.setCacheDataOnWrite(true); famC.setCacheDataOnWrite(true); famC.<API key>(true); famC.<API key>(true); famC.setBlocksize(BLOCK_SIZE); famC.setBloomFilterType(BloomType.ROW); tableA = new HTableDescriptor(TABLE_A); tableA.addFamily(famA); tableA.addFamily(famB); tableA.addFamily(famC); } /** * Creates the get. * * @param row the row * @param familyMap the family map * @param tr the tr * @param f the f * @return the gets the * @throws IOException Signals that an I/O exception has occurred. */ protected Get createGet(byte[] row, Map<byte[], NavigableSet<byte[]>> familyMap, TimeRange tr, Filter f ) throws IOException { Get get = new Get(row); if(tr != null){ get.setTimeRange(tr.getMin(), tr.getMax()); } if(f != null) get.setFilter(f); if(familyMap != null){ for(byte[] fam: familyMap.keySet()) { NavigableSet<byte[]> cols = familyMap.get(fam); if( cols == null || cols.size() == 0){ get.addFamily(fam); } else{ for(byte[] col: cols) { get.addColumn(fam, col); } } } } return get; } /** * Creates the get. * * @param i the i * @return the gets the */ protected Get createGet(int i) { Get get = new Get(getRow(i)); for(int k = 0; k < FAMILIES.length; k++) { get.addFamily(FAMILIES[k]); } return get; } /** * Creates the put. * * @param values the values * @return the put */ protected Put createPut(List<KeyValue> values) { Put put = new Put(values.get(0).getRow()); for(KeyValue kv: values) { put.add(kv.getFamily(), kv.getQualifier(), kv.getTimestamp(), kv.getValue()); } return put; } /** * Creates the increment. * * @param row the row * @param familyMap the family map * @param tr the tr * @param value the value * @return the increment * @throws IOException Signals that an I/O exception has occurred. */ protected Increment createIncrement(byte[] row, Map<byte[], NavigableSet<byte[]>> familyMap, TimeRange tr, long value) throws IOException { Increment incr = new Increment(row); if(tr != null){ incr.setTimeRange(tr.getMin(), tr.getMax()); } if(familyMap != null){ for(byte[] fam: familyMap.keySet()) { NavigableSet<byte[]> cols = familyMap.get(fam); for(byte[] col: cols) { incr.addColumn(fam, col, value); } } } return incr; } /** * Creates the append. * * @param row the row * @param families the families * @param columns the columns * @param value the value * @return the append */ protected Append createAppend(byte[] row, List<byte[]> families, List<byte[]> columns, byte[] value){ Append op = new Append(row); for(byte[] f: families){ for(byte[] c: columns){ op.add(f, c, value); } } return op; } /** * Creates the delete. * * @param values the values * @return the delete */ protected Delete createDelete(List<KeyValue> values) { Delete del = new Delete(values.get(0).getRow()); for(KeyValue kv: values) { del.deleteColumns(kv.getFamily(), kv.getQualifier()); } return del; } /** * Creates the delete. * * @param row the row * @return the delete */ protected Delete createDelete(byte[] row) { Delete del = new Delete(row); return del; } /** * Creates the delete. * * @param row the row * @param families the families * @return the delete */ protected Delete createDelete(byte[] row, List<byte[]> families) { Delete del = new Delete(row); for(byte[] f: families) { del.deleteFamily(f); } return del; } /** * Equals. * * @param list1 the list1 * @param list2 the list2 * @return true, if successful */ protected boolean equals(List<KeyValue> list1, List<KeyValue> list2) { if(list1.size() != list2.size()) return false; Collections.sort(list1, KeyValue.COMPARATOR); Collections.sort(list2, KeyValue.COMPARATOR); for(int i=0; i < list1.size(); i++){ if(list1.get(i).equals(list2.get(i)) == false) return false; } return true; } protected boolean equalsNoTS(List<KeyValue> list1, List<KeyValue> list2) { if(list1.size() != list2.size()) return false; Collections.sort(list1, KeyValue.COMPARATOR); Collections.sort(list2, KeyValue.COMPARATOR); for(int i=0; i < list1.size(); i++){ KeyValue first = list1.get(i); KeyValue second = list2.get(i); //LOG.info(i +" ["+ new String(first.getRow())+"]"+ "["+new String(second.getRow())+"]"); int r1 = Bytes.compareTo(first.getRow(), second.getRow()); if(r1 != 0) return false; // LOG.info(i+ " ["+ new String(first.getFamily())+"]"+ "["+new String(second.getFamily())+"]"); int r2 = Bytes.compareTo(first.getFamily(), second.getFamily()); if(r2 != 0) return false; // LOG.info(i+" ["+ new String(first.getQualifier())+"]"+ "["+new String(second.getQualifier())+"]"); int r3 = Bytes.compareTo(first.getQualifier(), second.getQualifier()); if(r3 != 0) return false; // LOG.info(i +" ["+ new String(first.getValue())+"]"+ "["+new String(second.getValue())+"]"); int r4 = Bytes.compareTo(first.getValue(), second.getValue()); if(r4 != 0) { return false; } } return true; } /** * Sub list. * * @param list the list * @param family the family * @return the list */ protected List<KeyValue> subList(List<KeyValue> list, byte[] family){ List<KeyValue> result = new ArrayList<KeyValue>(); for(KeyValue kv : list){ if(Bytes.equals(family, kv.getFamily())){ result.add(kv); } } return result; } /** * Sub list. * * @param list the list * @param family the family * @param cols the cols * @return the list */ protected List<KeyValue> subList(List<KeyValue> list, byte[] family, List<byte[]> cols){ List<KeyValue> result = new ArrayList<KeyValue>(); for(KeyValue kv : list){ if(Bytes.equals(family, kv.getFamily())){ byte[] col = kv.getQualifier(); for(byte[] c: cols){ if(Bytes.equals(col, c)){ result.add(kv); break; } } } } return result; } /** * Sub list. * * @param list the list * @param families the families * @param cols the cols * @return the list */ protected List<KeyValue> subList(List<KeyValue> list, List<byte[]> families, List<byte[]> cols){ List<KeyValue> result = new ArrayList<KeyValue>(); for(KeyValue kv : list){ for(byte[] family: families){ if(Bytes.equals(family, kv.getFamily())){ byte[] col = kv.getQualifier(); for(byte[] c: cols){ if(Bytes.equals(col, c)){ result.add(kv); break; } } } } } return result; } /** * Sub list. * * @param list the list * @param families the families * @param cols the cols * @param max the max * @return the list */ protected List<KeyValue> subList(List<KeyValue> list, List<byte[]> families, List<byte[]> cols, int max){ List<KeyValue> result = new ArrayList<KeyValue>(); for(KeyValue kv : list){ for(byte[] family: families){ if(Bytes.equals(family, kv.getFamily())){ byte[] col = kv.getQualifier(); for(byte[] c: cols){ if(Bytes.equals(col, c)){ result.add(kv); break; } } } } } int current = 0; byte[] f = result.get(0).getFamily(); byte[] c = result.get(0).getQualifier(); List<KeyValue> ret = new ArrayList<KeyValue>(); for(KeyValue kv : result ){ byte[] fam = kv.getFamily(); byte[] col = kv.getQualifier(); if(Bytes.equals(f, fam) ){ if( Bytes.equals(c, col)){ if( current < max){ ret.add(kv); } current++; } else{ c = col; current = 1; ret.add(kv); } } else { f = fam; c = col; current = 1; ret.add(kv); } } return ret; } /** * Gets the column set. * * @param cols the cols * @return the column set */ protected NavigableSet<byte[]> getColumnSet(List<byte[]> cols) { if(cols == null) return null; TreeSet<byte[]> set = new TreeSet<byte[]>(Bytes.BYTES_COMPARATOR); for(byte[] c: cols){ set.add(c); } return set; } /** * Dump. * * @param list the list */ protected void dump(List<KeyValue> list) { for( KeyValue kv : list){ dump(kv); } } /** * Dump. * * @param kv the kv */ protected void dump(KeyValue kv) { LOG.info("row="+new String(kv.getRow())+" family="+ new String(kv.getFamily())+ " column="+new String(kv.getQualifier()) + " ts="+ kv.getTimestamp()); } /** * Patch row. * * @param kv the kv * @param patch the patch */ protected void patchRow(KeyValue kv, byte[] patch) { int off = kv.getRowOffset(); System.arraycopy(patch, 0, kv.getBuffer(), off, patch.length); } }
'use strict'; /** * @module module:publish/packages/states */ /** * Defines the list of package publication states. * * @namespace */ var STATES = { /** * Package is on error. * * @const * @type {Number} * @default * @inner */ ERROR: 0, /** * Package is in the queue waiting to be processed. * * @const * @type {Number} * @default * @inner */ PENDING: 1, /** * Package is copying. * * @const * @type {Number} * @default * @inner */ COPYING: 2, /** * Package is extracting. * * @const * @type {Number} * @default * @inner */ EXTRACTING: 3, /** * Package is validating. * * @const * @type {Number} * @default * @inner */ VALIDATING: 4, /** * Package is preparing. * * @const * @type {Number} * @default * @inner */ PREPARING: 5, /** * Package is waiting for a user action to be uploaded to the platform. * * @const * @type {Number} * @default * @inner */ WAITING_FOR_UPLOAD: 6, /** * Package is uploading to the platform. * * @const * @type {Number} * @default * @inner */ UPLOADING: 7, /** * Media information are being synchronized with the platform. * * @const * @type {Number} * @default * @inner */ SYNCHRONIZING: 8, /** * Package is saving points of interest. * * @const * @type {Number} * @default * @inner */ <API key>: 9, /** * Package is copying images. * * @const * @type {Number} * @default * @inner */ COPYING_IMAGES: 10, /** * Package is processed but not published. * * @const * @type {Number} * @default * @inner */ READY: 11, /** * Package is processed and published. * * @const * @type {Number} * @default * @inner */ PUBLISHED: 12, /** * Package is generating thumbnail. * * @const * @type {Number} * @default * @inner */ GENERATING_THUMB: 13, /** * Package is analyzing media for more information. * * @const * @type {Number} * @default * @inner */ GETTING_METADATA: 14, /** * Package is defragmenting the mp4. * * @const * @type {Number} * @default * @inner */ DEFRAGMENTING_MP4: 15, /** * Package is looking for another package of the same name to merge with. * * @const * @type {Number} * @default * @inner */ INITIALIZING_MERGE: 16, /** * Package has been locked by another one to merge with. * * @const * @type {Number} * @default * @inner */ WAITING_FOR_MERGE: 17, /** * Package is merging to a package with the same name. * * @const * @type {Number} * @default * @inner */ MERGING: 18, /** * Package is finalizing merge with the package with the same name. * * @const * @type {Number} * @default * @inner */ FINALIZING_MERGE: 19, /** * Package is being removed. * * @const * @type {Number} * @default * @inner */ REMOVING: 20, /** * Package temporary directory is being removed. * * @const * @type {Number} * @default * @inner */ CLEANING: 21 }; Object.freeze(STATES); module.exports = STATES;
#pragma warning disable 1591 using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Globalization; using System.IO; using System.Linq; using System.Net.Http; using System.Net.Http.Formatting; using System.Net.Http.Headers; using System.Web.Http.Description; using System.Xml.Linq; using Newtonsoft.Json; namespace TubsWeb.Areas.HelpPage { <summary> This class will generate the samples for the help page. </summary> public class <API key> { <summary> Initializes a new instance of the <see cref="<API key>"/> class. </summary> public <API key>() { <API key> = new Dictionary<HelpPageSampleKey, Type>(); ActionSamples = new Dictionary<HelpPageSampleKey, object>(); SampleObjects = new Dictionary<Type, object>(); } <summary> Gets CLR types that are used as the content of <see cref="HttpRequestMessage"/> or <see cref="HttpResponseMessage"/>. </summary> public IDictionary<HelpPageSampleKey, Type> <API key> { get; internal set; } <summary> Gets the objects that are used directly as samples for certain actions. </summary> public IDictionary<HelpPageSampleKey, object> ActionSamples { get; internal set; } <summary> Gets the objects that are serialized as samples by the supported formatters. </summary> public IDictionary<Type, object> SampleObjects { get; internal set; } <summary> Gets the request body samples for a given <see cref="ApiDescription"/>. </summary> <param name="api">The <see cref="ApiDescription"/>.</param> <returns>The samples keyed by media type.</returns> public IDictionary<<API key>, object> GetSampleRequests(ApiDescription api) { return GetSample(api, SampleDirection.Request); } <summary> Gets the response body samples for a given <see cref="ApiDescription"/>. </summary> <param name="api">The <see cref="ApiDescription"/>.</param> <returns>The samples keyed by media type.</returns> public IDictionary<<API key>, object> GetSampleResponses(ApiDescription api) { return GetSample(api, SampleDirection.Response); } <summary> Gets the request or response body samples. </summary> <param name="api">The <see cref="ApiDescription"/>.</param> <param name="sampleDirection">The value indicating whether the sample is for a request or for a response.</param> <returns>The samples keyed by media type.</returns> public virtual IDictionary<<API key>, object> GetSample(ApiDescription api, SampleDirection sampleDirection) { if (api == null) { throw new <API key>("api"); } string controllerName = api.ActionDescriptor.<API key>.ControllerName; string actionName = api.ActionDescriptor.ActionName; IEnumerable<string> parameterNames = api.<API key>.Select(p => p.Name); Collection<MediaTypeFormatter> formatters; Type type = ResolveType(api, controllerName, actionName, parameterNames, sampleDirection, out formatters); var samples = new Dictionary<<API key>, object>(); // Use the samples provided directly for actions var actionSamples = GetAllActionSamples(controllerName, actionName, parameterNames, sampleDirection); foreach (var actionSample in actionSamples) { samples.Add(actionSample.Key.MediaType, WrapSampleIfString(actionSample.Value)); } // Do the sample generation based on formatters only if an action doesn't return an HttpResponseMessage. // Here we cannot rely on formatters because we don't know what's in the HttpResponseMessage, it might not even use formatters. if (type != null && !typeof(HttpResponseMessage).IsAssignableFrom(type)) { object sampleObject = GetSampleObject(type); foreach (var formatter in formatters) { foreach (<API key> mediaType in formatter.SupportedMediaTypes) { if (!samples.ContainsKey(mediaType)) { object sample = GetActionSample(controllerName, actionName, parameterNames, type, formatter, mediaType, sampleDirection); // If no sample found, try generate sample using formatter and sample object if (sample == null && sampleObject != null) { sample = <API key>(formatter, sampleObject, type, mediaType); } samples.Add(mediaType, WrapSampleIfString(sample)); } } } } return samples; } <summary> Search for samples that are provided directly through <see cref="ActionSamples"/>. </summary> <param name="controllerName">Name of the controller.</param> <param name="actionName">Name of the action.</param> <param name="parameterNames">The parameter names.</param> <param name="type">The CLR type.</param> <param name="formatter">The formatter.</param> <param name="mediaType">The media type.</param> <param name="sampleDirection">The value indicating whether the sample is for a request or for a response.</param> <returns>The sample that matches the parameters.</returns> public virtual object GetActionSample(string controllerName, string actionName, IEnumerable<string> parameterNames, Type type, MediaTypeFormatter formatter, <API key> mediaType, SampleDirection sampleDirection) { object sample; // First, try get sample provided for a specific mediaType, controllerName, actionName and parameterNames. // If not found, try get the sample provided for a specific mediaType, controllerName and actionName regardless of the parameterNames // If still not found, try get the sample provided for a specific type and mediaType if (ActionSamples.TryGetValue(new HelpPageSampleKey(mediaType, sampleDirection, controllerName, actionName, parameterNames), out sample) || ActionSamples.TryGetValue(new HelpPageSampleKey(mediaType, sampleDirection, controllerName, actionName, new[] { "*" }), out sample) || ActionSamples.TryGetValue(new HelpPageSampleKey(mediaType, type), out sample)) { return sample; } return null; } <summary> Gets the sample object that will be serialized by the formatters. First, it will look at the <see cref="SampleObjects"/>. If no sample object is found, it will try to create one using <see cref="ObjectGenerator"/>. </summary> <param name="type">The type.</param> <returns>The sample object.</returns> public virtual object GetSampleObject(Type type) { object sampleObject; if (!SampleObjects.TryGetValue(type, out sampleObject)) { // Try create a default sample object ObjectGenerator objectGenerator = new ObjectGenerator(); sampleObject = objectGenerator.GenerateObject(type); } return sampleObject; } <summary> Resolves the type of the action parameter or return value when <see cref="HttpRequestMessage"/> or <see cref="HttpResponseMessage"/> is used. </summary> <param name="api">The <see cref="ApiDescription"/>.</param> <param name="controllerName">Name of the controller.</param> <param name="actionName">Name of the action.</param> <param name="parameterNames">The parameter names.</param> <param name="sampleDirection">The value indicating whether the sample is for a request or a response.</param> <param name="formatters">The formatters.</param> [SuppressMessage("Microsoft.Design", "CA1021:AvoidOutParameters", Justification = "This is only used in advanced scenarios.")] public virtual Type ResolveType(ApiDescription api, string controllerName, string actionName, IEnumerable<string> parameterNames, SampleDirection sampleDirection, out Collection<MediaTypeFormatter> formatters) { if (!Enum.IsDefined(typeof(SampleDirection), sampleDirection)) { throw new <API key>("sampleDirection", (int)sampleDirection, typeof(SampleDirection)); } if (api == null) { throw new <API key>("api"); } Type type; if (<API key>.TryGetValue(new HelpPageSampleKey(sampleDirection, controllerName, actionName, parameterNames), out type) || <API key>.TryGetValue(new HelpPageSampleKey(sampleDirection, controllerName, actionName, new[] { "*" }), out type)) { // Re-compute the supported formatters based on type Collection<MediaTypeFormatter> newFormatters = new Collection<MediaTypeFormatter>(); foreach (var formatter in api.ActionDescriptor.Configuration.Formatters) { if (IsFormatSupported(sampleDirection, formatter, type)) { newFormatters.Add(formatter); } } formatters = newFormatters; } else { switch (sampleDirection) { case SampleDirection.Request: <API key> <API key> = api.<API key>.FirstOrDefault(p => p.Source == ApiParameterSource.FromBody); type = <API key> == null ? null : <API key>.ParameterDescriptor.ParameterType; formatters = api.<API key>; break; case SampleDirection.Response: default: type = api.ActionDescriptor.ReturnType; formatters = api.<API key>; break; } } return type; } <summary> Writes the sample object using formatter. </summary> <param name="formatter">The formatter.</param> <param name="value">The value.</param> <param name="type">The type.</param> <param name="mediaType">Type of the media.</param> <returns></returns> [SuppressMessage("Microsoft.Design", "CA1031:<API key>", Justification = "The exception is recorded as InvalidSample.")] public virtual object <API key>(MediaTypeFormatter formatter, object value, Type type, <API key> mediaType) { if (formatter == null) { throw new <API key>("formatter"); } if (mediaType == null) { throw new <API key>("mediaType"); } object sample = String.Empty; MemoryStream ms = null; HttpContent content = null; try { if (formatter.CanWriteType(type)) { ms = new MemoryStream(); content = new ObjectContent(type, value, formatter, mediaType); formatter.WriteToStreamAsync(type, value, ms, content, null).Wait(); ms.Position = 0; StreamReader reader = new StreamReader(ms); string <API key> = reader.ReadToEnd(); if (mediaType.MediaType.ToUpperInvariant().Contains("XML")) { <API key> = TryFormatXml(<API key>); } else if (mediaType.MediaType.ToUpperInvariant().Contains("JSON")) { <API key> = TryFormatJson(<API key>); } sample = new TextSample(<API key>); } else { sample = new InvalidSample(String.Format( CultureInfo.CurrentCulture, "Failed to generate the sample for media type '{0}'. Cannot use formatter '{1}' to write type '{2}'.", mediaType, formatter.GetType().Name, type.Name)); } } catch (Exception e) { sample = new InvalidSample(String.Format( CultureInfo.CurrentCulture, "An exception has occurred while using the formatter '{0}' to generate sample for media type '{1}'. Exception message: {2}", formatter.GetType().Name, mediaType.MediaType, e.Message)); } finally { if (ms != null) { ms.Dispose(); } if (content != null) { content.Dispose(); } } return sample; } [SuppressMessage("Microsoft.Design", "CA1031:<API key>", Justification = "Handling the failure by returning the original string.")] private static string TryFormatJson(string str) { try { object parsedJson = JsonConvert.DeserializeObject(str); return JsonConvert.SerializeObject(parsedJson, Formatting.Indented); } catch { // can't parse JSON, return the original string return str; } } [SuppressMessage("Microsoft.Design", "CA1031:<API key>", Justification = "Handling the failure by returning the original string.")] private static string TryFormatXml(string str) { try { XDocument xml = XDocument.Parse(str); return xml.ToString(); } catch { // can't parse XML, return the original string return str; } } private static bool IsFormatSupported(SampleDirection sampleDirection, MediaTypeFormatter formatter, Type type) { switch (sampleDirection) { case SampleDirection.Request: return formatter.CanReadType(type); case SampleDirection.Response: return formatter.CanWriteType(type); } return false; } private IEnumerable<KeyValuePair<HelpPageSampleKey, object>> GetAllActionSamples(string controllerName, string actionName, IEnumerable<string> parameterNames, SampleDirection sampleDirection) { HashSet<string> parameterNamesSet = new HashSet<string>(parameterNames, StringComparer.OrdinalIgnoreCase); foreach (var sample in ActionSamples) { HelpPageSampleKey sampleKey = sample.Key; if (String.Equals(controllerName, sampleKey.ControllerName, StringComparison.OrdinalIgnoreCase) && String.Equals(actionName, sampleKey.ActionName, StringComparison.OrdinalIgnoreCase) && (sampleKey.ParameterNames.SetEquals(new[] { "*" }) || parameterNamesSet.SetEquals(sampleKey.ParameterNames)) && sampleDirection == sampleKey.SampleDirection) { yield return sample; } } } private static object WrapSampleIfString(object sample) { string stringSample = sample as string; if (stringSample != null) { return new TextSample(stringSample); } return sample; } } } #pragma warning restore 1591
class ProductPicture < ActiveRecord::Base scope :main, :conditions => { :is_main_picture => true } belongs_to :product mount_uploader :file, <API key>, :mount_on => :file_file_name # has_attached_file :file, :styles => { :medium => ["400>x400>", :jpg], # :thumb => ["80x80>", :jpg] }, # :convert_options => { # :all => "-limit memory 10485760 -limit map 20971520 -strip -background white -flatten" def is_main_picture? is_main_picture end def set_main_picture product.product_pictures.each do |pp| pp.is_main_picture = false pp.save end if !product.blank? self.is_main_picture = true self.save end end
#!/bin/bash # 1st param (optional): force the target branch to update to. WILL LOSE UNCOMMITTED CHANGES. Defaults to staying on current branch. set -ex cd `dirname $0` if [[ -n $1 ]] then git fetch origin git checkout --force origin/$1 fi git submodule sync git submodule update --init --recursive
package org.kuali.kfs.krad.uif.util; import org.apache.commons.lang.StringUtils; import org.kuali.kfs.krad.datadictionary.validation.constraint.<API key>; import org.kuali.kfs.krad.keyvalues.KeyValuesFinder; import org.kuali.kfs.krad.service.<API key>; import org.kuali.kfs.krad.uif.UifConstants; import org.kuali.kfs.krad.uif.component.Component; import org.kuali.kfs.krad.uif.container.CollectionGroup; import org.kuali.kfs.krad.uif.container.Group; import org.kuali.kfs.krad.uif.container.LinkGroup; import org.kuali.kfs.krad.uif.container.NavigationGroup; import org.kuali.kfs.krad.uif.container.PageGroup; import org.kuali.kfs.krad.uif.container.TabGroup; import org.kuali.kfs.krad.uif.container.TreeGroup; import org.kuali.kfs.krad.uif.control.CheckboxControl; import org.kuali.kfs.krad.uif.control.<API key>; import org.kuali.kfs.krad.uif.control.Control; import org.kuali.kfs.krad.uif.control.FileControl; import org.kuali.kfs.krad.uif.control.HiddenControl; import org.kuali.kfs.krad.uif.control.MultiValueControl; import org.kuali.kfs.krad.uif.control.RadioGroupControl; import org.kuali.kfs.krad.uif.control.SelectControl; import org.kuali.kfs.krad.uif.control.SizedControl; import org.kuali.kfs.krad.uif.control.TextAreaControl; import org.kuali.kfs.krad.uif.control.TextControl; import org.kuali.kfs.krad.uif.field.ActionField; import org.kuali.kfs.krad.uif.field.BlankField; import org.kuali.kfs.krad.uif.field.DataField; import org.kuali.kfs.krad.uif.field.ErrorsField; import org.kuali.kfs.krad.uif.field.FieldGroup; import org.kuali.kfs.krad.uif.field.GenericField; import org.kuali.kfs.krad.uif.field.HeaderField; import org.kuali.kfs.krad.uif.field.IframeField; import org.kuali.kfs.krad.uif.field.ImageField; import org.kuali.kfs.krad.uif.field.InputField; import org.kuali.kfs.krad.uif.field.LabelField; import org.kuali.kfs.krad.uif.field.LinkField; import org.kuali.kfs.krad.uif.field.MessageField; import org.kuali.kfs.krad.uif.view.View; import org.kuali.rice.core.api.uif.<API key>; import org.kuali.rice.core.api.uif.<API key>; import org.kuali.rice.core.api.uif.RemotableCheckbox; import org.kuali.rice.core.api.uif.<API key>; import org.kuali.rice.core.api.uif.<API key>; import org.kuali.rice.core.api.uif.RemotableDatepicker; import org.kuali.rice.core.api.uif.<API key>; import org.kuali.rice.core.api.uif.<API key>; import org.kuali.rice.core.api.uif.<API key>; import org.kuali.rice.core.api.uif.RemotableSelect; import org.kuali.rice.core.api.uif.<API key>; import org.kuali.rice.core.api.uif.RemotableTextExpand; import org.kuali.rice.core.api.uif.RemotableTextInput; import org.kuali.rice.core.api.uif.RemotableTextarea; import org.kuali.rice.core.api.util.ConcreteKeyValue; import org.kuali.rice.core.api.util.KeyValue; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; /** * Factory class for creating new UIF components from their base definitions * in the dictionary */ public class ComponentFactory { protected static final String TEXT_CONTROL = "Uif-TextControl"; protected static final String CHECKBOX_CONTROL = "Uif-CheckboxControl"; protected static final String HIDDEN_CONTROL = "Uif-HiddenControl"; protected static final String TEXTAREA_CONTROL = "Uif-TextAreaControl"; protected static final String SELECT_CONTROL = "Uif-DropdownControl"; protected static final String <API key> = "<API key>"; protected static final String <API key> = "<API key>"; protected static final String RADIO_GROUP_CONTROL = "<API key>"; protected static final String <API key> = "<API key>"; protected static final String FILE_CONTROL = "Uif-FileControl"; protected static final String DATE_CONTROL = "Uif-DateControl"; protected static final String USER_CONTROL = "<API key>"; protected static final String GROUP_CONTROL = "Uif-KimGroupControl"; protected static final String DATA_FIELD = "Uif-DataField"; protected static final String INPUT_FIELD = "Uif-InputField"; protected static final String ERRORS_FIELD = "<API key>"; protected static final String ACTION_FIELD = "<API key>"; protected static final String ACTION_LINK_FIELD = "Uif-ActionLink"; protected static final String LINK_FIELD = "Uif-Link"; protected static final String IFRAME_FIELD = "Uif-IframeField"; protected static final String IMAGE_FIELD = "Uif-ImageField"; protected static final String BLANK_FIELD = "Uif-EmptyField"; protected static final String GENERIC_FIELD = "<API key>"; protected static final String LABEL_FIELD = "Uif-Label"; protected static final String MESSAGE_FIELD = "Uif-MessageField"; protected static final String FIELD_GROUP = "<API key>"; protected static final String <API key> = "<API key>"; protected static final String GROUP = "Uif-BoxSection"; protected static final String PAGE_GROUP = "Uif-Page"; protected static final String GROUP_GRID_LAYOUT = "Uif-GridSection"; protected static final String GROUP_BODY_ONLY = "Uif-BoxGroup"; protected static final String <API key> = "Uif-GridGroup"; protected static final String TAB_GROUP = "Uif-TabSection"; protected static final String NAVIGATION_GROUP = "<API key>"; protected static final String TREE_GROUP = "Uif-TreeSection"; protected static final String LINK_GROUP = "Uif-LinkGroup"; protected static final String COLLECTION_GROUP = "<API key>"; protected static final String <API key> = "<API key>"; protected static final String LIST_GROUP = "<API key>"; protected static final String HEADER = "Uif-HeaderFieldBase"; protected static final String FOOTER = "Uif-FooterBase"; protected static final String <API key> = "Uif-FormFooter"; /** * Gets a fresh copy of the component by the id passed in which used to look up the component in * the view index, then retrieve a new instance with initial state configured using the factory id * * @param id - id for the component in the view index * @return Component new instance */ public static Component <API key>(View view, String id) { Component component = null; Component origComponent = view.getViewIndex().getComponentById(id); if (origComponent == null) { throw new RuntimeException(id + " not found in view index try setting p:persistInSession=\"true\" in xml"); } if (view.getViewIndex().<API key>().containsKey(origComponent.getFactoryId())) { component = view.getViewIndex().<API key>().get(origComponent.getFactoryId()); } else { component = (Component) <API key>.<API key>().getDictionaryObject( origComponent.getFactoryId()); } if (component != null) { component = ComponentUtils.copyObject(component); component.setId(origComponent.getFactoryId()); } return component; } /** * Returns a new <code>Component</code> instance for the given bean id from the spring factory * * @param beanId - id of the bean definition * @return new component instance or null if no such component definition was found */ public static Component <API key>(String beanId) { Component component = (Component) <API key>.<API key>().getDictionaryObject(beanId); // clear id before returning so duplicates do not occur component.setId(null); component.setFactoryId(null); return component; } public static TextControl getTextControl() { return (TextControl) <API key>(TEXT_CONTROL); } public static TextAreaControl getTextAreaControl() { return (TextAreaControl) <API key>(TEXTAREA_CONTROL); } public static CheckboxControl getCheckboxControl() { return (CheckboxControl) <API key>(CHECKBOX_CONTROL); } public static HiddenControl getHiddenControl() { return (HiddenControl) <API key>(HIDDEN_CONTROL); } public static SelectControl getSelectControl() { return (SelectControl) <API key>(SELECT_CONTROL); } public static <API key> <API key>() { return (<API key>) <API key>(<API key>); } public static <API key> <API key>() { return (<API key>) <API key>(<API key>); } public static RadioGroupControl <API key>() { return (RadioGroupControl) <API key>(RADIO_GROUP_CONTROL); } public static RadioGroupControl <API key>() { return (RadioGroupControl) <API key>(<API key>); } public static FileControl getFileControl() { return (FileControl) <API key>(FILE_CONTROL); } public static TextControl getDateControl() { return (TextControl) <API key>(DATE_CONTROL); } public static TextControl getUserControl() { return (TextControl) <API key>(USER_CONTROL); } public static TextControl getGroupControl() { return (TextControl) <API key>(GROUP_CONTROL); } public static DataField getDataField() { return (DataField) <API key>(DATA_FIELD); } public static DataField getDataField(String propertyName, String label) { DataField field = (DataField) <API key>(DATA_FIELD); field.setPropertyName(propertyName); field.setLabel(label); return field; } public static InputField getInputField() { return (InputField) <API key>(INPUT_FIELD); } public static InputField getInputField(String propertyName, String label) { InputField field = (InputField) <API key>(INPUT_FIELD); field.setPropertyName(propertyName); field.setLabel(label); return field; } public static InputField getInputField(String propertyName, String label, UifConstants.ControlType controlType) { InputField field = (InputField) <API key>(INPUT_FIELD); field.setPropertyName(propertyName); field.setLabel(label); field.setControl(getControl(controlType)); return field; } public static InputField getInputField(String propertyName, String label, UifConstants.ControlType controlType, String defaultValue) { InputField field = (InputField) <API key>(INPUT_FIELD); field.setPropertyName(propertyName); field.setLabel(label); field.setControl(getControl(controlType)); field.setDefaultValue(defaultValue); return field; } public static InputField getInputField(String propertyName, String label, UifConstants.ControlType controlType, Class<? extends KeyValuesFinder> optionsFinderClass) { InputField field = (InputField) <API key>(INPUT_FIELD); field.setPropertyName(propertyName); field.setLabel(label); field.setControl(getControl(controlType)); field.<API key>(optionsFinderClass); return field; } public static InputField getInputField(String propertyName, String label, UifConstants.ControlType controlType, List<KeyValue> options) { InputField field = (InputField) <API key>(INPUT_FIELD); field.setPropertyName(propertyName); field.setLabel(label); Control control = getControl(controlType); if (control instanceof MultiValueControl) { ((MultiValueControl) control).setOptions(options); } else { throw new RuntimeException("Control is not instance of multi-value control, cannot set options"); } return field; } public static InputField getInputField(String propertyName, String label, UifConstants.ControlType controlType, int size, int maxLength, int minLength) { InputField field = (InputField) <API key>(INPUT_FIELD); field.setPropertyName(propertyName); field.setLabel(label); Control control = getControl(controlType); if (control instanceof SizedControl) { ((SizedControl) control).setSize(size); } else { throw new RuntimeException("Control does not support the size property"); } field.setMaxLength(maxLength); field.setMinLength(minLength); return field; } /** * Builds a new <code>InputField</code> from the properties set on the * given <code><API key></code> * <p> * <p> * Note the returned InputField will not be initialized yet. Its state will be that of the initial * object returned from the UIF dictionary with the properties set from the remotable attribute field, thus it * is really just a more configuration complete field * </p> * * @return AttributeField instance built from remotable field */ public static InputField <API key>(<API key> remotableField) { InputField inputField = getInputField(); inputField.setPropertyName(remotableField.getName()); inputField.setShortLabel(remotableField.getShortLabel()); inputField.setLabel(remotableField.getLongLabel()); inputField.setHelpSummary(remotableField.getHelpSummary()); inputField.setHelpDescription(remotableField.getHelpDescription()); inputField.setConstraintText(remotableField.getConstraintText()); inputField.setPerformUppercase(remotableField.isForceUpperCase()); inputField.setMinLength(remotableField.getMinLength()); inputField.setMaxLength(remotableField.getMaxLength()); // why are exclusive min and max strings? if (remotableField.getMinValue() != null) { inputField.setExclusiveMin(remotableField.getMinValue().toString()); } if (remotableField.getMaxValue() != null) { inputField.setInclusiveMax(remotableField.getMaxValue().toString()); } inputField.setRequired(remotableField.isRequired()); if ((remotableField.getDefaultValues() != null) && !remotableField.getDefaultValues().isEmpty()) { inputField.setDefaultValue(remotableField.getDefaultValues().iterator().next()); } if (StringUtils.isNotBlank(remotableField.getRegexConstraint())) { <API key> constraint = new <API key>(); constraint.setValue(remotableField.getRegexConstraint()); inputField.<API key>(constraint); // TODO: how to deal with remotable field regexContraintMsg? } RemotableDatepicker remotableDatepicker = null; RemotableTextExpand remotableTextExpand = null; <API key> <API key> = null; for (<API key> remoteWidget : remotableField.getWidgets()) { if (remoteWidget instanceof RemotableDatepicker) { remotableDatepicker = (RemotableDatepicker) remoteWidget; } else if (remoteWidget instanceof RemotableTextExpand) { remotableTextExpand = (RemotableTextExpand) remoteWidget; } else if (remoteWidget instanceof <API key>) { <API key> = (<API key>) remoteWidget; } } if (<API key> != null) { inputField.getFieldLookup().setBaseLookupUrl(<API key>.getBaseLookupUrl()); inputField.getFieldLookup().<API key>(<API key>.getDataObjectClass()); inputField.getFieldLookup().setLookupParameters(<API key>.getLookupParameters()); inputField.getFieldLookup().setFieldConversions(<API key>.getFieldConversions()); } if (remotableField.getControl() != null) { Control control = null; <API key> remotableControl = remotableField.getControl(); if (remotableControl instanceof <API key>) { control = getHiddenControl(); } else if (remotableControl instanceof <API key>) { <API key> <API key> = (<API key>) remotableControl; control = <API key>(); ((RadioGroupControl) control).setOptions(buildKeyValuePairs(<API key>.getKeyLabels())); } else if (remotableControl instanceof RemotableSelect) { RemotableSelect remotableSelect = (RemotableSelect) remotableControl; control = getSelectControl(); Map<String, String> keyLabels = new HashMap<String, String>(); if ((remotableSelect.getGroups() != null) && (!remotableSelect.getGroups().isEmpty())) { for (<API key> <API key> : remotableSelect.getGroups()) { keyLabels.putAll(<API key>.getKeyLabels()); } } else { keyLabels = remotableSelect.getKeyLabels(); } ((SelectControl) control).setOptions(buildKeyValuePairs(keyLabels)); if (remotableSelect.getSize() != null) { ((SelectControl) control).setSize(remotableSelect.getSize()); } ((SelectControl) control).setMultiple(remotableSelect.isMultiple()); } else if (remotableControl instanceof <API key>) { <API key> <API key> = (<API key>) remotableControl; control = <API key>(); ((<API key>) control).setOptions(buildKeyValuePairs(<API key>.getKeyLabels())); } else if (remotableControl instanceof RemotableCheckbox) { control = getCheckboxControl(); } else if (remotableControl instanceof RemotableTextarea) { RemotableTextarea remotableTextarea = (RemotableTextarea) remotableControl; control = getTextAreaControl(); if (remotableTextExpand != null) { ((TextAreaControl) control).setTextExpand(true); } ((TextAreaControl) control).setRows(remotableTextarea.getRows()); ((TextAreaControl) control).setCols(remotableTextarea.getCols()); ((TextAreaControl) control).setWatermarkText(remotableTextarea.getWatermark()); } else if (remotableControl instanceof RemotableTextInput) { RemotableTextInput remotableTextInput = (RemotableTextInput) remotableControl; if (remotableDatepicker != null) { control = getDateControl(); } else { control = getTextControl(); } if (remotableTextExpand != null) { ((TextAreaControl) control).setTextExpand(true); } ((TextControl) control).setSize(remotableTextInput.getSize()); ((TextControl) control).setWatermarkText(remotableTextInput.getWatermark()); } inputField.setControl(control); } return inputField; } /** * For each remotable field in the given list creates a new {@link InputField} * instance and sets the * corresponding properties from the remotable instance * * @param remotableFields - list of remotable fields to translate * @return List<AttributeField> list of attribute fields built from the remotable field properties */ public static List<InputField> <API key>(List<<API key>> remotableFields) { List<InputField> inputFields = new ArrayList<InputField>(); for (<API key> remotableField : remotableFields) { inputFields.add(<API key>(remotableField)); } return inputFields; } protected static List<KeyValue> buildKeyValuePairs(Map<String, String> optionsMap) { List<KeyValue> options = new ArrayList<KeyValue>(); for (Map.Entry<String, String> optionEntry : optionsMap.entrySet()) { KeyValue keyValue = new ConcreteKeyValue(optionEntry.getKey(), optionEntry.getValue()); options.add(keyValue); } return options; } protected static Control getControl(UifConstants.ControlType controlType) { Control control = null; switch (controlType) { case CHECKBOX: control = getCheckboxControl(); case CHECKBOXGROUP: control = <API key>(); case FILE: control = getFileControl(); case GROUP: control = getGroupControl(); case HIDDEN: control = getHiddenControl(); case RADIOGROUP: control = <API key>(); case SELECT: control = getSelectControl(); case TEXTAREA: control = getTextAreaControl(); case TEXT: control = getTextControl(); case USER: control = getUserControl(); } return control; } public static ErrorsField getErrorsField() { return (ErrorsField) <API key>(ERRORS_FIELD); } public static ActionField getActionField() { return (ActionField) <API key>(ACTION_FIELD); } public static ActionField getActionLinkField() { return (ActionField) <API key>(ACTION_LINK_FIELD); } public static LinkField getLinkField() { return (LinkField) <API key>(LINK_FIELD); } public static IframeField getIframeField() { return (IframeField) <API key>(IFRAME_FIELD); } public static ImageField getImageField() { return (ImageField) <API key>(IMAGE_FIELD); } public static BlankField getBlankField() { return (BlankField) <API key>(BLANK_FIELD); } public static GenericField getGenericField() { return (GenericField) <API key>(GENERIC_FIELD); } public static LabelField getLabelField() { return (LabelField) <API key>(LABEL_FIELD); } public static MessageField getMessageField() { return (MessageField) <API key>(MESSAGE_FIELD); } public static FieldGroup getFieldGroup() { return (FieldGroup) <API key>(FIELD_GROUP); } public static FieldGroup <API key>() { return (FieldGroup) <API key>(<API key>); } public static Group getGroup() { return (Group) <API key>(GROUP); } public static PageGroup getPageGroup() { return (PageGroup) <API key>(PAGE_GROUP); } public static Group getGroupGridLayout() { return (Group) <API key>(GROUP_GRID_LAYOUT); } public static Group getGroupBodyOnly() { return (Group) <API key>(GROUP_BODY_ONLY); } public static Group <API key>() { return (Group) <API key>(<API key>); } public static TabGroup getTabGroup() { return (TabGroup) <API key>(TAB_GROUP); } public static NavigationGroup getNavigationGroup() { return (NavigationGroup) <API key>(NAVIGATION_GROUP); } public static TreeGroup getTreeGroup() { return (TreeGroup) <API key>(TREE_GROUP); } public static LinkGroup getLinkGroup() { return (LinkGroup) <API key>(LINK_GROUP); } public static CollectionGroup getCollectionGroup() { return (CollectionGroup) <API key>(COLLECTION_GROUP); } public static CollectionGroup <API key>() { return (CollectionGroup) <API key>(<API key>); } public static CollectionGroup getListGroup() { return (CollectionGroup) <API key>(LIST_GROUP); } public static HeaderField getHeader() { return (HeaderField) <API key>(HEADER); } public static Group getFooter() { return (Group) <API key>(FOOTER); } public static Group <API key>() { return (Group) <API key>(<API key>); } }
<?php namespace Timetabio\Library\Transformations { use Timetabio\Framework\Dom\Document; use Timetabio\Frontend\Models\PageModel; interface <API key> { public function apply(PageModel $model, Document $template); } }
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals import os import re from future import standard_library from pyload.utils import convert, purge, web from pyload.utils.convert import to_str from pyload.utils.layer.legacy import hashlib from pyload.utils.time import seconds_to_midnight standard_library.install_aliases() _RE_ALIAS = re.compile(r'[\d.-_]+') def alias(text): chunks = _RE_ALIAS.split(purge.name(text)) return ''.join(word.capitalize() for word in chunks if word) _BOOLEANMAP = { '1': True, 'yes': True, 'true': True, 'on': True, '0': False, 'no': False, 'false': False, 'off': False} def boolean(text): return _BOOLEANMAP.get(text.strip().lower()) def entries(text, allow_whitespaces=False): chars = ';,|' if not allow_whitespaces: chars += r'\s' pattr = r'[{0}]+'.format(chars) return [entry for entry in re.split(pattr, text) if entry] def hash(text): text = text.replace('-', '').lower() algop = '|'.join(hashlib.algorithms + ('adler32', 'crc(32)?')) pattr = r'(?P<D1>{}|)\s*[:=]?\s*(?P<H>[\w^_]{8,}?)\s*[:=]?\s*(?P<D2>{}|)' pattr = pattr.format(algop, algop) m = re.search(pattr, text) if m is None: return None, None checksum = m.group('H') algorithm = m.group('D1') or m.group('D2') if algorithm == 'crc': algorithm = 'crc32' return checksum, algorithm def name(text, strict=True): try: name = web.parse.name(text) except Exception: name = os.path.basename(text).strip() return name if strict else purge.name(name) _ONEWORDS = ( 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine', 'ten', 'eleven', 'twelve', 'thirteen', 'fourteen', 'fifteen', 'sixteen', 'seventeen', 'eighteen', 'nineteen') _TENWORDS = ( 'twenty', 'thirty', 'forty', 'fifty', 'sixty', 'seventy', 'eighty', 'ninety') _RE_NUMBER = re.compile(r'[\s-]+') def number(text): try: text = web.misc.translate(text).lower() except Exception: text = text.lower() o_tuple = [(w, i) for i, w in enumerate(_ONEWORDS)] t_tuple = [(w, i * 10) for i, w in enumerate(_TENWORDS, 2)] numwords = dict(o_tuple + t_tuple) tokens = _RE_NUMBER.split(text) numbers = [_f for _f in (numwords.get(word) for word in tokens) if _f] return sum(numbers) if numbers else None _RE_PACKS = re.compile(r'[^a-z0-9]+(?:(cd|part).*?\d+)?', flags=re.I) def packs(nameurls): DEFAULT_URLNAME = 'Unknown' packs = {} for urlname, url in nameurls: urlname = name(urlname, strict=False) urlname = os.path.splitext(urlname)[0].strip() urlname = _RE_PACKS.sub('_', urlname).strip('_') if not urlname: urlname = DEFAULT_URLNAME packs.setdefault(urlname, []).append(url) return packs _RE_SIZE = re.compile(r'(?P<S>-?[\d.,]+)\s*(?P<U>[a-zA-Z]*)') def bytesize(text, unit=None): # returns integer bytes DEFAULT_INPUTUNIT = 'byte' m = _RE_SIZE.match(to_str(text)) if m is None: return None if unit is None: unit = m.group('U') or DEFAULT_INPUTUNIT size = float(m.group('S').replace(',', '.')) unit = unit[0].lower() return int(convert.size(size, unit, 'byte')) _TIMEWORDS = ('this', 'a', 'an', 'next') _TIMEMAP = { 'day': 60 ** 2 * 12, 'hr': 60 ** 2, 'hour': 60 ** 2, 'min': 60, 'sec': 1} _RE_TIME = re.compile(r'(\d+|[a-zA-Z-]+)\s*(day|hr|hour|min|sec)|(\d+)') def seconds(text): def to_int(obj): try: return int(obj) except ValueError: return None try: text = web.misc.translate(text).lower() except Exception: text = text.lower() pattr = r'({0})\s+day|today|daily'.format('|'.join(_TIMEWORDS)) m = re.search(pattr, text) if m is not None: return seconds_to_midnight() seconds = sum( (w in _TIMEWORDS or to_int(i or w) or number(w) or 1) * _TIMEMAP.get(u, 1) for w, u, i in _RE_TIME.findall(text)) return seconds def minutes(text): return seconds(text) / 60 def hours(text): return seconds(text) / 60 ** 2
#pragma once #include "introspection.hpp" namespace dci::grt::structSupport { template <class T> constexpr bool operator==(const T &l, const T &r) requires introspection::declaredAsStruct<T> {return introspection::linearize(l) == introspection::linearize(r);} template <class T> constexpr bool operator!=(const T &l, const T &r) requires introspection::declaredAsStruct<T> {return introspection::linearize(l) != introspection::linearize(r);} template <class T> constexpr bool operator> (const T &l, const T &r) requires introspection::declaredAsStruct<T> {return introspection::linearize(l) > introspection::linearize(r);} template <class T> constexpr bool operator>=(const T &l, const T &r) requires introspection::declaredAsStruct<T> {return introspection::linearize(l) >= introspection::linearize(r);} template <class T> constexpr bool operator< (const T &l, const T &r) requires introspection::declaredAsStruct<T> {return introspection::linearize(l) < introspection::linearize(r);} template <class T> constexpr bool operator<=(const T &l, const T &r) requires introspection::declaredAsStruct<T> {return introspection::linearize(l) <= introspection::linearize(r);} }
YUI.add("lang/<API key>",function(a){a.Intl.add("<API key>","fr",{"a":["dim.","lun.","mar.","mer.","jeu.","ven.","sam."],"A":["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"],"b":["janv.","févr.","mars","avr.","mai","juin","juil.","août","sept.","oct.","nov.","déc."],"B":["janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre"],"c":"%a %d %b %Y %H:%M:%S %Z","p":["AM","PM"],"P":["am","pm"],"x":"%d/%m/%y","X":"%H:%M:%S"});},"3.3.0");YUI.add("lang/datatype-date_fr",function(a){},"3.3.0",{use:["lang/<API key>"]});
package cn.dlb.bim.models.ifc2x3tc1; import org.eclipse.emf.common.util.EList; /** * <!-- begin-user-doc --> * A representation of the model object '<em><b>Ifc Project Order Record</b></em>'. * <!-- end-user-doc --> * * <p> * The following features are supported: * </p> * <ul> * <li>{@link cn.dlb.bim.models.ifc2x3tc1.<API key>#getRecords <em>Records</em>}</li> * <li>{@link cn.dlb.bim.models.ifc2x3tc1.<API key>#getPredefinedType <em>Predefined Type</em>}</li> * </ul> * * @see cn.dlb.bim.models.ifc2x3tc1.Ifc2x3tc1Package#<API key>() * @model * @generated */ public interface <API key> extends IfcControl { /** * Returns the value of the '<em><b>Records</b></em>' reference list. * The list contents are of type {@link cn.dlb.bim.models.ifc2x3tc1.<API key>}. * <!-- begin-user-doc --> * <p> * If the meaning of the '<em>Records</em>' reference list isn't clear, * there really should be more of a description here... * </p> * <!-- end-user-doc --> * @return the value of the '<em>Records</em>' reference list. * @see cn.dlb.bim.models.ifc2x3tc1.Ifc2x3tc1Package#<API key>() * @model * @generated */ EList<<API key>> getRecords(); /** * Returns the value of the '<em><b>Predefined Type</b></em>' attribute. * The literals are from the enumeration {@link cn.dlb.bim.models.ifc2x3tc1.<API key>}. * <!-- begin-user-doc --> * <p> * If the meaning of the '<em>Predefined Type</em>' attribute isn't clear, * there really should be more of a description here... * </p> * <!-- end-user-doc --> * @return the value of the '<em>Predefined Type</em>' attribute. * @see cn.dlb.bim.models.ifc2x3tc1.<API key> * @see #setPredefinedType(<API key>) * @see cn.dlb.bim.models.ifc2x3tc1.Ifc2x3tc1Package#<API key>() * @model * @generated */ <API key> getPredefinedType(); /** * Sets the value of the '{@link cn.dlb.bim.models.ifc2x3tc1.<API key>#getPredefinedType <em>Predefined Type</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @param value the new value of the '<em>Predefined Type</em>' attribute. * @see cn.dlb.bim.models.ifc2x3tc1.<API key> * @see #getPredefinedType() * @generated */ void setPredefinedType(<API key> value); } // <API key>
#include "pypool.h" #include "parsing.h" #include <iostream> using namespace std; using namespace essentia; PyMethodDef PyPool_methods[] = { { "__add__", (PyCFunction)PyPool::add, METH_VARARGS, "Pool.add(key, value) adds \"value\" to the pool under \"key\"" }, { "__set__", (PyCFunction)PyPool::set, METH_VARARGS, "Pool.set(key, value) sets \"value\" in the pool under \"key\"" }, { "__merge__", (PyCFunction)PyPool::merge, METH_VARARGS, "Pool.merge(key, mergeType) merges \"value\" in the pool under \"key\" or "\ "Pool.merge(pool, mergeType) merges \"pool\" in the pool"}, { "__mergeSingle__",(PyCFunction)PyPool::mergeSingle, METH_VARARGS, "Pool.mergeSingle(key, value) sets \"value\" in the pool under \"key\"" }, { "__value__", (PyCFunction)PyPool::value, METH_VARARGS, "Pool.value(key) retrieves a value from the pool under \"key\"" }, { "isSingleValue", (PyCFunction)PyPool::isSingleValue, METH_O, "Pool.isSingleValue(key) returns true if the descriptor under \"key\" is a single value descriptor" }, { "remove", (PyCFunction)PyPool::remove, METH_O, "Pool.remove(key) removes all values in the pool under \"key\"" }, { "removeNamespace",(PyCFunction)PyPool::removeNamespace, METH_O, "Pool.removeNamespace(namespace) removes all descriptors in the pool under \"namespace\"" }, { "clear", (PyCFunction)PyPool::clear, METH_NOARGS, "Pool.clear() clears out the pool" }, { "descriptorNames",(PyCFunction)PyPool::descriptorNames, METH_VARARGS, "Pool.descriptorNames(namespace) returns a list of all descriptors in the pool under \"namespace\". If no namespace is supplied it returns a list of all descriptors" }, { "__keyType__", (PyCFunction)PyPool::keyType, METH_O, "Returns the type of the data stored under 'key'" }, { NULL } /* Sentinel */ }; PyTypeObject PyPoolType = { #if PY_MAJOR_VERSION >= 3 <API key>(NULL, 0) #else PyObject_HEAD_INIT(NULL) 0, // ob_size #endif "essentia.Pool", // tp_name sizeof(PyPool), // tp_basicsize 0, // tp_itemsize PyPool::dealloc, // tp_dealloc 0, // tp_print 0, // tp_getattr 0, // tp_setattr 0, // tp_compare 0, // tp_repr 0, // tp_as_number 0, // tp_as_sequence 0, // tp_as_mapping 0, // tp_hash 0, // tp_call 0, // tp_str 0, // tp_getattro 0, // tp_setattro 0, // tp_as_buffer Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, // tp_flags "Pool objects", // tp_doc 0, // tp_traverse 0, // tp_clear 0, // tp_richcompare 0, // tp_weaklistoffset 0, // tp_iter 0, // tp_iternext PyPool_methods, // tp_methods 0, // tp_members 0, // tp_getset 0, // tp_base 0, // tp_dict 0, // tp_descr_get 0, // tp_descr_set 0, // tp_dictoffset PyPool::init, // tp_init 0, // tp_alloc PyPool::make_new, // tp_new }; int PyPool::init(PyObject* self, PyObject* args, PyObject* kwds) { reinterpret_cast<PyPool*>(self)->pool = new essentia::Pool(); // default constructor with no argument if (PyArg_ParseTuple(args, (char*)"")) return 0; return -1; } PyObject* PyPool::keyType(PyPool* self, PyObject* obj) { if (!PyString_Check(obj)) { PyErr_SetString(PyExc_TypeError, "expected a string argument"); return NULL; } string key = PyString_AS_STRING(obj); Pool& p = *(self->pool); // search for the key and return the respective Edt of the sub-pool its in // search Real sub-pool if (p.getRealPool().find(key) != p.getRealPool().end()) { return PyString_FromString( edtToString(VECTOR_REAL).c_str() ); } // search string sub-pool if (p.getStringPool().find(key) != p.getStringPool().end()) { return PyString_FromString( edtToString(VECTOR_STRING).c_str() ); } // search StereoSample sub-pool if (p.getStereoSamplePool().find(key) != p.getStereoSamplePool().end()) { return PyString_FromString( edtToString(VECTOR_STEREOSAMPLE).c_str() ); } // search vector<Real> sub-pool if (p.getVectorRealPool().find(key) != p.getVectorRealPool().end()) { return PyString_FromString( edtToString(VECTOR_VECTOR_REAL).c_str() ); } // search vector<string> sub-pool if (p.getVectorStringPool().find(key) != p.getVectorStringPool().end()) { return PyString_FromString( edtToString(<API key>).c_str() ); } // search array2d sub-pool if (p.getArray2DRealPool().find(key) != p.getArray2DRealPool().end()) { return PyString_FromString( edtToString(VECTOR_MATRIX_REAL).c_str() ); } // search single real pool if (p.getSingleRealPool().find(key) != p.getSingleRealPool().end()) { return PyString_FromString( edtToString(REAL).c_str() ); } // search single vector real pool if (p.<API key>().find(key) != p.<API key>().end()) { return PyString_FromString( edtToString(VECTOR_REAL).c_str() ); } // search single string pool if (p.getSingleStringPool().find(key) != p.getSingleStringPool().end()) { return PyString_FromString( edtToString(STRING).c_str() ); } // couldn't find the key ostringstream msg; msg << "'" << key << "' is not a key in the pool" << endl; PyErr_SetString(PyExc_ValueError, msg.str().c_str()); return NULL; } PyObject* PyPool::toPythonRef(Pool* data) { return TO_PYTHON_PROXY(PyPool, data); } Pool* PyPool::fromPythonRef(PyObject* obj) { if (!PyType_IsSubtype(obj->ob_type, &PyPoolType)) { throw EssentiaException("PyPool::fromPythonCopy: argument given is not a PyPool.\n" "If it actually is one, also make sure your algorithm is among the ones being able to receive a pool as input (as defined in essentia/standard.py)"); } return reinterpret_cast<PyPool*>(obj)->pool; } PyObject* PyPool::add(PyPool* self, PyObject* pyArgs) { vector<PyObject*> args = unpack(pyArgs); // make sure we have three args (key, type, value) if (args.size() != 4) { PyErr_SetString(PyExc_RuntimeError, "4 arguments required (string, string, value, bool)"); return NULL; } // make sure first and second args are strings if (!PyString_Check(args[0]) || !PyString_Check(args[1])) { PyErr_SetString(PyExc_TypeError, "first argument should be a string"); return NULL; } string key = PyString_AsString(args[0]); Edt tp = stringToEdt( PyString_AS_STRING(args[1]) ); Pool& p = *(self->pool); if (!PyBool_Check(args[3])) { PyErr_SetString(PyExc_TypeError, "last argument should be a boolean"); } bool validityCheck = (args[3]==Py_True); try { #define ADD_COPY(tname, type) { \ type* val = (type*)tname::fromPythonCopy(args[2]); \ p.add(key, *val, validityCheck); \ delete val; \ break; \ } #define ADD_REF(tname, type) { \ type* val = (type*)tname::fromPythonRef(args[2]); \ p.add(key, *val, validityCheck); \ delete val; \ break; \ } switch (tp) { case REAL: ADD_COPY(PyReal, Real); case STRING: ADD_COPY(String, string); case STEREOSAMPLE: ADD_COPY(PyStereoSample, StereoSample); case VECTOR_STRING: ADD_COPY(VectorString, vector<string>); case MATRIX_REAL: ADD_COPY(MatrixReal, TNT::Array2D<Real>); case VECTOR_REAL: ADD_REF(VectorReal, RogueVector<Real>); default: ostringstream msg; msg << "Pool.add does not support the type: " << edtToString(tp); PyErr_SetString(PyExc_TypeError, msg.str().c_str()); return NULL; } #undef ADD_COPY #undef ADD_REF } catch (const exception& e) { ostringstream msg; msg << "error while adding to the Pool: " << e.what(); PyErr_SetString(PyExc_RuntimeError, msg.str().c_str()); return NULL; } Py_RETURN_NONE; } PyObject* PyPool::set(PyPool* self, PyObject* pyArgs) { vector<PyObject*> args = unpack(pyArgs); // make sure we have three args (key, type, value) if (args.size() != 4) { PyErr_SetString(PyExc_RuntimeError, "4 arguments required (string, string, value, bool)"); return NULL; } // make sure first and second args are strings if (!PyString_Check(args[0]) || !PyString_Check(args[1])) { PyErr_SetString(PyExc_TypeError, "first argument should be a string"); return NULL; } string key = PyString_AsString(args[0]); Edt tp = stringToEdt( PyString_AS_STRING(args[1]) ); Pool& p = *(self->pool); if (!PyBool_Check(args[3])) { PyErr_SetString(PyExc_TypeError, "last argument should be a boolean"); } bool validityCheck = (args[3]==Py_True); try { #define SET_COPY(tname, type) { \ type* val = (type*)tname::fromPythonCopy(args[2]); \ p.set(key, *val, validityCheck); \ delete val; \ break; \ } #define SET_REF(tname, type) { \ type* val = (type*)tname::fromPythonRef(args[2]); \ p.set(key, *val, validityCheck); \ delete val; \ break; \ } switch (tp) { case REAL: SET_COPY(PyReal, Real); case STRING: SET_COPY(String, string); case VECTOR_REAL: SET_REF(VectorReal, RogueVector<Real>); default: ostringstream msg; msg << "Pool.set does not support the type: " << edtToString(tp); PyErr_SetString(PyExc_TypeError, msg.str().c_str()); return NULL; } #undef SET_COPY #undef SET_REF } catch (const exception& e) { ostringstream msg; msg << "error while setting value in the Pool: " << e.what(); PyErr_SetString(PyExc_RuntimeError, msg.str().c_str()); return NULL; } Py_RETURN_NONE; } PyObject* PyPool::merge(PyPool* self, PyObject* pyArgs) { vector<PyObject*> args = unpack(pyArgs); // make sure we have three args (key, type, value) if (args.size() < 3) { PyErr_SetString(PyExc_RuntimeError, "4 arguments required (string, string, value, string)"); return NULL; } // make sure first and second args are strings string key = ""; Edt tp = UNDEFINED; string mergeType = ""; Pool& p = *(self->pool); if (args.size() == 4) { if (!PyString_Check(args[0]) || !PyString_Check(args[1])) { PyErr_SetString(PyExc_TypeError, "pool.merge, first argument should be a string"); return NULL; } if (!PyString_Check(args[3])) { PyErr_SetString(PyExc_TypeError, "pool.merge, 4rth argument should be a string"); return NULL; } key = PyString_AsString(args[0]); tp = stringToEdt( PyString_AS_STRING(args[1]) ); mergeType = PyString_AsString(args[3]); } else if(args.size() == 3) { tp = stringToEdt( PyString_AS_STRING(args[0]) ); if (tp != POOL) { PyErr_SetString(PyExc_TypeError, "pool.merge, first argument should be a pool"); return NULL; } if (!PyString_Check(args[2])) { PyErr_SetString(PyExc_TypeError, "pool.merge, 3rd argument should be a string"); return NULL; } string mergeType = PyString_AsString(args[2]); try { p.merge(*PyPool::fromPythonRef(args[1]), mergeType); Py_RETURN_NONE; } catch (const exception& e) { ostringstream msg; msg << "pool.merge, error while merging two pools: " << e.what(); PyErr_SetString(PyExc_RuntimeError, msg.str().c_str()); return NULL; } } try { #define MERGE_COPY(tname, type) { \ type* val = (type*)tname::fromPythonCopy(args[2]); \ p.merge(key, *val, mergeType); \ delete val; \ break; \ } #define MERGE_REF(tname, type) { \ type* val = (type*)tname::fromPythonRef(args[2]); \ p.merge(key, *val, mergeType); \ delete val; \ break; \ } switch (tp) { // single types (not vectorized) are not possible types as they should // belong to single_valued_pools and not usual pools, hence they appear // in mergeSingle: case VECTOR_REAL: MERGE_REF(VectorReal, RogueVector<Real>); case VECTOR_STRING: MERGE_COPY(VectorString, vector<string>); case VECTOR_STEREOSAMPLE: MERGE_COPY(VectorStereoSample, vector<StereoSample>); case VECTOR_VECTOR_REAL: MERGE_COPY(VectorVectorReal, vector<vector<Real> >); case <API key>: MERGE_COPY(VectorVectorString, vector<vector<string> >); case VECTOR_MATRIX_REAL: MERGE_COPY(VectorMatrixReal, vector<TNT::Array2D<Real> >); //case POOL: p.merge(args[1].cppPool, mergeType) default: ostringstream msg; msg << "Pool.merge does not support the type: " << edtToString(tp); PyErr_SetString(PyExc_TypeError, msg.str().c_str()); return NULL; } #undef MERGE_COPY #undef MERGE_REF } catch (const exception& e) { ostringstream msg; msg << "Pool.merge error while merging into the Pool: " << e.what(); PyErr_SetString(PyExc_RuntimeError, msg.str().c_str()); return NULL; } Py_RETURN_NONE; } PyObject* PyPool::mergeSingle(PyPool* self, PyObject* pyArgs) { vector<PyObject*> args = unpack(pyArgs); // make sure we have three args (key, type, value) if (args.size() != 4) { PyErr_SetString(PyExc_RuntimeError, "4 arguments required (string, string, value, string)"); return NULL; } // make sure first and second args are strings if (!PyString_Check(args[0]) || !PyString_Check(args[1])) { PyErr_SetString(PyExc_TypeError, "first argument should be a string"); return NULL; } if (!PyString_Check(args[3])) { PyErr_SetString(PyExc_TypeError, "4th argument should be a string"); return NULL; } string key = PyString_AsString(args[0]); Edt tp = stringToEdt( PyString_AS_STRING(args[1]) ); Pool& p = *(self->pool); string mergeType = PyString_AsString(args[3]); try { #define MERGE_COPY(tname, type) { \ type* val = (type*)tname::fromPythonCopy(args[2]); \ p.mergeSingle(key, *val, mergeType); \ delete val; \ break; \ } #define MERGE_REF(tname, type) { \ type* val = (type*)tname::fromPythonRef(args[2]); \ p.mergeSingle(key, *val, mergeType); \ delete val; \ break; \ } switch (tp) { case REAL: MERGE_COPY(PyReal, Real); case STRING: MERGE_COPY(String, string); case VECTOR_REAL: MERGE_REF(VectorReal, RogueVector<Real>); default: ostringstream msg; msg << "Pool.mergeSingle does not support the type: " << edtToString(tp); PyErr_SetString(PyExc_TypeError, msg.str().c_str()); return NULL; } #undef MERGE_COPY #undef MERGE_REF } catch (const exception& e) { ostringstream msg; msg << "Pool.mergeSingle error while merging value in the Pool: " << e.what(); PyErr_SetString(PyExc_RuntimeError, msg.str().c_str()); return NULL; } Py_RETURN_NONE; } PyObject* PyPool::value(PyPool* self, PyObject* pyArgs) { vector<PyObject*> args = unpack(pyArgs); // make sure we have two arg and they are strings if (args.size() != 2 || !PyString_Check(args[0]) || !PyString_Check(args[1])) { PyErr_SetString(PyExc_RuntimeError, "2 arguments required (string, string)"); return NULL; } string key = PyString_AS_STRING(args[0]); Edt tp = stringToEdt( PyString_AS_STRING(args[1]) ); Pool& p = *(self->pool); try { switch (tp) { case REAL: return PyReal::toPythonCopy(&p.value<Real>(key)); case STRING: return String::toPythonCopy(&p.value<string>(key)); case VECTOR_REAL: { // this is a special case, we can't create the RogueVector that wraps // the Pool's underlying std::vector because it might be the case that // the Pool is deleted and the numpy.array that points to the RogueVector // still exists const vector<Real>& v = p.value<vector<Real> >(key); RogueVector<Real>* r = new RogueVector<Real>(v.size(), 0.); for (int i=0; i<int(v.size()); ++i) { (*r)[i] = v[i]; } return VectorReal::toPythonRef(r); } case VECTOR_STRING: return VectorString::toPythonCopy(&p.value<vector<string> >(key)); case VECTOR_STEREOSAMPLE: return VectorStereoSample::toPythonCopy(&p.value<vector<StereoSample> >(key)); case VECTOR_VECTOR_REAL: return VectorVectorReal::toPythonCopy(&p.value<vector<vector<Real> > >(key)); case <API key>: return VectorVectorString::toPythonCopy(&p.value<vector<vector<string> > >(key)); case VECTOR_MATRIX_REAL: return VectorMatrixReal::toPythonCopy(&p.value<vector<TNT::Array2D<Real> > >(key)); default: ostringstream msg; msg << "Pool.value does not support the type: " << edtToString(tp); PyErr_SetString(PyExc_TypeError, msg.str().c_str()); return NULL; } } catch (const exception& e) { ostringstream msg; msg << "error while retrieving value from Pool: " << e.what(); PyErr_SetString(PyExc_RuntimeError, msg.str().c_str()); return NULL; } } PyObject* PyPool::remove(PyPool* self, PyObject* obj) { // make sure first arg is a string if (!PyString_Check(obj)) { PyErr_SetString(PyExc_TypeError, "expecting a string argument"); return NULL; } self->pool->remove(PyString_AS_STRING(obj)); Py_RETURN_NONE; } PyObject* PyPool::isSingleValue(PyPool* self, PyObject* obj) { // make sure first arg is a string if (!PyString_Check(obj)) { PyErr_SetString(PyExc_TypeError, "expecting a string argument"); return NULL; } if (self->pool->isSingleValue(PyString_AS_STRING(obj))) Py_RETURN_TRUE; Py_RETURN_FALSE; } PyObject* PyPool::removeNamespace(PyPool* self, PyObject* obj) { // make sure first arg is a string if (!PyString_Check(obj)) { PyErr_SetString(PyExc_TypeError, "expecting a string argument"); return NULL; } self->pool->removeNamespace(PyString_AS_STRING(obj)); Py_RETURN_NONE; } PyObject* PyPool::descriptorNames(PyPool* self, PyObject* pyArgs) { vector<PyObject*> args = unpack(pyArgs); if (args.size() > 1) { PyErr_SetString(PyExc_TypeError, "expecting only one argument"); return NULL; } if (args.size() == 0) { vector<string> dNames = self->pool->descriptorNames(); return VectorString::toPythonCopy(&dNames); } if (!PyString_Check(args[0])) { PyErr_SetString(PyExc_TypeError, "expecting a string argument"); return NULL; } vector<string> dNames = self->pool->descriptorNames(PyString_AS_STRING(args[0])); // convert dNames to python list return VectorString::toPythonCopy(&dNames); } PyObject* PyPool::clear(PyPool* self) { self->pool->clear(); Py_RETURN_NONE; }
# -*- coding: utf-8 -*- from __future__ import absolute_import #from . import report_order_line #from . import order_report_nex # Estado de Cuenta - Used by Patient - Moved from . import report_sale_product from . import order_admin from . import ticket from . import order from . import order_business from . import order_controller from . import order_extra from . import order_line from . import order_line_pl from . import payment_method from . import payment_method_line #from . import closing from . import card
<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php'); <API key>(array('plugins' => array(array('function', 'sugar_getjspath', 'modules/ModuleBuilder/tpls/includes.tpl', 38, false),)), $this); ?> <script type="text/javascript" src="<?php echo <API key>(array('file' => 'modules/ModuleBuilder/javascript/JSTransaction.js'), $this);?> " ></script> <script> var jstransaction = new JSTransaction(); <?php echo ' if (SUGAR.themes.tempHideLeftCol){ SUGAR.themes.tempHideLeftCol(); } '; ?> </script> <link rel="stylesheet" type="text/css" href="<?php echo <API key>(array('file' => "modules/ModuleBuilder/tpls/LayoutEditor.css"), $this);?> " /> <link rel="stylesheet" type="text/css" href="<?php echo <API key>(array('file' => "include/ytree/TreeView/css/folders/tree.css"), $this);?> " /> <script type="text/javascript" src='<?php echo <API key>(array('file' => 'modules/ModuleBuilder/javascript/studio2.js'), $this);?> ' ></script> <script type="text/javascript" src='<?php echo <API key>(array('file' => 'modules/ModuleBuilder/javascript/studio2PanelDD.js'), $this);?> ' ></script> <script type="text/javascript" src='<?php echo <API key>(array('file' => 'modules/ModuleBuilder/javascript/studio2RowDD.js'), $this);?> ' ></script> <script type="text/javascript" src='<?php echo <API key>(array('file' => 'modules/ModuleBuilder/javascript/studio2FieldDD.js'), $this);?> ' ></script> <script type="text/javascript" src='<?php echo <API key>(array('file' => 'modules/ModuleBuilder/javascript/studiotabgroups.js'), $this);?> '></script> <script type="text/javascript" src='<?php echo <API key>(array('file' => 'modules/ModuleBuilder/javascript/studio2ListDD.js'), $this);?> ' ></script> <!--end ModuleBuilder Assistant! <script type="text/javascript" language="Javascript" src='<?php echo <API key>(array('file' => 'modules/ModuleBuilder/javascript/ModuleBuilder.js'), $this);?> '></script> <script type="text/javascript" language="Javascript" src='<?php echo <API key>(array('file' => 'modules/ModuleBuilder/javascript/SimpleList.js'), $this);?> '></script> <script type="text/javascript" src='<?php echo <API key>(array('file' => 'modules/ModuleBuilder/javascript/JSTransaction.js'), $this);?> ' ></script> <script type="text/javascript" src='<?php echo <API key>(array('file' => 'include/javascript/tiny_mce/tiny_mce.js'), $this);?> ' ></script> <link rel="stylesheet" type="text/css" href="<?php echo <API key>(array('file' => "modules/ModuleBuilder/tpls/MB.css"), $this);?> " />
// <auto-generated> // Dieser Code wurde von einem Tool generiert. // der Code erneut generiert wird. // </auto-generated> namespace CafeInternational.Properties { using System; <summary> Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw. </summary> // Diese Klasse wurde von der <API key> automatisch generiert // mit der /str-Option erneut aus, oder Sie erstellen Ihr VS-Projekt neu. [global::System.CodeDom.Compiler.<API key>("System.Resources.Tools.<API key>", "4.0.0.0")] [global::System.Diagnostics.<API key>()] [global::System.Runtime.CompilerServices.<API key>()] internal class Resources { private static global::System.Resources.ResourceManager resourceMan; private static global::System.Globalization.CultureInfo resourceCulture; [global::System.Diagnostics.CodeAnalysis.<API key>("Microsoft.Performance", "CA1811:<API key>")] internal Resources() { } <summary> Gibt die <API key> <API key> zurück, die von dieser Klasse verwendet wird. </summary> [global::System.ComponentModel.<API key>(global::System.ComponentModel.<API key>.Advanced)] internal static global::System.Resources.ResourceManager ResourceManager { get { if (object.ReferenceEquals(resourceMan, null)) { global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("CafeInternational.Properties.Resources", typeof(Resources).Assembly); resourceMan = temp; } return resourceMan; } } <summary> Überschreibt die <API key> des aktuellen Threads für alle <API key>, die diese stark typisierte Ressourcenklasse verwenden. </summary> [global::System.ComponentModel.<API key>(global::System.ComponentModel.<API key>.Advanced)] internal static global::System.Globalization.CultureInfo Culture { get { return resourceCulture; } set { resourceCulture = value; } } } }
// #pragma once is supported starting with _MCS_VER 1000, // so we need not to check the version (because we only support _MSC_VER >= 1100)! #pragma once //#include <windows.h> // special defines for VC5/6 (if no actual PSDK is installed): #if _MSC_VER < 1300 typedef unsigned __int64 DWORD64, *PDWORD64; #if defined(_WIN64) typedef unsigned __int64 SIZE_T, *PSIZE_T; #else typedef unsigned long SIZE_T, *PSIZE_T; #endif #endif // _MSC_VER < 1300 class __declspec(dllexport) StackWalkerInternal; // forward class __declspec(dllexport) StackWalker { public: typedef enum StackWalkOptions { // No addition info will be retrived // (only the address is available) RetrieveNone = 0, // Try to get the symbol-name RetrieveSymbol = 1, // Try to get the line for this symbol RetrieveLine = 2, // Try to retrieve the module-infos RetrieveModuleInfo = 4, // Also retrieve the version for the DLL/EXE RetrieveFileVersion = 8, // Contains all the abouve RetrieveVerbose = 0xF, // Generate a "good" symbol-search-path SymBuildPath = 0x10, // Also use the public <API key> SymUseSymSrv = 0x20, // Contains all the abouve "Sym"-options SymAll = 0x30, // Contains all options (default) OptionsAll = 0x3F } StackWalkOptions; StackWalker( int options = OptionsAll, // 'int' is by design, to combine the enum-flags LPCSTR szSymPath = NULL, DWORD dwProcessId = GetCurrentProcessId(), HANDLE hProcess = GetCurrentProcess() ); StackWalker(DWORD dwProcessId, HANDLE hProcess); virtual ~StackWalker(); typedef BOOL (__stdcall *<API key>)( HANDLE hProcess, DWORD64 qwBaseAddress, PVOID lpBuffer, DWORD nSize, LPDWORD lpNumberOfBytesRead, LPVOID pUserData // optional data, which was passed in "ShowCallstack" ); BOOL LoadModules(); BOOL m_sharedptrlog; BOOL ShowCallstack(BOOL issharedptrlog = FALSE, HANDLE hThread = GetCurrentThread(), const CONTEXT *context = NULL, <API key> readMemoryFunction = NULL, LPVOID pUserData = NULL // optional to identify some data in the 'readMemoryFunction'-callback ); #if _MSC_VER >= 1300 // due to some reasons, the "<API key>" must be declared as "public" // in older compilers in order to use it... starting with VC7 we can declare it as "protected" protected: #endif enum { <API key> = 1024 }; // max name length for found symbols protected: // Entry for each Callstack-Entry typedef struct CallstackEntry { DWORD64 offset; // if 0, we have no valid entry CHAR name[<API key>]; CHAR undName[<API key>]; CHAR undFullName[<API key>]; DWORD64 offsetFromSmybol; DWORD offsetFromLine; DWORD lineNumber; CHAR lineFileName[<API key>]; DWORD symType; LPCSTR symTypeString; CHAR moduleName[<API key>]; DWORD64 baseOfImage; CHAR loadedImageName[<API key>]; } CallstackEntry; typedef enum CallstackEntryType {firstEntry, nextEntry, lastEntry}; virtual void OnSymInit(LPCSTR szSearchPath, DWORD symOptions, LPCSTR szUserName); virtual void OnLoadModule(LPCSTR img, LPCSTR mod, DWORD64 baseAddr, DWORD size, DWORD result, LPCSTR symType, LPCSTR pdbName, ULONGLONG fileVersion); virtual void OnCallstackEntry(CallstackEntryType eType, CallstackEntry &entry); virtual void OnDbgHelpErr(LPCSTR szFuncName, DWORD gle, DWORD64 addr); virtual void OnOutput(LPCSTR szText); StackWalkerInternal *m_sw; HANDLE m_hProcess; DWORD m_dwProcessId; BOOL m_modulesLoaded; LPSTR m_szSymPath; int m_options; static BOOL __stdcall myReadProcMem(HANDLE hProcess, DWORD64 qwBaseAddress, PVOID lpBuffer, DWORD nSize, LPDWORD lpNumberOfBytesRead); friend StackWalkerInternal; }; // The "ugly" <API key> is needed for systems before XP // If you have a new PSDK and you only compile for XP and later, then you can use // the "RtlCaptureContext" // Currently there is no define which determines the PSDK-Version... // So we just use the compiler-version (and assumes that the PSDK is // the one which was installed by the VS-IDE) // INFO: If you want, you can use the RtlCaptureContext if you only target XP and later... // But I currently use it in x64/IA64 environments... //#if defined(_M_IX86) && (_WIN32_WINNT <= 0x0500) && (_MSC_VER < 1400) #if defined(_M_IX86) #ifdef <API key> // TODO: The following is not a "good" implementation, // because the callstack is only valid in the "__except" block... #define GET_CURRENT_CONTEXT(c, contextFlags) \ do { \ memset(&c, 0, sizeof(CONTEXT)); \ EXCEPTION_POINTERS *pExp = NULL; \ __try { \ throw 0; \ } __except( ( (pExp = <API key>()) ? <API key> : <API key>)) {} \ if (pExp != NULL) \ memcpy(&c, pExp->ContextRecord, sizeof(CONTEXT)); \ c.ContextFlags = contextFlags; \ } while(0); #else // The following should be enough for walking the callstack... #define GET_CURRENT_CONTEXT(c, contextFlags) \ do { \ memset(&c, 0, sizeof(CONTEXT)); \ c.ContextFlags = contextFlags; \ __asm call x \ __asm x: pop eax \ __asm mov c.Eip, eax \ __asm mov c.Ebp, ebp \ __asm mov c.Esp, esp \ } while(0); #endif #else // The following is defined for x86 (XP and higher), x64 and IA64: #define GET_CURRENT_CONTEXT(c, contextFlags) \ do { \ memset(&c, 0, sizeof(CONTEXT)); \ c.ContextFlags = contextFlags; \ RtlCaptureContext(&c); \ } while(0); #endif
package se.malmo.esb.primecase; import javax.xml.ws.WebFault; @WebFault(name = "HandleCaseException", targetNamespace = "http://schemas.datacontract.org/2004/07/PrimeSystems.PrimeCaseCore.Portal") public class <API key> extends Exception { public static final long serialVersionUID = 20090615172405L; private org.datacontract.schemas._2004._07.<API key>.HandleCaseException handleCaseException; public <API key>() { super(); } public <API key>(String message) { super(message); } public <API key>(String message, Throwable cause) { super(message, cause); } public <API key>(String message, org.datacontract.schemas._2004._07.<API key>.HandleCaseException handleCaseException) { super(message); this.handleCaseException = handleCaseException; } public <API key>(String message, org.datacontract.schemas._2004._07.<API key>.HandleCaseException handleCaseException, Throwable cause) { super(message, cause); this.handleCaseException = handleCaseException; } public org.datacontract.schemas._2004._07.<API key>.HandleCaseException getFaultInfo() { return this.handleCaseException; } }
class GameDecorator < Draper::Decorator delegate_all def start clock_icon + format_timedate(object.start) end def registration_end clock_icon + format_timedate(object.registration_end) end def <API key> 5 end def <API key> h.content_tag(:div, class: "list-group") { ((1..5).map { |i| team_line(i)}).join.html_safe } end private def team_line(name) h.link_to(team_line_badge(name) + "Team #{name}", "#", class: "list-group-item") end def team_line_badge(count) h.content_tag(:span, h.pluralize(count, "member"), class: "badge") end def clock_icon h.content_tag(:span, class: "glyphicon glyphicon-time") {}.html_safe end def format_timedate(timedate) timedate.strftime(" %d.%m.%Y %H:%S%z") end end
package nl.mpi.arbil.ui; import java.awt.HeadlessException; import java.awt.Point; import java.io.File; import java.net.<API key>; import java.net.URI; import java.net.URISyntaxException; import java.net.URLDecoder; import java.text.MessageFormat; import java.util.ArrayList; import java.util.List; import java.util.ResourceBundle; import javax.swing.JOptionPane; import nl.mpi.arbil.<API key>; import nl.mpi.arbil.data.ArbilDataNode; import nl.mpi.arbil.data.<API key>; import nl.mpi.arbil.data.ArbilField; import nl.mpi.arbil.data.ArbilNode; import nl.mpi.arbil.data.DataNodeLoader; import nl.mpi.arbil.data.MetadataBuilder; import nl.mpi.arbil.data.MetadataFormat; import nl.mpi.arbil.ui.fieldeditors.<API key>; import nl.mpi.arbil.ui.menu.TreeContextMenu; import nl.mpi.arbil.userstorage.SessionStorage; import nl.mpi.arbil.util.<API key>; import nl.mpi.arbil.util.BugCatcherManager; import nl.mpi.arbil.util.<API key>; import nl.mpi.arbil.util.MimeHashQueue; import nl.mpi.arbil.util.TreeHelper; import nl.mpi.arbil.util.WindowManager; import nl.mpi.arbil.util.XsdChecker; /** * Controller class for tree actions, most of them probably called from * {@link TreeContextMenu} * * @author Twan Goosen <twan.goosen@mpi.nl> */ public class ArbilTreeController { private static final ResourceBundle widgets = ResourceBundle.getBundle("nl/mpi/arbil/localisation/Widgets"); private final SessionStorage sessionStorage; private final TreeHelper treeHelper; private final WindowManager windowManager; private final <API key> dialogHandler; private final DataNodeLoader dataNodeLoader; private final <API key> versionManager; private final MimeHashQueue mimeHashQueue; public ArbilTreeController(SessionStorage sessionStorage, TreeHelper treeHelper, WindowManager windowManager, <API key> dialogHandler, DataNodeLoader dataNodeLoader, MimeHashQueue mimeHashQueue, <API key> versionManager) { this.sessionStorage = sessionStorage; this.treeHelper = treeHelper; this.windowManager = windowManager; this.dialogHandler = dialogHandler; this.dataNodeLoader = dataNodeLoader; this.mimeHashQueue = mimeHashQueue; this.versionManager = versionManager; } public void reImportBranch(ArbilDataNode <API key>, ArbilTreePanels treePanels) { try { URI remoteDataFile = sessionStorage.getOriginatingUri(<API key>.getURI()); if (remoteDataFile != null) { ArbilDataNode originatingNode = dataNodeLoader.<API key>(remoteDataFile); if (originatingNode.isLocal() && !originatingNode.getFile().exists()) { dialogHandler.<API key>(widgets.getString("THE ORIGIONAL FILE LOCATION CANNOT BE FOUND"), widgets.getString("RE IMPORT BRANCH")); } else if (originatingNode.isMetaDataNode()) { ImportExportDialog importExportDialog = new ImportExportDialog(treePanels.localCorpusTree); // TODO: this may not always be to correct component and this code should be updated importExportDialog.setDestinationNode(<API key>); // TODO: do not re add the location in this case importExportDialog.copyToCache(new ArbilDataNode[]{originatingNode}); } else { dialogHandler.<API key>(widgets.getString("COULD NOT DETERMINE THE ORIGIONAL NODE TYPE"), widgets.getString("RE IMPORT BRANCH")); } } else { dialogHandler.<API key>(widgets.getString("COULD NOT DETERMINE THE ORIGIONAL LOCATION"), widgets.getString("RE IMPORT BRANCH")); } } catch (Exception ex) { BugCatcherManager.getBugCatcher().logError(ex); } } public void <API key>(ArbilDataNode <API key>) throws HeadlessException { String initialValue; if (<API key>.hasLocalResource()) { initialValue = <API key>.resourceUrlField.getFieldValue(); } else { initialValue = ""; } String manualLocation = (String) JOptionPane.showInputDialog(windowManager.getMainFrame(), widgets.getString("ENTER THE RESOURCE URI:"), widgets.getString("MANUAL RESOURCE LOCATION"), JOptionPane.PLAIN_MESSAGE, null, null, initialValue); if (manualLocation != null) { // Not canceled try { final URI locationURI = new URI(manualLocation); if (<API key>(locationURI)) { <API key>.<API key>(locationURI); } } catch (URISyntaxException ex) { dialogHandler.<API key>(widgets.getString("THE URI ENTERED AS A RESOURCE LOCATION IS INVALID. PLEASE CHECK THE LOCATION AND TRY AGAIN."), widgets.getString("INVALID URI")); } catch (<API key> ex) { BugCatcherManager.getBugCatcher().logError(ex); dialogHandler.<API key>(widgets.getString("COULD NOT ADD RESOURCE TO THE METADATA. CHECK THE ERROR LOG FOR DETAILS."), widgets.getString("ERROR ADDING RESOURCE")); } } } private boolean <API key>(final URI locationURI) { if (locationURI.isAbsolute()) { try { // See if creating a file out of the URI does not cause any issues final File file = MetadataFormat.getFile(locationURI); if (file != null && !file.exists()) { dialogHandler.<API key>(widgets.getString("WARNING: NO FILE EXISTS AT THE SPECIFIED LOCATION!"), widgets.getString("MANUAL RESOURCE LOCATION")); } return true; } catch (<API key> ex) { BugCatcherManager.getBugCatcher().logError(ex); dialogHandler.<API key>(widgets.getString("ILLEGAL FILE NAME. CHECK THE ERROR LOG FOR DETAILS."), widgets.getString("ERROR ADDING RESOURCE")); return false; } } else { dialogHandler.<API key>(widgets.getString("LOCATION SHOULD BE AN ABSOLUTE URI"), widgets.getString("ERROR ADDING RESOURCE")); return false; } } public void addRemoteCorpus() { String addableLocation = (String) JOptionPane.showInputDialog(windowManager.getMainFrame(), widgets.getString("ENTER THE URL"), widgets.getString("ADD LOCATION"), JOptionPane.PLAIN_MESSAGE); addRemoteCorpus(addableLocation.trim()); } public void addRemoteCorpus(String addableLocation) { if ((addableLocation != null) && (addableLocation.length() > 0)) { try { treeHelper.<API key>(<API key>.conformStringToUrl(addableLocation)); } catch (URISyntaxException ex) { dialogHandler.<API key>(widgets.getString("FAILED TO ADD LOCATION TO REMOTE CORPUS. SEE ERROR LOG FOR DETAILS."), widgets.getString("ERROR")); BugCatcherManager.getBugCatcher().logError(ex); } } } public void searchSubnodes(ArbilTreePanels treePanels) { windowManager.openSearchTable(((ArbilTree) treePanels.localCorpusTree).getAllSelectedNodes(), widgets.getString("SEARCH")); } public void <API key>(ArbilTreePanels treePanels) { windowManager.openSearchTable(((ArbilTree) treePanels.remoteCorpusTree).getSelectedNodes(), widgets.getString("SEARCH REMOTE CORPUS")); } public void validateNodes(ArbilDataNode[] selectedTreeNodes) { for (ArbilDataNode currentNode : selectedTreeNodes) { if (currentNode.getNeedsSaveToDisk(false) && JOptionPane.YES_OPTION == dialogHandler.showDialogBox( widgets.getString("VALIDATION WILL BE AGAINST THE FILE ON DISK. SAVE CHANGES FIRST?"), widgets.getString("TREE_VALIDATION"), JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE)) { currentNode.saveChangesToCache(true); currentNode.reloadNode(); } XsdChecker xsdChecker = new XsdChecker(); ((ArbilWindowManager) windowManager).createWindow(widgets.getString("XSDCHECKER"), xsdChecker); xsdChecker.checkXML(currentNode); xsdChecker.setDividerLocation(0.5); } } public void addFromFavourite(ArbilDataNode <API key>, String favouriteUrlString, String displayName) { try { String <API key> = URLDecoder.decode(favouriteUrlString, "UTF-8"); ArbilDataNode templateDataNode = dataNodeLoader.getArbilDataNode(null, <API key>.conformStringToUrl(<API key>)); if (<API key> != null) { new MetadataBuilder().requestAddNode(<API key>, displayName, templateDataNode); } else { new MetadataBuilder().requestAddRootNode(templateDataNode, displayName); } // treeHelper.getImdiChildNodes(targetNode); // String addedNodeUrlString = treeHelper.addImdiChildNode(targetNode, linorgFavourites.getNodeType(<API key>), ((JMenuItem) evt.getSource()).getText()); // imdiLoader.getImdiObject("", addedNodeUrlString).requestMerge(imdiLoader.getImdiObject("", <API key>)); // loop child nodes and insert them into the new node // ImdiTreeObject templateImdiObject = GuiHelper.imdiLoader.getImdiObject("", <API key>); // ImdiTreeObject targetImdiObject = GuiHelper.imdiLoader.getImdiObject("", addedNodeUrl); // for (Enumeration<ImdiTreeObject> childTemplateEnum = templateImdiObject.getChildEnum(); childTemplateEnum.hasMoreElements();) { // ImdiTreeObject <API key> = childTemplateEnum.nextElement(); // String addedNodeUrl = treeHelper.addImdiChildNode(targetNode, linorgFavourites.getNodeType(<API key>.getUrlString()), <API key>.toString()); // linorgFavourites.mergeFromFavourite(addedNodeUrl, <API key>, true); // treeHelper.<API key>(targetNode); } catch (Exception ex) { dialogHandler.<API key>(widgets.getString("FAILED TO ADD FROM FAVOURITES, SEE ERROR LOG FOR DETAILS."), widgets.getString("ERROR")); BugCatcherManager.getBugCatcher().logError(ex); } } public void viewSelectedNodes(ArbilTree tree) { try { ArrayList<ArbilDataNode> filteredNodes = new ArrayList<ArbilDataNode>(); for (ArbilDataNode currentItem : tree.getSelectedNodes()) { if (currentItem.isMetaDataNode() || currentItem.getFields().size() > 0) { filteredNodes.add(currentItem); } else { try { windowManager.openUrlWindowOnce(currentItem.toString(), currentItem.getURI().toURL()); } catch (<API key> murle) { BugCatcherManager.getBugCatcher().logError(murle); } } } if (filteredNodes.size() > 0) { windowManager.<API key>(filteredNodes.toArray(new ArbilDataNode[]{}), null); } } catch (Exception ex) { BugCatcherManager.getBugCatcher().logError(ex); } } public void <API key>(ArbilTree tree) { ArbilDataNode[] selectedNodes = tree.getSelectedNodes(); ArrayList<ArbilDataNode> filteredNodes = new ArrayList<ArbilDataNode>(selectedNodes.length); for (ArbilDataNode dataNode : selectedNodes) { if (dataNode.isSession() || dataNode.isMetaDataNode()) { filteredNodes.add(dataNode); } } if (!filteredNodes.isEmpty()) { windowManager.<API key>(filteredNodes.toArray(new ArbilDataNode[0])); } } public void <API key>(ArbilTree tree) { windowManager.<API key>(tree.getSelectedNodes(), null); } /** * Starts long field editor for selected nodes */ public void <API key>(ArbilTree tree) { ArbilDataNode[] selectedNodes = tree.getSelectedNodes(); for (ArbilDataNode node : selectedNodes) { if (node.getFields().size() > 0) { // Get fields for the node List<ArbilField[]> fieldArrays = node.getFieldsSorted(); // Show the editor new <API key>().showEditor(fieldArrays.get(0), fieldArrays.get(0)[0].getFieldValue(), 0); } } } public void copyBranch(ArbilTree tree) { try { ImportExportDialog importExportDialog = new ImportExportDialog(tree); importExportDialog.copyToCache(tree.getSelectedNodes()); } catch (Exception ex) { BugCatcherManager.getBugCatcher().logError(ex); } } public void addLocalDirectory() { File[] selectedFiles = dialogHandler.<API key>(widgets.getString("ADD WORKING DIRECTORY"), true); if (selectedFiles != null && selectedFiles.length > 0) { for (File currentDirectory : selectedFiles) { treeHelper.<API key>(currentDirectory.toURI()); } } } /** * <strong>NOTE: this function is not complete and should not be * used</strong> * * @param targetObject */ public void addBulkResources(ArbilNode targetObject) { try { final FavouriteSelectBox favouriteSelectBox = new FavouriteSelectBox(targetObject); File[] selectedFiles = dialogHandler.showFileSelectBox(widgets.getString("ADD BULK RESOURCES"), false, true, null, <API key>.DialogueType.open, favouriteSelectBox); if (selectedFiles != null && selectedFiles.length > 0) { // BulkResourcesAdder bulkResourcesAdder = new BulkResourcesAdder(dialogHandler, favouriteSelectBox.getTargetNode(), favouriteSelectBox.<API key>(), selectedFiles); // bulkResourcesAdder.<API key>(favouriteSelectBox.<API key>()); // bulkResourcesAdder.<API key>(favouriteSelectBox.<API key>()); // bulkResourcesAdder.doBulkAdd(); // if (favouriteSelectBox.getTargetNode() instanceof ArbilDataNode) { new MetadataBuilder().<API key>(favouriteSelectBox.getTargetNode(), widgets.getString("ADD BULK RESOURCES"), favouriteSelectBox.<API key>(), selectedFiles, favouriteSelectBox.<API key>(), favouriteSelectBox.<API key>()); // } else { // new MetadataBuilder().requestAddRootNode(favouriteSelectBox.<API key>(), ((JMenuItem) evt.getSource()).getText()); } } catch (Exception ex) { BugCatcherManager.getBugCatcher().logError(ex); } } public void addNodeFromTemplate(ArbilDataNode <API key>, String nodeType, String displayName) { try { if (<API key> != null) { new MetadataBuilder().requestAddNode(<API key>, nodeType, displayName); } else { // no nodes found that were valid imdi tree objects so we can assume that tis is the tree root new MetadataBuilder().requestRootAddNode(nodeType, displayName); } } catch (Exception ex) { BugCatcherManager.getBugCatcher().logError(ex); } } public void addSubnode(ArbilDataNode <API key>, String nodeType, String nodeText) { try { if (<API key> != null) { if (!<API key>.getParentDomNode().getNeedsSaveToDisk(false) || dialogHandler.<API key>( MessageFormat.format(widgets.getString("ADDING A NODE WILL SAVE PENDING CHANGES"), <API key>.getParentDomNode().toString()), widgets.getString("SAVE PENDING CHANGES?"))) { new MetadataBuilder().requestAddNode(<API key>, nodeType, nodeText); } } else { // no nodes found that were valid imdi tree objects so we can assume that tis is the tree root new MetadataBuilder().requestRootAddNode(nodeType, nodeText); } } catch (Exception ex) { BugCatcherManager.getBugCatcher().logError(ex); } } public void forceTypeCheck(ArbilDataNode dataNode) { mimeHashQueue.forceInQueue(dataNode); } public void showContextMenu(ArbilTree tree, Point location) { new TreeContextMenu(tree, this, treeHelper, dialogHandler, windowManager, sessionStorage, versionManager).show(location.x, location.y); } }
--Copyright (C) 2010 <SWGEmu> --This File is part of Core3. --This program is free software; you can redistribute --it and/or modify it under the terms of the GNU Lesser --General Public License as published by the Free Software --Foundation; either version 2 of the License, --or (at your option) any later version. --This program is distributed in the hope that it will be useful, --but WITHOUT ANY WARRANTY; without even the implied warranty of --MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. --See the GNU Lesser General Public License for --more details. --You should have received a copy of the GNU Lesser General --Public License along with this program; if not, write to --the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA --Linking Engine3 statically or dynamically with other modules --is making a combined work based on Engine3. --Thus, the terms and conditions of the GNU Lesser General Public License --cover the whole combination. --In addition, as a special exception, the copyright holders of Engine3 --give you permission to combine Engine3 program with free software --programs or libraries that are released under the GNU LGPL and with --code included in the standard release of Core3 under the GNU LGPL --license (or modified versions of such code, with unchanged license). --You may copy and distribute such a system following the terms of the --GNU LGPL for Engine3 and the licenses of the other code concerned, --provided that you include the source code of that other code when --and as the GNU LGPL requires distribution of source code. --Note that people who make modified versions of Engine3 are not obligated --to grant this special exception for their modified versions; --it is their choice whether to do so. The GNU Lesser General Public License --gives permission to release a modified version without this exception; --this exception also makes it possible to release a modified version <API key> = <API key>:new { objectMenuComponent = "LairMenuComponent", } ObjectTemplates:addTemplate(<API key>, "object/tangible/lair/laa/lair_laa.iff")
package com.x.program.center.zhengwudingding; import com.x.base.core.project.exception.<API key>; import com.x.base.core.project.exception.PromptException; class ExceptionListOrg extends <API key> { private static final long serialVersionUID = <API key>; ExceptionListOrg(Integer retCode, String retMessage) { super(",:{},:{}.", retCode, retMessage); } }
package com.cgi.eoss.ftep.io.download; import com.cgi.eoss.ftep.io.ServiceIoException; import com.cgi.eoss.ftep.logging.Logging; import com.google.common.collect.ImmutableMultimap; import com.google.common.collect.Iterables; import com.google.common.collect.Multimap; import com.jayway.jsonpath.JsonPath; import lombok.Builder; import lombok.Value; import lombok.extern.log4j.Log4j2; import okhttp3.HttpUrl; import okhttp3.OkHttpClient; import okhttp3.Request; import okhttp3.Response; import okio.BufferedSink; import okio.Okio; import org.apache.logging.log4j.<API key>; import javax.annotation.PostConstruct; import javax.annotation.PreDestroy; import java.io.IOException; import java.net.<API key>; import java.net.URI; import java.nio.file.Path; import java.util.List; import java.util.Set; import java.util.concurrent.TimeUnit; import java.util.stream.Collectors; @Log4j2 public class <API key> implements Downloader { private static final Multimap<String, String> <API key> = ImmutableMultimap.<String, String>builder() .put("sentinel1", "Sentinel1") .put("sentinel2", "Sentinel2") .put("sentinel3", "Sentinel3") .put("landsat", "Landsat5") .put("landsat", "Landsat7") .put("landsat", "Landsat8") .put("envisat", "Envisat") .build(); private final OkHttpClient httpClient; private final OkHttpClient searchClient; private final DownloaderFacade downloaderFacade; private final Properties properties; private final ProtocolPriority protocolPriority; private final CreodiasOrderer creodiasOrderer; private final int <API key> = 31; private final int ORDERED_STATUS = 32; public <API key>(OkHttpClient okHttpClient, int downloadTimeout, int searchTimeout, <API key> <API key>, DownloaderFacade downloaderFacade, Properties properties, ProtocolPriority protocolPriority, <API key> <API key>) { // Use a long timeout as the data access can be slow this.httpClient = okHttpClient.newBuilder() .connectTimeout(downloadTimeout, TimeUnit.SECONDS) .readTimeout(downloadTimeout, TimeUnit.SECONDS) .authenticator(<API key>) .build(); // Use a long timeout as the search query takes a while... this.searchClient = okHttpClient.newBuilder().readTimeout(searchTimeout, TimeUnit.SECONDS).build(); this.downloaderFacade = downloaderFacade; this.properties = properties; this.protocolPriority = protocolPriority; this.creodiasOrderer = new CreodiasOrderer(httpClient, <API key>); } @PostConstruct public void postConstruct() { downloaderFacade.registerDownloader(this); } @PreDestroy public void preDestroy() { downloaderFacade.<API key>(this); } @Override public Set<String> getProtocols() { return <API key>.keySet(); } @Override public int getPriority(URI uri) { return protocolPriority.get(uri.getScheme()); } @Override public Path download(Path targetDir, URI uri) throws IOException { LOG.info("Downloading: {}", uri); HttpUrl downloadUrl = getDownloadUrl(uri); LOG.debug("Resolved IPT download URL: {}", downloadUrl); String filename = Iterables.getLast(downloadUrl.pathSegments()) + ".zip"; Path outputFile = targetDir.resolve(filename); Request request = new Request.Builder().url(downloadUrl).build(); try (Response response = httpClient.newCall(request).execute()) { if (!response.isSuccessful()) { throw new ServiceIoException("Unsuccessful HTTP response: " + response); } try (BufferedSink sink = Okio.buffer(Okio.sink(outputFile))) { long downloadedBytes = sink.writeAll(response.body().source()); LOG.debug("Downloaded {} bytes for {}", downloadedBytes, uri); } } LOG.info("Successfully downloaded via IPT: {}", outputFile); return outputFile; } private HttpUrl getDownloadUrl(URI uri) throws IOException { // Trim the leading slash from the path and get the search URL String productId = uri.getPath().substring(1); List<HttpUrl> searchUrls = <API key>.get(uri.getScheme()).stream() .map(collection -> buildSearchUrl(collection, productId)) .collect(Collectors.toList()); for (HttpUrl searchUrl : searchUrls) { try { return findDownloadUrl(uri, searchUrl); } catch (Exception e) { LOG.debug("Failed to locate download URL: {}", e.getMessage()); } } throw new ServiceIoException("Unable to locate IPT product data for " + uri); } private HttpUrl findDownloadUrl(URI uri, HttpUrl searchUrl) throws IOException { Request request = new Request.Builder().url(searchUrl).get().build(); try (Response response = searchClient.newCall(request).execute()) { if (!response.isSuccessful()) { LOG.error("Received unsuccessful HTTP response for IPT search: {}", response.toString()); throw new ServiceIoException("Unexpected HTTP response from IPT: " + response.message()); } String responseBody = response.body().string(); String productPath = ((String) JsonPath.read(responseBody, "$.features[0].properties.productIdentifier")).replaceFirst("^/", ""); int status = JsonPath.read(responseBody, "$.features[0].properties.status"); // TODO: correct? // If the status is 31 or 32, the product is offline and must be ordered from CREODIAS if (status == <API key> || status == ORDERED_STATUS) { HttpUrl orderUrl = HttpUrl.parse(properties.getIptOrderUrl()); creodiasOrderer.orderProduct(uri, orderUrl); } return HttpUrl.parse(properties.getIptDownloadUrl()).newBuilder() .addPathSegments(productPath) .build(); } catch (<API key> timeout) { try (<API key>.Instance userCtc = Logging.userLoggingContext()) { LOG.error("Timeout locating EO product data for {}; please try again and contact the F-TEP support team if the error persists", uri); } throw new ServiceIoException("Timeout locating IPT product data for " + uri); } } private HttpUrl buildSearchUrl(String collection, String productId) { return HttpUrl.parse(properties.getIptSearchUrl()).newBuilder() .addPathSegments("api/collections") .addPathSegment(collection) .addPathSegment("search.json") .addQueryParameter("maxRecords", "1") .addQueryParameter("productIdentifier", "%" + productId + "%") .build(); } @Value @Builder public static final class Properties { private String iptSearchUrl; private String iptDownloadUrl; private String iptOrderUrl; } }
var webpack = require('webpack') function getConfig() { var env = process.env.CONFIG_FILE_ENV var configFile = '' if (env) { configFile = 'config_' + env + '.js' } else { configFile = 'config.js' } console.log("Using this config file: ", configFile) return __dirname + '/configs/' + configFile } module.exports = { cache: true, resolve: { alias: {config: getConfig(), assets: __dirname + '/assets/'} }, entry: { app: './src/index.js', vendor: './src/vendor.js', }, output: { path: './dist/', publicPath: '/dist/', filename: 'bundle.js' }, module: { // preLoaders: [ // { test: /\.html$/, include: /src/, loader: 'riotjs', query: { type: 'babel' } }, loaders: [ // { test: /\.png$/, include: /assets/, loader: "file" }, { test: /\.png$/, include: /node_modules/, loader: "file" }, // { test: /\.(png|otf|svg)$/, loader: "file" }, { test: /\.css$/, loader: 'style!css' }, { test: /\.scss$/, include: /src/, loader: 'style!css!sass' }, { test: /\.sass$/, include: /src/, loader: 'style!css!sass?indentedSyntax' }, // { test: /\.html$/, include: /src/, loader: 'riotjs' }, // { test: /\.js$/, exclude: /\.es5\.js$/, include: /src/, loader: 'babel' }, { test: /\.html$/, include: /src/, loader: 'riotjs', query: { type: 'babel' } }, { test: /\.js$/, exclude: /\.es5\.js$/, // include: /src/, include: [ /configs/, /src/ ], loader: 'babel', query: { presets: ['es2015-riot'], plugins: ['<API key>', '<API key>'] } // query: { // modules: 'common', // // loose: ['es6.classes'], // // loose: ['all'], // // optional: 'runtime', } // { test: /\.js$|\.html$/, exclude: /\.es5\.js$/, include: [ /configs/, /src/ ], loader: 'babel', query: { presets: 'es2015-riot' } }, // ,{ test: /\.(png|otf|svg)$/, include: /assets/, loader: "url-loader?limit=100000" } ,{ test: /cluster\.svg$/, include: /assets/, loader: "url?limit=100000" } ] }, plugins: [ new webpack.ProvidePlugin({ riot: 'riot', leaflet: 'leaflet', // regeneratorRuntime: 'regeneratorRuntime', }), new webpack.optimize.CommonsChunkPlugin( /* chunkName= */"vendor", /* filename= */"vendor.bundle.js") ], devServer: { port: 5001 }, devtool: "source-map" }
'use strict'; export default function() { let app = require('../app').app; let gridfs = app.get('gridfs'); return gridfs; }
import ckan.plugins as plugins import ckan.lib.base as base class LegalController(base.BaseController): def index(self): return plugins.toolkit.render('ckanext/legal/index.html') def nutzungsbedingungen(self): return plugins.toolkit.render('ckanext/legal/nutzungsbedingungen.html') class HelpController(base.BaseController): def searchguide(self): return plugins.toolkit.render('ckanext/docs/help/searchguide.html') class <API key>(base.BaseController): def index(self): return plugins.toolkit.render('ckanext/docs/guidelines/index.html') def providing(self): return plugins.toolkit.render('ckanext/docs/guidelines/providing.html') def harvesting(self): return plugins.toolkit.render('ckanext/docs/guidelines/harvesting.html') def mapping(self): return plugins.toolkit.render('ckanext/docs/guidelines/mapping.html')
# <API key>: true module StatusPage class ChecksController < <API key> before_action :set_check, :ensure_public def show @public_view = true render template: 'checks/show', layout: 'status_page' end private # Use callbacks to share common setup or constraints between actions. def set_check @check = Check.find(params[:id]) end def ensure_public head :forbidden unless @check.status_page_enable == true end end end
package com.x.program.center.schedule; import java.util.Calendar; import java.util.List; import javax.persistence.EntityManager; import javax.persistence.criteria.CriteriaBuilder; import javax.persistence.criteria.CriteriaQuery; import javax.persistence.criteria.Predicate; import javax.persistence.criteria.Root; import org.quartz.JobExecutionContext; import org.quartz.<API key>; import com.x.base.core.container.<API key>; import com.x.base.core.container.factory.<API key>; import com.x.base.core.project.logger.Logger; import com.x.base.core.project.logger.LoggerFactory; import com.x.program.center.core.entity.Captcha; import com.x.program.center.core.entity.Captcha_; public class CleanupCaptcha extends BaseAction { private static Logger logger = LoggerFactory.getLogger(CleanupCaptcha.class); @Override public void execute(JobExecutionContext jobExecutionContext) throws <API key> { try { if (pirmaryCenter()) { cleanupCaptcha(); } } catch (Exception e) { logger.error(e); throw new <API key>(e); } } private void cleanupCaptcha() throws Exception { try (<API key> emc = <API key>.instance().create()) { EntityManager em = emc.get(Captcha.class); CriteriaBuilder cb = em.getCriteriaBuilder(); CriteriaQuery<String> cq = cb.createQuery(String.class); Root<Captcha> root = cq.from(Captcha.class); Calendar cal = Calendar.getInstance(); cal.add(Calendar.MINUTE, -30); Predicate p = cb.not(cb.greaterThan(root.get(Captcha_.createTime), cal.getTime())); cq.select(root.get(Captcha_.id)).where(p); List<String> list = em.createQuery(cq).getResultList(); for (String id : list) { Captcha o = emc.find(id, Captcha.class); if (null != o) { emc.beginTransaction(Captcha.class); emc.remove(o); emc.commit(); } } } catch (Exception e) { logger.error(e); throw new <API key>(e); } } }
# -*- coding: utf-8 -*- # Module Writen For Odoo, Open Source Management Solution # info Vauxoo (info@vauxoo.com) # coded by: moylop260@vauxoo.com from . import runbot_repo from . import runbot_build
<!--<div align="center" class="heading_gray"> <h3>Participant Card(single)</h3> </div> <br /> <?php echo form_open('report/prereportpdf/participant_regno', array('id' => 'part_reg','target'=>'_blank')); echo blue_box_top(); for($j=0;$j<count($retdat); $j++){ $dat[$retdat[$j]['school_code']] = $retdat[$j]['school_name']; } ?> <input type="hidden" name="hiddtext" value=""> <table width="100%" border="0" cellspacing="0" cellpadding="4" align="center" class="heading_tab" style="margin-top:15px;"> <tr> <th colspan="4" align="left"><strong>Participants Cards - Reg No Wise</strong></th> </tr> <tr> <td width="20%" align="left" class="table_row_first"><strong> &nbsp;Enter Register Number :</strong></td> <td width="24%" align="left" class="table_row_first"><?php echo form_input("regno", '','class="input_box" id="regno" onkeypress="javascript:return numbersonly(this, event, false);" '); ?> </td> <td width="55%" class="table_row_first"><td width="1%"> </tr> <tr> <td width="20%" align="left" class="table_row_first">&nbsp;</td> <td width="24%" align="left" class="table_row_first"><?php echo form_input("regno1", '','class="input_box" id="regno1" onkeypress="javascript:return numbersonly(this, event, false);" '); ?> </td> <td width="55%" class="table_row_first"><td width="1%"> </tr> <tr> <td width="20%" align="left" class="table_row_first">&nbsp;</td> <td width="24%" align="left" class="table_row_first"><?php echo form_input("regno2", '','class="input_box" id="regno2" onkeypress="javascript:return numbersonly(this, event, false);" '); ?> </td> <td width="55%" class="table_row_first"><td width="1%"> </tr> <tr> <tr> <td align="center" colspan="3"><?php echo form_submit('Card', 'Card'); ?>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </td> </tr> </table> <?php echo blue_box_bottom(); echo form_close(); ?>
package com.readrz.math.merging.snaps; import java.util.ArrayList; import java.util.List; import com.readrz.data.SnapInfo; public final class ClusterDocument { private final SnapInfo _snapInfo; private final List<ClusterSentence> _sentences; public ClusterDocument(SnapInfo snapInfo) { _snapInfo = snapInfo; _sentences = new ArrayList<>(); } public SnapInfo getSnapInfo() { return _snapInfo; } public void addSentence(ClusterSentence sentence) { _sentences.add(sentence); } public List<ClusterSentence> getSentences() { return _sentences; } }
<?php abstract class acCouchdbDocument extends <API key> { const BIG_DOCUMENT_SIZE = 50000; protected $_is_new = true; protected $<API key> = null; protected $_is_modified = false; public function loadFromCouchdb(stdClass $data) { if (!is_null($this-><API key>)) { throw new acCouchdbException("data already load"); } if (isset($data->_attachments) && !$this->getDefinition()->exist('_attachments')) { unset($data->_attachments); } $this-><API key> = serialize(new acCouchdbJsonNative($data)); $this->load($data); } public function reloadFromCouchdb(stdClass $data) { $this-><API key> = null; $this->loadFromCouchdb($data); } public function __toString() { return $this->get('_id') . '/' . $this->get('_rev'); } public function __construct() { parent::__construct(acCouchdbManager::getDefinitionByHash($this-><API key>(), '/'), $this, ""); $this->type = $this->getDefinition()->getModel(); if (!$this->type) { throw new acCouchdbException('Model should include Type field in the document root'); } } public function isNew() { if (!$this->_exist('_rev')) return true; return is_null($this->get('_rev')); } public function save() { if ($this->isNew() && !$this->get('_id')) { $this->constructId(); } $this->preSave(); $this-><API key>(); if ($this->isModified()) { $this->doSave(); return $this->storeDoc(); } return false; } public function storeDoc() { $ret = acCouchdbManager::getClient()->save($this); $this->_rev = $ret->rev; $this-><API key> = serialize(new acCouchdbJsonNative($this->getData())); return $ret; } public function rollBackAndPreserve($revision = null) { $doc_to_roll_back = acCouchdbManager::getClient()->getPreviousDoc($this->_id, $revision); $doc_to_roll_back->_rev = $this->_rev; $ret = acCouchdbManager::getClient()->storeDoc($doc_to_roll_back); $this->_rev = $ret->rev; return $ret; } protected function constructId() { } protected function preSave() { } protected function doSave() { } protected function postSave($doc) { $this->_rev = $doc->rev; $this-><API key> = serialize(new acCouchdbJsonNative($this->getData())); } public function getData() { $data = parent::getData(); if ($this->isNew()) { unset($data->_rev); } return $data; } public function <API key>() { throw new acCouchdbException('Definition model not implemented'); } public function delete() { $ret = acCouchdbManager::getClient()->delete($this); $this->_rev = null; return $ret; } public function storeAttachment($file, $content_type = 'application/octet-stream', $filename = null) { $ret = acCouchdbManager::getClient()->storeAttachment($this, $file, $content_type, $filename); if (isset($ret->error)) throw new sfException($ret->reason); $this->postSave($ret); $json = acCouchdbManager::getClient()->find($this->_id, acCouchdbClient::HYDRATE_JSON); $this->_attachments = $json->_attachments; return $ret; } public function getAttachmentUri($filename) { return acCouchdbManager::getClient()->dsn().acCouchdbManager::getClient()->getAttachmentUri($this, $filename); } public function loadAllData() { return parent::loadAllData(); } public function update($params = array()) { return parent::update($params); } public function init($params = array()) { return parent::init($params); } public function getModifications() { $native_json = unserialize($this-><API key>); $final_json = new acCouchdbJsonNative($this->getData()); return $final_json->diff($native_json); } public function isModified() { if($this->_is_modified) { return true; } if(strlen($this-><API key>) > self::BIG_DOCUMENT_SIZE) { return true; }; $native_json = unserialize($this-><API key>); $final_json = new acCouchdbJsonNative($this->getData()); return $this->isNew() || (!$native_json->equal($final_json)); } public function forceModified() { $this->_is_modified = true; } protected function reset($document) { parent::reset($this); $this->_is_new = true; $this-><API key> = null; } public function __clone() { $data = $this->getData(); $this->reset($this); $this->loadFromCouchdb($data); $this->_rev = null; $this->_id = null; } }
# This program is free software: you can redistribute it and/or modify # published by the Free Software Foundation, either version 3 of the # This program is distributed in the hope that it will be useful, # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the import numpy as np from numpy import math _trigonom_ = ['sin', 'cos', 'tan'] _invtrigonom_ = ['a' + f for f in _trigonom_] + ['atan2'] _restricted_ = ['trunc'] for fun in dir(math): if fun in _restricted_: pass elif fun in _trigonom_: exec '{0} = lambda x: math.{0}(math.radians(x))'.format(fun) in globals() elif fun == 'atan2': exec '{0} = lambda y, x: math.degrees(math.{0}(y, x))'.format(fun) in globals() elif fun in _invtrigonom_: exec '{0} = lambda x: math.degrees(math.{0}(x))'.format(fun) in globals() else: exec '{0} = math.{0}'.format(fun) def norm(vector): """ Returns the norm (length) of the vector.""" # note: this is a very hot function, hence the odd optimization # Unoptimized it is: return np.sqrt(np.sum(np.square(vector))) return np.sqrt(np.dot(vector, vector)) def unit_vector(vector): """ Returns the unit vector of the vector. """ return vector / norm(vector) def angle_between(v1, v2): """ Returns the angle in radians between vectors 'v1' and 'v2':: angle_between((1, 0, 0), (0, 1, 0)) 1.5707963267948966 angle_between((1, 0, 0), (1, 0, 0)) 0.0 angle_between((1, 0, 0), (-1, 0, 0)) 3.141592653589793 """ v1_u = unit_vector(v1) v2_u = unit_vector(v2) angle = np.arccos(np.dot(v1_u, v2_u)) if math.isnan(angle): if (v1_u == v2_u).all(): return 0.0 else: return 180 return math.degrees(angle)
# This file is part of wger Workout Manager. # wger Workout Manager is free software: you can redistribute it and/or modify # (at your option) any later version. # wger Workout Manager is distributed in the hope that it will be useful, # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # Standard Library import datetime import decimal import json # Django from django.contrib.auth.models import User from django.urls import reverse # wger from wger.core.tests.base_testcase import WgerTestCase from wger.utils.constants import TWOPLACES from wger.weight.models import WeightEntry class <API key>(WgerTestCase): """ Tests the calories calculator methods and views """ def test_page(self): """ Access the page """ response = self.client.get(reverse('nutrition:calories:view')) self.assertEqual(response.status_code, 302) self.user_login('test') response = self.client.get(reverse('nutrition:calories:view')) self.assertEqual(response.status_code, 200) def test_calculator(self): """ Tests the calculator itself """ self.user_login('test') response = self.client.post(reverse('nutrition:calories:activities'), {'sleep_hours': 7, 'work_hours': 8, 'work_intensity': 1, 'sport_hours': 6, 'sport_intensity': 3, 'freetime_hours': 8, 'freetime_intensity': 1}) self.assertEqual(response.status_code, 200) result = json.loads(response.content.decode('utf8')) self.assertEqual(decimal.Decimal(result['factor']), decimal.Decimal(1.57).quantize(TWOPLACES)) self.assertEqual(decimal.Decimal(result['activities']), decimal.Decimal(2920)) def <API key>(self): """ Tests that weight entries are automatically created or updated """ self.user_login('test') user = User.objects.get(username=self.current_user) # Existing weight entry is old, a new one is created entry1 = WeightEntry.objects.filter(user=user).latest() response = self.client.post(reverse('nutrition:bmi:calculate'), {'height': 180, 'weight': 80}) self.assertEqual(response.status_code, 200) entry2 = WeightEntry.objects.filter(user=user).latest() self.assertEqual(entry1.weight, 83) self.assertEqual(entry2.weight, 80) # Existing weight entry is from today, is updated entry2.delete() entry1.date = datetime.date.today() entry1.save() response = self.client.post(reverse('nutrition:bmi:calculate'), {'height': 180, 'weight': 80}) self.assertEqual(response.status_code, 200) entry2 = WeightEntry.objects.filter(user=user).latest() self.assertEqual(entry1.pk, entry2.pk) self.assertEqual(entry2.weight, 80) # No existing entries WeightEntry.objects.filter(user=user).delete() response = self.client.post(reverse('nutrition:bmi:calculate'), {'height': 180, 'weight': 80}) self.assertEqual(response.status_code, 200) entry = WeightEntry.objects.filter(user=user).latest() self.assertEqual(entry.weight, 80) self.assertEqual(entry.date, datetime.date.today()) def test_bmr(self): """ Tests the BMR view """ self.user_login('test') response = self.client.post(reverse('nutrition:calories:bmr'), {'age': 30, 'height': 180, 'gender': 1, 'weight': 80}) self.assertEqual(response.status_code, 200) result = json.loads(response.content.decode('utf8')) self.assertEqual(result, {'bmr': '1780'}) def <API key>(self): """ Tests that weight entries are automatically created or updated """ self.user_login('test') user = User.objects.get(username=self.current_user) # Existing weight entry is old, a new one is created entry1 = WeightEntry.objects.filter(user=user).latest() response = self.client.post(reverse('nutrition:calories:bmr'), {'age': 30, 'height': 180, 'gender': 1, 'weight': 80}) self.assertEqual(response.status_code, 200) entry2 = WeightEntry.objects.filter(user=user).latest() self.assertEqual(entry1.weight, 83) self.assertEqual(entry2.weight, 80) # Existing weight entry is from today, is updated entry2.delete() entry1.date = datetime.date.today() entry1.save() response = self.client.post(reverse('nutrition:calories:bmr'), {'age': 30, 'height': 180, 'gender': 1, 'weight': 80}) self.assertEqual(response.status_code, 200) entry2 = WeightEntry.objects.filter(user=user).latest() self.assertEqual(entry1.pk, entry2.pk) self.assertEqual(entry2.weight, 80) # No existing entries WeightEntry.objects.filter(user=user).delete() response = self.client.post(reverse('nutrition:calories:bmr'), {'age': 30, 'height': 180, 'gender': 1, 'weight': 80}) self.assertEqual(response.status_code, 200) entry = WeightEntry.objects.filter(user=user).latest() self.assertEqual(entry.weight, 80) self.assertEqual(entry.date, datetime.date.today())
// This program is free software: you can redistribute it and/or modify // published by the Free Software Foundation, either version 3 of the // This program is distributed in the hope that it will be useful, // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the using System; using System.IO; using System.Text; using System.Xml; namespace CalDavSynchronizer.DataAccess { public class WebDavClientBase { private readonly bool _acceptInvalidChars; protected WebDavClientBase(bool acceptInvalidChars) { _acceptInvalidChars = acceptInvalidChars; } protected <API key> CreateXmlDocument(Stream webDavXmlStream, Uri uri) { var responseBody = <API key>(webDavXmlStream); return <API key>(uri, responseBody); } public static <API key> <API key>(Uri uri, XmlDocument responseBody) { XmlNamespaceManager namespaceManager = new XmlNamespaceManager(responseBody.NameTable); namespaceManager.AddNamespace("D", "DAV:"); namespaceManager.AddNamespace("C", "urn:ietf:params:xml:ns:caldav"); namespaceManager.AddNamespace("A", "urn:ietf:params:xml:ns:carddav"); namespaceManager.AddNamespace("E", "http://apple.com/ns/ical/"); namespaceManager.AddNamespace("CS", "http://calendarserver.org/ns/"); return new <API key>(responseBody, namespaceManager, uri); } private XmlDocument <API key>(Stream webDavXmlStream) { using (var reader = new StreamReader(webDavXmlStream, Encoding.UTF8)) { if (_acceptInvalidChars) { var settings = new XmlReaderSettings(); settings.CheckCharacters = false; using (var xmlReader = XmlReader.Create(reader, settings)) { XmlDocument responseBody = new XmlDocument(); responseBody.Load(xmlReader); return responseBody; } } else { XmlDocument responseBody = new XmlDocument(); responseBody.Load(reader); return responseBody; } } } } }
package uk.org.sappho.code.heatmap.selection; import java.util.List; public interface HeatMapSelector { public List<HeatMapMapping> map(String changedFile); }
import videojs from 'video.js' import './pause-bezel' const Plugin = videojs.getPlugin('plugin') class BezelsPlugin extends Plugin { constructor (player: videojs.Player, options?: videojs.ComponentOptions) { super(player) this.player.ready(() => { player.addClass('vjs-bezels') }) player.addChild('PauseBezel', options) } } videojs.registerPlugin('bezels', BezelsPlugin) export { BezelsPlugin }
<API key> = Creature:new { objectName = "@mob/creature_names:<API key>", randomNameType = NAME_GENERIC, randomNameTag = true, socialGroup = "rebel", faction = "rebel", level = 27, chanceHit = 0.38, damageMin = 260, damageMax = 270, baseXp = 2700, baseHAM = 8100, baseHAMmax = 9900, armor = 0, resists = {5,5,5,5,5,5,5,-1,-1}, meatType = "", meatAmount = 0, hideType = "", hideAmount = 0, boneType = "", boneAmount = 0, milk = 0, tamingChance = 0, ferocity = 0, pvpBitmask = ATTACKABLE, creatureBitmask = PACK, optionsBitmask = AIENABLED, diet = HERBIVORE, templates = { "object/mobile/<API key>.iff", "object/mobile/<API key>.iff", "object/mobile/<API key>.iff", "object/mobile/<API key>.iff", "object/mobile/<API key>.iff", "object/mobile/<API key>.iff"}, lootGroups = { { groups = { {group = "color_crystals", chance = 200000}, {group = "junk", chance = 6000000}, {group = "weapons_all", chance = 1250000}, {group = "armor_all", chance = 1250000}, {group = "<API key>", chance = 150000}, {group = "armor_attachments", chance = 150000}, {group = "wearables_all", chance = 1000000} } } }, weapons = {"<API key>"}, <API key> = "", reactionStf = "@npc_reaction/military", attacks = merge(brawlermaster,riflemannovice,marksmanmaster) } CreatureTemplates:addCreatureTemplate(<API key>, "<API key>")
--Copyright (C) 2007 <SWGEmu> --This File is part of Core3. --This program is free software; you can redistribute --it and/or modify it under the terms of the GNU Lesser --General Public License as published by the Free Software --Foundation; either version 2 of the License, --or (at your option) any later version. --This program is distributed in the hope that it will be useful, --but WITHOUT ANY WARRANTY; without even the implied warranty of --MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. --See the GNU Lesser General Public License for --more details. --You should have received a copy of the GNU Lesser General --Public License along with this program; if not, write to --the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA --Linking Engine3 statically or dynamically with other modules --is making a combined work based on Engine3. --Thus, the terms and conditions of the GNU Lesser General Public License --cover the whole combination. --In addition, as a special exception, the copyright holders of Engine3 --give you permission to combine Engine3 program with free software --programs or libraries that are released under the GNU LGPL and with --code included in the standard release of Core3 under the GNU LGPL --license (or modified versions of such code, with unchanged license). --You may copy and distribute such a system following the terms of the --GNU LGPL for Engine3 and the licenses of the other code concerned, --provided that you include the source code of that other code when --and as the GNU LGPL requires distribution of source code. --Note that people who make modified versions of Engine3 are not obligated --to grant this special exception for their modified versions; --it is their choice whether to do so. The GNU Lesser General Public License --gives permission to release a modified version without this exception; --this exception also makes it possible to release a modified version --which carries forward this exception. --true = 1, false = 0 <API key> = { name = "volleyfireattack", damageMultiplier = 1, speedMultiplier = 1, combatSpam = "volley", animation = "", <API key> = 0, <API key> = 0, mindCostMultiplier = 0, range = -1 } AddCommand(<API key>)
package msi.gama.rap.oauth; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; public class ResourceLoaderUtil { private static final ClassLoader CLASSLOADER = ResourceLoaderUtil.class.getClassLoader(); public static String readTextContent( String resource ) { try { return <API key>( resource ); } catch( IOException e ) { throw new <API key>( "Failed to read: " + resource ); } } private static String <API key>( String resource ) throws IOException { InputStream stream = CLASSLOADER.getResourceAsStream( resource ); if( stream == null ) { throw new <API key>( "Not found: " + resource ); } try { BufferedReader reader = new BufferedReader( new InputStreamReader( stream, "UTF-8" ) ); return readLines( reader ); } finally { stream.close(); } } private static String readLines( BufferedReader reader ) throws IOException { StringBuilder builder = new StringBuilder(); String line = reader.readLine(); while( line != null ) { builder.append( line ); builder.append( '\n' ); line = reader.readLine(); } return builder.toString(); } }
'use strict' import fetch from 'isomorphic-fetch' import get from 'lodash/get' import omit from 'lodash/omit' import qs from 'qs' import twreporterRedux from '@twreporter/redux' import { InternalServerError } from '../custom-error' import { <API key>, <API key>, <API key>, RETURN_DELAY_TIME } from '../constants/authors-list' import { author as authorSchema } from '../schemas/article-schema' import { schema, normalize } from 'normalizr' import { camelizeKeys } from 'humps' import * as CONSTANTS from '../constants/index' const formAPIURL = twreporterRedux.utils.formAPIURL const _ = { get, omit } export function <API key>(keywords = '') { return { type: (keywords === '') ? CONSTANTS.<API key> : CONSTANTS.<API key>, keywords: keywords } } export function failToSearchAuthors(keywords = '', error) { return { type: (keywords === '') ? CONSTANTS.<API key> : CONSTANTS.<API key>, error, failedAt: Date.now() } } export function <API key>(keywords, response) { return { type: (keywords === '') ? CONSTANTS.<API key> : CONSTANTS.<API key>, keywords, response, // {object} contains entities{object}, result{array}, currentPage{number}, totalPages{number} receivedAt: Date.now() } } export function searchAuthors({ keywords, targetPage, returnDelay }) { return (dispatch, getState) => { // eslint-disable-line no-unused-vars const searchParas = { keywords, filters: 'articlesCount>0', hitsPerPage: (keywords === '') ? <API key> : <API key>, page: targetPage } // Trans searchParas object to url parameters: let urlParasString = qs.stringify(searchParas) let url = formAPIURL(`search/authors?${urlParasString}`, false) dispatch(<API key>(keywords)) // Call our API server to fetch the data return fetch(url) .then((response) => { if (response.status >= 400) { // console.log(response) throw new InternalServerError('Bad response from API, response:' + JSON.stringify(response)) } return response.json() }) .then((responseObject) => { const items = _.get(responseObject, 'hits', {}) // responseObject.hit const camelizedJson = camelizeKeys(items) const responseItems = normalize(camelizedJson, new schema.Array(authorSchema)) const currentPage = _.get(responseObject, 'page', <API key> - 1) const totalPages = _.get(responseObject, 'nbPages', 0) const response = { responseItems, currentPage, totalPages } // delay for displaying loading spinner function delayDispatch() { return new Promise((resolve, reject)=> { // eslint-disable-line no-unused-vars setTimeout(() => { resolve() }, returnDelay) }) } if (returnDelay > 0) { return delayDispatch().then(()=>{ return dispatch(<API key>(keywords, response)) }) } return dispatch(<API key>(keywords, response)) }, (error) => { return dispatch(failToSearchAuthors(keywords, error)) }) } } /* Algolia set hitsPerPage limit up to 1000 items per search. So if number of authors grows over 1000, it will need to check hasMore as case lsat all authors. */ export function <API key>(currentKeywords = '') { if (currentKeywords === '') { return (dispatch, getState) => { const currentState = getState() const authorsList = _.get(currentState, 'authorsList', {}) const { isFetching, currentPage, hasMore } = authorsList if (currentPage < <API key>) { // Situation 1/3: If no data exists => fetch first page immediately return dispatch(searchAuthors({ keywords: '', targetPage: <API key>, returnDelay: 0 })) } // If current page >= <API key>: if (!isFetching && hasMore) { // Situation 2/3: If already have data AND not fetching AND has more => delay && next page return dispatch(searchAuthors({ keywords: '', targetPage: currentPage + 1, returnDelay: RETURN_DELAY_TIME })) } return Promise.resolve('Promise Resolved') // Situation 3/3: If already have all data (not has more) OR is fetching => do nothing } } return (dispatch, getState) => { const currentState = getState() const authorsList = _.get(currentState, 'searchedAuthorsList', {}) const previousKeywords = _.get(authorsList, 'keywords') if ( currentKeywords !== previousKeywords) { // Situation 1/2:If keywords are new => search return dispatch(searchAuthors({ keywords: currentKeywords, targetPage: <API key>, returnDelay: 0 })) } return Promise.resolve('Promise Resolved') // Situation 2/2:If keywords are the same => do nothing } }
package resources; import static org.junit.Assert.assertTrue; import java.util.Iterator; import org.junit.Test; public class <API key> { /** * Characters are compared by numerical value and they * should therefore be stored in such order within the list. */ @Test public void testSorting() { SortedLinkedList<Character> list = new SortedLinkedList<>(); final char testchar1 = 'a'; final char testchar2 = 'b'; final char testchar3 = 'c'; Iterator<Character> it; list.add(testchar2); list.add(testchar3); list.add(testchar1); it = list.listIterator(); assertTrue(it.next().equals(testchar1)); assertTrue(it.next().equals(testchar2)); assertTrue(it.next().equals(testchar3)); } }
#pragma once #include <vector> #include <string> #include <unordered_map> #include "scene/Asset.hpp" #include "scene/Scene.hpp" #include "scene/Parameter.hpp" #include "scene/Technique.hpp" #include "scene/Pass.hpp" #include <scene/SeqPos.hpp> namespace Scene { class Effect : public <API key> { friend class Library<Effect>; friend class Scene::Collada::Importer; public: Effect( DataBase& db, const std::string& id ); ~Effect(); /** Returns the COLLADA-related id. */ const std::string& id() const { return m_id; } /** Returns an unique id that is suitable for use as a hash-key. */ const std::string& key() const; const Profile* profile( ProfileType type ) const; Profile* profile( ProfileType type ); Profile* createProfile( ProfileType ); const Parameter* parameter( const size_t index ) const; const Parameter* parameter( const std::string& sid ) const; const size_t parameters() const { return m_parameters.size(); } void addParameter( const Parameter& p ); const Asset& asset() const { return m_asset; } void setAsset( const Asset& asset ) { m_asset = asset; } protected: DataBase& m_db; /** The unique id of the effect, required. */ const std::string m_id; Asset m_asset; std::string m_name; std::vector<Parameter*> m_parameters; Profile* m_profile_common; Profile* m_profile_glsl; Profile* m_profile_gles; Profile* m_profile_gles2; Effect( Library<Effect>* library_effects, const std::string& id ); }; } // of namespace Scene
// This file is part of the Kaltura Collaborative Media Suite which allows users // to do with audio, video, and animation what Wiki platforms allow them to do with // text. // This program is free software: you can redistribute it and/or modify // published by the Free Software Foundation, either version 3 of the // This program is distributed in the hope that it will be useful, // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // @ignore package com.kaltura.client.types; import com.google.gson.JsonObject; import com.kaltura.client.Params; import com.kaltura.client.utils.request.MultiRequestBuilder; /** * This class was generated using generate.php * against an XML schema provided by Kaltura. * * MANUAL CHANGES TO THIS CLASS WILL BE OVERWRITTEN. */ @SuppressWarnings("serial") @MultiRequestBuilder.Tokenizer(<API key>.Tokenizer.class) public abstract class <API key> extends <API key> { public interface Tokenizer extends <API key>.Tokenizer { } public <API key>() { super(); } public <API key>(JsonObject jsonObject) throws APIException { super(jsonObject); } public Params toParams() { Params kparams = super.toParams(); kparams.add("objectType", "<API key>"); return kparams; } }
<?php error_reporting(E_ALL ^ ( E_STRICT | E_DEPRECATED | E_NOTICE ) ); putenv('DEBUG=true'); ini_set('display_errors',true); set_time_limit(100); ini_set('zlib.output_compression','On'); ini_set('zlib.<API key>',9); // routing config for built in web server. we only use this for travis temporarily if (function_exists('php_sapi_name') && php_sapi_name() == 'cli-server') { $path = pathinfo($_SERVER['SCRIPT_FILENAME']); $file = substr($_SERVER['SCRIPT_NAME'],1); $allowed = ['scss','php']; if (file_exists($file) && !in_array($path['extension'], $allowed)) { $info = @trim(explode(':',exec('file --mime-type '.$file))[1]); header('Content-Type: '.$info); readfile($_SERVER['SCRIPT_FILENAME']); exit; } else { $_SERVER['SCRIPT_NAME'] = '/index.php'; } } $file = getcwd() . $_SERVER['DOCUMENT_URI']; if (file_exists($file)) { $path = pathinfo($file); $allowed = ['gif','png', 'jpg', 'jpeg', 'mp3', 'ico', 'svg', 'wav', 'js', 'css', 'eot', 'ttf', 'woff']; if (in_array($path['extension'], $allowed)) { header("Content-Type:" . mime_content_type($file)); readfile($file); exit; } } if (isset($_REQUEST['__url']) && $_REQUEST['__url'] == 'index.php') { $_REQUEST['__url'] = ''; } // no reason to pass __url if (!$_REQUEST['__url']) { $request = explode('?', $_SERVER['REQUEST_URI'], 2)[0]; $dir = str_replace('\\', '/', dirname($_SERVER['SCRIPT_NAME'])); $base = substr($dir, -1) == '/' ? $dir : $dir.'/'; $url = preg_replace('/^'.str_replace('/','\\/',''.$dir).'/','',$request); $url = substr($url, 0, 1) == '/' ? $url : '/'.$url; $_REQUEST['__url'] = substr($url, 1); } if (isset($_GET['__host'])) { setcookie('__host', $_GET['__host'], time()+60*60*24, '/'); $_COOKIE['__host'] = $_GET['__host']; } if ($_COOKIE['__host']) { $_SERVER['HTTP_HOST'] = $_SERVER['SERVER_NAME'] = $_REQUEST['__host']; } if (preg_match('/^www\..*$/',$_SERVER['HTTP_HOST'])) { header('Location: http: exit; } if ($_ENV['DEBUG']) { error_log('>> PAGE START >> '.$_SERVER['REQUEST_URI']); } require_once '../include/crunchbutton.php'; if ($_ENV['DEBUG']) { error_log('>> DISPLAYING PAGE...'); } $page = ltrim($_SERVER['DOCUMENT_URI'], '/'); Cana::app()->buildPages($page); Cana::app()->displayPage($page); if ($_ENV['DEBUG']) { <API key>(function() { error_log('<< PAGE FINISHED << '.$_SERVER['REQUEST_URI']); }); } exit;
import os import random import string from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.support.ui import WebDriverWait TEST_APP_URL = os.getenv('TEST_APP_URL') TEST_CLIENT_URL = os.getenv('TEST_CLIENT_URL') E2E_ARGS = os.getenv('E2E_ARGS') TEST_URL = TEST_CLIENT_URL if E2E_ARGS == 'client' else TEST_APP_URL def random_string(length=8): return ''.join(random.choice(string.ascii_letters) for x in range(length)) def register(selenium, user): selenium.get(f'{TEST_URL}/register') selenium.implicitly_wait(1) username = selenium.find_element_by_id('username') username.send_keys(user.get('username')) email = selenium.find_element_by_id('email') email.send_keys(user.get('email')) password = selenium.find_element_by_id('password') password.send_keys(user.get('password')) password_conf = selenium.find_element_by_id('confirm-password') password_conf.send_keys(user.get('password_conf')) submit_button = selenium.<API key>('button') submit_button.click() def login(selenium, user): selenium.get(f'{TEST_URL}/login') selenium.implicitly_wait(1) email = selenium.find_element_by_id('email') email.send_keys(user.get('email')) password = selenium.find_element_by_id('password') password.send_keys(user.get('password')) submit_button = selenium.<API key>('button') submit_button.click() def register_valid_user(selenium): user_name = random_string() user = { 'username': user_name, 'email': f'{user_name}@example.com', 'password': 'p@ssw0rd', 'password_conf': 'p@ssw0rd', } register(selenium, user) WebDriverWait(selenium, 15).until(EC.url_changes(f"{TEST_URL}/register")) return user def <API key>(selenium): user_name = random_string() user = { 'username': user_name, 'email': f'{user_name}@example.com', 'password': 'p@ssw0rd', 'password_conf': 'p@ssw0rd', } register(selenium, user) WebDriverWait(selenium, 15).until(EC.url_changes(f"{TEST_URL}/register")) user_menu = selenium.<API key>('nav-items-user-menu') logout_link = user_menu.<API key>('nav-item')[2] logout_link.click() selenium.implicitly_wait(1) return user def login_valid_user(selenium, user): login(selenium, user) WebDriverWait(selenium, 10).until(EC.url_changes(f"{TEST_URL}/login")) return user def assert_navbar(selenium, user): nav = selenium.find_element_by_id('nav').text assert 'Register' not in nav assert 'Login' not in nav assert 'Dashboard' in nav assert 'Workouts' in nav assert 'Statistics' in nav assert 'Add a workout' in nav assert user['username'] in nav assert 'Logout' in nav
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Rgaa 4.0 Test.4.6.2 Failed 01</title> </head> <body class="Failed"> <div> <h1>Rgaa 4.0 Test.4.6.2 Failed 01</h1> <!-- START [test-detail] --> <div class="test-detail" lang="fr"> <p>Pour chaque <a href="https://www.numerique.gouv.fr/publications/rgaa-accessibilite/methode/glossaire/ </div> <!-- END [test-detail] --> <!-- START [testcase] --> <div class="testcase"> </div> <!-- END [testcase] --> <!-- START [test-explanation] --> <div class="test-explanation"> Failed. </div> <!-- END [test-explanation] --> </div> </body> </html>
package com.personalgarage.service.common.application; import com.personalgarage.service.common.exceptions.<API key>; import com.personalgarage.service.common.interfaces.errors.ApplicationErrors; import org.springframework.http.HttpHeaders; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.ControllerAdvice; import org.springframework.web.bind.annotation.ExceptionHandler; import org.springframework.web.context.request.WebRequest; import org.springframework.web.servlet.mvc.method.annotation.<API key>; @ControllerAdvice public class <API key> extends <API key> { @ExceptionHandler(value = {<API key>.class}) public ResponseEntity<Object> <API key>(RuntimeException ex, WebRequest request) { return <API key>(ex, ApplicationErrors.INTERNAL_ERROR, new HttpHeaders(), HttpStatus.BAD_REQUEST, request); } @ExceptionHandler(value = {<API key>.class}) public ResponseEntity<Object> <API key>(RuntimeException ex, WebRequest request) { return <API key>(ex, ApplicationErrors.INCORRECT_ARGUMENTS, new HttpHeaders(), HttpStatus.BAD_REQUEST, request); } @ExceptionHandler(value = {<API key>.class}) public ResponseEntity<Object> <API key>(RuntimeException ex, WebRequest request) { <API key> <API key> = (<API key>) ex; return <API key>(ex, <API key>.getExceptionData(), new HttpHeaders(), HttpStatus.BAD_REQUEST, request); } }
package org.opencps.processmgt.model.impl; import com.liferay.portal.kernel.util.StringBundler; import com.liferay.portal.kernel.util.StringPool; import com.liferay.portal.model.CacheModel; import org.opencps.processmgt.model.ProcessWorkflow; import java.io.Externalizable; import java.io.IOException; import java.io.ObjectInput; import java.io.ObjectOutput; import java.util.Date; /** * The cache model class for representing ProcessWorkflow in entity cache. * * @author khoavd * @see ProcessWorkflow * @generated */ public class <API key> implements CacheModel<ProcessWorkflow>, Externalizable { @Override public String toString() { StringBundler sb = new StringBundler(47); sb.append("{processWorkflowId="); sb.append(processWorkflowId); sb.append(", companyId="); sb.append(companyId); sb.append(", groupId="); sb.append(groupId); sb.append(", userId="); sb.append(userId); sb.append(", createDate="); sb.append(createDate); sb.append(", modifiedDate="); sb.append(modifiedDate); sb.append(", serviceProcessId="); sb.append(serviceProcessId); sb.append(", preProcessStepId="); sb.append(preProcessStepId); sb.append(", postProcessStepId="); sb.append(postProcessStepId); sb.append(", autoEvent="); sb.append(autoEvent); sb.append(", actionName="); sb.append(actionName); sb.append(", assignUser="); sb.append(assignUser); sb.append(", actionUserId="); sb.append(actionUserId); sb.append(", requestPayment="); sb.append(requestPayment); sb.append(", paymentFee="); sb.append(paymentFee); sb.append(", generateReceptionNo="); sb.append(generateReceptionNo); sb.append(", receptionNoPattern="); sb.append(receptionNoPattern); sb.append(", generateDeadline="); sb.append(generateDeadline); sb.append(", deadlinePattern="); sb.append(deadlinePattern); sb.append(", isFinishStep="); sb.append(isFinishStep); sb.append(", preCondition="); sb.append(preCondition); sb.append(", isMultipled="); sb.append(isMultipled); sb.append(", actionCode="); sb.append(actionCode); sb.append("}"); return sb.toString(); } @Override public ProcessWorkflow toEntityModel() { ProcessWorkflowImpl processWorkflowImpl = new ProcessWorkflowImpl(); processWorkflowImpl.<API key>(processWorkflowId); processWorkflowImpl.setCompanyId(companyId); processWorkflowImpl.setGroupId(groupId); processWorkflowImpl.setUserId(userId); if (createDate == Long.MIN_VALUE) { processWorkflowImpl.setCreateDate(null); } else { processWorkflowImpl.setCreateDate(new Date(createDate)); } if (modifiedDate == Long.MIN_VALUE) { processWorkflowImpl.setModifiedDate(null); } else { processWorkflowImpl.setModifiedDate(new Date(modifiedDate)); } processWorkflowImpl.setServiceProcessId(serviceProcessId); processWorkflowImpl.setPreProcessStepId(preProcessStepId); processWorkflowImpl.<API key>(postProcessStepId); if (autoEvent == null) { processWorkflowImpl.setAutoEvent(StringPool.BLANK); } else { processWorkflowImpl.setAutoEvent(autoEvent); } if (actionName == null) { processWorkflowImpl.setActionName(StringPool.BLANK); } else { processWorkflowImpl.setActionName(actionName); } processWorkflowImpl.setAssignUser(assignUser); processWorkflowImpl.setActionUserId(actionUserId); processWorkflowImpl.setRequestPayment(requestPayment); if (paymentFee == null) { processWorkflowImpl.setPaymentFee(StringPool.BLANK); } else { processWorkflowImpl.setPaymentFee(paymentFee); } processWorkflowImpl.<API key>(generateReceptionNo); if (receptionNoPattern == null) { processWorkflowImpl.<API key>(StringPool.BLANK); } else { processWorkflowImpl.<API key>(receptionNoPattern); } processWorkflowImpl.setGenerateDeadline(generateDeadline); if (deadlinePattern == null) { processWorkflowImpl.setDeadlinePattern(StringPool.BLANK); } else { processWorkflowImpl.setDeadlinePattern(deadlinePattern); } processWorkflowImpl.setIsFinishStep(isFinishStep); if (preCondition == null) { processWorkflowImpl.setPreCondition(StringPool.BLANK); } else { processWorkflowImpl.setPreCondition(preCondition); } processWorkflowImpl.setIsMultipled(isMultipled); if (actionCode == null) { processWorkflowImpl.setActionCode(StringPool.BLANK); } else { processWorkflowImpl.setActionCode(actionCode); } processWorkflowImpl.resetOriginalValues(); return processWorkflowImpl; } @Override public void readExternal(ObjectInput objectInput) throws IOException { processWorkflowId = objectInput.readLong(); companyId = objectInput.readLong(); groupId = objectInput.readLong(); userId = objectInput.readLong(); createDate = objectInput.readLong(); modifiedDate = objectInput.readLong(); serviceProcessId = objectInput.readLong(); preProcessStepId = objectInput.readLong(); postProcessStepId = objectInput.readLong(); autoEvent = objectInput.readUTF(); actionName = objectInput.readUTF(); assignUser = objectInput.readBoolean(); actionUserId = objectInput.readLong(); requestPayment = objectInput.readBoolean(); paymentFee = objectInput.readUTF(); generateReceptionNo = objectInput.readBoolean(); receptionNoPattern = objectInput.readUTF(); generateDeadline = objectInput.readBoolean(); deadlinePattern = objectInput.readUTF(); isFinishStep = objectInput.readBoolean(); preCondition = objectInput.readUTF(); isMultipled = objectInput.readBoolean(); actionCode = objectInput.readUTF(); } @Override public void writeExternal(ObjectOutput objectOutput) throws IOException { objectOutput.writeLong(processWorkflowId); objectOutput.writeLong(companyId); objectOutput.writeLong(groupId); objectOutput.writeLong(userId); objectOutput.writeLong(createDate); objectOutput.writeLong(modifiedDate); objectOutput.writeLong(serviceProcessId); objectOutput.writeLong(preProcessStepId); objectOutput.writeLong(postProcessStepId); if (autoEvent == null) { objectOutput.writeUTF(StringPool.BLANK); } else { objectOutput.writeUTF(autoEvent); } if (actionName == null) { objectOutput.writeUTF(StringPool.BLANK); } else { objectOutput.writeUTF(actionName); } objectOutput.writeBoolean(assignUser); objectOutput.writeLong(actionUserId); objectOutput.writeBoolean(requestPayment); if (paymentFee == null) { objectOutput.writeUTF(StringPool.BLANK); } else { objectOutput.writeUTF(paymentFee); } objectOutput.writeBoolean(generateReceptionNo); if (receptionNoPattern == null) { objectOutput.writeUTF(StringPool.BLANK); } else { objectOutput.writeUTF(receptionNoPattern); } objectOutput.writeBoolean(generateDeadline); if (deadlinePattern == null) { objectOutput.writeUTF(StringPool.BLANK); } else { objectOutput.writeUTF(deadlinePattern); } objectOutput.writeBoolean(isFinishStep); if (preCondition == null) { objectOutput.writeUTF(StringPool.BLANK); } else { objectOutput.writeUTF(preCondition); } objectOutput.writeBoolean(isMultipled); if (actionCode == null) { objectOutput.writeUTF(StringPool.BLANK); } else { objectOutput.writeUTF(actionCode); } } public long processWorkflowId; public long companyId; public long groupId; public long userId; public long createDate; public long modifiedDate; public long serviceProcessId; public long preProcessStepId; public long postProcessStepId; public String autoEvent; public String actionName; public boolean assignUser; public long actionUserId; public boolean requestPayment; public String paymentFee; public boolean generateReceptionNo; public String receptionNoPattern; public boolean generateDeadline; public String deadlinePattern; public boolean isFinishStep; public String preCondition; public boolean isMultipled; public String actionCode; }
<?php if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); // Opportunity is used to store customer information. class Opportunity extends SugarBean { var $field_name_map; // Stored fields var $id; var $lead_source; var $date_entered; var $date_modified; var $modified_user_id; var $assigned_user_id; var $created_by; var $created_by_name; var $modified_by_name; var $description; var $name; var $opportunity_type; var $amount; var $amount_usdollar; var $currency_id; var $date_closed; var $next_step; var $sales_stage; var $probability; var $campaign_id; // These are related var $account_name; var $account_id; var $contact_id; var $task_id; var $note_id; var $meeting_id; var $call_id; var $email_id; var $assigned_user_name; var $table_name = "opportunities"; var $rel_account_table = "<API key>"; var $rel_contact_table = "<API key>"; var $module_dir = "Opportunities"; var $importable = true; var $object_name = "Opportunity"; // This is used to retrieve related fields from form posts. var $<API key> = Array('assigned_user_name', 'assigned_user_id', 'account_name', 'account_id', 'contact_id', 'task_id', 'note_id', 'meeting_id', 'call_id', 'email_id' ); var $relationship_fields = Array('task_id'=>'tasks', 'note_id'=>'notes', 'account_id'=>'accounts', 'meeting_id'=>'meetings', 'call_id'=>'calls', 'email_id'=>'emails', 'project_id'=>'project', // Bug 38529 & 40938 'currency_id' => 'currencies', ); function Opportunity() { parent::SugarBean(); global $sugar_config; if(!$sugar_config['require_accounts']){ unset($this->required_fields['account_name']); } } var $new_schema = true; function get_summary_text() { return "$this->name"; } function create_list_query($order_by, $where, $show_deleted = 0) { $custom_join = $this->getCustomJoin(); $query = "SELECT "; $query .= " accounts.id as account_id, accounts.name as account_name, accounts.assigned_user_id account_id_owner, users.user_name as assigned_user_name "; $query .= $custom_join['select']; $query .= " ,opportunities.* FROM opportunities "; $query .= "LEFT JOIN users ON opportunities.assigned_user_id=users.id "; $query .= "LEFT JOIN $this->rel_account_table ON opportunities.id=$this->rel_account_table.opportunity_id LEFT JOIN accounts ON $this->rel_account_table.account_id=accounts.id "; $query .= $custom_join['join']; $where_auto = '1=1'; if($show_deleted == 0){ $where_auto = " ($this->rel_account_table.deleted is null OR $this->rel_account_table.deleted=0) AND (accounts.deleted is null OR accounts.deleted=0) AND opportunities.deleted=0"; }else if($show_deleted == 1){ $where_auto = " opportunities.deleted=1"; } if($where != "") $query .= "where ($where) AND ".$where_auto; else $query .= "where ".$where_auto; if($order_by != "") $query .= " ORDER BY $order_by"; else $query .= " ORDER BY opportunities.name"; return $query; } function create_export_query(&$order_by, &$where, $relate_link_join='') { $custom_join = $this->getCustomJoin(true, true, $where); $custom_join['join'] .= $relate_link_join; $query = "SELECT opportunities.*, accounts.name as account_name, users.user_name as assigned_user_name "; $query .= $custom_join['select']; $query .= " FROM opportunities "; $query .= "LEFT JOIN users ON opportunities.assigned_user_id=users.id"; $query .= " LEFT JOIN $this->rel_account_table ON opportunities.id=$this->rel_account_table.opportunity_id LEFT JOIN accounts ON $this->rel_account_table.account_id=accounts.id "; $query .= $custom_join['join']; $where_auto = " ($this->rel_account_table.deleted is null OR $this->rel_account_table.deleted=0) AND (accounts.deleted is null OR accounts.deleted=0) AND opportunities.deleted=0"; if($where != "") $query .= "where $where AND ".$where_auto; else $query .= "where ".$where_auto; if($order_by != "") $query .= " ORDER BY opportunities.$order_by"; else $query .= " ORDER BY opportunities.name"; return $query; } function <API key>() { if ( $this->force_load_details == true) { $this-><API key>(); } } function <API key>() { parent::<API key>(); if(!empty($this->currency_id)) { $currency = new Currency(); $currency->retrieve($this->currency_id); if($currency->id != $this->currency_id || $currency->deleted == 1){ $this->amount = $this->amount_usdollar; $this->currency_id = $currency->id; } } //get campaign name if(!empty($this->campaign_id)) { $camp = new Campaign(); $camp->retrieve($this->campaign_id); $this->campaign_name = $camp->name; } $this->account_name = ''; $this->account_id = ''; if(!empty($this->id)) { $ret_values=Opportunity::get_account_detail($this->id); if (!empty($ret_values)) { $this->account_name=$ret_values['name']; $this->account_id=$ret_values['id']; $this->account_id_owner =$ret_values['assigned_user_id']; } } } function get_contacts() { $this->load_relationship('contacts'); $query_array=$this->contacts->getQuery(true); //update the select clause in the retruned query. $query_array['select']="SELECT contacts.id, contacts.first_name, contacts.last_name, contacts.title, contacts.email1, contacts.phone_work, <API key>.contact_role as opportunity_role, <API key>.id as opportunity_rel_id "; $query=''; foreach ($query_array as $qstring) { $query.=' '.$qstring; } $temp = Array('id', 'first_name', 'last_name', 'title', 'email1', 'phone_work', 'opportunity_role', 'opportunity_rel_id'); return $this->build_related_list2($query, new Contact(), $temp); } function update_currency_id($fromid, $toid){ $idequals = ''; $currency = new Currency(); $currency->retrieve($toid); foreach($fromid as $f){ if(!empty($idequals)){ $idequals .=' or '; } $idequals .= "currency_id='$f'"; } if(!empty($idequals)){ $query = "select amount, id from opportunities where (". $idequals. ") and deleted=0 and opportunities.sales_stage <> 'Closed Won' AND opportunities.sales_stage <> 'Closed Lost';"; $result = $this->db->query($query); while($row = $this->db->fetchByAssoc($result)){ $query = "update opportunities set currency_id='".$currency->id."', amount_usdollar='".$currency->convertToDollar($row['amount'])."' where id='".$row['id']."';"; $this->db->query($query); } } } function get_list_view_data(){ global $locale, $current_language, $current_user, $mod_strings, $app_list_strings, $sugar_config; $app_strings = <API key>($current_language); $params = array(); $temp_array = $this->get_list_view_array(); $temp_array['SALES_STAGE'] = empty($temp_array['SALES_STAGE']) ? '' : $temp_array['SALES_STAGE']; $temp_array["ENCODED_NAME"]=$this->name; return $temp_array; } function get_currency_symbol(){ if(isset($this->currency_id)){ $cur_qry = "select * from currencies where id ='".$this->currency_id."'"; $cur_res = $this->db->query($cur_qry); if(!empty($cur_res)){ $cur_row = $this->db->fetchByAssoc($cur_res); if(isset($cur_row['symbol'])){ return $cur_row['symbol']; } } } return ''; } /** builds a generic search based on the query string using or do not include any $this-> because this is called on without having the class instantiated */ function <API key> ($the_query_string) { $where_clauses = Array(); $the_query_string = $GLOBALS['db']->quote($the_query_string); array_push($where_clauses, "opportunities.name like '$the_query_string%'"); array_push($where_clauses, "accounts.name like '$the_query_string%'"); $the_where = ""; foreach($where_clauses as $clause) { if($the_where != "") $the_where .= " or "; $the_where .= $clause; } return $the_where; } function save($check_notify = FALSE) { // Bug 32581 - Make sure the currency_id is set to something global $current_user, $app_list_strings; if ( empty($this->currency_id) ) $this->currency_id = $current_user->getPreference('currency'); if ( empty($this->currency_id) ) $this->currency_id = -99; //if probablity isn't set, set it based on the sales stage if (!isset($this->probability) && !empty($this->sales_stage)) { $prob_arr = $app_list_strings['<API key>']; if (isset($prob_arr[$this->sales_stage])) $this->probability = $prob_arr[$this->sales_stage]; } require_once('modules/Opportunities/SaveOverload.php'); perform_save($this); return parent::save($check_notify); } function <API key>($is_update) { //if account_id was replaced unlink the previous account_id. //this <API key> is populated by sugarbean during the retrieve call. if (!empty($this->account_id) and !empty($this-><API key>['account_id']) and (trim($this->account_id) != trim($this-><API key>['account_id']))) { //unlink the old record. $this->load_relationship('accounts'); $this->accounts->delete($this->id,$this-><API key>['account_id']); } // Bug 38529 & 40938 - exclude currency_id parent::<API key>($is_update, array('currency_id')); if (!empty($this->contact_id)) { $this-><API key>($this->contact_id); } } function <API key>($contact_id) { global $app_list_strings; $default = $app_list_strings['<API key>']; $this->load_relationship('contacts'); $this->contacts->add($contact_id,array('contact_role'=>$default)); } function <API key>($xtpl, $oppty) { global $app_list_strings; $xtpl->assign("OPPORTUNITY_NAME", $oppty->name); $xtpl->assign("OPPORTUNITY_AMOUNT", $oppty->amount); $xtpl->assign("<API key>", $oppty->date_closed); $xtpl->assign("OPPORTUNITY_STAGE", (isset($oppty->sales_stage)?$app_list_strings['sales_stage_dom'][$oppty->sales_stage]:"")); $xtpl->assign("<API key>", $oppty->description); return $xtpl; } function bean_implements($interface){ switch($interface){ case 'ACL':return true; } return false; } function listviewACLHelper(){ $array_assign = parent::listviewACLHelper(); $is_owner = false; if(!empty($this->account_id)){ if(!empty($this->account_id_owner)){ global $current_user; $is_owner = $current_user->id == $this->account_id_owner; } } if(!ACLController::moduleSupportsACL('Accounts') || ACLController::checkAccess('Accounts', 'view', $is_owner)){ $array_assign['ACCOUNT'] = 'a'; }else{ $array_assign['ACCOUNT'] = 'span'; } return $array_assign; } /** * Static helper function for getting releated account info. */ function get_account_detail($opp_id) { $ret_array = array(); $db = DBManagerFactory::getInstance(); $query = "SELECT acc.id, acc.name, acc.assigned_user_id " . "FROM accounts acc, <API key> a_o " . "WHERE acc.id=a_o.account_id" . " AND a_o.opportunity_id='$opp_id'" . " AND a_o.deleted=0" . " AND acc.deleted=0"; $result = $db->query($query, true,"Error filling in opportunity account details: "); $row = $db->fetchByAssoc($result); if($row != null) { $ret_array['name'] = $row['name']; $ret_array['id'] = $row['id']; $ret_array['assigned_user_id'] = $row['assigned_user_id']; } return $ret_array; } } function getCurrencyType(){ } ?>
App.WhyExhibitView = Ember.View.extend({ templateName: 'why-exhibit', classNames: ['tile content-tile why-exhibit rabdforange innerTile mix general_info all tab-tile tile-3-tall tile-n-wide'], attributeBindings: ['width:data-width', 'height:data-height'], width: 'n', height: 2, didInsertElement: function() { //foundation orbit this.$().foundation('orbit', { timer_speed: 999999999, animation_speed: 250, navigation_arrows: false, slide_number: false, bullets: false, timer:false, }); //sidebar $('.sidebarHolder').animate({height: (this.$().height() + 10)}, 600); //tabs var $tabs = this.$().find('.tab'); var $prevTab; $tabs.click(function() { $tabs.not(this).removeClass('currentTab'); $(this).addClass('currentTab'); $prevTab = $(this).prev('.tab'); $tabs.not($prevTab).removeClass('prevTab'); $prevTab.addClass("prevTab"); }); } });
DELETE FROM `weenie` WHERE `class_Id` = 14006; INSERT INTO `weenie` (`class_Id`, `class_Name`, `type`, `last_Modified`) VALUES (14006, 'housecottage2314', 53, '2019-02-10 00:00:00') /* House */; INSERT INTO `<API key>` (`object_Id`, `type`, `value`) VALUES (14006, 1, 128) /* ItemType - Misc */ , (14006, 5, 10) /* EncumbranceVal */ , (14006, 16, 1) /* ItemUseable - No */ , (14006, 19, 0) /* Value */ , (14006, 93, 52) /* PhysicsState - Ethereal, IgnoreCollisions, NoDraw */ , (14006, 155, 1) /* HouseType - Cottage */ , (14006, 8041, 101) /* <API key> - Resting */; INSERT INTO `<API key>` (`object_Id`, `type`, `value`) VALUES (14006, 1, True ) /* Stuck */ , (14006, 24, True ) /* UiHidden */; INSERT INTO `<API key>` (`object_Id`, `type`, `value`) VALUES (14006, 39, 0.1) /* DefaultScale */; INSERT INTO `<API key>` (`object_Id`, `type`, `value`) VALUES (14006, 1, 'Cottage') /* Name */; INSERT INTO `<API key>` (`object_Id`, `type`, `value`) VALUES (14006, 1, 33557058) /* Setup */ , (14006, 8, 100671873) /* Icon */ , (14006, 30, 152) /* PhysicsScript - <API key> */ , (14006, 8001, 203423760) /* <API key> - Usable, Burden, HouseRestrictions, PScript */ , (14006, 8003, 148) /* <API key> - Stuck, Attackable, UiHidden */ , (14006, 8005, 163969) /* <API key> - CSetup, ObjScale, Position, AnimationFrame */; INSERT INTO `<API key>` (`object_Id`, `position_Type`, `obj_Cell_Id`, `origin_X`, `origin_Y`, `origin_Z`, `angles_W`, `angles_X`, `angles_Y`, `angles_Z`) VALUES (14006, 8040, 1558642960, 33.7556, 129.236, 27.9995, 0.7055992, 0, 0, 0.7086112) /* <API key> */ /* @teleloc 0x5CE70110 [33.755600 129.236000 27.999500] 0.705599 0.000000 0.000000 0.708611 */; INSERT INTO `<API key>` (`object_Id`, `type`, `value`) VALUES (14006, 8000, 1976463778) /* <API key> */;
import 'font-awesome/scss/font-awesome.scss' import '<API key>/dist/<API key>.scss' import 'vue2-animate/dist/vue2-animate.min.css' import 'buefy/lib/buefy.css' import 'bulmaswatch/lumen/bulmaswatch.min.css' import Buefy from 'buefy' import Vue from 'vue' import VueCookie from 'vue-cookie' import Raven from 'raven-js' import RavenVue from 'raven-js/plugins/vue' import VueAnalytics from 'vue-analytics' import App from '@/App.vue' import store from '@/store.js' import router from '@/router' if (process.env.NODE_ENV === 'production') { Vue.config.debug = false Vue.config.productionTip = false Vue.config.silent = true Vue.use(VueAnalytics, { id: 'UA-107368667-1', router: router, ready () { console.log('Analytics loaded') }, }) Raven .config('https://<API key>@sentry.io/271420') .addPlugin(RavenVue, Vue) .install() } else { Vue.config.debug = true Vue.config.productionTip = true Vue.config.silent = false } // import { sync } from 'vuex-router-sync' // sync(store, router) Vue.use(Buefy, { defaultIconPack: 'fa', // mdi: broken }) Vue.use(VueCookie) /* eslint-disable no-new */ new Vue({ el: '#app', router: router, store, template: '<App />', components: { App, }, })
'use strict'; describe('myApp.joystickDpadSwitch module', function() { var $compile, $rootScope, scope, $controller, element,controller; beforeEach(angular.mock.module('templates')); beforeEach(module('myApp.joystickDpadSwitch')); beforeEach(module('myApp.joystickService')); beforeEach(module('myApp.roverService')); /** * General setup */ beforeEach(inject(function(_$compile_, _$rootScope_, _$controller_) { $compile = _$compile_; $rootScope = _$rootScope_; $controller = _$controller_; element = $compile('<<API key>></<API key>>')($rootScope); $rootScope.$digest(); controller = element.controller("<API key>"); scope = element.isolateScope() || element.scope(); })); it('should exposes Joystick state', function() { expect(scope).toBeDefined(); console.log(scope); expect(scope.joystickState).toBeDefined(); }); });
# -*- coding: utf-8 -*- # Generated by Django 1.11.4 on 2018-03-26 15:34 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('jurisdiction', '<API key>'), ] operations = [ migrations.RemoveField( model_name='jurisdiction', name='full_name', ), ]
package state_test import ( jc "github.com/juju/testing/checkers" gc "gopkg.in/check.v1" "gopkg.in/mgo.v2" "gopkg.in/mgo.v2/bson" "github.com/juju/juju/state" "github.com/juju/juju/testing/factory" ) type CollectionsSuite struct { ConnSuite } var _ = gc.Suite(&CollectionsSuite{}) type collectionsTestCase struct { label string test func() (int, error) expectedCount int expectedPanic string } func (s *CollectionsSuite) <API key>(c *gc.C) { // The users collection does not require filtering by env UUID. coll, closer := state.GetCollection(s.State, state.UsersC) defer closer() c.Check(coll.Name(), gc.Equals, state.UsersC) s.factory.MakeUser(c, &factory.UserParams{Name: "foo", DisplayName: "Ms Foo"}) s.factory.MakeUser(c, &factory.UserParams{Name: "bar"}) collSnapshot := <API key>(c, coll.Underlying()) for i, t := range []collectionsTestCase{ { label: "Count", test: func() (int, error) { return coll.Count() }, expectedCount: 3, }, { label: "FindId", test: func() (int, error) { return coll.FindId("foo").Count() }, expectedCount: 1, }, { label: "Find with one result", test: func() (int, error) { return coll.Find(bson.D{{"displayname", "Ms Foo"}}).Count() }, expectedCount: 1, }, { label: "Find with nil", test: func() (int, error) { return coll.Find(nil).Count() }, expectedCount: 3, }, { label: "Insert", test: func() (int, error) { err := coll.Insert(bson.D{{"_id", "more"}}) c.Assert(err, jc.ErrorIsNil) return coll.Count() }, expectedCount: 4, }, { label: "RemoveId", test: func() (int, error) { err := coll.RemoveId("bar") c.Assert(err, jc.ErrorIsNil) return coll.Count() }, expectedCount: 2, }, { label: "Remove", test: func() (int, error) { err := coll.Remove(bson.D{{"displayname", "Ms Foo"}}) c.Assert(err, jc.ErrorIsNil) return coll.Count() }, expectedCount: 2, }, { label: "RemoveAll", test: func() (int, error) { _, err := coll.RemoveAll(bson.D{{"createdby", s.owner.Name()}}) c.Assert(err, jc.ErrorIsNil) return coll.Count() }, expectedCount: 0, }, } { c.Logf("test %d: %s", i, t.label) collSnapshot.restore(c) count, err := t.test() c.Assert(err, jc.ErrorIsNil) c.Check(count, gc.Equals, t.expectedCount) } } func (s *CollectionsSuite) <API key>(c *gc.C) { // The machines collection requires filtering by env UUID. Set up // 2 environments with machines in each. m0 := s.factory.MakeMachine(c, nil) s.factory.MakeMachine(c, nil) st1 := s.factory.MakeEnvironment(c, nil) defer st1.Close() f1 := factory.NewFactory(st1) otherM0 := f1.MakeMachine(c, &factory.MachineParams{Series: "trusty"}) // Ensure that the first machine in each env have overlapping ids // (otherwise tests may not fail when they should) c.Assert(m0.Id(), gc.Equals, otherM0.Id()) // Also add a network interface to test collections with ObjectId ids _, err := s.State.AddNetwork(state.NetworkInfo{"net1", "net1", "0.1.2.3/24", 0}) c.Assert(err, jc.ErrorIsNil) _, err = m0.AddNetworkInterface(state.<API key>{ MACAddress: "91:de:f1:02:f6:f0", InterfaceName: "foo0", NetworkName: "net1", }) c.Assert(err, jc.ErrorIsNil) // Grab the document id of the just added network interface for use in tests. ifaceId := func() bson.ObjectId { var doc bson.M coll, closer := state.GetRawCollection(s.State, state.NetworkInterfacesC) defer closer() err = coll.Find(nil).One(&doc) c.Assert(err, jc.ErrorIsNil) return doc["_id"].(bson.ObjectId) }() machines0, closer := state.GetCollection(s.State, state.MachinesC) defer closer() machines1, closer := state.GetCollection(st1, state.MachinesC) defer closer() networkInterfaces, closer := state.GetCollection(s.State, state.NetworkInterfacesC) defer closer() machinesSnapshot := <API key>(c, machines0.Underlying()) <API key> := <API key>(c, networkInterfaces.Underlying()) c.Assert(machines0.Name(), gc.Equals, state.MachinesC) c.Assert(networkInterfaces.Name(), gc.Equals, state.NetworkInterfacesC) for i, t := range []collectionsTestCase{ { label: "Count filters by env", test: func() (int, error) { return machines0.Count() }, expectedCount: 2, }, { label: "Find filters by env", test: func() (int, error) { return machines0.Find(bson.D{{"series", m0.Series()}}).Count() }, expectedCount: 2, }, { label: "Find adds env UUID when _id is provided", test: func() (int, error) { return machines0.Find(bson.D{{"_id", m0.Id()}}).Count() }, expectedCount: 1, }, { label: "Find tolerates env UUID prefix already being present", test: func() (int, error) { return machines0.Find(bson.D{ {"_id", state.DocID(s.State, m0.Id())}, }).Count() }, expectedCount: 1, }, { label: "Find with no selector still filters by env", test: func() (int, error) { return machines0.Find(nil).Count() }, expectedCount: 2, }, { label: "Find leaves _id alone if used with operator", test: func() (int, error) { return machines0.Find(bson.D{ {"_id", bson.D{{"$regex", ":" + m0.Id() + "$"}}}, }).Count() }, expectedCount: 1, // not 2 because env-uuid filter is still added }, { label: "Find works with collections with ObjectId ids", test: func() (int, error) { return networkInterfaces.Find(bson.D{{"interfacename", "foo0"}}).Count() }, expectedCount: 1, }, { label: "Find works with ObjectId ids", test: func() (int, error) { return networkInterfaces.Find(bson.D{{"_id", ifaceId}}).Count() }, expectedCount: 1, }, { label: "Find panics if env-uuid is included", test: func() (int, error) { machines0.Find(bson.D{{"env-uuid", "whatever"}}) return 0, nil }, expectedPanic: "env-uuid is added automatically and should not be provided", }, { label: "Find panics if query type is unsupported", test: func() (int, error) { machines0.Find(bson.M{"foo": "bar"}) return 0, nil }, expectedPanic: "query must either be bson.D or nil", }, { label: "FindId adds env UUID prefix", test: func() (int, error) { return machines0.FindId(m0.Id()).Count() }, expectedCount: 1, }, { label: "FindId tolerates env UUID prefix already being there", test: func() (int, error) { return machines0.FindId(state.DocID(s.State, m0.Id())).Count() }, expectedCount: 1, }, { label: "FindId works with ObjectId ids", test: func() (int, error) { return networkInterfaces.FindId(ifaceId).Count() }, expectedCount: 1, }, { label: "FindId panics if id isn't a string", test: func() (int, error) { machines0.FindId(99) return 0, nil }, expectedPanic: "multi-environment collections only use string or ObjectId ids. got: 99", }, { label: "Insert works", test: func() (int, error) { err := machines0.Insert(bson.D{ {"_id", state.DocID(s.State, "99")}, {"machineid", 99}, {"env-uuid", s.State.EnvironUUID()}, }) c.Assert(err, jc.ErrorIsNil) return machines0.Count() }, expectedCount: 3, }, { label: "Remove adds env UUID prefix to _id", test: func() (int, error) { err := machines0.Remove(bson.D{{"_id", "0"}}) c.Assert(err, jc.ErrorIsNil) return s.machines.Count() }, expectedCount: 2, // Expect machine-1 in first env and machine-0 in second env }, { label: "Remove filters by env", test: func() (int, error) { // Attempt to remove the trusty machine in the second // env with the collection that's filtering for the // first env - nothing should get removed. err := machines0.Remove(bson.D{{"series", "trusty"}}) c.Assert(err, gc.ErrorMatches, "not found") return s.machines.Count() }, expectedCount: 3, // Expect all machines to still be there. }, { label: "Remove filters by env 2", test: func() (int, error) { err := machines0.Remove(bson.D{{"machineid", "0"}}) c.Assert(err, jc.ErrorIsNil) return s.machines.Count() }, expectedCount: 2, // Expect machine 1 in first env and machine-0 in second env }, { label: "RemoveId adds env UUID prefix", test: func() (int, error) { err := machines0.RemoveId(m0.Id()) c.Assert(err, jc.ErrorIsNil) return s.machines.Count() }, expectedCount: 2, // Expect machine-1 in first env and machine-0 in second env }, { label: "RemoveId tolerates env UUID prefix already being there", test: func() (int, error) { err := machines0.RemoveId(state.DocID(s.State, m0.Id())) c.Assert(err, jc.ErrorIsNil) return s.machines.Count() }, expectedCount: 2, // Expect machine-1 in first env and machine-0 in second env }, { label: "RemoveId panics if id isn't a string", test: func() (int, error) { machines0.RemoveId(99) return 0, nil }, expectedPanic: "multi-environment collections only use string or ObjectId ids. got: 99", }, { label: "RemoveAll filters by env", test: func() (int, error) { _, err := machines0.RemoveAll(bson.D{{"series", m0.Series()}}) c.Assert(err, jc.ErrorIsNil) return s.machines.Count() }, expectedCount: 1, // Expect machine-1 in second env }, { label: "RemoveAll adds env UUID when _id is provided", test: func() (int, error) { _, err := machines0.RemoveAll(bson.D{{"_id", m0.Id()}}) c.Assert(err, jc.ErrorIsNil) return s.machines.Count() }, expectedCount: 2, // Expect machine-1 in first env and machine-0 in second env }, { label: "RemoveAll tolerates env UUID prefix already being present", test: func() (int, error) { _, err := machines0.RemoveAll(bson.D{ {"_id", state.DocID(s.State, m0.Id())}, }) c.Assert(err, jc.ErrorIsNil) return s.machines.Count() }, expectedCount: 2, // Expect machine-1 in first env and machine-0 in second env }, { label: "RemoveAll with no selector still filters by env", test: func() (int, error) { _, err := machines0.RemoveAll(nil) c.Assert(err, jc.ErrorIsNil) return s.machines.Count() }, expectedCount: 1, // Expect machine-0 in second env }, { label: "RemoveAll panics if env-uuid is included", test: func() (int, error) { machines0.RemoveAll(bson.D{{"env-uuid", "whatever"}}) return 0, nil }, expectedPanic: "env-uuid is added automatically and should not be provided", }, { label: "RemoveAll panics if query type is unsupported", test: func() (int, error) { machines0.RemoveAll(bson.M{"foo": "bar"}) return 0, nil }, expectedPanic: "query must either be bson.D or nil", }, } { c.Logf("test %d: %s", i, t.label) machinesSnapshot.restore(c) <API key>.restore(c) if t.expectedPanic == "" { count, err := t.test() c.Assert(err, jc.ErrorIsNil) c.Check(count, gc.Equals, t.expectedCount) } else { c.Check(func() { t.test() }, gc.PanicMatches, t.expectedPanic) } // Check that other environment is untouched after each test count, err := machines1.Count() c.Assert(err, jc.ErrorIsNil) c.Check(count, gc.Equals, 1) } } type collectionSnapshot struct { coll *mgo.Collection origDocs []interface{} } func <API key>(c *gc.C, coll *mgo.Collection) *collectionSnapshot { ss := &collectionSnapshot{coll: coll} err := coll.Find(nil).All(&ss.origDocs) c.Assert(err, jc.ErrorIsNil) return ss } func (ss *collectionSnapshot) restore(c *gc.C) { _, err := ss.coll.RemoveAll(nil) c.Assert(err, jc.ErrorIsNil) err = ss.coll.Insert(ss.origDocs...) c.Assert(err, jc.ErrorIsNil) }
package tigase.io; import tigase.stats.StatisticsList; import java.io.EOFException; import java.io.IOException; import java.nio.ByteBuffer; import java.nio.channels.SocketChannel; import java.util.logging.Level; import java.util.logging.Logger; /** * Describe class TLSIO here. * * * Created: Sat May 14 07:43:30 2005 * * @author <a href="mailto:artur.hefczyc@tigase.org">Artur Hefczyc</a> * @version $Rev$ */ public class TLSIO implements IOInterface { /** Field description */ public static final String TLS_CAPS = "tls-caps"; /** * Variable <code>log</code> is a class logger. */ private static final Logger log = Logger.getLogger(TLSIO.class.getName()); private IOInterface io = null; /** * <code>tlsInput</code> buffer keeps data decoded from tlsWrapper. */ private ByteBuffer tlsInput = null; /** * <code>tlsWrapper</code> is a TLS wrapper for connections requiring TLS * protocol. */ private TLSWrapper tlsWrapper = null; // /** // * Creates a new <code>TLSIO</code> instance. // * // */ // public TLSIO(final SocketChannel sock) { // io = new SocketIO(sock); // tlsWrapper = new TLSWrapper("TLS"); // tlsInput = ByteBuffer.allocate(tlsWrapper.getAppBuffSize()); /** * Constructs ... * * * @param ioi * @param wrapper * * @throws IOException */ public TLSIO(final IOInterface ioi, final TLSWrapper wrapper) throws IOException { io = ioi; tlsWrapper = wrapper; tlsWrapper.setDebugId(toString()); tlsInput = ByteBuffer.allocate(tlsWrapper.getAppBuffSize()); if (log.isLoggable(Level.FINER)) { log.log(Level.FINER, "TLS Socket created: {0}", io.toString()); } if (tlsWrapper.isClientMode()) { if (log.isLoggable(Level.FINER)) { log.finer("TLS - client mode, starting handshaking now..."); } write(ByteBuffer.allocate(0)); } // end of if (tlsWrapper.isClientMode()) } /** * Method description * * * @return */ @Override public int bytesRead() { return io.bytesRead(); } /** * Method description * * * @param caps * * @return */ @Override public boolean checkCapabilities(String caps) { return caps.contains(TLS_CAPS) || io.checkCapabilities(caps); } /** * Method description * * * @return * * @throws IOException */ @Override public int getInputPacketSize() throws IOException { return tlsWrapper.getPacketBuffSize(); } /** * Method description * * * @return */ @Override public SocketChannel getSocketChannel() { return io.getSocketChannel(); } /** * Method description * * * @param list * @param reset */ @Override public void getStatistics(StatisticsList list, boolean reset) { if (io != null) { io.getStatistics(list, reset); } } /** * Method description * * * @return */ @Override public boolean isConnected() { return io.isConnected(); } /** * Method description * * * @param addr * * @return */ @Override public boolean isRemoteAddress(String addr) { return io.isRemoteAddress(addr); } /** * Method description * * * @param buff * * @return * * @throws IOException */ @Override public ByteBuffer read(ByteBuffer buff) throws IOException { // if (log.isLoggable(Level.FINER)) { // log.finer("input.capacity()=" + buff.capacity()); // log.finer("input.remaining()=" + buff.remaining()); // log.finer("input.limit()=" + buff.limit()); // log.finer("input.position()=" + buff.position()); ByteBuffer tmpBuffer = io.read(buff); if (io.bytesRead() > 0) { if (log.isLoggable(Level.FINER)) { log.log(Level.FINER, "Read bytes: {0}, {1}", new Object[] { io.bytesRead(), toString() }); } return decodeData(tmpBuffer); } else { return null; } // end of else } /** * Method description * * * @throws IOException */ @Override public void stop() throws IOException { if (log.isLoggable(Level.FINEST)) { log.finest("Stop called..." + toString()); // Thread.dumpStack(); } io.stop(); tlsWrapper.close(); } /** * Method description * * * @return */ @Override public String toString() { return "TLS: " + io.toString(); } /** * Method description * * * @return */ @Override public boolean waitingToSend() { return io.waitingToSend(); } /** * Method description * * * @return */ @Override public int waitingToSendSize() { return io.waitingToSendSize(); } /** * Method description * * * @param buff * * @return * * @throws IOException */ @Override public int write(ByteBuffer buff) throws IOException { TLSStatus stat = tlsWrapper.getStatus(); // The loop below falls into infinite loop for some reason. // Let's try to detect it here and recover. // Looks like for some reason tlsWrapper.getStatus() sometimes starts to // return // NEED_READ status all the time and the loop never ends. int loop_cnt = 0; int max_loop_runs = 1000; while (((stat == TLSStatus.NEED_WRITE) || (stat == TLSStatus.NEED_READ)) && (++loop_cnt < max_loop_runs)) { switch (stat) { case NEED_WRITE: writeBuff(ByteBuffer.allocate(0)); break; case NEED_READ: // I wonder if some real data can be read from the socket here (and we // would // loose the data) or this is just TLS stuff here..... ByteBuffer rbuff = read(ByteBuffer.allocate(tlsWrapper.getNetBuffSize())); break; // case CLOSED: // if (tlsWrapper.getStatus() == TLSStatus.CLOSED) { // if (log.isLoggable(Level.FINER)) { // log.finer("TLS Socket closed..."); // throw new EOFException("Socket has been closed."); // } // end of if (tlsWrapper.getStatus() == TLSStatus.CLOSED) // break; default: } stat = tlsWrapper.getStatus(); } if (loop_cnt > (max_loop_runs / 2)) { log.log(Level.WARNING, "Infinite loop detected in write(buff) TLS code, tlsWrapper.getStatus(): {0}", tlsWrapper.getStatus()); // Let's close the connection now throw new EOFException("Socket has been closed due to TLS problems."); } if (tlsWrapper.getStatus() == TLSStatus.CLOSED) { if (log.isLoggable(Level.FINER)) { log.finer("TLS Socket closed..."); } throw new EOFException("Socket has been closed."); } // end of if (tlsWrapper.getStatus() == TLSStatus.CLOSED) int result = -1; if (buff == null) { result = io.write(null); } else { if (log.isLoggable(Level.FINER)) { log.log(Level.FINER, "TLS - Writing data, remaining: {0}, {1}", new Object[] { buff.remaining(), toString() }); } result = writeBuff(buff); } // if (isRemoteAddress("81.142.228.219")) { // log.warning("TLS - Writing data, remaining: " + buff.remaining()); // if (isRemoteAddress("81.142.228.219")) { // log.warning("TLS - written: " + result); return result; } private ByteBuffer decodeData(ByteBuffer input) throws IOException { TLSStatus stat = null; boolean continueLoop = true; // input.flip(); // do_loop: do { // if (log.isLoggable(Level.FINER)) { // log.finer("Decoding data: " + input.remaining()); // log.finer("input.capacity()=" + input.capacity()); // log.finer("input.remaining()=" + input.remaining()); // log.finer("input.limit()=" + input.limit()); // log.finer("input.position()=" + input.position()); // log.finer("tlsInput.capacity()=" + tlsInput.capacity()); // log.finer("tlsInput.remaining()=" + tlsInput.remaining()); // log.finer("tlsInput.limit()=" + tlsInput.limit()); // log.finer("tlsInput.position()=" + tlsInput.position()); tlsInput = tlsWrapper.unwrap(input, tlsInput); // if (log.isLoggable(Level.FINEST)) { // int netSize = tlsWrapper.getPacketBuffSize(); // log.finer("tlsWrapper.getStatus() = " + tlsWrapper.getStatus().name()); // log.finer("PacketBuffSize=" + netSize); // log.finer("input.capacity()=" + input.capacity()); // log.finer("input.remaining()=" + input.remaining()); // log.finer("input.limit()=" + input.limit()); // log.finer("input.position()=" + input.position()); // log.finer("tlsInput.capacity()=" + tlsInput.capacity()); // log.finer("tlsInput.remaining()=" + tlsInput.remaining()); // log.finer("tlsInput.limit()=" + tlsInput.limit()); // log.finer("tlsInput.position()=" + tlsInput.position()); // if (input.hasRemaining()) { // input.compact(); // }// end of if (input.hasRemaining()) switch (tlsWrapper.getStatus()) { case NEED_WRITE: writeBuff(ByteBuffer.allocate(0)); break; case UNDERFLOW: // if (log.isLoggable(Level.FINER) && !log.isLoggable(Level.FINEST)) { // int netSize = tlsWrapper.getPacketBuffSize(); // log.finer("tlsWrapper.getStatus() = UNDERFLOW"); // log.finer("PacketBuffSize=" + netSize); // log.finer("input.capacity()=" + input.capacity()); // log.finer("input.remaining()=" + input.remaining()); // log.finer("input.limit()=" + input.limit()); // log.finer("input.position()=" + input.position()); // log.finer("tlsInput.capacity()=" + tlsInput.capacity()); // log.finer("tlsInput.remaining()=" + tlsInput.remaining()); // log.finer("tlsInput.limit()=" + tlsInput.limit()); // log.finer("tlsInput.position()=" + tlsInput.position()); // Obtain more inbound network data for src, // then retry the operation. // If there is some data ready to read, let's try to read it before we // increase // the buffer size // throw new <API key>(); if (tlsInput.capacity() == tlsInput.remaining()) { throw new <API key>(); } else { input.compact(); continueLoop = false; } break; case CLOSED: // if (tlsWrapper.getStatus() == TLSStatus.CLOSED) { if (log.isLoggable(Level.FINER)) { log.finer("TLS Socket closed..." + toString()); } throw new EOFException("Socket has been closed."); // } // end of if (tlsWrapper.getStatus() == TLSStatus.CLOSED) // break do_loop; // break; default: break; } // end of switch (tlsWrapper.getStatus()) stat = tlsWrapper.getStatus(); } while (continueLoop && ((stat == TLSStatus.NEED_READ) || (stat == TLSStatus.OK)) && input.hasRemaining()); if (continueLoop) { if (input.hasRemaining()) { input.rewind(); } else { input.clear(); } } tlsInput.flip(); return tlsInput; } private int writeBuff(ByteBuffer buff) throws IOException { int result = 0; int wr = 0; // The loop below falls into infinite loop for some reason. // Let's try to detect it here and recover. // -- After some tests.... // Looks like the cause has been detected. Sometimes the loop // below is executed a few times for some reason. It happens that // the tlsWarpper.getStatus() returns NEED_READ and it doesn't // accept any more data from the input buffer. // The proper handling would need reading from the socket to // reset TLS to the correct state, but this involves another problems. // What to do with possible user data received in such a call? // It happens extremely rarely and is hard to diagnose. Let's leave it // as it is now which just causes such connections to be closed. int loop_cnt = 0; int max_loop_runs = 1000; do { if (tlsWrapper.getStatus() == TLSStatus.NEED_READ) { // I wonder if some real data can be read from the socket here (and we // would // loose the data) or this is just TLS stuff here..... ByteBuffer rbuff = read(ByteBuffer.allocate(tlsWrapper.getNetBuffSize())); } ByteBuffer tlsOutput = ByteBuffer.allocate(tlsWrapper.getNetBuffSize()); // Not sure if this is really needed, I guess not... tlsOutput.clear(); tlsWrapper.wrap(buff, tlsOutput); if (tlsWrapper.getStatus() == TLSStatus.CLOSED) { throw new EOFException("Socket has been closed."); } // end of if (tlsWrapper.getStatus() == TLSStatus.CLOSED) tlsOutput.flip(); wr = io.write(tlsOutput); result += wr; } while (buff.hasRemaining() && (++loop_cnt < max_loop_runs)); if (loop_cnt > (max_loop_runs / 2)) { log.warning("Infinite loop detected in writeBuff(buff) TLS code, " + "tlsWrapper.getStatus(): " + tlsWrapper.getStatus()); // Let's close the connection now throw new EOFException("Socket has been closed due to TLS problems."); } if (tlsWrapper.getStatus() == TLSStatus.NEED_WRITE) { writeBuff(ByteBuffer.allocate(0)); } // end of if () return result; } /* * (non-Javadoc) * * @see tigase.io.IOInterface#setLogId(java.lang.String) */ @Override public void setLogId(String logId) { io.setLogId(logId); } } // TLSIO // ~ Formatted in Sun Code Convention
(function() { var NAME = _CMProxy.parameter.NAME; var DESCRIPTION = _CMProxy.parameter.DESCRIPTION; Ext.define("CMDBuild.delegate.administration.common.basepanel.<API key>", { extend: "CMDBuild.delegate.administration.common.basepanel.CMFormFiledsManager", /** * @return {array} an array of Ext.component to use as form items */ // override build: function() { this.name = new Ext.form.TextField({ fieldLabel: CMDBuild.Translation.administration.modClass.attributeProperties.name, labelWidth: CMDBuild.LABEL_WIDTH, width: CMDBuild.ADM_BIG_FIELD_WIDTH, name: NAME, allowBlank: false, vtype: "alphanum", cmImmutable: true }); this.description= new Ext.form.CMTranslatableText({ fieldLabel : CMDBuild.Translation.administration.modClass.attributeProperties.description, labelWidth: CMDBuild.LABEL_WIDTH, width: CMDBuild.ADM_BIG_FIELD_WIDTH, name: DESCRIPTION, allowBlank : false, vtype : "cmdbcomment" }); return [this.name, this.description]; }, /** * * @param {Ext.data.Model} record * the record to use to fill the field values */ // override loadRecord: function(record) { this.reset(); this.name.setValue(record.get(NAME)); this.description.setValue(record.get(DESCRIPTION)); }, /** * @return {object} values * a key/value map with the values of the fields */ // override getValues: function() { var values = {}; values[NAME] = this.name.getValue(); values[DESCRIPTION] = this.description.getValue(); return values; }, /** * clean up all the fields */ // override reset: function() { this.name.reset(); this.description.reset(); } }); })();
<!DOCTYPE html> <html lang="en" > <head> <title>task1 - CDW2 (MDE)</title> <!-- Using the latest rendering mode for IE --> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <style type="text/css"> /*some stuff for output/input prompts*/ div.cell{border:1px solid transparent;display:-webkit-box;-webkit-box-orient:vertical;-webkit-box-align:stretch;display:-moz-box;-moz-box-orient:vertical;-moz-box-align:stretch;display:box;box-orient:vertical;box-align:stretch;display:flex;flex-direction:column;align-items:stretch}div.cell.selected{border-radius:4px;border:thin #ababab solid} div.cell.edit_mode{border-radius:4px;border:thin #008000 solid} div.cell{width:100%;padding:5px 5px 5px 0;margin:0;outline:none} div.prompt{min-width:11ex;padding:.4em;margin:0;font-family:monospace;text-align:right;line-height:1.21429em} @media (max-width:480px){div.prompt{text-align:left}}div.inner_cell{display:-webkit-box;-webkit-box-orient:vertical;-webkit-box-align:stretch;display:-moz-box;-moz-box-orient:vertical;-moz-box-align:stretch;display:box;box-orient:vertical;box-align:stretch;display:flex;flex-direction:column;align-items:stretch;-webkit-box-flex:1;-moz-box-flex:1;box-flex:1;flex:1} div.input_area{border:1px solid #cfcfcf;border-radius:4px;background:#f7f7f7;line-height:1.21429em} div.prompt:empty{padding-top:0;padding-bottom:0} div.input{page-break-inside:avoid;display:-webkit-box;-webkit-box-orient:horizontal;-webkit-box-align:stretch;display:-moz-box;-moz-box-orient:horizontal;-moz-box-align:stretch;display:box;box-orient:horizontal;box-align:stretch;} div.inner_cell{width:90%;} div.input_area{border:1px solid #cfcfcf;border-radius:4px;background:#f7f7f7;} div.input_prompt{color:navy;border-top:1px solid transparent;} div.output_wrapper{margin-top:5px;position:relative;display:-webkit-box;-webkit-box-orient:vertical;-webkit-box-align:stretch;display:-moz-box;-moz-box-orient:vertical;-moz-box-align:stretch;display:box;box-orient:vertical;box-align:stretch;width:100%;} div.output_scroll{height:24em;width:100%;overflow:auto;border-radius:4px;-webkit-box-shadow:inset 0 2px 8px rgba(0, 0, 0, 0.8);-moz-box-shadow:inset 0 2px 8px rgba(0, 0, 0, 0.8);box-shadow:inset 0 2px 8px rgba(0, 0, 0, 0.8);} div.output_collapsed{margin:0px;padding:0px;display:-webkit-box;-webkit-box-orient:vertical;-webkit-box-align:stretch;display:-moz-box;-moz-box-orient:vertical;-moz-box-align:stretch;display:box;box-orient:vertical;box-align:stretch;width:100%;} div.out_prompt_overlay{height:100%;padding:0px 0.4em;position:absolute;border-radius:4px;} div.out_prompt_overlay:hover{-webkit-box-shadow:inset 0 0 1px #000000;-moz-box-shadow:inset 0 0 1px #000000;box-shadow:inset 0 0 1px #000000;background:rgba(240, 240, 240, 0.5);} div.output_prompt{color:darkred;} a.anchor-link:link{text-decoration:none;padding:0px 20px;visibility:hidden;} h1:hover .anchor-link,h2:hover .anchor-link,h3:hover .anchor-link,h4:hover .anchor-link,h5:hover .anchor-link,h6:hover .anchor-link{visibility:visible;} /* end stuff for output/input prompts*/ .highlight-ipynb .hll { background-color: #ffffcc } .highlight-ipynb { background: #f8f8f8; } .highlight-ipynb .c { color: #408080; font-style: italic } /* Comment */ .highlight-ipynb .err { border: 1px solid #FF0000 } /* Error */ .highlight-ipynb .k { color: #008000; font-weight: bold } /* Keyword */ .highlight-ipynb .o { color: #666666 } /* Operator */ .highlight-ipynb .cm { color: #408080; font-style: italic } /* Comment.Multiline */ .highlight-ipynb .cp { color: #BC7A00 } /* Comment.Preproc */ .highlight-ipynb .c1 { color: #408080; font-style: italic } /* Comment.Single */ .highlight-ipynb .cs { color: #408080; font-style: italic } /* Comment.Special */ .highlight-ipynb .gd { color: #A00000 } /* Generic.Deleted */ .highlight-ipynb .ge { font-style: italic } /* Generic.Emph */ .highlight-ipynb .gr { color: #FF0000 } /* Generic.Error */ .highlight-ipynb .gh { color: #000080; font-weight: bold } /* Generic.Heading */ .highlight-ipynb .gi { color: #00A000 } /* Generic.Inserted */ .highlight-ipynb .go { color: #888888 } /* Generic.Output */ .highlight-ipynb .gp { color: #000080; font-weight: bold } /* Generic.Prompt */ .highlight-ipynb .gs { font-weight: bold } /* Generic.Strong */ .highlight-ipynb .gu { color: #800080; font-weight: bold } /* Generic.Subheading */ .highlight-ipynb .gt { color: #0044DD } /* Generic.Traceback */ .highlight-ipynb .kc { color: #008000; font-weight: bold } /* Keyword.Constant */ .highlight-ipynb .kd { color: #008000; font-weight: bold } /* Keyword.Declaration */ .highlight-ipynb .kn { color: #008000; font-weight: bold } /* Keyword.Namespace */ .highlight-ipynb .kp { color: #008000 } /* Keyword.Pseudo */ .highlight-ipynb .kr { color: #008000; font-weight: bold } /* Keyword.Reserved */ .highlight-ipynb .kt { color: #B00040 } /* Keyword.Type */ .highlight-ipynb .m { color: #666666 } /* Literal.Number */ .highlight-ipynb .s { color: #BA2121 } /* Literal.String */ .highlight-ipynb .na { color: #7D9029 } /* Name.Attribute */ .highlight-ipynb .nb { color: #008000 } /* Name.Builtin */ .highlight-ipynb .nc { color: #0000FF; font-weight: bold } /* Name.Class */ .highlight-ipynb .no { color: #880000 } /* Name.Constant */ .highlight-ipynb .nd { color: #AA22FF } /* Name.Decorator */ .highlight-ipynb .ni { color: #999999; font-weight: bold } /* Name.Entity */ .highlight-ipynb .ne { color: #D2413A; font-weight: bold } /* Name.Exception */ .highlight-ipynb .nf { color: #0000FF } /* Name.Function */ .highlight-ipynb .nl { color: #A0A000 } /* Name.Label */ .highlight-ipynb .nn { color: #0000FF; font-weight: bold } /* Name.Namespace */ .highlight-ipynb .nt { color: #008000; font-weight: bold } /* Name.Tag */ .highlight-ipynb .nv { color: #19177C } /* Name.Variable */ .highlight-ipynb .ow { color: #AA22FF; font-weight: bold } /* Operator.Word */ .highlight-ipynb .w { color: #bbbbbb } /* Text.Whitespace */ .highlight-ipynb .mf { color: #666666 } /* Literal.Number.Float */ .highlight-ipynb .mh { color: #666666 } /* Literal.Number.Hex */ .highlight-ipynb .mi { color: #666666 } /* Literal.Number.Integer */ .highlight-ipynb .mo { color: #666666 } /* Literal.Number.Oct */ .highlight-ipynb .sb { color: #BA2121 } /* Literal.String.Backtick */ .highlight-ipynb .sc { color: #BA2121 } /* Literal.String.Char */ .highlight-ipynb .sd { color: #BA2121; font-style: italic } /* Literal.String.Doc */ .highlight-ipynb .s2 { color: #BA2121 } /* Literal.String.Double */ .highlight-ipynb .se { color: #BB6622; font-weight: bold } /* Literal.String.Escape */ .highlight-ipynb .sh { color: #BA2121 } /* Literal.String.Heredoc */ .highlight-ipynb .si { color: #BB6688; font-weight: bold } /* Literal.String.Interpol */ .highlight-ipynb .sx { color: #008000 } /* Literal.String.Other */ .highlight-ipynb .sr { color: #BB6688 } /* Literal.String.Regex */ .highlight-ipynb .s1 { color: #BA2121 } /* Literal.String.Single */ .highlight-ipynb .ss { color: #19177C } /* Literal.String.Symbol */ .highlight-ipynb .bp { color: #008000 } /* Name.Builtin.Pseudo */ .highlight-ipynb .vc { color: #19177C } /* Name.Variable.Class */ .highlight-ipynb .vg { color: #19177C } /* Name.Variable.Global */ .highlight-ipynb .vi { color: #19177C } /* Name.Variable.Instance */ .highlight-ipynb .il { color: #666666 } /* Literal.Number.Integer.Long */ </style> <style type="text/css"> /* Overrides of notebook CSS for static HTML export */ div.entry-content { overflow: visible; padding: 8px; } .input_area { padding: 0.2em; } a.heading-anchor { white-space: normal; } .rendered_html code { font-size: .8em; } pre.ipynb { color: black; background: #f7f7f7; border: none; box-shadow: none; margin-bottom: 0; padding: 0; margin: 0px; font-size: 13px; } /* remove the prompt div from text cells */ div.text_cell .prompt { display: none; } /* remove horizontal padding from text cells, */ /* so it aligns with outer body text */ div.text_cell_render { padding: 0.5em 0em; } img.anim_icon{padding:0; border:0; vertical-align:middle; -webkit-box-shadow:none; -box-shadow:none} </style> <script src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML" type="text/javascript"></script> <script type="text/javascript"> init_mathjax = function() { if (window.MathJax) { // MathJax loaded MathJax.Hub.Config({ tex2jax: { inlineMath: [ ['$','$'], ["\\(","\\)"] ], displayMath: [ ['$$','$$'], ["\\[","\\]"] ] }, displayAlign: 'left', // Change this to 'center' to center equations. "HTML-CSS": { styles: {'.MathJax_Display': {"margin": 0}} } }); MathJax.Hub.Queue(["Typeset",MathJax.Hub]); } } init_mathjax(); </script> <meta name="author" content="kmol" /> <meta name="keywords" content="task1" /> <!-- Open Graph tags --> <meta property="og:site_name" content="CDW2 (MDE)" /> <meta property="og:type" content="website"/> <meta property="og:title" content="CDW2 (MDE)"/> <meta property="og:url" content="http://2015fallhw.github.io/cdw2/post"/> <meta property="og:description" content="CDW2 (MDE)"/> <!-- Bootstrap --> <link rel="stylesheet" href="http://2015fallhw.github.io/cdw2/post/theme/css/bootstrap.united.min.css" type="text/css"/> <link href="http://2015fallhw.github.io/cdw2/post/theme/css/font-awesome.min.css" rel="stylesheet"> <link href="http://2015fallhw.github.io/cdw2/post/theme/css/pygments/monokai.css" rel="stylesheet"> <link href="http://2015fallhw.github.io/cdw2/post/theme/tipuesearch/tipuesearch.css" rel="stylesheet"> <link rel="stylesheet" href="http://2015fallhw.github.io/cdw2/post/theme/css/style.css" type="text/css"/> <link href="http://2015fallhw.github.io/cdw2/post/feeds/all.atom.xml" type="application/atom+xml" rel="alternate" title="CDW2 (MDE) ATOM Feed"/> <script type="text/javascript" src="http://cad-lab.github.io/cadlab_data/files/syntaxhighlighter/shCore.js"></script> <script type="text/javascript" src="http://cad-lab.github.io/cadlab_data/files/syntaxhighlighter/shBrushJScript.js"></script> <script type="text/javascript" src="http://cad-lab.github.io/cadlab_data/files/syntaxhighlighter/shBrushJava.js"></script> <script type="text/javascript" src="http://cad-lab.github.io/cadlab_data/files/syntaxhighlighter/shBrushPython.js"></script> <script type="text/javascript" src="http://cad-lab.github.io/cadlab_data/files/syntaxhighlighter/shBrushSql.js"></script> <script type="text/javascript" src="http://cad-lab.github.io/cadlab_data/files/syntaxhighlighter/shBrushXml.js"></script> <script type="text/javascript" src="http://cad-lab.github.io/cadlab_data/files/syntaxhighlighter/shBrushPhp.js"></script> <script type="text/javascript" src="http://cad-lab.github.io/cadlab_data/files/syntaxhighlighter/shBrushCpp.js"></script> <script type="text/javascript" src="http://cad-lab.github.io/cadlab_data/files/syntaxhighlighter/shBrushCss.js"></script> <script type="text/javascript" src="http://cad-lab.github.io/cadlab_data/files/syntaxhighlighter/shBrushCSharp.js"></script> <script type='text/javascript'> (function(){ var corecss = document.createElement('link'); var themecss = document.createElement('link'); var corecssurl = "http://cad-lab.github.io/cadlab_data/files/syntaxhighlighter/css/shCore.css"; if ( corecss.setAttribute ) { corecss.setAttribute( "rel", "stylesheet" ); corecss.setAttribute( "type", "text/css" ); corecss.setAttribute( "href", corecssurl ); } else { corecss.rel = "stylesheet"; corecss.href = corecssurl; } document.<API key>("head")[0].insertBefore( corecss, document.getElementById("<API key>") ); var themecssurl = "http://cad-lab.github.io/cadlab_data/files/syntaxhighlighter/css/shThemeDefault.css?ver=3.0.9b"; if ( themecss.setAttribute ) { themecss.setAttribute( "rel", "stylesheet" ); themecss.setAttribute( "type", "text/css" ); themecss.setAttribute( "href", themecssurl ); } else { themecss.rel = "stylesheet"; themecss.href = themecssurl; } //document.getElementById("<API key>").appendChild(themecss); document.<API key>("head")[0].insertBefore( themecss, document.getElementById("<API key>") ); })(); SyntaxHighlighter.config.strings.expandSource = '+ expand source'; SyntaxHighlighter.config.strings.help = '?'; SyntaxHighlighter.config.strings.alert = 'SyntaxHighlighter\n\n'; SyntaxHighlighter.config.strings.noBrush = 'Can\'t find brush for: '; SyntaxHighlighter.config.strings.brushNotHtmlScript = 'Brush wasn\'t configured for html-script option: '; SyntaxHighlighter.defaults['pad-line-numbers'] = false; SyntaxHighlighter.defaults['toolbar'] = false; SyntaxHighlighter.all(); </script> </head> <body> <div class="navbar navbar-default navbar-fixed-top" role="navigation"> <div class="container"> <div class="navbar-header"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-ex1-collapse"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a href="http://2015fallhw.github.io/cdw2/post/" class="navbar-brand"> CDW2 (MDE) </a> </div> <div class="collapse navbar-collapse navbar-ex1-collapse"> <ul class="nav navbar-nav"> <li><a href="http://2015fallhw.github.io/cdw2/post/pages/about/"> About </a></li> <li > <a href="http://2015fallhw.github.io/cdw2/post/category/ag1.html">Ag1</a> </li> <li > <a href="http://2015fallhw.github.io/cdw2/post/category/ag10.html">Ag10</a> </li> <li > <a href="http://2015fallhw.github.io/cdw2/post/category/ag100.html">Ag100</a> </li> <li > <a href="http://2015fallhw.github.io/cdw2/post/category/ag3.html">Ag3</a> </li> <li > <a href="http://2015fallhw.github.io/cdw2/post/category/ag5.html">Ag5</a> </li> <li > <a href="http://2015fallhw.github.io/cdw2/post/category/ag6.html">Ag6</a> </li> <li > <a href="http://2015fallhw.github.io/cdw2/post/category/ag7.html">Ag7</a> </li> <li > <a href="http://2015fallhw.github.io/cdw2/post/category/ag8.html">Ag8</a> </li> <li > <a href="http://2015fallhw.github.io/cdw2/post/category/ag9.html">Ag9</a> </li> <li > <a href="http://2015fallhw.github.io/cdw2/post/category/bg07.html">Bg07</a> </li> <li > <a href="http://2015fallhw.github.io/cdw2/post/category/bg1.html">Bg1</a> </li> <li > <a href="http://2015fallhw.github.io/cdw2/post/category/bg11.html">Bg11</a> </li> <li > <a href="http://2015fallhw.github.io/cdw2/post/category/bg2.html">Bg2</a> </li> <li > <a href="http://2015fallhw.github.io/cdw2/post/category/bg3.html">Bg3</a> </li> <li > <a href="http://2015fallhw.github.io/cdw2/post/category/bg4.html">Bg4</a> </li> <li > <a href="http://2015fallhw.github.io/cdw2/post/category/bg5.html">Bg5</a> </li> <li > <a href="http://2015fallhw.github.io/cdw2/post/category/bg7.html">Bg7</a> </li> <li > <a href="http://2015fallhw.github.io/cdw2/post/category/bg8.html">Bg8</a> </li> <li > <a href="http://2015fallhw.github.io/cdw2/post/category/bg9.html">Bg9</a> </li> </ul> <ul class="nav navbar-nav navbar-right"> <li><span> <form class="navbar-search" action="http://2015fallhw.github.io/cdw2/post/search.html"> <input type="text" class="search-query" placeholder="Search" name="q" id="tipue_search_input" required> </form></span> </li> <li><a href="http://2015fallhw.github.io/cdw2/post/archives.html"><i class="fa fa-th-list"></i><span class="icon-label">Archives</span></a></li> </ul> </div> <!-- /.navbar-collapse --> </div> </div> <!-- /.navbar --> <!-- Banner --> <!-- End Banner --> <div class="container"> <div class="row"> <div class="col-sm-9"> <article> <h2><a href="http://2015fallhw.github.io/cdw2/post/<API key>.html">40123134scrum1- g1 40123134</a></h2> <div class="summary"><p>: .md s2b/g1, Tags Tags .</p> <p>bg1 cdw2 master g1.leo Task1 </p> <a class="btn btn-default btn-xs" href="http://2015fallhw.github.io/cdw2/post/<API key>.html">more ...</a> </div> </article> <hr/> <article> <h2><a href="http://2015fallhw.github.io/cdw2/post/<API key>.html">40123244scrum1- g2 scrum1 </a></h2> <div class="summary"><p>: .md s2b/g2, Tags Tags .</p> <p>bg2 cdw2 master g2.leo Task1 </p> <a class="btn btn-default btn-xs" href="http://2015fallhw.github.io/cdw2/post/<API key>.html">more ...</a> </div> </article> <hr/> <article> <h2><a href="http://2015fallhw.github.io/cdw2/post/<API key>.html">40323201-</a></h2> <div class="summary"><p><span style="font-size:20px;">40323201-</span> <a class="btn btn-default btn-xs" href="http://2015fallhw.github.io/cdw2/post/<API key>.html">more ...</a> </div> </article> <hr/> <article> <h2><a href="http://2015fallhw.github.io/cdw2/post/<API key>.html">40123216- ag7 </a></h2> <div class="summary"><p>ag7 40123216 cdw2 master Task1 </p> <a class="btn btn-default btn-xs" href="http://2015fallhw.github.io/cdw2/post/<API key>.html">more ...</a> </div> </article> <hr/> <article> <h2><a href="http://2015fallhw.github.io/cdw2/post/<API key>.html">40123255- ag7 </a></h2> <div class="summary"><p>ag7 40123255 cdw2 master Task1 </p> <a class="btn btn-default btn-xs" href="http://2015fallhw.github.io/cdw2/post/<API key>.html">more ...</a> </div> </article> <hr/> <article> <h2><a href="http://2015fallhw.github.io/cdw2/post/<API key>.html">40123149- ag7 </a></h2> <div class="summary"><p>ag7 40123149 cdw2 master Task1 </p> <a class="btn btn-default btn-xs" href="http://2015fallhw.github.io/cdw2/post/<API key>.html">more ...</a> </div> </article> <hr/> <article> <h2><a href="http://2015fallhw.github.io/cdw2/post/<API key>.html">40123119- ag7 </a></h2> <div class="summary"><p>ag7 40123119 cdw2 master Task1 </p> <a class="btn btn-default btn-xs" href="http://2015fallhw.github.io/cdw2/post/<API key>.html">more ...</a> </div> </article> <hr/> <article> <h2><a href="http://2015fallhw.github.io/cdw2/post/<API key>.html">40123141- ag7 </a></h2> <div class="summary"><p>ag7 40123141 cdw2 master Task1 </p> <a class="btn btn-default btn-xs" href="http://2015fallhw.github.io/cdw2/post/<API key>.html">more ...</a> </div> </article> <hr/> <article> <h2><a href="http://2015fallhw.github.io/cdw2/post/<API key>.html">40023234- ag7 </a></h2> <div class="summary"><p>ag7 40023234 cdw2 master Task1 </p> <a class="btn btn-default btn-xs" href="http://2015fallhw.github.io/cdw2/post/<API key>.html">more ...</a> </div> </article> <hr/> <article> <h2><a href="http://2015fallhw.github.io/cdw2/post/<API key>.html">40123202scrum1- g2 scrum1 </a></h2> <div class="summary"><p>: .md s2b/g2, Tags Tags .</p> <p>bg2 cdw2 master g2.leo Task1 </p> <a class="btn btn-default btn-xs" href="http://2015fallhw.github.io/cdw2/post/<API key>.html">more ...</a> </div> </article> <hr/> <ul class="pagination"> <li class="prev"><a href="http://2015fallhw.github.io/cdw2/post/tag/task1.html">&laquo;</a> </li> <li class=""><a href="http://2015fallhw.github.io/cdw2/post/tag/task1.html">1</a></li> <li class="active"><a href="http://2015fallhw.github.io/cdw2/post/tag/task12.html">2</a></li> <li class=""><a href="http://2015fallhw.github.io/cdw2/post/tag/task13.html">3</a></li> <li class=""><a href="http://2015fallhw.github.io/cdw2/post/tag/task14.html">4</a></li> <li class=""><a href="http://2015fallhw.github.io/cdw2/post/tag/task15.html">5</a></li> <li class=""><a href="http://2015fallhw.github.io/cdw2/post/tag/task16.html">6</a></li> <li class=""><a href="http://2015fallhw.github.io/cdw2/post/tag/task17.html">7</a></li> <li class=""><a href="http://2015fallhw.github.io/cdw2/post/tag/task18.html">8</a></li> <li class=""><a href="http://2015fallhw.github.io/cdw2/post/tag/task19.html">9</a></li> <li class=""><a href="http://2015fallhw.github.io/cdw2/post/tag/task110.html">10</a></li> <li class=""><a href="http://2015fallhw.github.io/cdw2/post/tag/task111.html">11</a></li> <li class="next"><a href="http://2015fallhw.github.io/cdw2/post/tag/task13.html">&raquo;</a></li> </ul> </div> <div class="col-sm-3" id="sidebar"> <aside> <section class="well well-sm"> <ul class="list-group list-group-flush"> <li class="list-group-item"><h4><i class="fa fa-home fa-lg"></i><span class="icon-label">Recent Posts</span></h4> <ul class="list-group" id="recentposts"> <li class="list-group-item"> <a href="http://2015fallhw.github.io/cdw2/post/<API key>.html"> user1- content md </a> </li> <li class="list-group-item"> <a href="http://2015fallhw.github.io/cdw2/post/<API key>.html"> 40123128- bg4 </a> </li> <li class="list-group-item"> <a href="http://2015fallhw.github.io/cdw2/post/<API key>.html"> 40323208- bg4 </a> </li> <li class="list-group-item"> <a href="http://2015fallhw.github.io/cdw2/post/<API key>.html"> 40323205- bg4 </a> </li> <li class="list-group-item"> <a href="http://2015fallhw.github.io/cdw2/post/<API key>.html"> 40323253scrum5- bg5 scrum5 </a> </li> </ul> </li> <li class="list-group-item"><a href="http://2015fallhw.github.io/cdw2/post/categories.html"><h4><i class="fa fa-home fa-lg"></i><span class="icon-label">Categories</span></h4></a> <ul class="list-group" id="categories"> <li class="list-group-item"> <a href="http://2015fallhw.github.io/cdw2/post/category/ag1.html"> <i class="fa fa-folder-open fa-lg"></i> ag1 </a> </li> <li class="list-group-item"> <a href="http://2015fallhw.github.io/cdw2/post/category/ag10.html"> <i class="fa fa-folder-open fa-lg"></i> ag10 </a> </li> <li class="list-group-item"> <a href="http://2015fallhw.github.io/cdw2/post/category/ag100.html"> <i class="fa fa-folder-open fa-lg"></i> ag100 </a> </li> <li class="list-group-item"> <a href="http://2015fallhw.github.io/cdw2/post/category/ag3.html"> <i class="fa fa-folder-open fa-lg"></i> ag3 </a> </li> <li class="list-group-item"> <a href="http://2015fallhw.github.io/cdw2/post/category/ag5.html"> <i class="fa fa-folder-open fa-lg"></i> ag5 </a> </li> <li class="list-group-item"> <a href="http://2015fallhw.github.io/cdw2/post/category/ag6.html"> <i class="fa fa-folder-open fa-lg"></i> ag6 </a> </li> <li class="list-group-item"> <a href="http://2015fallhw.github.io/cdw2/post/category/ag7.html"> <i class="fa fa-folder-open fa-lg"></i> ag7 </a> </li> <li class="list-group-item"> <a href="http://2015fallhw.github.io/cdw2/post/category/ag8.html"> <i class="fa fa-folder-open fa-lg"></i> ag8 </a> </li> <li class="list-group-item"> <a href="http://2015fallhw.github.io/cdw2/post/category/ag9.html"> <i class="fa fa-folder-open fa-lg"></i> ag9 </a> </li> <li class="list-group-item"> <a href="http://2015fallhw.github.io/cdw2/post/category/bg07.html"> <i class="fa fa-folder-open fa-lg"></i> bg07 </a> </li> <li class="list-group-item"> <a href="http://2015fallhw.github.io/cdw2/post/category/bg1.html"> <i class="fa fa-folder-open fa-lg"></i> bg1 </a> </li> <li class="list-group-item"> <a href="http://2015fallhw.github.io/cdw2/post/category/bg11.html"> <i class="fa fa-folder-open fa-lg"></i> bg11 </a> </li> <li class="list-group-item"> <a href="http://2015fallhw.github.io/cdw2/post/category/bg2.html"> <i class="fa fa-folder-open fa-lg"></i> bg2 </a> </li> <li class="list-group-item"> <a href="http://2015fallhw.github.io/cdw2/post/category/bg3.html"> <i class="fa fa-folder-open fa-lg"></i> bg3 </a> </li> <li class="list-group-item"> <a href="http://2015fallhw.github.io/cdw2/post/category/bg4.html"> <i class="fa fa-folder-open fa-lg"></i> bg4 </a> </li> <li class="list-group-item"> <a href="http://2015fallhw.github.io/cdw2/post/category/bg5.html"> <i class="fa fa-folder-open fa-lg"></i> bg5 </a> </li> <li class="list-group-item"> <a href="http://2015fallhw.github.io/cdw2/post/category/bg7.html"> <i class="fa fa-folder-open fa-lg"></i> bg7 </a> </li> <li class="list-group-item"> <a href="http://2015fallhw.github.io/cdw2/post/category/bg8.html"> <i class="fa fa-folder-open fa-lg"></i> bg8 </a> </li> <li class="list-group-item"> <a href="http://2015fallhw.github.io/cdw2/post/category/bg9.html"> <i class="fa fa-folder-open fa-lg"></i> bg9 </a> </li> </ul> </li> <li class="list-group-item"><a href="http://2015fallhw.github.io/cdw2/post/tags.html"><h4><i class="fa fa-tags fa-lg"></i><span class="icon-label">Tags</span></h4></a> <ul class="list-group list-inline tagcloud" id="tags"> </ul> </li> <li class="list-group-item"><h4><i class="fa <API key> fa-lg"></i><span class="icon-label">Links</span></h4> <ul class="list-group" id="links"> <li class="list-group-item"> <a href="http://getpelican.com/" target="_blank"> Pelican </a> </li> <li class="list-group-item"> <a href="https://github.com/DandyDev/pelican-bootstrap3/" target="_blank"> pelican-bootstrap3 </a> </li> <li class="list-group-item"> <a href="https://github.com/getpelican/pelican-plugins" target="_blank"> pelican-plugins </a> </li> <li class="list-group-item"> <a href="https://github.com/Tipue/Tipue-Search" target="_blank"> Tipue search </a> </li> </ul> </li> </ul> </section> </aside> </div> </div> </div> <footer> <div class="container"> <hr> <div class="row"> <div class="col-xs-10">&copy; 2016 kmol &middot; Powered by <a href="https://github.com/DandyDev/pelican-bootstrap3" target="_blank">pelican-bootstrap3</a>, <a href="http://docs.getpelican.com/" target="_blank">Pelican</a>, <a href="http://getbootstrap.com" target="_blank">Bootstrap</a> </div> <div class="col-xs-2"><p class="pull-right"><i class="fa fa-arrow-up"></i> <a href="#">Back to top</a></p></div> </div> </div> </footer> <script src="http://2015fallhw.github.io/cdw2/post/theme/js/jquery.min.js"></script> <!-- Include all compiled plugins (below), or include individual files as needed --> <script src="http://2015fallhw.github.io/cdw2/post/theme/js/bootstrap.min.js"></script> <script src="http://2015fallhw.github.io/cdw2/post/theme/js/respond.min.js"></script> <!-- Disqus --> <script type="text/javascript"> /* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */ var disqus_shortname = 'cadlabmanual'; // required: replace example with your forum shortname /* * * DON'T EDIT BELOW THIS LINE * * */ (function () { var s = document.createElement('script'); s.async = true; s.type = 'text/javascript'; s.src = '//' + disqus_shortname + '.disqus.com/count.js'; (document.<API key>('HEAD')[0] || document.<API key>('BODY')[0]).appendChild(s); }()); </script> <!-- End Disqus Code --> </body> </html>
import React from 'react'; import PropTypes from 'prop-types'; import { Link } from 'react-router-dom'; import { Trans } from '@lingui/macro'; import <API key> from 'common/<API key>'; import { makePlainUrl } from 'interface/common/makeAnalyzerUrl'; import <API key> from 'interface/home/ReportHistory/<API key>'; const ReportHistory = props => { const { reportHistory } = props; const now = (+new Date()) / 1000; return ( <ul className="list selection" style={{ backgroundColor: 'rgba(0, 0, 0, 0.05)' }}> {[...reportHistory].reverse().map(report => ( <li key={report.code} className="selectable"> {report.type === <API key>.CHARACTER && ( <Link to={<API key>(report.playerRegion, report.playerRealm, report.playerName)} style={{ color: '#fff', textDecoration: 'none' }} > <div> <div className={`playerName ${report.playerClass}`}>{report.playerName}</div> <div className="flex wrapable"> <div>{report.playerRealm} ({report.playerRegion})</div> <div className="flex-sub"> <Trans>viewed {Math.floor(Math.max(0, now - report.end) / 86400)}d ago</Trans> </div> </div> </div> </Link> )} {(report.type === <API key>.REPORT || !report.type) && ( <Link to={makePlainUrl(report.code, report.fightId, report.fightName, report.playerId, report.playerName)} style={{ color: '#fff', textDecoration: 'none' }} > <div> <div className={`playerName ${report.playerClass}`}>{report.playerName}</div> <div className="flex wrapable"> <div>{report.fightName}</div> <div className="flex-sub"> <Trans>{Math.floor(Math.max(0, now - report.end) / 86400)}d old report</Trans> </div> </div> </div> </Link> )} </li> ))} {reportHistory.length === 0 && ( <li style={{ padding: '10px 22px' }}> <Trans>You haven't viewed anything yet.</Trans> </li> )} </ul> ); }; ReportHistory.propTypes = { reportHistory: PropTypes.arrayOf(PropTypes.shape({ code: PropTypes.string.isRequired, fightId: PropTypes.number, fightName: PropTypes.string, playerId: PropTypes.number, playerName: PropTypes.string.isRequired, playerRealm: PropTypes.string, playerRegion: PropTypes.string, playerClass: PropTypes.string.isRequired, end: PropTypes.number.isRequired, type: PropTypes.number.isRequired, })).isRequired, }; export default ReportHistory;
describe('<API key>', function(){ var $compile, $parse, scope; beforeEach(module('json-schema-ui')); beforeEach(inject(function(_$compile_, _$rootScope_, _$parse_){ $compile = _$compile_; $parse = _$parse_; scope = _$rootScope_.$new(); })); it('should preprocess data with correct path', function(){ var path = '_cm.common.title', updateScope = function(scope) { scope.field = { type: 'string', relativePath: path, path: path, value: null }; scope.data = {}; return scope; }, element = $compile('<input type="text" ng-model scm-field-formatter />')(updateScope(scope)); scope.$digest(); element.val('123').trigger('input'); scope.$apply(); expect($parse(path)(scope.data)).toEqual('123'); }); });
package org.rstudio.studio.client.workbench.views.workspace.model; import com.google.gwt.core.client.JavaScriptObject; public class DownloadInfo extends JavaScriptObject { protected DownloadInfo() { } public final native String getPath() /*-{ return this.path[0]; }-*/; public final native String getVarname() /*-{ return this.varname[0]; }-*/; }
// DO NOT EDIT: generated by gooxml ECMA-376 generator // Use of this source code is governed by the terms of the Affero GNU General package wml import ( "encoding/xml" "log" ) type CT_DocPartCategory struct { // Category Associated With Entry Name *CT_String // Gallery Associated With Entry Gallery *CT_DocPartGallery } func <API key>() *CT_DocPartCategory { ret := &CT_DocPartCategory{} ret.Name = NewCT_String() ret.Gallery = <API key>() return ret } func (m *CT_DocPartCategory) MarshalXML(e *xml.Encoder, start xml.StartElement) error { e.EncodeToken(start) sename := xml.StartElement{Name: xml.Name{Local: "w:name"}} e.EncodeElement(m.Name, sename) segallery := xml.StartElement{Name: xml.Name{Local: "w:gallery"}} e.EncodeElement(m.Gallery, segallery) e.EncodeToken(xml.EndElement{Name: start.Name}) return nil } func (m *CT_DocPartCategory) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { // initialize to default m.Name = NewCT_String() m.Gallery = <API key>() lCT_DocPartCategory: for { tok, err := d.Token() if err != nil { return err } switch el := tok.(type) { case xml.StartElement: switch el.Name { case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "name"}: if err := d.DecodeElement(m.Name, &el); err != nil { return err } case xml.Name{Space: "http://schemas.openxmlformats.org/wordprocessingml/2006/main", Local: "gallery"}: if err := d.DecodeElement(m.Gallery, &el); err != nil { return err } default: log.Printf("skipping unsupported element on CT_DocPartCategory %v", el.Name) if err := d.Skip(); err != nil { return err } } case xml.EndElement: break lCT_DocPartCategory case xml.CharData: } } return nil } // Validate validates the CT_DocPartCategory and its children func (m *CT_DocPartCategory) Validate() error { return m.ValidateWithPath("CT_DocPartCategory") } // ValidateWithPath validates the CT_DocPartCategory and its children, prefixing error messages with path func (m *CT_DocPartCategory) ValidateWithPath(path string) error { if err := m.Name.ValidateWithPath(path + "/Name"); err != nil { return err } if err := m.Gallery.ValidateWithPath(path + "/Gallery"); err != nil { return err } return nil }
# <API key>: true require 'spec_helper' describe 'Underlined' do it 'underlined_single' do docx = OoxmlParser::DocxParser.parse_docx('spec/document/elements/paragraph/runs/font_style/underlined/underlined_single.docx') expect(docx.elements[0].nonempty_runs.first.font_style.underlined).to eq(:single) end end
/* * Written by Matti Katila */ // MAKE: gcc triples.c -o triples `pkg-config glib-2.0 --cflags --libs ` && ./triples test add 1 2 3 #include <sys/types.h> #include <sys/stat.h> #include <unistd.h> #include <stdio.h> #include <stdbool.h> #include <string.h> #include <stdlib.h> #include <glib.h> static const char *APP; static const char *RDF_FILE; static off_t file_len(FILE *fs) { struct stat fstatus; fstat(fileno(fs), &fstatus); if (fstatus.st_size < 0) return 0; return fstatus.st_size; } static off_t find_pos_rec(FILE *fs, char *line, off_t a, off_t b) { if (b-a < 6) b = a; //printf("find %zd %zd\n", a, b); off_t half = a + (b - a) / 2; //printf("half: %zd\n", half); fseeko(fs, half, SEEK_SET); // fast forward to next new line (or eof) // except if we know we are in the beginning of the line int ch; if (half > 0L) { while (true) { ch = fgetc(fs); //printf("%c", ch); if (ch == '\n' || ch == EOF) break; } } //printf("\n"); if (ch == EOF) return find_pos_rec(fs, line, a, half); // read next line char buff[1024*4]; char *s = fgets(buff, sizeof(buff), fs); if (s == NULL && feof(fs)) { return find_pos_rec(fs, line, a, half); } int cmp = strcmp(line, s); //printf("line: %d, %s", cmp, s); if (cmp == 0) // line exists already. // we should signal back return ftello(fs) - strlen(line); if (cmp < 0) { if (a == half) { if (a == 0) return 0; return a + 1; } return find_pos_rec(fs, line, a, half); } if (b <= ftello(fs)) return ftello(fs); else if (cmp > 0) return find_pos_rec(fs, line, ftello(fs)-1, b); } static off_t find_pos(FILE *fs, char *line) { off_t total_len = file_len(fs); if (total_len == 0) return 0; off_t pos = find_pos_rec(fs, line, 0L, total_len); return pos; } static size_t smin(size_t a, off_t b) { return a <= b? a: (size_t)b; } static int add(FILE *fs, char *subj, char *p, char *o) { char line_add[1024*4]; snprintf(line_add, sizeof(line_add), "%s %s %s\n", subj,p,o); off_t seek = find_pos(fs, line_add); char buff[1024*4]; fseeko(fs, seek, SEEK_SET); char *s = fgets(buff, sizeof(buff), fs); if (s != NULL && strcmp(s, line_add) == 0) exit(0); // generate a new file char *new_file = tmpnam(NULL); FILE *new = fopen(new_file, "w"); size_t r, w; fseeko(fs, 0L, SEEK_SET); do { r = fread(buff, 1, smin(sizeof(buff), seek-ftello(fs)), fs); w = fwrite(buff, 1, r, new); } while (w > 0); // make addition fwrite(line_add, strlen(line_add), 1, new); // write rest of the file to new file FILE *rest = tmpfile(); fseeko(fs, seek, SEEK_SET); do { r = fread(buff, 1, sizeof(buff), fs); w = fwrite(buff, 1, r, new); } while (w > 0); fflush(new); int ret = rename(new_file, RDF_FILE); remove(new_file); return ret; } static int rm(FILE *fs, char *s, char *p, char *o) { char tmp[1024]; char line_rm[1024*4]; snprintf(line_rm, sizeof(line_rm), "%s %s %s\n", s,p,o); off_t seek = find_pos(fs, line_rm); //printf("pos: %zd\n", seek); char buff[1024*4]; // check that we actually found a one fseeko(fs, seek, SEEK_SET); char *to_be_removed = fgets(buff, sizeof(buff), fs); if (to_be_removed == NULL || strcmp(line_rm, to_be_removed) != 0) return 1; // generate a new file char *new_file = tmpnam(tmp); FILE *new = fopen(new_file, "w"); size_t r, w; fseeko(fs, 0L, SEEK_SET); do { r = fread(buff, 1, smin(sizeof(buff), seek-ftello(fs)), fs); w = fwrite(buff, 1, r, new); } while (w > 0); // move forward removed line. fseeko(fs, seek, SEEK_SET); fseeko(fs, strlen(line_rm), SEEK_CUR); // write rest of the file to new file do { r = fread(buff, 1, sizeof(buff), fs); w = fwrite(buff, 1, r, new); } while (w > 0); fflush(new); int ret = rename(new_file, RDF_FILE); remove(new_file); return ret; } static void fetch_xaa(FILE *fs) { char buff[1024*4]; fseeko(fs, 0L, SEEK_SET); while (!feof(fs)) { char *s = fgets(buff, sizeof(buff), fs); if (s == NULL) break; char *sp = strchr(s, ' '); size_t len = sp-s; fwrite(s, 1, len, stdout); printf("\n"); } fflush(stdout); } static void fetch_1xa(FILE *fs, char *subj) { char buff[1024*4]; char line[1024*4]; off_t seek = find_pos(fs, subj); fseeko(fs, seek, SEEK_SET); while (!feof(fs)) { char *s = fgets(buff, sizeof(buff), fs); if (s == NULL) break; char *sp = strchr(s, ' '); size_t len = sp-s + 1; snprintf(line, len, "%s", s); //printf("%s %s %d\n", line, subj, len); if (strcmp(subj, line) != 0) break; s = ++sp; sp = strchr(sp, ' '); len = sp-s; fwrite(s, 1, len, stdout); printf("\n"); } fflush(stdout); } static void fetch_11x(FILE *fs, char *subj, char *pred) { char buff[1024*4]; char line[1024*4]; char test[1024*4]; snprintf(test, sizeof(test), "%s %s ", subj, pred); off_t seek = find_pos(fs, test); fseeko(fs, seek, SEEK_SET); while (!feof(fs)) { const char *s = fgets(buff, sizeof(buff), fs); if (s == NULL) break; char *sp = strchr(s, ' '); sp++; sp = strchr(sp, ' '); sp++; size_t len = sp-s + 1; snprintf(line, len, "%s", s); //printf("%s %s %d\n", line, test, len); if (strcmp(test, line) != 0) break; len = strlen(s) - (sp - s); fwrite(sp, 1, len, stdout); // last has new line printf("\n"); } fflush(stdout); } static void print_help() { g_print("This is triple-git: an RDFstorage on top of git.\n\n" "Available commands are:\n" " %s <file> add <subj> <pred> <object or literal>\n", APP); } int main(int argc, char *argv[]) { APP = argv[0]; if (argc < 3) { print_help(); return 0; } char *file = argv[1]; RDF_FILE = file; FILE *fs = fopen(file, "r+"); if (fs == NULL) { g_print("Error opening file %s", file); return 1; } // <cmd> <file> add <subj> <pred> <obj/literal> if (g_strcmp0(argv[2], "add") == 0) { if (argc != 6) { g_print("Waiting for five arguments.\n\n"); print_help(); return 1; } char *s = argv[3], *p = argv[4], *o = argv[5]; return add(fs, s,p,o); } else if (g_strcmp0(argv[2], "rm") == 0) { if (argc != 6) { g_print("Waiting for five arguments.\n\n"); print_help(); return 1; } char *s = argv[3], *p = argv[4], *o = argv[5]; return rm(fs, s,p,o); } else if (g_strcmp0(argv[2], "xaa") == 0) { if (argc != 3) { g_print("Waiting for two arguments.\n\n"); print_help(); return 1; } fetch_xaa(fs); } else if (g_strcmp0(argv[2], "1xa") == 0) { if (argc != 4) { g_print("Waiting for three arguments.\n\n"); print_help(); return 1; } fetch_1xa(fs, argv[3]); } else if (g_strcmp0(argv[2], "11x") == 0) { if (argc != 5) { g_print("Waiting for four arguments.\n\n"); print_help(); return 1; } fetch_11x(fs, argv[3], argv[4]); } else { print_help(); return 1; } return 0; }
package backend.api.rest.application.v21.impl; import com.liferay.petra.string.StringPool; import com.liferay.portal.kernel.json.JSONArray; import com.liferay.portal.kernel.json.JSONException; import com.liferay.portal.kernel.json.JSONFactoryUtil; import com.liferay.portal.kernel.json.JSONObject; import com.liferay.portal.kernel.log.Log; import com.liferay.portal.kernel.log.LogFactoryUtil; import com.liferay.portal.kernel.messaging.Message; import com.liferay.portal.kernel.messaging.MessageBusException; import com.liferay.portal.kernel.messaging.MessageBusUtil; import com.liferay.portal.kernel.model.Company; import com.liferay.portal.kernel.model.Group; import com.liferay.portal.kernel.model.User; import com.liferay.portal.kernel.search.Field; import com.liferay.portal.kernel.service.<API key>; import com.liferay.portal.kernel.service.ServiceContext; import com.liferay.portal.kernel.util.GetterUtil; import com.liferay.portal.kernel.util.Validator; import java.io.File; import java.net.URLEncoder; import java.util.Locale; import javax.servlet.http.HttpServletResponse; import javax.ws.rs.core.Context; import javax.ws.rs.core.HttpHeaders; import javax.ws.rs.core.Response; import javax.ws.rs.core.Response.ResponseBuilder; import org.opencps.dossiermgt.action.util.ConstantUtils; import org.opencps.dossiermgt.action.util.<API key>; import org.opencps.dossiermgt.model.DocumentType; import org.opencps.dossiermgt.service.<API key>; import org.opencps.rest.application.api.StatisticReportApi; import backend.api.rest.application.utils.ConstantTerm; public class <API key> implements StatisticReportApi { @Context private User user; @Context private Company company; @Context private HttpHeaders header; @Context HttpServletResponse response; ServiceContext serviceContext = new ServiceContext(); private static Log _log = LogFactoryUtil.getLog(<API key>.class); @Override public Object <API key>(User user, Company company, Locale locale, HttpHeaders httpHeaders, ServiceContext serviceContext, String code, String body) { _log.info("====START PRINT REPORT==== "); File file = null; long userId = user.getUserId(); long groupId = GetterUtil.getLong(header.getHeaderString(Field.GROUP_ID)); Group group = <API key>.fetchGroup(groupId); String siteName = group.getNameCurrentValue(); serviceContext.setUserId(userId); DocumentType docType = <API key>.getByTypeCode(groupId, code); String documentScript; String reportType = ConstantTerm.PDF_TYPE; try { JSONObject bodyObj = JSONFactoryUtil.createJSONObject(body); if (bodyObj.has(ConstantTerm.JSON_REPORT_TYPE)) { reportType = bodyObj.getString(ConstantTerm.JSON_REPORT_TYPE); } } catch (JSONException e) { _log.debug(e); _log.error("Report Type JSONException"); } if (docType != null) { documentScript = docType.getDocumentScript(); Message message = new Message(); message.put(ConstantTerm.JSON_FORM_REPORT, documentScript); message.put(ConstantTerm.JSON_REPORT_TYPE, reportType); JSONObject resultObject = doGetFormData(code, body, siteName); message.put(ConstantTerm.JSON_FORM_DATA, resultObject); try { String previewResponse = (String) MessageBusUtil .<API key>(ConstantTerm.<API key>, message, 10000); if (Validator.isNotNull(previewResponse)) { file = new File(previewResponse); ResponseBuilder responseBuilder = Response.ok((Object) file); String rootFileName = docType.getDocumentName(); try { rootFileName = URLEncoder.encode(docType.getDocumentName(), ConstantTerm.UTF_8); } catch (Exception e) { _log.debug(e); } if (ConstantTerm.EXCEL_TYPE.equals(reportType)) { responseBuilder.header(<API key>.get(ConstantUtils.TYPE_DISPOSITON), <API key>.get(ConstantUtils.<API key>) + rootFileName + backend.api.rest.application.utils.<API key>.get(ConstantTerm.EXTENSION_XLS)); // responseBuilder.header(ConstantUtils.CONTENT_TYPE, "application/vnd.<API key>.spreadsheetml.sheet"); responseBuilder.header(ConstantUtils.CONTENT_TYPE, backend.api.rest.application.utils.<API key>.get(ConstantTerm.<API key>)); // responseBuilder.header("<API key>", "binary"); } else if (ConstantTerm.WORD_TYPE.equals(reportType)) { responseBuilder.header(<API key>.get(ConstantUtils.TYPE_DISPOSITON), <API key>.get(ConstantUtils.<API key>) + rootFileName + backend.api.rest.application.utils.<API key>.get(ConstantTerm.EXTENSION_DOC)); responseBuilder.header(ConstantUtils.CONTENT_TYPE, backend.api.rest.application.utils.<API key>.get(ConstantTerm.<API key>)); // responseBuilder.header(ConstantUtils.CONTENT_TYPE, "application/octet-stream"); // responseBuilder.header("<API key>", "binary"); } else { responseBuilder.header(<API key>.get(ConstantUtils.TYPE_DISPOSITON), <API key>.get(ConstantUtils.<API key>) + rootFileName + backend.api.rest.application.utils.<API key>.get(ConstantTerm.EXTENSION_PDF)); responseBuilder.header(ConstantUtils.CONTENT_TYPE, backend.api.rest.application.utils.<API key>.get(ConstantTerm.<API key>)); } return responseBuilder.build(); } _log.info("====END PRINT REPORT==== "); } catch (MessageBusException e) { _log.debug(e); _log.error("====PRINT REPORT ERROR==== "); return Response.status(HttpServletResponse.SC_CONFLICT).build(); } } return Response.status(HttpServletResponse.SC_NOT_FOUND).build(); } private JSONObject doGetFormData(String code, String body, String siteName) { _log.info("====START GET FORM DATA==== "); JSONObject result = JSONFactoryUtil.createJSONObject(); switch (code) { case ConstantTerm.REPORT_01: result = getFormDataReport01(body, siteName); break; case ConstantTerm.REPORT_02: result = <API key>(body, siteName); break; case ConstantTerm.REPORT_03: result = <API key>(body, siteName); break; case ConstantTerm.REPORT_04: result = <API key>(body, siteName); break; case ConstantTerm.REPORT_05: result = <API key>(body, siteName); break; case ConstantTerm.REPORT_06: result = <API key>(body, siteName); break; case ConstantTerm.REPORT_07: // result = getFormDataReport07(body); break; case ConstantTerm.REPORT_08: // result = getFormDataReport08(body); break; case ConstantTerm.REPORT_09: result = <API key>(body, siteName); break; case ConstantTerm.REPORT_10: result = <API key>(body, siteName); break; default: result = JSONFactoryUtil.createJSONObject(); } _log.info("====END GET FORM DATA==== "); return result; } private JSONObject <API key>(String body, String siteName) { // TODO Auto-generated method stub return null; } private JSONObject <API key>(String body, String siteName) { _log.info("====START GET DATA REPORT DETAIL==== "); JSONObject result = JSONFactoryUtil.createJSONObject(); try { JSONObject resultBody = JSONFactoryUtil.createJSONObject(body); result.put(ConstantTerm.JSON_YEAR, resultBody.getInt(ConstantTerm.JSON_YEAR)); result.put(ConstantTerm.JSON_MONTH, resultBody.getInt(ConstantTerm.JSON_MONTH)); result.put(ConstantTerm.<API key>, siteName); result.put(ConstantTerm.JSON_FROMDATE, resultBody.getString(ConstantTerm.JSON_FROMDATE)); result.put(ConstantTerm.JSON_TODATE, resultBody.getString(ConstantTerm.JSON_TODATE)); result.put(ConstantTerm.JSON_ACTION_USER, StringPool.BLANK); JSONArray dossierData = resultBody.getJSONArray(ConstantUtils.DATA); JSONObject currentObject = null; JSONObject domainRaw = JSONFactoryUtil.createJSONObject(); JSONObject dossierRaw = JSONFactoryUtil.createJSONObject(); for (int i = 0; i < dossierData.length(); i++) { currentObject = dossierData.getJSONObject(i); JSONObject domainRawItem = JSONFactoryUtil.createJSONObject(); domainRawItem.put(ConstantTerm.JSON_DOMAIN_NAME, currentObject.getString(ConstantTerm.JSON_DOMAIN_NAME)); domainRawItem.put(ConstantTerm.JSON_SERVICES, JSONFactoryUtil.createJSONArray()); if (Validator.isNull(domainRaw.getJSONObject(currentObject.getString(ConstantTerm.JSON_DOMAIN_NAME)))) { domainRaw.put(currentObject.getString(ConstantTerm.JSON_DOMAIN_NAME), domainRawItem); } if (Validator.isNotNull(dossierRaw.getJSONObject(currentObject.getString(ConstantTerm.JSON_SERVICE_CODE)))) { if (dossierRaw.getJSONObject(currentObject.getString(ConstantTerm.JSON_SERVICE_CODE)).getString(ConstantTerm.JSON_SERVICE_CODE) .equalsIgnoreCase(currentObject.getString(ConstantTerm.JSON_SERVICE_CODE))) { dossierRaw.getJSONObject(currentObject.getString(ConstantTerm.JSON_SERVICE_CODE)).getJSONArray(ConstantTerm.JSON_DOSSIERS) .put(currentObject); } } else { JSONObject dossierRawItem = JSONFactoryUtil.createJSONObject(); dossierRawItem.put(ConstantTerm.JSON_SERVICE_CODE, currentObject.getString(ConstantTerm.JSON_SERVICE_CODE)); dossierRawItem.put(ConstantTerm.JSON_SERVICE_NAME, currentObject.getString(ConstantTerm.JSON_SERVICE_NAME)); dossierRawItem.put(ConstantTerm.JSON_DOMAIN_NAME, currentObject.getString(ConstantTerm.JSON_DOMAIN_NAME)); dossierRawItem.put(ConstantTerm.JSON_DOSSIERS, JSONFactoryUtil.createJSONArray()); dossierRaw.put(currentObject.getString(ConstantTerm.JSON_SERVICE_CODE), dossierRawItem); dossierRaw.getJSONObject(currentObject.getString(ConstantTerm.JSON_SERVICE_CODE)).getJSONArray(ConstantTerm.JSON_DOSSIERS) .put(currentObject); } } JSONArray keys = dossierRaw.names(); for (int i = 0; i < keys.length(); ++i) { String key = keys.getString(i); JSONObject keyObject = dossierRaw.getJSONObject(key); if (Validator.isNotNull(keyObject)) { if (Validator.isNotNull(domainRaw.getString(keyObject.getString(ConstantTerm.JSON_DOMAIN_NAME))) && domainRaw.getJSONObject(keyObject.getString(ConstantTerm.JSON_DOMAIN_NAME)).getString(ConstantTerm.JSON_DOMAIN_NAME) .equalsIgnoreCase(keyObject.getString(ConstantTerm.JSON_DOMAIN_NAME))) { domainRaw.getJSONObject(keyObject.getString(ConstantTerm.JSON_DOMAIN_NAME)).getJSONArray(ConstantTerm.JSON_SERVICES) .put(keyObject); } } } JSONArray domains = JSONFactoryUtil.createJSONArray(); keys = domainRaw.names(); for (int i = 0; i < keys.length(); ++i) { String key = keys.getString(i); JSONObject keyObject = domainRaw.getJSONObject(key); if (Validator.isNotNull(key)) { JSONObject domainRawItem = JSONFactoryUtil.createJSONObject(); domainRawItem.put(ConstantTerm.JSON_DOMAIN_NAME, key); domainRawItem.put(ConstantTerm.JSON_SERVICES, keyObject.getJSONArray(ConstantTerm.JSON_SERVICES)); domains.put(domainRawItem); } } _log.info("====END GET DATA REPORT DETAIL==== "); result.put(ConstantTerm.DOMAINS, domains); } catch (JSONException e) { _log.error(e); } return result; } private JSONObject getFormDataReport01(String body, String siteName) { _log.info("====START GET DATA REPORT 01==== "); JSONObject result = JSONFactoryUtil.createJSONObject(); try { JSONObject resultBody = JSONFactoryUtil.createJSONObject(body); int year = resultBody.getInt(ConstantTerm.JSON_YEAR); int month = resultBody.getInt(ConstantTerm.JSON_MONTH); String fromStatisticDate = resultBody.getString(ConstantTerm.<API key>); String toStatisticDate = resultBody.getString(ConstantTerm.<API key>); if (year > 0 || month > 0) { result.put(ConstantTerm.JSON_YEAR, year); result.put(ConstantTerm.JSON_MONTH, month); } else if (Validator.isNotNull(fromStatisticDate) || Validator.isNotNull(toStatisticDate)){ result.put(ConstantTerm.<API key>, fromStatisticDate); result.put(ConstantTerm.<API key>, toStatisticDate); } result.put(ConstantTerm.<API key>, siteName); //Process statistic all agency int flagAgency = resultBody.getInt(ConstantTerm.JSON_FLAG_AGENCY); result.put(ConstantTerm.JSON_FLAG_AGENCY, flagAgency); JSONArray statistics = resultBody.getJSONArray(ConstantUtils.DATA); JSONArray statisticsData = JSONFactoryUtil.createJSONArray(); if (statistics.length() > 0) { result.put(ConstantTerm.JSON_NODATA, 1); } JSONObject currentObject = null; if (flagAgency > 0) { for (int i = 0; i < statistics.length(); i++) { currentObject = statistics.getJSONObject(i); if (Validator.isNull(currentObject.getString(ConstantTerm.JSON_DOMAIN_NAME)) && Validator.isNull(currentObject.getString(ConstantTerm.<API key>))) { result.put(ConstantTerm.JSON_TOTAL_3, currentObject.getInt(ConstantTerm.JSON_TOTAL_COUNT)); result.put(ConstantTerm.JSON_TOTAL_4, currentObject.getInt(ConstantTerm.JSON_DENIED_COUNT)); result.put(ConstantTerm.JSON_TOTAL_5, currentObject.getInt(ConstantTerm.<API key>)); result.put(ConstantTerm.JSON_TOTAL_6, currentObject.getInt(ConstantTerm.JSON_PROCESS_COUNT)); result.put(ConstantTerm.JSON_TOTAL_7, currentObject.getInt(ConstantTerm.<API key>)); result.put(ConstantTerm.JSON_TOTAL_8, currentObject.getInt(ConstantTerm.JSON_RECEIVED_COUNT)); result.put(ConstantTerm.JSON_TOTAL_9, currentObject.getInt(ConstantTerm.JSON_ONEGATE_COUNT)); result.put(ConstantTerm.JSON_TOTAL_10, currentObject.getInt(ConstantTerm.JSON_ONLINE_COUNT)); result.put(ConstantTerm.JSON_TOTAL_11, currentObject.getInt(ConstantTerm.JSON_RELEASE_COUNT)); result.put(ConstantTerm.JSON_TOTAL_12, currentObject.getInt(ConstantTerm.JSON_BETIMES_COUNT)); result.put(ConstantTerm.JSON_TOTAL_13, currentObject.getInt(ConstantTerm.JSON_ONTIME_COUNT)); result.put(ConstantTerm.JSON_TOTAL_14, currentObject.getInt(ConstantTerm.JSON_OVERTIME_COUNT)); result.put(ConstantTerm.JSON_TOTAL_15, currentObject.getInt(ConstantTerm.<API key>)); result.put(ConstantTerm.JSON_TOTAL_16, currentObject.getInt(ConstantTerm.<API key>)); result.put(ConstantTerm.JSON_TOTAL_17, currentObject.getInt(ConstantTerm.JSON_DONE_COUNT)); result.put(ConstantTerm.JSON_TOTAL_18, currentObject.getInt(ConstantTerm.<API key>)); result.put(ConstantTerm.JSON_TOTAL_19, currentObject.getInt(ConstantTerm.<API key>)); result.put(ConstantTerm.JSON_TOTAL_20, currentObject.getInt(ConstantTerm.<API key>)); result.put(ConstantTerm.JSON_TOTAL_21, currentObject.getInt(ConstantTerm.JSON_UNDUE_COUNT)); result.put(ConstantTerm.JSON_TOTAL_22, currentObject.getInt(ConstantTerm.JSON_OVERDUE_COUNT)); result.put(ConstantTerm.JSON_TOTAL_23, currentObject.getInt(ConstantTerm.JSON_OUTSIDE_COUNT)); result.put(ConstantTerm.JSON_TOTAL_24, currentObject.getInt(ConstantTerm.JSON_WAITING_COUNT)); result.put(ConstantTerm.JSON_TOTAL_25, currentObject.getInt(ConstantTerm.<API key>)); } else if (Validator.isNull(currentObject.getString(ConstantTerm.JSON_DOMAIN_NAME)) && Validator.isNotNull(currentObject.getString(ConstantTerm.<API key>))) { statisticsData.put(currentObject); } } } else { for (int i = 0; i < statistics.length(); i++) { currentObject = statistics.getJSONObject(i); if (Validator.isNull(currentObject.getString(ConstantTerm.JSON_DOMAIN_NAME)) && Validator.isNotNull(currentObject.getString(ConstantTerm.<API key>))) { // result.put(ConstantTerm.JSON_TOTAL_3, currentObject.getInt(ConstantTerm.JSON_TOTAL_COUNT)); // result.put(ConstantTerm.JSON_TOTAL_4, currentObject.getInt(ConstantTerm.JSON_DENIED_COUNT)); // result.put(ConstantTerm.JSON_TOTAL_5, currentObject.getInt(ConstantTerm.<API key>)); // result.put(ConstantTerm.JSON_TOTAL_6, currentObject.getInt(ConstantTerm.JSON_PROCESS_COUNT)); // result.put(ConstantTerm.JSON_TOTAL_7, currentObject.getInt(ConstantTerm.<API key>)); // result.put(ConstantTerm.JSON_TOTAL_8, currentObject.getInt(ConstantTerm.JSON_RECEIVED_COUNT)); // result.put(ConstantTerm.JSON_TOTAL_9, currentObject.getInt(ConstantTerm.JSON_ONEGATE_COUNT)); // result.put(ConstantTerm.JSON_TOTAL_10, currentObject.getInt(ConstantTerm.JSON_ONLINE_COUNT)); // result.put(ConstantTerm.JSON_TOTAL_11, currentObject.getInt(ConstantTerm.JSON_RELEASE_COUNT)); // result.put(ConstantTerm.JSON_TOTAL_12, currentObject.getInt(ConstantTerm.JSON_BETIMES_COUNT)); // result.put(ConstantTerm.JSON_TOTAL_13, currentObject.getInt(ConstantTerm.JSON_ONTIME_COUNT)); // result.put(ConstantTerm.JSON_TOTAL_14, currentObject.getInt(ConstantTerm.JSON_OVERTIME_COUNT)); // result.put(ConstantTerm.JSON_TOTAL_15, currentObject.getInt(ConstantTerm.<API key>)); // result.put(ConstantTerm.JSON_TOTAL_16, currentObject.getInt(ConstantTerm.<API key>)); // result.put(ConstantTerm.JSON_TOTAL_17, currentObject.getInt(ConstantTerm.<API key>)); // result.put(ConstantTerm.JSON_TOTAL_18, currentObject.getInt(ConstantTerm.JSON_DONE_COUNT)); // result.put(ConstantTerm.JSON_TOTAL_19, currentObject.getInt(ConstantTerm.<API key>)); // result.put(ConstantTerm.JSON_TOTAL_20, currentObject.getInt(ConstantTerm.<API key>)); // result.put(ConstantTerm.JSON_TOTAL_21, currentObject.getInt(ConstantTerm.<API key>)); // result.put(ConstantTerm.JSON_TOTAL_22, currentObject.getInt(ConstantTerm.JSON_UNDUE_COUNT)); // result.put(ConstantTerm.JSON_TOTAL_23, currentObject.getInt(ConstantTerm.JSON_OVERDUE_COUNT)); // result.put(ConstantTerm.JSON_TOTAL_24, currentObject.getInt(ConstantTerm.JSON_WAITING_COUNT)); result.put(ConstantTerm.JSON_TOTAL_3, currentObject.getInt(ConstantTerm.JSON_TOTAL_COUNT)); result.put(ConstantTerm.JSON_TOTAL_4, currentObject.getInt(ConstantTerm.JSON_DENIED_COUNT)); result.put(ConstantTerm.JSON_TOTAL_5, currentObject.getInt(ConstantTerm.<API key>)); result.put(ConstantTerm.JSON_TOTAL_6, currentObject.getInt(ConstantTerm.JSON_PROCESS_COUNT)); result.put(ConstantTerm.JSON_TOTAL_7, currentObject.getInt(ConstantTerm.<API key>)); result.put(ConstantTerm.JSON_TOTAL_8, currentObject.getInt(ConstantTerm.JSON_RECEIVED_COUNT)); result.put(ConstantTerm.JSON_TOTAL_9, currentObject.getInt(ConstantTerm.JSON_ONEGATE_COUNT)); result.put(ConstantTerm.JSON_TOTAL_10, currentObject.getInt(ConstantTerm.JSON_ONLINE_COUNT)); result.put(ConstantTerm.JSON_TOTAL_11, currentObject.getInt(ConstantTerm.JSON_RELEASE_COUNT)); result.put(ConstantTerm.JSON_TOTAL_12, currentObject.getInt(ConstantTerm.JSON_BETIMES_COUNT)); result.put(ConstantTerm.JSON_TOTAL_13, currentObject.getInt(ConstantTerm.JSON_ONTIME_COUNT)); result.put(ConstantTerm.JSON_TOTAL_14, currentObject.getInt(ConstantTerm.JSON_OVERTIME_COUNT)); result.put(ConstantTerm.JSON_TOTAL_15, currentObject.getInt(ConstantTerm.<API key>)); result.put(ConstantTerm.JSON_TOTAL_16, currentObject.getInt(ConstantTerm.<API key>)); result.put(ConstantTerm.JSON_TOTAL_17, currentObject.getInt(ConstantTerm.JSON_DONE_COUNT)); result.put(ConstantTerm.JSON_TOTAL_18, currentObject.getInt(ConstantTerm.<API key>)); result.put(ConstantTerm.JSON_TOTAL_19, currentObject.getInt(ConstantTerm.<API key>)); result.put(ConstantTerm.JSON_TOTAL_20, currentObject.getInt(ConstantTerm.<API key>)); result.put(ConstantTerm.JSON_TOTAL_21, currentObject.getInt(ConstantTerm.JSON_UNDUE_COUNT)); result.put(ConstantTerm.JSON_TOTAL_22, currentObject.getInt(ConstantTerm.JSON_OVERDUE_COUNT)); result.put(ConstantTerm.JSON_TOTAL_23, currentObject.getInt(ConstantTerm.JSON_OUTSIDE_COUNT)); result.put(ConstantTerm.JSON_TOTAL_24, currentObject.getInt(ConstantTerm.JSON_WAITING_COUNT)); result.put(ConstantTerm.JSON_TOTAL_25, currentObject.getInt(ConstantTerm.<API key>)); } else if (Validator.isNotNull(currentObject.getString(ConstantTerm.JSON_DOMAIN_NAME)) && Validator.isNotNull(currentObject.getString(ConstantTerm.<API key>))) { statisticsData.put(currentObject); } } } _log.info("====END GET DATA REPORT 01==== "); result.put(ConstantTerm.STATISTICS, statisticsData); } catch (JSONException e) { _log.error("JSONException: "+e); } return result; } }
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Rgaa 4.0 Test.12.9.1 Failed 01</title> </head> <body class="Failed"> <div> <h1>Rgaa 4.0 Test.12.9.1 Failed 01</h1> <!-- START [test-detail] --> <div class="test-detail" lang="fr"> <p>Dans chaque page web, chaque <a href="https://www.numerique.gouv.fr/publications/rgaa-accessibilite/methode/glossaire/ <ul> <li>Il est possible d’atteindre l’élément suivant ou précédent pouvant recevoir le focus avec la touche de tabulation.</li> <li>L’utilisateur est informé d’un mécanisme fonctionnel permettant d’atteindre au clavier l’élément suivant ou précédent pouvant recevoir le focus.</li> </ul> </div> <!-- END [test-detail] --> <!-- START [testcase] --> <div class="testcase"> </div> <!-- END [testcase] --> <!-- START [test-explanation] --> <div class="test-explanation"> Failed. </div> <!-- END [test-explanation] --> </div> </body> </html>
<?php namespace AppBundle\Form\Type; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\<API key>; use Symfony\Component\OptionsResolver\<API key>; class FiltroPaisType extends AbstractType { /** * @param <API key> $builder * @param array $options */ public function buildForm(<API key> $builder, array $options) { $builder ->add('pais', 'choice', [ 'label' => 'Paises', 'required' => false, 'choices' => $options['paises'], 'empty_value' => 'Todos', 'attr' => ['class' => 'toggle', 'name' => 'pais'] ]) ->add('enviar', 'submit', [ 'label' => ($options['centro']) ? 'Filtrar Centros' : 'Filtrar Familias', 'attr' => ['class' => 'btn volver cbutton <API key>'] ]); } /** * @param <API key> $resolver */ public function setDefaultOptions(<API key> $resolver) { $resolver->setDefaults([ 'paises' => null, 'centro' => false, 'familia' => false ]); } /** * @return string */ public function getName() { return 'filtroPaises'; } }
import { commitMutation, graphql } from "react-relay"; const mutation = graphql` mutation SetPasswordMutation($input: SetPasswordInput!) { setPassword(input: $input) { viewer { MemberReset_viewer } } } `; function commit(environment, input, onCompleted) { const variables = { input, }; return commitMutation(environment, { mutation, variables, onCompleted, }); } export default { commit };
<?php return array( 'does_not_exist' => 'ไม่มีโมเดลนี้', 'assoc_users' => 'โมเดลนี้มีความสัมพันธ์กับสินทรัพย์หนึ่ง หรือมากกว่าในปัจจุบัน และจะไม่สามารถลบได้ กรุณาลบสินทรัพย์และลองอีกครั้ง ', 'create' => array( 'error' => 'ยังไม่ได้สร้างโมเดล กรุณาลองใหม่อีกครั้ง', 'success' => 'สร้างโมเดียลเรียบร้อยแล้ว', 'duplicate_set' => 'มีชื่อโมเดลสินทรัพย์ ผู้ผลิต และหมายเลขโมเดลแล้ว', ), 'update' => array( 'error' => 'ยังไม่ได้ปรับปรุงโมเดล กรุณาลองใหม่อีกครั้ง', 'success' => 'ปรับปรุงโมเดลเรียบร้อยแล้ว' ), 'delete' => array( 'confirm' => 'คุณแน่ใจที่จะลบโมเดลนี้?', 'error' => 'มีปัญหาระหว่างลบโมเดล กรุณาลองใหม่อีกครั้ง.', 'success' => 'ลบโมเดลเรียบร้อยแล้ว' ), 'restore' => array( 'error' => 'ยังไม่ได้กู้คืนโมเดล กรุณาลองใหม่อีกครั้ง', 'success' => 'กู้คืนโมเดลเรียบร้อยแล้ว' ), 'bulkedit' => array( 'error' => 'No fields were changed, so nothing was updated.', 'success' => 'Models updated.' ), );
{% extends "base.html" %} {% block page_content %} <!-- Page Heading/Breadcrumbs --> <div class="row"> <div class="col-lg-12"> <h1 class="page-header"> <small>Submit</small> </h1> <ol class="breadcrumb"> <li><a href="{{ url_for('index.index_page') }}">Home</a> </li> <li class="active">Submit</li> </ol> </div> </div> <!-- /.row --> <div class="row"> <div class="col-lg-12"> <div class="col-lg-1"> </div> <div class="col-lg-10"> <form method="post" class="form-horizontal"> {{ form.hidden_tag() }} <div class="form-group has-feedback{% if form.problem_id.errors %} has-error{% endif %}"> {{ form.problem_id.label(for="inputProblemid", class="col-sm-2 control-label") }} <div class="col-sm-8"> {{ form.problem_id(type="text", class="form-control", placeholder="ID") }} {% if form.problem_id.errors %} <span class="glyphicon glyphicon-remove <API key>" aria-hidden="true"></span> <span id="inputError" class="sr-only">(error)</span> {% for error in form.problem_id.errors %} <span id="helpBlock" class="help-block"> {{ error }} </span> {% endfor%} {% endif %} </div> </div> <div class="form-group has-feedback{% if form.language.errors %} has-error{% endif %}"> {{ form.language.label(for="inputLanguage", class="col-sm-2 control-label") }} <div class="col-sm-8"> {{ form.language(type="text", class="form-control", placeholder="") }} {% if form.language.errors %} <span class="glyphicon glyphicon-remove <API key>" aria-hidden="true"></span> <span id="inputError" class="sr-only">(error)</span> {% for error in form.language.errors %} <span id="helpBlock" class="help-block"> {{ error }} </span> {% endfor%} {% endif %} </div> </div> <div class="form-group has-feedback{% if form.code.errors %} has-error{% endif %}"> <div class="col-sm-2"> </div> <div class="col-sm-8"> {{ form.code(rows="18", type="text", class="form-control") }} {% if form.code.errors %} <span class="glyphicon glyphicon-remove <API key>" aria-hidden="true"></span> <span id="inputError" class="sr-only">(error)</span> {% for error in form.code.errors %} <span id="helpBlock" class="help-block"> {{ error }} </span> {% endfor%} {% endif %} </div> </div> <div class="form-group"> <div class="col-sm-offset-2 col-sm-8"> {{ form.submit(class="btn btn-default btn-block btn btn-primary") }} </div> </div> </form> </div> </div> </div> {% endblock %}
/** * CORE * * This is the set of CSS rules required by Calendar to drive core functionality and structure. * Changes to these rules may result in the Calendar not functioning or rendering correctly. * * They should not be modified for skinning. **/ /* CALENDAR BOUNDING BOX */ .yui-calcontainer { position: relative; float: left; _overflow: hidden; /* IE6 only, to clip iframe shim */ } /* IFRAME SHIM */ .yui-calcontainer iframe { position: absolute; border: none; margin: 0; padding: 0; z-index: 0; width: 100%; height: 100%; left: 0px; top: 0px; } /* IFRAME SHIM IE6 only */ .yui-calcontainer iframe.fixedsize { width: 50em; height: 50em; top: -1px; left: -1px; } /* BOUNDING BOX FOR EACH CALENDAR GROUP PAGE */ .yui-calcontainer.multi .groupcal { z-index: 1; float: left; position: relative; } /* TITLE BAR */ .yui-calcontainer .title { position: relative; z-index: 1; } /* CLOSE ICON CONTAINER */ .yui-calcontainer .close-icon { position: absolute; z-index: 1; text-indent: -10000em; overflow: hidden; } /* CALENDAR TABLE */ .yui-calendar { position: relative; } /* NAVBAR LEFT ARROW CONTAINER */ .yui-calendar .calnavleft { position: absolute; z-index: 1; text-indent: -10000em; overflow: hidden; } /* NAVBAR RIGHT ARROW CONTAINER */ .yui-calendar .calnavright { position: absolute; z-index: 1; text-indent: -10000em; overflow: hidden; } /* NAVBAR TEXT CONTAINER */ .yui-calendar .calheader { position: relative; width: 100%; text-align: center; } /* CalendarNavigator */ .yui-calcontainer .yui-cal-nav-mask { position: absolute; z-index: 2; margin: 0; padding: 0; width: 100%; height: 100%; _width: 0; /* IE6, IE7 quirks - width/height set programmatically to match container */ _height: 0; left: 0; top: 0; display: none; } /* NAVIGATOR BOUNDING BOX */ .yui-calcontainer .yui-cal-nav { position: absolute; z-index: 3; top: 0; display: none; } /* NAVIGATOR BUTTONS (based on button-core.css) */ .yui-calcontainer .yui-cal-nav .yui-cal-nav-btn { display: -moz-inline-box; /* Gecko */ display: inline-block; /* IE, Opera and Safari */ } .yui-calcontainer .yui-cal-nav .yui-cal-nav-btn button { display: block; *display: inline-block; *overflow: visible; /* Remove superfluous padding for IE */ border: none; background-color: transparent; cursor: pointer; } /* Specific changes for calendar running under fonts/reset */ .yui-calendar .calbody a:hover { background: inherit; } p#clear { clear: left; padding-top: 10px; }
DELETE FROM `weenie` WHERE `class_Id` = 10228; INSERT INTO `weenie` (`class_Id`, `class_Name`, `type`, `last_Modified`) VALUES (10228, 'housecottage536', 53, '2019-02-10 00:00:00') /* House */; INSERT INTO `<API key>` (`object_Id`, `type`, `value`) VALUES (10228, 1, 128) /* ItemType - Misc */ , (10228, 5, 10) /* EncumbranceVal */ , (10228, 16, 1) /* ItemUseable - No */ , (10228, 93, 52) /* PhysicsState - Ethereal, IgnoreCollisions, NoDraw */ , (10228, 155, 1) /* HouseType - Cottage */ , (10228, 8041, 101) /* <API key> - Resting */; INSERT INTO `<API key>` (`object_Id`, `type`, `value`) VALUES (10228, 1, True ) /* Stuck */ , (10228, 24, True ) /* UiHidden */; INSERT INTO `<API key>` (`object_Id`, `type`, `value`) VALUES (10228, 39, 0.1) /* DefaultScale */; INSERT INTO `<API key>` (`object_Id`, `type`, `value`) VALUES (10228, 1, 'Cottage') /* Name */; INSERT INTO `<API key>` (`object_Id`, `type`, `value`) VALUES (10228, 1, 0x02000A42) /* Setup */ , (10228, 8, 0x06002181) /* Icon */ , (10228, 30, 152) /* PhysicsScript - <API key> */ , (10228, 8001, 236978192) /* <API key> - Usable, Burden, HouseOwner, HouseRestrictions, PScript */ , (10228, 8003, 148) /* <API key> - Stuck, Attackable, UiHidden */ , (10228, 8005, 163969) /* <API key> - CSetup, ObjScale, Position, AnimationFrame */; INSERT INTO `<API key>` (`object_Id`, `position_Type`, `obj_Cell_Id`, `origin_X`, `origin_Y`, `origin_Z`, `angles_W`, `angles_X`, `angles_Y`, `angles_Z`) VALUES (10228, 8040, 0xCE570104, 83.1647, 153.965, 29.9995, 0.99995, 0, 0, 0.010055) /* <API key> */ /* @teleloc 0xCE570104 [83.164700 153.965000 29.999500] 0.999950 0.000000 0.000000 0.010055 */; INSERT INTO `<API key>` (`object_Id`, `type`, `value`) VALUES (10228, 8000, 0x7CE5709B) /* <API key> */;
Thursday 17th of September 2015 09:26:47 AM Unknown error type: [8] Undefined offset: 226 Error on line 14 in file /home/starsquest/servers/game/includes/libs/opbe/implementations/2Moons/1_6_1_injectionmode/LangImplementation.php, PHP 5.4.36-0+deb7u3 (Linux) $_POST = $_GET = <table class="lined widthFull"> <caption> <br> 0% - 0% - 0%</caption> <thead> <tr> <th>Großer Transporter</th> <th>array ( 'slots' => '2', 'battleinput' => array ( 0 => array ( 1 => array ( 1 => '6', 2 => '2', 3 => '1', 109 => '0', 110 => '0', 111 => '0', 202 => '0', 203 => '900000000000', 204 => '0', 205 => '0', 206 => '0', 207 => '0', 208 => '0', 209 => '0', 210 => '0', 211 => '0', 213 => '0', 214 => '0', 215 => '0', 225 => '0', 226 => '1', 401 => '16616465', 402 => '798354943', 403 => '262540151', 404 => '1630448267', 405 => '425381511', 406 => '2390864974', 407 => '1', 408 => '1', 212 => '1605000000000', ), 0 => array ( 109 => '20', 110 => '20', 111 => '19', 202 => '0', 203 => '0', 204 => '0', 205 => '0', 206 => '0', 207 => '0', 208 => '0', 209 => '0', 210 => '0', 211 => '', 213 => '10245257516272', 214 => '0', 215 => '0', 225 => '0', 226 => '0', ), ), ), )array ( 'page' => 'battlesim', 'action' => 'send', )
namespace InfinniPlatform.PrintView.Expressions.CompiledExpressions { internal class ConstantExpression : ICompiledExpression { public static readonly ConstantExpression Null = new ConstantExpression(null); private readonly object _value; public ConstantExpression(object value) { _value = value; } public object Execute(object dataContext, ExpressionScope scope) { return _value; } } }
const dns = require('dns') const localIP = '192.168.178.0' // TODO: make local IP a variable or in config file function <API key> (packetArray) { var routesArray = [] for (var packet in packetArray) { try { routesArray.push(getRouteFromPacket(packet)) } catch (exception) { console.log(exception) } } } function getRouteFromPacket (packet) { switch (packet.payload.ethertype) { case 0x800: // console.log('Ipv4') return handleIPv4Packet(packet.payload.payload) case 0x86dd: // console.log('Ipv6') return handleIPv6Packet(packet.payload.payload) default: throw new Error('Don\'t know how to handle this packet of ethertype ' + packet.payload.ethertype) } } // TODO: check if packet is valid, check if IPs are valid function handleIPv4Packet (packet) { var route = { senderIP: packet.saddr.toString(), receiverIP: packet.daddr.toString() } // console.log('IPv4: ', result) return route } // TODO: same as IPv4 function handleIPv6Packet (packet) { console.log('Ipv6 in function') return 'IPv6 Packet' } // TODO: check if IP valid, return ipAddress if dns.reverse fails function reverseLookupOfIP (ipAddress) { // console.log(ipAddress) return new Promise((resolve, reject) => { dns.reverse(ipAddress, (err, domains) => { if (err) { reject(err) } // console.log('reverse for ' + ipAddress + ': ' + domains) resolve(domains) }) }) } // TODO: check if IPs valid function getLocalAddress (sender, receiver) { if (getNetworkPartOfIP(sender) === getNetworkPartOfIP(localIP)) { return {local: sender, receiver} } else { // if sender is not local, then receiver must be local return {local: receiver, receiver: sender} } } // TODO: check if IP valid function getNetworkPartOfIP (ipAddress) { return ipAddress.substring(0, ipAddress.lastIndexOf('.')) } module.exports = { reverseLookupOfIP, <API key>, getRouteFromPacket, getLocalAddress }
html, body { margin: 0; padding: 0; font-family: Consolas, Monospace; font-size: 12px; } p, div { margin: 0; padding: 0; } p { padding: 2px 5px; } p.lineError { background-color: #FFD8D8; border-bottom: 1px dashed #FF9696 } span.error { color: #F00; min-width: 5px; border-bottom: 1px solid #F00; }
/** * Utility functions for manipulating the data from files, like reading it into memory * and converting between the different formats we use */ #include "util.h" #include <stdio.h> #include <string.h> #include "lines.h" /** * This reads data from the given file pointer into memory, breaking it into segments * of the given number of lines, to ease memory management issues at the cost of some * overhead. This assumes that the file consists entirely of quality scores with no * other lines in between * @param path Path of the file to read * @param info Information structure to store in, this must be a valid pointer already * @param max_lines Maximum number of lines to read, will override the actual number in the file if >0 */ uint32_t load_file(const char *path, struct quality_file_t *info, uint64_t max_lines) { uint32_t status, block_idx, line_idx; uint32_t j; char line[READ_LINEBUF_LENGTH]; FILE *fp; struct _stat finfo; // Load metadata into the info structure info->path = strdup(path); fp = fopen(path, "rt"); if (!fp) { return LF_ERROR_NOT_FOUND; } // Use the first line to figure out how long the file is fgets(line, READ_LINEBUF_LENGTH, fp); info->columns = strlen(line) - 1; if (info->columns > MAX_READS_PER_LINE) { fclose(fp); return LF_ERROR_TOO_LONG; } // Figure out how many lines we'll need depending on whether we were limited or not _stat(path, &finfo); info->lines = finfo.st_size / ((uint64_t) (info->columns+1)); if (max_lines > 0 && info->lines > max_lines) { info->lines = max_lines; } status = alloc_blocks(info); if (status != LF_ERROR_NONE) return status; // Process the file block_idx = 0; line_idx = 0; fseek(fp, 0, SEEK_SET); while (!feof(fp) && (block_idx * MAX_LINES_PER_BLOCK + line_idx) < info->lines) { // Read line and store in our array with data conversion, also stripping newlines fgets(line, READ_LINEBUF_LENGTH, fp); for (j = 0; j < info->columns; ++j) { info->blocks[block_idx].lines[line_idx].data[j] = line[j] - 33; } // Increment line/block pointers as necesary line_idx += 1; if (line_idx == info->blocks[block_idx].count) { line_idx = 0; block_idx += 1; } } fclose(fp); return LF_ERROR_NONE; } /** * Allocate an array of line block pointers and the memory within each block, so that we can * use it to store the results of reading the file */ uint32_t alloc_blocks(struct quality_file_t *info) { uint64_t lines_left = info->lines; symbol_t *sym_buf; double *dist_buf; struct line_block_t *cblock; struct line_t *cline; uint32_t i; // Figure out how many blocks we'll need to store this file info->block_count = (uint32_t) (info->lines / (uint64_t)MAX_LINES_PER_BLOCK); if (info->block_count * MAX_LINES_PER_BLOCK != info->lines) { info->block_count += 1; } info->blocks = (struct line_block_t *) calloc(info->block_count, sizeof(struct line_block_t)); if (!info->blocks) { return LF_ERROR_NO_MEMORY; } cblock = info->blocks; while (lines_left > 0) { // Figure out how many lines we'll have in this block if (lines_left > MAX_LINES_PER_BLOCK) { lines_left -= MAX_LINES_PER_BLOCK; cblock->count = MAX_LINES_PER_BLOCK; } else { cblock->count = (uint32_t) lines_left; lines_left = 0; } // Allocate symbol buffer and array of line info structs for the block sym_buf = (symbol_t *) calloc(cblock->count, info->columns*sizeof(symbol_t)); dist_buf = (double *) calloc(cblock->count, info->cluster_count*sizeof(double)); cblock->lines = (struct line_t *) calloc(cblock->count, sizeof(struct line_t)); cline = cblock->lines; if (!sym_buf || !cblock->lines || !dist_buf) { return LF_ERROR_NO_MEMORY; } // Save pointers into the symbol buffer for each line in the block for (i = 0; i < cblock->count; ++i) { cline->data = sym_buf; cline->distances = dist_buf; cline += 1; sym_buf += info->columns; dist_buf += info->cluster_count; } // Advance to the next line block cblock += 1; } return LF_ERROR_NONE; } /** * Deallocates the memory used to store file information in blocks */ void free_blocks(struct quality_file_t *info) { // Array of block pointers is a single allocation // For each block, array of lines and array of symbols are both single allocations uint32_t i; for (i = 0; i < info->block_count; ++i) { free(info->blocks[i].lines[0].data); free(info->blocks[i].lines[0].distances); free(info->blocks[i].lines); } free(info->blocks); }
using ACE.Server.Network.Enum; using ACE.Server.Network.GameMessages; using ACE.Server.Network.GameMessages.Messages; namespace ACE.Server.Network.Handlers { public static class DDDHandler { [GameMessage(GameMessageOpcode.<API key>, SessionState.AuthConnected)] public static void <API key>(ClientMessage message, Session session) { <API key> patchStatusMessage = new <API key>(); session.Network.EnqueueSend(patchStatusMessage); } [GameMessage(GameMessageOpcode.DDD_EndDDD, SessionState.AuthConnected)] public static void DDD_EndDDD(ClientMessage message, Session session) { // We don't need to reply to this message. } } }
package org.yamcs.algorithms; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; import java.util.Map; import org.junit.After; import org.junit.Before; import org.junit.BeforeClass; import org.junit.Test; import org.yamcs.<API key>; import org.yamcs.Processor; import org.yamcs.ProcessorFactory; import org.yamcs.<API key>; import org.yamcs.YConfiguration; import org.yamcs.events.<API key>; import org.yamcs.parameter.ParameterConsumer; import org.yamcs.parameter.<API key>; import org.yamcs.parameter.ParameterValue; import org.yamcs.xtce.Parameter; import org.yamcs.xtce.XtceDb; import org.yamcs.xtceproc.XtceDbFactory; import static org.yamcs.algorithms.<API key>.getPwc; /** * Just a small sanity check to verify python/jython still works. Uses algorithms in the spreadsheet that are * interpreted the same in javascript and python */ public class <API key> { @BeforeClass public static void setUpBeforeClass() throws Exception { YConfiguration.setupTest(instance); XtceDbFactory.reset(); // org.yamcs.LoggingUtils.enableLogging(); } static String instance = "refmdb"; private XtceDb db; private Processor processor; private <API key> tmGenerator; private <API key> prm; @Before public void beforeEachTest() throws Exception { <API key>.setMockup(true); db = XtceDbFactory.getInstance(instance); assertNotNull(db.getParameter("/REFMDB/SUBSYS1/FloatPara1_1_2")); tmGenerator = new <API key>(); Map<String, Object> jslib = new HashMap<>(); Map<String, Object> config = new HashMap<>(); jslib.put("python", Arrays.asList("mdb/algolib.py")); jslib.put("JavaScript", Arrays.asList("mdb/algolib.js")); config.put("libraries", jslib); AlgorithmManager am = new AlgorithmManager(); processor = ProcessorFactory.create("refmdb", "<API key>", getPwc(tmGenerator, YConfiguration.emptyConfig()), getPwc(am, YConfiguration.wrap(config))); prm = processor.<API key>(); } @After public void afterEachTest() { // Prevents us from wrapping our code in try-finally processor.quit(); } @Test public void testFloats() throws <API key> { final ArrayList<ParameterValue> params = new ArrayList<>(); Parameter p = prm.getParameter("/REFMDB/SUBSYS1/AlgoFloatAdditionPy"); prm.addRequest(p, (ParameterConsumer) (subscriptionId, items) -> params.addAll(items)); processor.start(); tmGenerator.generate_PKT1_1(); assertEquals(1, params.size()); assertEquals(2.1672918, params.get(0).getEngValue().getFloatValue(), 0.001); } @Test public void testSignedIntegers() throws <API key> { final ArrayList<ParameterValue> params = new ArrayList<>(); prm.addRequest(Arrays.asList( prm.getParameter("/REFMDB/SUBSYS1/<API key>"), prm.getParameter("/REFMDB/SUBSYS1/<API key>"), prm.getParameter("/REFMDB/SUBSYS1/<API key>"), prm.getParameter("/REFMDB/SUBSYS1/<API key>")), (ParameterConsumer) (subscriptionId, items) -> params.addAll(items)); processor.start(); tmGenerator.generate_PKT1_8(2, -2); assertEquals(4, params.size()); assertEquals(2, params.get(0).getEngValue().getSint32Value()); assertEquals(-2, params.get(1).getEngValue().getSint32Value()); assertEquals(-2, params.get(2).getEngValue().getSint32Value()); assertEquals(2, params.get(3).getEngValue().getSint32Value()); } @Test public void testExternalLibrary() throws <API key> { final ArrayList<ParameterValue> params = new ArrayList<>(); prm.addRequest(prm.getParameter("/REFMDB/SUBSYS1/AlgoFloatDivisionPy"), (ParameterConsumer) (subscriptionId, items) -> params.addAll(items)); processor.start(); tmGenerator.generate_PKT1_1(); assertEquals(1, params.size()); assertEquals(tmGenerator.pIntegerPara1_1_1, params.get(0).getEngValue().getFloatValue() * 3, 0.001); } }
namespace LQT.GUI.Quantification { partial class FrmMorbidity { <summary> Required designer variable. </summary> private System.ComponentModel.IContainer components = null; <summary> Clean up any resources being used. </summary> <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> protected override void Dispose(bool disposing) { if (disposing && (components != null)) { components.Dispose(); } base.Dispose(disposing); } #region Windows Form Designer generated code <summary> Required method for Designer support - do not modify the contents of this method with the code editor. </summary> private void InitializeComponent() { this.taskPane1 = new Microsoft.Samples.Windows.Forms.TaskPane.TaskPane(); this.taskFrame1 = new Microsoft.Samples.Windows.Forms.TaskPane.TaskFrame(); this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel(); this.taskFrame2 = new Microsoft.Samples.Windows.Forms.TaskPane.TaskFrame(); this.flowLayoutPanel2 = new System.Windows.Forms.FlowLayoutPanel(); this.panel1 = new System.Windows.Forms.Panel(); this.txtstartdate = new System.Windows.Forms.TextBox(); this.txtbudgetend = new System.Windows.Forms.TextBox(); this.txtbudgetstart = new System.Windows.Forms.TextBox(); this.txttitle = new System.Windows.Forms.TextBox(); this.txtdescription = new System.Windows.Forms.TextBox(); this.label9 = new System.Windows.Forms.Label(); this.label6 = new System.Windows.Forms.Label(); this.label5 = new System.Windows.Forms.Label(); this.label2 = new System.Windows.Forms.Label(); this.label1 = new System.Windows.Forms.Label(); this.groupBox1 = new System.Windows.Forms.GroupBox(); this.button7 = new System.Windows.Forms.Button(); this.button6 = new System.Windows.Forms.Button(); this.button5 = new System.Windows.Forms.Button(); this.button4 = new System.Windows.Forms.Button(); this.button3 = new System.Windows.Forms.Button(); this.button2 = new System.Windows.Forms.Button(); this.button1 = new System.Windows.Forms.Button(); this.taskPane1.SuspendLayout(); this.taskFrame1.SuspendLayout(); this.taskFrame2.SuspendLayout(); this.panel1.SuspendLayout(); this.groupBox1.SuspendLayout(); this.SuspendLayout(); // taskPane1 this.taskPane1.AutoScroll = true; this.taskPane1.AutoScrollMinSize = new System.Drawing.Size(0, 1078); this.taskPane1.BackColor = System.Drawing.SystemColors.ActiveCaption; this.taskPane1.Controls.Add(this.taskFrame1); this.taskPane1.Controls.Add(this.taskFrame2); this.taskPane1.Dock = System.Windows.Forms.DockStyle.Fill; this.taskPane1.Location = new System.Drawing.Point(0, 151); this.taskPane1.Name = "taskPane1"; this.taskPane1.Size = new System.Drawing.Size(1008, 551); this.taskPane1.TabIndex = 0; this.taskPane1.FrameExpanded += new Microsoft.Samples.Windows.Forms.TaskPane.<API key>(this.<API key>); this.taskPane1.FrameExpanding += new Microsoft.Samples.Windows.Forms.TaskPane.<API key>(this.<API key>); // taskFrame1 this.taskFrame1.AllowDrop = true; this.taskFrame1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(196)))), ((int)(((byte)(200)))), ((int)(((byte)(212))))); this.taskFrame1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.taskFrame1.CaptionBlend = new Microsoft.Samples.Windows.Forms.TaskPane.BlendFill(Microsoft.Samples.Windows.Forms.TaskPane.BlendStyle.Horizontal, System.Drawing.Color.FromArgb(((int)(((byte)(244)))), ((int)(((byte)(247)))), ((int)(((byte)(252))))), System.Drawing.Color.FromArgb(((int)(((byte)(196)))), ((int)(((byte)(200)))), ((int)(((byte)(212)))))); this.taskFrame1.Controls.Add(this.flowLayoutPanel1); this.taskFrame1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold); this.taskFrame1.ForeColor = System.Drawing.SystemColors.HotTrack; this.taskFrame1.Location = new System.Drawing.Point(12, 33); this.taskFrame1.Name = "taskFrame1"; this.taskFrame1.Size = new System.Drawing.Size(966, 500); this.taskFrame1.TabIndex = 1; this.taskFrame1.Text = "Supply & Procurement Forecast Result"; // flowLayoutPanel1 this.flowLayoutPanel1.AutoScroll = true; this.flowLayoutPanel1.AutoSize = true; this.flowLayoutPanel1.BackColor = System.Drawing.Color.White; this.flowLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill; this.flowLayoutPanel1.Location = new System.Drawing.Point(0, 0); this.flowLayoutPanel1.Name = "flowLayoutPanel1"; this.flowLayoutPanel1.Size = new System.Drawing.Size(964, 498); this.flowLayoutPanel1.TabIndex = 0; // taskFrame2 this.taskFrame2.AllowDrop = true; this.taskFrame2.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(196)))), ((int)(((byte)(200)))), ((int)(((byte)(212))))); this.taskFrame2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.taskFrame2.CaptionBlend = new Microsoft.Samples.Windows.Forms.TaskPane.BlendFill(Microsoft.Samples.Windows.Forms.TaskPane.BlendStyle.Horizontal, System.Drawing.Color.FromArgb(((int)(((byte)(244)))), ((int)(((byte)(247)))), ((int)(((byte)(252))))), System.Drawing.Color.FromArgb(((int)(((byte)(196)))), ((int)(((byte)(200)))), ((int)(((byte)(212)))))); this.taskFrame2.Controls.Add(this.flowLayoutPanel2); this.taskFrame2.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold); this.taskFrame2.ForeColor = System.Drawing.SystemColors.HotTrack; this.taskFrame2.IsExpanded = false; this.taskFrame2.Location = new System.Drawing.Point(12, 566); this.taskFrame2.Name = "taskFrame1"; this.taskFrame2.Size = new System.Drawing.Size(966, 500); this.taskFrame2.TabIndex = 3; this.taskFrame2.Text = "No. of Tests Forecast Result"; // flowLayoutPanel2 this.flowLayoutPanel2.AutoScroll = true; this.flowLayoutPanel2.BackColor = System.Drawing.Color.White; this.flowLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Fill; this.flowLayoutPanel2.Location = new System.Drawing.Point(0, 0); this.flowLayoutPanel2.Name = "flowLayoutPanel2"; this.flowLayoutPanel2.Size = new System.Drawing.Size(964, 498); this.flowLayoutPanel2.TabIndex = 0; // panel1 this.panel1.Controls.Add(this.txtstartdate); this.panel1.Controls.Add(this.txtbudgetend); this.panel1.Controls.Add(this.txtbudgetstart); this.panel1.Controls.Add(this.txttitle); this.panel1.Controls.Add(this.txtdescription); this.panel1.Controls.Add(this.label9); this.panel1.Controls.Add(this.label6); this.panel1.Controls.Add(this.label5); this.panel1.Controls.Add(this.label2); this.panel1.Controls.Add(this.label1); this.panel1.Controls.Add(this.groupBox1); this.panel1.Dock = System.Windows.Forms.DockStyle.Top; this.panel1.Location = new System.Drawing.Point(0, 0); this.panel1.Name = "panel1"; this.panel1.Size = new System.Drawing.Size(1008, 151); this.panel1.TabIndex = 1; // txtstartdate this.txtstartdate.BackColor = System.Drawing.SystemColors.Control; this.txtstartdate.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.txtstartdate.Location = new System.Drawing.Point(389, 64); this.txtstartdate.Name = "txtstartdate"; this.txtstartdate.ReadOnly = true; this.txtstartdate.Size = new System.Drawing.Size(227, 20); this.txtstartdate.TabIndex = 25; // txtbudgetend this.txtbudgetend.BackColor = System.Drawing.SystemColors.Control; this.txtbudgetend.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.txtbudgetend.Location = new System.Drawing.Point(389, 116); this.txtbudgetend.Name = "txtbudgetend"; this.txtbudgetend.ReadOnly = true; this.txtbudgetend.Size = new System.Drawing.Size(227, 20); this.txtbudgetend.TabIndex = 24; // txtbudgetstart this.txtbudgetstart.BackColor = System.Drawing.SystemColors.Control; this.txtbudgetstart.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.txtbudgetstart.Location = new System.Drawing.Point(389, 90); this.txtbudgetstart.Name = "txtbudgetstart"; this.txtbudgetstart.ReadOnly = true; this.txtbudgetstart.Size = new System.Drawing.Size(227, 20); this.txtbudgetstart.TabIndex = 23; // txttitle this.txttitle.BackColor = System.Drawing.SystemColors.Control; this.txttitle.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.txttitle.Location = new System.Drawing.Point(389, 21); this.txttitle.Multiline = true; this.txttitle.Name = "txttitle"; this.txttitle.ReadOnly = true; this.txttitle.Size = new System.Drawing.Size(227, 37); this.txttitle.TabIndex = 22; // txtdescription this.txtdescription.BackColor = System.Drawing.SystemColors.Control; this.txtdescription.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.txtdescription.Location = new System.Drawing.Point(625, 50); this.txtdescription.Multiline = true; this.txtdescription.Name = "txtdescription"; this.txtdescription.ReadOnly = true; this.txtdescription.Size = new System.Drawing.Size(279, 86); this.txtdescription.TabIndex = 21; // label9 this.label9.AutoSize = true; this.label9.Location = new System.Drawing.Point(622, 23); this.label9.Name = "label9"; this.label9.Size = new System.Drawing.Size(63, 13); this.label9.TabIndex = 20; this.label9.Text = "Description:"; // label6 this.label6.AutoSize = true; this.label6.Location = new System.Drawing.Point(267, 121); this.label6.Name = "label6"; this.label6.Size = new System.Drawing.Size(99, 13); this.label6.TabIndex = 19; this.label6.Text = "Budget End Period:"; // label5 this.label5.AutoSize = true; this.label5.Location = new System.Drawing.Point(267, 94); this.label5.Name = "label5"; this.label5.Size = new System.Drawing.Size(116, 13); this.label5.TabIndex = 18; this.label5.Text = "Budget Starting Period:"; // label2 this.label2.AutoSize = true; this.label2.Location = new System.Drawing.Point(267, 67); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(58, 13); this.label2.TabIndex = 17; this.label2.Text = "Start Date:"; // label1 this.label1.AutoSize = true; this.label1.Location = new System.Drawing.Point(267, 23); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(30, 13); this.label1.TabIndex = 16; this.label1.Text = "Title:"; // groupBox1 this.groupBox1.Controls.Add(this.button7); this.groupBox1.Controls.Add(this.button6); this.groupBox1.Controls.Add(this.button5); this.groupBox1.Controls.Add(this.button4); this.groupBox1.Controls.Add(this.button3); this.groupBox1.Controls.Add(this.button2); this.groupBox1.Controls.Add(this.button1); this.groupBox1.Location = new System.Drawing.Point(12, 13); this.groupBox1.Name = "groupBox1"; this.groupBox1.Size = new System.Drawing.Size(249, 123); this.groupBox1.TabIndex = 15; this.groupBox1.TabStop = false; this.groupBox1.Text = "Filter"; // button7 this.button7.Location = new System.Drawing.Point(6, 81); this.button7.Name = "button7"; this.button7.Size = new System.Drawing.Size(75, 23); this.button7.TabIndex = 6; this.button7.Text = "Chem"; this.button7.<API key> = true; this.button7.Click += new System.EventHandler(this.button7_Click); // button6 this.button6.Location = new System.Drawing.Point(7, 49); this.button6.Name = "button6"; this.button6.Size = new System.Drawing.Size(75, 23); this.button6.TabIndex = 5; this.button6.Text = "Patientno"; this.button6.<API key> = true; this.button6.Click += new System.EventHandler(this.button6_Click); // button5 this.button5.Location = new System.Drawing.Point(88, 75); this.button5.Name = "button5"; this.button5.Size = new System.Drawing.Size(104, 23); this.button5.TabIndex = 4; this.button5.Text = "hema and viral"; this.button5.<API key> = true; this.button5.Click += new System.EventHandler(this.button5_Click); // button4 this.button4.Location = new System.Drawing.Point(88, 53); this.button4.Name = "button4"; this.button4.Size = new System.Drawing.Size(122, 23); this.button4.TabIndex = 3; this.button4.Text = "CD4 Test Number"; this.button4.<API key> = true; this.button4.Click += new System.EventHandler(this.button4_Click); // button3 this.button3.Location = new System.Drawing.Point(88, 10); this.button3.Name = "button3"; this.button3.Size = new System.Drawing.Size(155, 23); this.button3.TabIndex = 2; this.button3.Text = "Supply Procurement Report"; this.button3.<API key> = true; this.button3.Click += new System.EventHandler(this.button3_Click); // button2 this.button2.Location = new System.Drawing.Point(88, 31); this.button2.Name = "button2"; this.button2.Size = new System.Drawing.Size(104, 23); this.button2.TabIndex = 1; this.button2.Text = "Supply Report"; this.button2.<API key> = true; this.button2.Click += new System.EventHandler(this.button2_Click); // button1 this.button1.Location = new System.Drawing.Point(6, 19); this.button1.Name = "button1"; this.button1.Size = new System.Drawing.Size(75, 23); this.button1.TabIndex = 0; this.button1.Text = "button1"; this.button1.<API key> = true; this.button1.Click += new System.EventHandler(this.button1_Click); // FrmMorbidity this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(1008, 702); this.Controls.Add(this.taskPane1); this.Controls.Add(this.panel1); this.Name = "FrmMorbidity"; this.Text = "Morbidity Forecast"; this.WindowState = System.Windows.Forms.FormWindowState.Maximized; this.taskPane1.ResumeLayout(false); this.taskFrame1.ResumeLayout(false); this.taskFrame1.PerformLayout(); this.taskFrame2.ResumeLayout(false); this.panel1.ResumeLayout(false); this.panel1.PerformLayout(); this.groupBox1.ResumeLayout(false); this.ResumeLayout(false); } #endregion private Microsoft.Samples.Windows.Forms.TaskPane.TaskPane taskPane1; private Microsoft.Samples.Windows.Forms.TaskPane.TaskFrame taskFrame1; private Microsoft.Samples.Windows.Forms.TaskPane.TaskFrame taskFrame2; private System.Windows.Forms.Panel panel1; private System.Windows.Forms.TextBox txtstartdate; private System.Windows.Forms.TextBox txtbudgetend; private System.Windows.Forms.TextBox txtbudgetstart; private System.Windows.Forms.TextBox txttitle; private System.Windows.Forms.TextBox txtdescription; private System.Windows.Forms.Label label9; private System.Windows.Forms.Label label6; private System.Windows.Forms.Label label5; private System.Windows.Forms.Label label2; private System.Windows.Forms.Label label1; private System.Windows.Forms.GroupBox groupBox1; private System.Windows.Forms.Button button1; private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel1; private System.Windows.Forms.Button button2; private System.Windows.Forms.Button button3; private System.Windows.Forms.Button button4; private System.Windows.Forms.Button button5; private System.Windows.Forms.Button button6; private System.Windows.Forms.Button button7; private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel2; } }
ActionController::Routing::Routes.draw do |map| # The priority is based upon order of creation: first created -> highest priority. # Sample of regular route: # map.connect 'products/:id', :controller => 'catalog', :action => 'view' # Keep in mind you can assign values other than :controller and :action # Sample of named route: # map.purchase 'products/:id/purchase', :controller => 'catalog', :action => 'purchase' # This route can be invoked with purchase_url(:id => product.id) # Sample resource route (maps HTTP verbs to controller actions automatically): # map.resources :products # Sample resource route with options: # map.resources :products, :member => { :short => :get, :toggle => :post }, :collection => { :sold => :get } # Sample resource route with sub-resources: # map.resources :products, :has_many => [ :comments, :sales ], :has_one => :seller # Sample resource route with more complex sub-resources # map.resources :products do |products| # products.resources :comments # products.resources :sales, :collection => { :recent => :get } # end # Sample resource route within a namespace: # map.namespace :admin do |admin|
package cn.dlb.bim.ifc.shared; public class <API key> extends Exception { private static final long serialVersionUID = -<API key>; public <API key>(String message) { super(message); } }
# WARNING: This program as such is intended to be used by professional # programmers who take the whole responsability of assessing all potential # consequences resulting from its eventual inadequacies and bugs # End users who are looking for a ready-to-use solution with commercial # garantees and support are strongly adviced to contract a Free Software # Service Company # This program is Free Software; you can redistribute it and/or # as published by the Free Software Foundation; either version 2 # This program is distributed in the hope that it will be useful, # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. import os import csv from xml.dom.minidom import <API key> import xml.dom.minidom import codecs from JasperReport import * from <API key> import * class <API key>(<API key>): def __init__(self, report, records): self.report = report self.records = records self.temporaryFiles = [] # CSV file generation using a list of dictionaries provided by the parser function. def generate(self, fileName): f = open( fileName, 'wb+' ) try: csv.QUOTE_ALL = True fieldNames = self.report.fieldNames() # JasperReports CSV reader requires an extra colon at the end of the line. writer = csv.DictWriter( f, fieldNames + [''], delimiter=',', quotechar='"' ) header = {} for field in fieldNames + ['']: header[ field ] = field writer.writerow( header ) <API key> = [] for record in self.records: row = {} for field in record: if field not in self.report.fields(): if not field in <API key>: print "FIELD '%s' NOT FOUND IN REPORT." % field <API key>.append( field ) continue value = record.get(field, False) if value==0.0: value = 0.0 elif value == False: value = '' elif isinstance(value, unicode): value = value.encode('utf-8') elif isinstance(value, float): value = '%.10f' % value elif not isinstance(value, str): value = str(value) if isinstance(value,str) or isinstance(value,unicode): #Parse Date if re.match("""^\d{4}-\d{2}-\d{2}$""",value)!=None: value = "%s 00:00:00"% str(value) row[self.report.fields()[field]['name']] = value writer.writerow( row ) finally: f.close() class <API key>(<API key>): # XML file generation using a list of dictionaries provided by the parser function. def generate(self, fileName): # Once all records have been calculated, create the XML structure itself self.document = <API key>().createDocument(None, 'data', None) topNode = self.document.documentElement for record in self.data['records']: recordNode = self.document.createElement('record') topNode.appendChild( recordNode ) for field, value in record.iteritems(): fieldNode = self.document.createElement( field ) recordNode.appendChild( fieldNode ) # The rest of field types must be converted into str if value == False: value = '' elif isinstance(value, str): value = unicode(value, 'utf-8') elif isinstance(value, float): value = '%.10f' % value elif not isinstance(value, unicode): value = unicode(value) valueNode = self.document.createTextNode( value ) fieldNode.appendChild( valueNode ) # Once created, the only missing step is to store the XML into a file f = codecs.open( fileName, 'wb+', 'utf-8' ) try: topNode.writexml( f ) finally: f.close()
<?php /** * This class has been auto-generated by the Doctrine ORM Framework */ class <API key> extends <API key> { }
<?php require __DIR__ . '/tests/Utilities.php'; ?>
package cn.dlb.bim.models.ifc4; /** * <!-- begin-user-doc --> * A representation of the model object '<em><b>Ifc Member Type</b></em>'. * <!-- end-user-doc --> * * <p> * The following features are supported: * </p> * <ul> * <li>{@link cn.dlb.bim.models.ifc4.IfcMemberType#getPredefinedType <em>Predefined Type</em>}</li> * </ul> * * @see cn.dlb.bim.models.ifc4.Ifc4Package#getIfcMemberType() * @model * @generated */ public interface IfcMemberType extends <API key> { /** * Returns the value of the '<em><b>Predefined Type</b></em>' attribute. * The literals are from the enumeration {@link cn.dlb.bim.models.ifc4.IfcMemberTypeEnum}. * <!-- begin-user-doc --> * <p> * If the meaning of the '<em>Predefined Type</em>' attribute isn't clear, * there really should be more of a description here... * </p> * <!-- end-user-doc --> * @return the value of the '<em>Predefined Type</em>' attribute. * @see cn.dlb.bim.models.ifc4.IfcMemberTypeEnum * @see #setPredefinedType(IfcMemberTypeEnum) * @see cn.dlb.bim.models.ifc4.Ifc4Package#<API key>() * @model * @generated */ IfcMemberTypeEnum getPredefinedType(); /** * Sets the value of the '{@link cn.dlb.bim.models.ifc4.IfcMemberType#getPredefinedType <em>Predefined Type</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @param value the new value of the '<em>Predefined Type</em>' attribute. * @see cn.dlb.bim.models.ifc4.IfcMemberTypeEnum * @see #getPredefinedType() * @generated */ void setPredefinedType(IfcMemberTypeEnum value); } // IfcMemberType
{% extends 'base.html' %} {% load static %} {% block content %} <script src="{% static 'js/jquery.liveurl.js' %}"></script> <link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css"> <script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script> <style> .<API key> .ui-state-default { background: url({{STATIC_URL}}images/slider-circle.png); border: 0px; height: 17px; width: 18px; } .<API key>, .ui-slider-range { width: 478px; left: 181px; top: -29px; height: 10px; border-width: 1px; -moz-border-image: -moz-linear-gradient(left, #C2B7A5 0%, #807362 50%, #B1816D 100%) 30 round; -webkit-border-image: -<API key>(left, #C2B7A5 0%, #807362 50%, #B1816D 100%) 30 round; border-image: linear-gradient(to right, #C2B7A5 0%, #807362 50%, #B1816D 100%) 30 round; border-image-slice: 1; background: #5e9ae2; /* Old browsers */ background: -moz-linear-gradient(left, #B3A896 0%, #463627 50%, #A34B33 100%) !important; /* FireFox 3.6+ */ background: -webkit-gradient(linear, left top, right top, color-stop(0%, #B3A896), color-stop(50%, #463627), color-stop(100%, #A34B33)); /* Chrome, Safari 4+ */ background: -<API key>(left, #B3A896 0%, #463627 50%, #A34B33 100%); /* Chrome 10+, Safari 5.1+ */ background: -o-linear-gradient(left, #B3A896 0%, #463627 50%, #A34B33 100%); /* Opera 11.10+ */ background: -ms-linear-gradient(left, #B3A896 0%, #463627 50%, #A34B33 100%); /* IE 10+ */ background: linear-gradient(left, #B3A896 0%, #463627 50%, #A34B33 100%); /* W3C */ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=’ /* IE 6-9 */ } #fee { left: 38px; top: 13px; position: relative; font-weight: bold; } #slide { color: #8C816F; left: 341px; top: -3px; position: relative; font-weight: bold; } </style> <script> // console.log('test'); $(document).ready(function () { $('#issueUrl').liveUrl({ success: function (data) { $.post("/parse_url_ajax/", { url: data['url'], csrfmiddlewaretoken: "{{ csrf_token }}" }).done(function (data) { var issue = jQuery.parseJSON(data) $('#title').val(issue['title']); $('#content').val(issue['content']); }); } }); $("#price").on('input', function (e) { $("#fee_amt").html(Math.round($("#price").val() * .10)); $("#total").html(Math.round(parseInt($("#fee_amt").html()) + parseInt($("#price").val()))); $("#grand_total").val($("#total").html()); }); }); $(function () { $("#slider").slider({ range: "min", value: 20, min: 5, max: 5000, slide: function (event, ui) { $("#price").val(ui.value); $("#fee_amt").html(Math.round(ui.value * .10)); $("#total").html(Math.round(parseInt($("#fee_amt").html()) + parseInt($("#price").val()))); $("#grand_total").val($("#total").html()); } }); }); </script> <!-- Section - Post a Bounty --> <div class="section-postBounty wrapper-section"> <div class="wrapper-global grid"> <div class="col-20"> <section class="frame frame-dark-paper"> <span class="bugfix-top"></span> <div class="frame-content"> <h1 class="titlebar-paper"><span>Po$t a Bounty</span></h1> <form action="{% url 'post' %}" method="post" id="post_bounty"> <input type="hidden" name="grand_total" id="grand_total" value="22"> {% csrf_token %} <div class="grid"> <!-- bounty-post --> <div class="col-15 bounty-post form-layout <API key>"> <div class="form-item"> {% if message %}<p>&nbsp;&nbsp;&nbsp;<strong>{{ message }}</strong></p>{% endif %} </div> <div class="form-item"> <p class="label">Issue Tracker:</p> <div class="value"> <span class="custom-radiobutton"><input type="radio" id="rbtnGithub" name="issuetracker" value="Github" checked /></span> <label for="rbtnGithub" class="label-github">GitHub</label> <span class="custom-radiobutton"><input type="radio" id="rbtnBitbucket" name="issuetracker" value="Bitbucket" /></span> <label for="rbtnBitbucket" class="label-bitbucket">Bitbucket</label> <! <span class="custom-radiobutton"><input type="radio" id="rbtnOther" name="issuetracker" /></span> <label for="rbtnOther">Other</label> </div> </div> <div class="form-item"> <label class="label" for="issueUrl">Issue URL:</label> <div class="value"> <input type="text" id="issueUrl" name="issueUrl" autocomplete="off" placeholder="Paste a link to an issue and we'll fill out the rest" value="{{form.issueUrl.value|default:''}}" /> </div> </div> <div class="form-item"> <label class="label" for="title">Title:</label> <div class="value"> <input type="text" id="title" name="title" value="{{form.title.value|default:''}}" /> {% for error_field,error_value in errors.items %} {% if error_field == 'title' %} {{ error_value }} {% endif %} {% endfor %} </div> </div> <div class="form-item"> <label class="label" for="content">Summary:</label> <div class="vlaue"> <textarea id="content" name="content">{{form.content.value|default:''}}</textarea> {% for error_field,error_value in errors.items %} {% if error_field == 'content' %} {{ error_value }} {% endif %} {% endfor %} </div> </div> <div class="form-item form-short"> <label class="label" for="language">Language:</label> <div class="value"> <select id="language" name="language"> {% for language in languages %} <option>{{ language }}</option> {% endfor %} </select> </div> </div> <div class="form-item form-short"> <label class="label" for="price">Bounty $:</label> <div class="value"> <input type="text" id="price" name="price" pattern="^[0-9]*$" value="20" /> <div id="slider"></div> {% for error_field,error_value in bounty_errors.items %} {{ error_value }} {% endfor %} </div> <div id="fee">Coderbounty's fee: $<span id="fee_amt">2</span></div> <span id="slide">(Slide to increase bounty)</span> </div> </div> <div class="col-4 bounty-info"> <h2>Project Title<a href="#">view all issues</a></h2> <a class="avatar" href="#"><img src="{% static 'images/temp/thumb-medium-00.jpg' %}" alt="" /></a> <div class="<API key>"> <div class="arrow"> <a class="icon-uniE65C" href=" <a class="icon-uniE63C" href=" </div> <a class="add-img" href="#">add image from url</a> </div> </div> </div> <div class="bounty-submit clearfix"> <div class="notice"> <p>Bounties are posted until the issue is closed, and then it goes to the developer who closed the issue. You can withdraw your bounty at anytime for a 3% fee.</p> </div> <div class="price">Total: <span>$<span id="total">22</span></span></div> <div class="button-wrapper"><button class="ribbon ribbon-large ribbon-03">Pay Now</button> </div> <div class="symbol-wrapper"> <div class="symbol-secure"><span class="icon-lock"></span> Coderbounty uses 1024 bit encryption for secure transactions</div> </div> </div> </form> </div> <span class="bugfix-bottom"></span> </section> </div> </div> </div> {% endblock %}
<!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>The source code</title> <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" /> <script type="text/javascript" src="../resources/prettify/prettify.js"></script> <style type="text/css"> .highlight { display: block; background-color: #ddd; } </style> <script type="text/javascript"> function highlight() { document.getElementById(location.hash.replace(/#/, "")).className = "highlight"; } </script> </head> <body onload="prettyPrint(); highlight();"> <pre class="prettyprint lang-js"><span id='<API key>'>/** </span> * The widget used to choose the frequency of recurrence. While this could be created * as a standalone widget, it is typically created automatically as part of a * Extensible.form.recurrence.Fieldset and does not normally need to be configured directly. */ Ext.define('Extensible.form.recurrence.FrequencyCombo', { extend: 'Ext.form.field.ComboBox', alias: 'widget.extensible.<API key>', requires: [ 'Ext.data.ArrayStore', 'Extensible.form.recurrence.Parser' ], <span id='<API key>'> fieldLabel: 'Repeats', </span><span id='<API key>'> queryMode: 'local', </span><span id='<API key>'> triggerAction: 'all', </span><span id='<API key>'> forceSelection: true, </span><span id='<API key>'> displayField: 'pattern', </span><span id='<API key>'> valueField: 'id', </span><span id='<API key>'> cls: '<API key>', </span> <span id='<API key>'> initComponent: function() { </span> var me = this; <span id='<API key>'> /** </span> * @event frequencychange * Fires when a frequency list item is selected. * @param {Extensible.form.recurrence.Combo} combo This combo box * @param {String} value The selected frequency value (one of the names * from {@link #frequencyOptions}, e.g. 'DAILY') */ me.addEvents('frequencychange'); var freq = Extensible.form.recurrence.Parser.strings.frequency; <span id='<API key>'> /** </span> * @cfg {Array} frequencyOptions * An array of arrays, each containing the name/value pair that defines a recurring * frequency option supported by the frequency combo. This array is bound to the underlying * {@link Ext.data.ArrayStore store} to provide the combo list items. The string descriptions * are defined in the {@link Extensible.form.recurrence.Parser#strings} config. * Defaults to: * * [ * ['NONE', 'Does not repeat'], * ['DAILY', 'Daily'], * ['WEEKDAYS', 'Every weekday (Mon-Fri)'], * ['WEEKLY', 'Weekly'], * ['MONTHLY', 'Monthly'], * ['YEARLY', 'Yearly'] * ] */ me.frequencyOptions = me.frequencyOptions || [ ['NONE', freq.none], ['DAILY', freq.daily], ['WEEKDAYS', freq.weekdays], ['WEEKLY', freq.weekly], ['MONTHLY', freq.monthly], ['YEARLY', freq.yearly] ]; me.store = me.store || Ext.create('Ext.data.ArrayStore', { fields: ['id', 'pattern'], idIndex: 0, data: me.frequencyOptions }); me.on('select', me.onSelect, me); me.callParent(arguments); }, <span id='<API key>'> onSelect: function(combo, records) { </span> this.fireEvent('frequencychange', records[0].data.id); } });</pre> </body> </html>
package com.ephesoft.gxt.core.shared.comparator; public interface SortingProperty { /** * Gets the <code>orderNumber</code> which specifies ordering at UI. * * @return {@link String} */ String getOrderNumber(); }
using System.Web.Mvc; using Frapid.Areas; using Frapid.Dashboard; using Frapid.Dashboard.Controllers; using Frapid.DataAccess.Models; namespace MixERP.HRM.Controllers.Tasks { public class ContractController : DashboardController { [Route("dashboard/hrm/tasks/contracts")] [MenuPolicy] [ScrudFactory] [AccessPolicy("hrm", "contracts", AccessTypeEnum.Read)] public ActionResult Index() { return this.FrapidView(this.GetRazorView<AreaRegistration>("Tasks/Contracts/Index.cshtml", this.Tenant)); } } }
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('app', '0014_survey'), ] operations = [ migrations.AddField( model_name='survey', name='question2', field=models.CharField(default=50, max_length=50), preserve_default=False, ), ]
package gplx.xowa.xtns.geoCrumbs; import gplx.*; import gplx.xowa.*; import gplx.xowa.xtns.*; import gplx.xowa.xtns.pfuncs.*; import gplx.xowa.langs.*; import gplx.xowa.langs.kwds.*; import gplx.xowa.parsers.*; import gplx.xowa.parsers.tmpls.*; public class Geoc_isin_func extends Pf_func_base { @Override public int Id() {return Xol_kwd_grp_.Id_geoCrumbs_isin;} @Override public Pf_func New(int id, byte[] name) {return new Geoc_isin_func().Name_(name);} @Override public void Func_evaluate(Bry_bfr bfr, Xop_ctx ctx, Xot_invk caller, Xot_invk self, byte[] src) { byte[] ttl_bry = Eval_argx(ctx, src, caller, self); Xowe_wiki wiki = ctx.Wiki(); Xoa_ttl ttl = Xoa_ttl.Parse(wiki, ttl_bry); if (ttl == null) return; byte[] lnki_ttl = Bry_.Add(Xop_tkn_.Lnki_bgn, ttl_bry, Xop_tkn_.Lnki_end); // make "[[ttl]]" Bry_bfr tmp_bfr = wiki.Utl__bfr_mkr().Get_b128(); wiki.Parser_mgr().Main().Parse_text_to_html(tmp_bfr, ctx, ctx.Page(), false, lnki_ttl); ctx.Page().Html_data().Content_sub_(tmp_bfr.To_bry_and_rls()); } public static final Geoc_isin_func Instance = new Geoc_isin_func(); }
# coding=utf-8 import os import setuptools # The plugin's identifier, has to be unique plugin_identifier = "OctoPNP" # The plugin's python package, should be "octoprint_<plugin identifier>", has to be unique plugin_package = "octoprint_%s" % plugin_identifier # The plugin's human readable name. # Can be overwritten within OctoPrint's internal data via __plugin_name__ in the plugin module plugin_name = "OctoPNP" # The plugin's version. # Can be overwritten within OctoPrint's internal data via __plugin_version__ in the plugin module plugin_version = "0.2" # The plugin's description. Can be overwritten within OctoPrint's # internal data via <API key> in the plugin module plugin_description = "OctoPrint plugin for camera based pick 'n place control" # The plugin's author. # Can be overwritten within OctoPrint's internal data via __plugin_author__ in the plugin module plugin_author = "Florens Wasserfall" # The plugin's author's mail address. plugin_author_email = "wasserfall@kalanka.de" # The plugin's homepage URL. # Can be overwritten within OctoPrint's internal data via __plugin_url__ in the plugin module plugin_url = "https://github.com/platsch/OctoPNP" plugin_license = "AGPLv3" # Additional package data to install for this plugin. The subfolders "templates", # "static" and "translations" will already be installed automatically if they exist. <API key> = [] def package_data_dirs(source, sub_folders): dirs = [] for d in sub_folders: folder = os.path.join(source, d) if not os.path.exists(folder): continue for dirname, _, files in os.walk(folder): dirname = os.path.relpath(dirname, source) for f in files: dirs.append(os.path.join(dirname, f)) return dirs def params(): # Our metadata, as defined above # pylint: disable=<API key> name = plugin_name version = plugin_version description = plugin_description author = plugin_author author_email = plugin_author_email url = plugin_url # pylint: disable=redefined-builtin license = plugin_license # we only have our plugin package to install packages = [plugin_package] # we might have additional data files in sub folders that need to be installed too package_data = { plugin_package: package_data_dirs( plugin_package, ["static", "templates", "translations", "cameras"] + <API key>, ) } <API key> = True # If you have any package data that needs to be accessible on the file system, # such as templates or static assets this plugin is not zip_safe. zip_safe = False # Read the requirements from our requirements.txt file with open("requirements.txt", 'r', encoding='utf-8') as f: install_requires = f.readlines() # Hook the plugin into the "octoprint.plugin" entry point, mapping the plugin_identifier # to the plugin_package. That way OctoPrint will be able to find the plugin and load it. entry_points = { "octoprint.plugin": ["%s = %s" % (plugin_identifier, plugin_package)] } return locals() setuptools.setup(**params())
(function() { 'use strict'; var repositories = function(restmod) { return restmod.model('/repositories'); }; repositories.$inject = ['restmod']; module.exports = { name: 'Repositories', provider: repositories }; }) ();