language
stringclasses 15
values | src_encoding
stringclasses 34
values | length_bytes
int64 6
7.85M
| score
float64 1.5
5.69
| int_score
int64 2
5
| detected_licenses
listlengths 0
160
| license_type
stringclasses 2
values | text
stringlengths 9
7.85M
|
|---|---|---|---|---|---|---|---|
Python
|
UTF-8
| 24,861
| 2.640625
| 3
|
[
"BSD-3-Clause"
] |
permissive
|
#Auhtor: YP
#Created: 2018-07-08
#Last updated: 2019-03-06
#A set of helper functions used by GPS that act as an interface between the redis database and the master and work processes of GPS.
#The "cat format" is an update introcued on 2019-03-06. The format refers to taking in arrays of pts (the parameter point values) and
#ptns (the parameter value names). For caterogircal parameters, these are identical. For numerical parameters, the point names refer
#to the bracket labels a,b,c or d, and the parameter point values refer to the numerical value of the corresponding bracket point.
import math
import time
from contextlib import contextmanager
import redis
from redis import WatchError
import gpsHelper
# Define a variable named inf which is infinity, so that when eval is
# called, if there are any inf values, they get evaluated to infinity! :)
inf = float('inf')
def connect(host='ada-udc.cs.ubc.ca',port=9503,dbid=0):
return redis.StrictRedis(host=host,port=port,db=dbid)
def setRunID(gpsID,runID,R):
R.set('runID:' + str(gpsID),runID)
def setCancel(gpsID, R):
R.set('cancel:' + str(gpsID), 'True')
def getRunID(gpsID,R):
return R.get('runID:' + str(gpsID))
def deleteAll():
#Author: YP
#Created: 2018-07-08
#Deletes EVERY database
R = connect()
R.flushall()
def deleteDB(R):
#Author: YP
#Created: 2018-07-26
#Deletes only the database selected in R
R.flushdb()
def enqueueAll(gpsID,toQueue,R):
#Author: YP
#Created: 2018-07-30
#Cteated to replace the function below so that we can queue
#Everything in a single batch, instead of one at a time
#This will hopefully make the code more efficient.
tasks = []
for task in toQueue:
tasks.append(str(task))
with R.pipeline() as pipe:
while 1:
try:
pipe.watch('taskQueue:' + str(gpsID),'taskQueueMembers:' + str(gpsID))
pipe.multi()
pipe.rpush('taskQueue:' + str(gpsID),*tasks)
pipe.sadd('taskQueueMembers:' + str(gpsID),*tasks)
pipe.rpush('enqueueHistory:' + str(gpsID),*tasks)
pipe.execute()
break
except WatchError:
R.incr('enqueueAllRollBack')
continue
def enqueue(gpsID,p,pt,inst,seed,R):
task = [p,pt,inst,seed]
with R.pipeline() as pipe:
while 1:
try:
pipe.watch('taskQueue:' + str(gpsID),'taskQueueMembers:' + str(gpsID))
pipe.multi()
pipe.rpush('taskQueue:' + str(gpsID),str(task))
pipe.sadd('taskQueueMembers:' + str(gpsID),str(task))
pipe.rpush('enqueueHistory:' + str(gpsID),str(task))
pipe.execute()
break
except WatchError:
R.incr('enqueueRollBack')
continue
def isInQueue(gpsID,p,pt,inst,seed,R):
task = str([p,pt,inst,seed])
return R.sismember('taskQueueMembers:' + str(gpsID),task)
def setRunning(gpsID,p,pt,inst,seed,cap,R):
task = toTaskString([p,pt,inst,seed])
#Set the status for the run to running
R.set('task:' + task,'Started running at ' + str(time.time()))
R.expire('task:' + task,int(cap*2))
@contextmanager
def running(gpsID,R):
#increment the number of runs being performed.
incrRunCount(gpsID,R)
try:
yield
finally:
#Decrement the number of runs being performed.
decrRunCount(gpsID,R)
def isRunning(gpsID,p,pt,inst,seed,R):
task = toTaskString([p,pt,inst,seed])
res = R.get('task:' + task)
#print(res)
return res is not None
def updateLastFailedCommand(gpsID, cmd, R):
R.set('lastFailedCommand:' + str(gpsID), cmd)
def getLastFailedCommand(gpsID, R):
return R.get('lastFailedCommand:' + str(gpsID))
def getAllAlive(gpsID,p,pts,ptns,logger,R):
#Author: YP
#Last updated: 2019-03-06
#Updated to take in the ptns (names of the parameter values, e.g., a,b,c,d, or categorical names) and pts (values of the parameters,e.g., 1,2,3, or categorical names)
logger.debug("Entering getAllAlive()")
with R.pipeline() as pipe:
while 1:
try:
logger.debug("Setting watch")
pipe.watch('taskQueue:' + str(gpsID), 'taskQueueMembers:' + str(gpsID),*['runs:' + str(gpsID) + ':' + p + ':' + ptn for ptn in ptns])
#logger.debug("Entering multi")
#pipe.multi()
logger.debug("Getting taskQueueMembers")
inQueue = pipe.smembers('taskQueueMembers:' + str(gpsID))
logger.debug("Getting all keys")
allKeys = pipe.keys()
logger.debug("Getting runs")
tmpRuns = {}
for ptn in ptns:
tmpRuns[ptn] = pipe.hgetall('runs:' + str(gpsID) + ':' + p + ':' + ptn)
logger.debug("Executing the pipeline")
pipe.execute()
break
except WatchError:
R.incr('getAllAliveRollBack')
logger.debug("There was a watch error. Rolling back.")
continue
logger.debug("Pipeline executed successfully.")
logger.debug("Running eval() on the runs.")
runs = {}
for ptn in ptns:
runs[ptn] = {}
for key in tmpRuns[ptn].keys():
runs[ptn][eval(key)] = eval(tmpRuns[ptn][key])
alive = set([])
aliveAndActive = set([])
for task in inQueue:
alive.add(toTaskString(task))
aliveAndActive.add(toTaskString(task))
logger.debug("Checking each key to see if it is a task.")
for k in allKeys:
#logger.debug("Checking key: " + k)
if('task:' == k[:5]):
alive.add(toTaskString(k[5:]))
aliveAndActive.add(toTaskString(k[5:]))
logger.debug("Adding each completed run to the alive set.")
for j in range(0,len(ptns)):
ptn = ptns[j]
pt = pts[j]
for (inst,seed) in runs[ptn].keys():
alive.add(toTaskString([p,pt,inst,seed]))
logger.debug("Done. Exciting getAllAlive()")
return alive, aliveAndActive
def toTaskString(task):
return str(task).replace(' ','-').replace(',','')
def stillInAliveSet(gpsID,p,pt,inst,seed,aliveSet,R):
#Author: YP
#Last updated: 2019-03-06
#Updated to remove ptn since it was never actually used.
task = toTaskString([p,pt,inst,seed])
return task in aliveSet
def stillAlive(gpsID,p,pt,ptn,inst,seed,R):
task = toTaskString([p,pt,inst,seed])
with R.pipeline() as pipe:
while 1:
try:
pipe.watch('taskQueue:' + str(gpsID), 'taskQueueMembers:' + str(gpsID),'task:' + task,'runs:' + str(gpsID) + ':' + p + ':' + ptn)
#pipe.multi()
stillInQueue = isInQueue(gpsID,p,pt,inst,seed,pipe)
stillIsRunning = isRunning(gpsID,p,pt,inst,seed,pipe)
runs = getRunsNoPipe(gpsID,p,pipe,[ptn])
pipe.execute()
break
except WatchError:
R.incr('stillAliveRollBack')
continue
#print('inQueue: ' + str(stillInQueue))
#print('IsRunning: ' + str(stillIsRunning))
done = (inst,seed) in runs[ptn].keys()
return stillInQueue or stillIsRunning or done
def initializeBudget(gpsID,budget,R):
R.hmset('budgetState:' + str(gpsID),budget)
def getBudget(gpsID,R):
budget = R.hgetall('budgetState:' + str(gpsID))
for key in budget.keys():
try:
budget[key] = eval(budget[key])
except:
try:
budget[key] = int(budget[key])
except:
budget[key] = float(budget[key])
return budget
def updateBudget(gpsID,budgetIncrs,R):
with R.pipeline() as pipe:
while 1:
try:
pipe.watch('budgetState:' + str(gpsID))
budget = getBudget(gpsID,pipe)
#print(budget)
pipe.multi()
for key in budgetIncrs.keys():
pipe.hset('budgetState:' + str(gpsID),key,budget[key] + budgetIncrs[key])
pipe.execute()
break
except WatchError:
R.incr('updateBudgetRollBack')
continue
def initializeBracket(gpsID,p,pts,ptns,paramType,alg,R):
#Author: YP
#Last updated: 2019-004-08
#Updated to take in an array of parameter name (ptns) and values (pts)
mapping = {}
for i in range(0,len(ptns)):
mapping[ptns[i]] = pts[i]
mapping['alg'] = alg
mapping['paramType'] = paramType
R.hmset('bracketState:' + str(gpsID) + ':' + p,mapping)
def updateBracket(gpsID,p,pts,ptns,paramType,alg,logger,R):
#Author: YP
#Last updated: 2019-04-08
#Updated to conform to the new argument format.
#Note that this function essentially performs two tasks:
#One, it re-assigns the key-value mappings between pts and ptns
#When the brackets for numerical parameters are udpated.
#Two, it updates the information about the other parameter
#incumbents stored in alg.
#This means there is no harm in allowing it to run for
#categorical parameters (since the key-value mappings never
#change), other than wasting time. It can therefore still be
#used to update the parameter incumbents stored in alg.
logger.debug("pts = " + str(pts))
logger.debug("ptns = " + str(ptns))
with R.pipeline() as pipe:
while 1:
try:
pipe.watch('bracketState:' + str(gpsID) + ':' + p,*['runs:' + str(gpsID) + ':' + p + ':' + ptn for ptn in ptns])
#Grab the runs.
runs = getRunsNoPipe(gpsID,p,pipe,ptns)
#Get the old bracket meta-data
oldPts,oldPtns,oldAlg = getBracket(gpsID,p,pipe)
logger.debug("oldPts = " + str(oldPts))
logger.debug("oldPtns = " + str(oldPtns))
#logger.debug("runs = " + str(runs))
pipe.multi()
#change the bracket's meta-data
initializeBracket(gpsID,p,pts,ptns,paramType,alg,pipe)
#Now the tricky part: updating the run information to match the new bracket points.
for i in range(0,len(ptns)):
oldPTN = ''
for oldI in range(0,len(ptns)):
if(pts[i] == oldPts[oldI]):
oldPTN = oldPtns[oldI]
break
if(len(oldPTN) > 0):
#We have found a match, so we need to update the run information
setPoint(gpsID,p,ptns[i],runs[oldPTN],pipe)
else:
#This point is new to the bracket, so we need to reinitialize this point
setPoint(gpsID,p,ptns[i],{},pipe)
pipe.execute()
break
except WatchError:
R.incr('updateBracketRollBack')
continue
def getBracket(gpsID,p,R):
#Author: YP
#Last updated: 2019-04-08
#Conforms to the new cat format.
mapping = R.hgetall('bracketState:' + str(gpsID) + ':' + p)
ptns = sorted(mapping.keys())
ptns.remove('alg')
ptns.remove('paramType')
paramType = mapping['paramType']
pts = []
for ptn in ptns:
if(paramType == 'real'):
pts.append(float(mapping[ptn]))
elif(paramType == 'integer'):
pts.append(int(mapping[ptn]))
else:
pts.append(mapping[ptn])
alg = eval(mapping['alg'])
return pts,ptns,alg
def setPoint(gpsID,p,ptn,runs,R):
#Author: YP
#Created; 2018-07-16
#Deletes the run information for the sepcified parameter point, and then create the new information based on runs.
R.delete('runs:' + str(gpsID) + ':' + p + ':' + ptn)
if(len(runs.keys()) > 0):
#print(runs)
R.hmset('runs:' + str(gpsID) + ':' + p + ':' + ptn,runs)
def addRun(gpsID,p,pt,ptns,inst,seed,res,runtime,sol,alg,adaptiveCap,runID,logger,R):
#Author: YP
#Created: 2018-07-08
#Last updated: 2019-06-25
task = toTaskString([p,pt,inst,seed])
#Create a pipeline
with R.pipeline() as pipe:
#Until we have succeeded, keep trying
while 1:
try:
#Watch to see if the bracket us updated before we have added
#The run.
pipe.watch('bracketState:' + str(gpsID) + ':' + p,'task:' + task,'runID:' + str(gpsID),*['runs:' + str(gpsID) + ':' + p + ':' + ptn for ptn in ptns])
curRunID = getRunID(gpsID,pipe)
if(not runID == curRunID):
logger.info("WE ARE DISCARDING THIS RUN BECAUSE THE GPS RUN ID HAS CHANGED.")
break
pts,ptns,alg = getBracket(gpsID,p,R)
if(pt not in pts):
#The bracket was updated and this point was removed
#while the run was in progress. We can just discard this
#run.
logger.debug("The bracket was updated while a run was in progress."
"We are discarding this run: " + str([p,pt,inst,seed,res,runtime,sol,alg,adaptiveCap]))
pipe.delete('task:' + task)
break
for i in range(0,len(ptns)):
if(pt == pts[i]):
ptn = ptns[i]
break
pipe.hset('runs:' + str(gpsID) + ':' + p + ':' + ptn,(inst,seed),[runtime,alg['params'],res,adaptiveCap,sol])
pipe.delete('task:' + task)
pipe.execute()
#If no WatchError then it worked.
break
except WatchError:
#The bracket was updated before we finsihed. The Roll back and
#retry.
R.incr('addRunRollBack')
continue
return curRunID
def getRuns(gpsID,p,ptns,R):
#Author: YP
#Last updated: 2019-03-06
#Conforms to cat format.
gpsID = str(gpsID)
#Create a pipline
with R.pipeline() as pipe:
#Until we have succeeded, keep trying
while 1:
try:
#Watch to see if any of them change
pipe.watch(*['runs:' + str(gpsID) + ':' + p + ':' + ptn for ptn in ptns])
#buffer the commands
#pipe.multi()
#Add the commands to the buffer
tmpRuns = {}
for ptn in ptns:
tmpRuns[ptn] = pipe.hgetall('runs:' + gpsID + ':' + p + ':' + ptn)
#Execute the pipeline
pipe.execute()
#If a WatchError wasn't raised, everything worked atomically.
break
except WatchError:
#Someone else changed the status of one of the runs while
#we were collecting them. The pipeline was rolled back
#and we can try again.
R.incr('getRunsRollBack')
continue
runs = {}
for ptn in ptns:
runs[ptn] = {}
for key in tmpRuns[ptn].keys():
#print('8'*8)
#print(key)
#print(tmpRuns[ptn][key])
runs[ptn][eval(key)] = eval(tmpRuns[ptn][key])
return runs
def getRunsNoPipe(gpsID,p,R,ptns):
#Author: YP
#Last updated: 2019-03-06
#Conforms to cat format.
runs = {}
for ptn in ptns:
runs[ptn] = {}
tmpRuns = R.hgetall('runs:' + str(gpsID) + ':' + p + ':' + ptn)
for key in tmpRuns.keys():
#print(key)
#print(tmpRuns[key])
runs[ptn][eval(key)] = eval(tmpRuns[key])
return runs
def saveIncumbent(gpsID,p,incVal,numRuns,stat,R):
#Author: YP
#Created: 2018-07-16
mapping = {}
mapping['incVal'] = incVal
mapping['numRuns'] = numRuns
mapping['stat'] = stat
R.hmset('incumbent:' + str(gpsID) + ':' + str(p),mapping)
def getIncumbent(gpsID,p,R):
mapping = R.hgetall('incumbent:' + str(gpsID) + ':' + p)
incVal = eval(mapping['incVal'])
numRuns = eval(mapping['numRuns'])
stat = eval(mapping['stat'])
return incVal,numRuns,stat
def fetchTaskAndBudget(gpsID,cutoff,prange,decayRate,boundMult,minInstances,runObj,R,logger):
#Author: YP
#Created before: 2019-04-05
#Last updated: 2019-06-28
#Conforms to cat format.
#Until we have succeeded, keep trying
with R.pipeline() as pipe:
while 1:
try:
#WATCH the queue to make sure it doesn't get updated
pipe.watch('taskQueue:' + str(gpsID),'taskQueueMembers:' + str(gpsID),'budgetState:' + str(gpsID))
#Get the next task in the queue
task = pipe.lpop('taskQueue:' + str(gpsID))
pipe.srem('taskQueueMembers:' + str(gpsID),task)
#Get the unique GPS run ID
runID = getRunID(gpsID,pipe)
if(task is None):
#There are no tasks in the queue. Exit now
return None, getBudget(gpsID,pipe), runID
p, pt, inst, seed = eval(task)
logger.debug("Found task: " + str(task))
#pipe.multi()
#print('after Multi')
#Get the current budget
budget = getBudget(gpsID,pipe)
#print(budget)
#Get the bracket information
pts,ptns,alg = getBracket(gpsID,p,pipe)
#Get the Runs
runs = getRunsNoPipe(gpsID,p,pipe,ptns)
#print(runs)
#print([a,b,c,d,alg])
#pipe.execute()
if(pt not in pts):
#The bracket has changed and we no longer need to evaluate
#this point. Continue and try the next point.
logger.debug("Point " + str(pt) + " has been removed from the set of points considered: " + str(pts))
R.incr("RemovedCount")
continue
for i in range(0,len(ptns)):
if(pt == pts[i]):
ptn = ptns[i]
#incVal,numRunsInc,incStat = getIncumbent(gpsID,p,pipe)
if(runObj == 'runtime'):
cutoffi = gpsHelper.getAdaptiveCap(p,runs,inst,seed,ptn,cutoff,alg['params'],prange,decayRate,minInstances,boundMult,logger)
else:
cutoffi = cutoff
setRunning(gpsID,p,pt,inst,seed,cutoffi,pipe)
#print('Running')
pipe.execute()
break
except WatchError:
logger.debug('Dequeue Roll Back')
R.incr('dequeueRollBack')
continue
task = {}
task['p'] = p
task['pt'] = pt
task['inst'] = inst
task['seed'] = seed
task['cutoff'] = cutoffi
task['alg'] = alg
return task, budget, runID
def incrRunCount(gpsID,R):
#Author: YP
#Created: 2018-07-13
R.incr('runCount:' + str(gpsID))
def decrRunCount(gpsID,R):
#Author: YP
#Created: 2018-07-13
R.incrby('runCount:' + str(gpsID),-1)
def queueState(gpsID,R):
#Author: YP
#Created: 2018-07-13
q = len(R.smembers('taskQueueMembers:' + str(gpsID)))
n = eval(R.get('runCount:' + str(gpsID)))
return [q,n]
def setPrange(gpsID,prange,R):
R.set('prange:' + str(gpsID),prange)
def setVerbosity(gpsID,verbose,R):
R.set('verbose:' + str(gpsID),verbose)
def getVerbosity(gpsID,R):
verbose = R.get('verbose:' + str(gpsID))
startTime = time.time()
while verbose is None:
time.sleep(0.5)
verbose = R.get('verbose:' + str(gpsID))
if(time.time() - startTime > 100):
raise ValueError("Verbose keepings being None...")
return verbose
def setQueueState(gpsID,qSum,rSum,instIncr,R):
R.set('queueState:' + str(gpsID),[qSum,rSum,instIncr])
def incrReadyCount(gpsID,R):
return R.incr('readyCount:' + str(gpsID))
def getReadyCount(gpsID,R):
c = R.get('readyCount:' + str(gpsID))
if(c is not None):
return eval(c)
else:
return c
def showTaskQueue(gpsID):
#Author: YP
#Created: 2018-07-11
dbid = (gpsID-1)%15+1
R = connect(dbid=dbid)
oldQ = ''
oldN = -1
while 1:
q = R.lrange('taskQueue:' + str(gpsID),0,1000000)
n = R.get('runCount:' + str(gpsID))
queueState = R.get('queueState:' + str(gpsID))
if(queueState is not None):
queueState = eval(queueState)
if(q == oldQ and n == oldN):
continue
oldQ = q
oldN = n
print('-'*50)
for t in q:
t = eval(t)
t[2] = "..." + t[2][-10:]
print(t)
n = R.get('runCount:' + str(gpsID))
print('Total Number of Tasks: ' + str(len(q)))
print('Total Number of Tasks currently Running: ' + str(n))
if(queueState is not None):
print('Instance Increment: ' + str(queueState[2]))
time.sleep(1)
def showBracket(gpsID,p):
#Author: YP
#Created; 2018-07-13
#Last updated: 2019-03-06
#Conforms to cat format.
oldStatus = ''
dbid = (gpsID-1)%15+1
R = connect(dbid=dbid)
insts = []
prange = eval(R.get('prange:' + str(gpsID)))
while True:
try:
runs = getRuns(gpsID,p,R) #TODO does not conform to cat format.
pts,ptns,alg = getBracket(gpsID,p,R)
incVal,numRuns,incStat = getIncumbent(gpsID,p,R)
except:
print("Caught error, continuing...")
continue
#insts = []
for ptn in ptns:
for inst in runs[ptn].keys():
if(inst not in insts):
insts.append(inst)
sinds = range(0,len(ptns))
sinds = sorted(sinds,key=lambda i:pts[i])
pts = [pts[i] for i in sinds]
ptns = [ptns[i] for i in sinds]
status = '-'*20 + p + ":" + str(incVal) + '-'*20 + '\n'
for i in range(0,len(ptns)):
ptn = ptns[i]
pt = pts[i]
if(pt == incVal):
status += '*'
else:
status += ' '
status += ptn + ':'
status += (3-len(str(pt)))*' ' + str(pt) + ':'
for (inst,seed) in sorted(insts,key=lambda k: k[1]):
if((inst,seed) in runs[ptn].keys()):
if(runs[ptn][(inst,seed)][2] == 'TIMEOUT'):
if(runs[ptn][(inst,seed)][3] == 10000):
status += 'T'
else:
status += 't'
else:
status += '*'
elif(isRunning(gpsID,p,pt,inst,seed,R)):
status += 'r'
elif(isInQueue(gpsID,p,pt,inst,seed,R)):
status += 'q'
else:
status += ' '
status += ':' + str(gpsHelper.calPerf(p,runs[ptn],alg['params'],prange,0.2))
status += '\n'
if(not status == oldStatus):
print(status[:-1])
oldStatus = status
def showQueueState(gpsID):
dbid = (gpsID-1)%15+1
R = connect(dbid=dbid)
oldQueueState = None
while True:
queueState = R.get('queueState:' + str(gpsID))
if(queueState is not None):
queueState = eval(queueState)
if(not queueState == oldQueueState):
print('-'*50)
print("Median Number in Queue: " + str(queueState[0]))
print("Maximum Number Running: " + str(queueState[1]))
print("The Instance Increment: " + str(queueState[2]))
time.sleep(0.5)
oldQueueState = queueState
def showRollBacks(gpsID):
dbid = (gpsID-1)%15+1
R = connect(dbid=dbid)
oldM = ''
while True:
time.sleep(0.5)
m = '*'*50 + '\n'
for k in sorted(R.keys()):
if('RollBack' in k or 'readyCount' in k):
m += k + ': ' + str(R.get(k)) + '\n'
if(not m == oldM):
oldM = m
print(m)
|
Python
|
UTF-8
| 152
| 3.328125
| 3
|
[] |
no_license
|
p1, p2 = list(map(int, input().split()))
n = int(input())
p = p1 / p2
sum = 0
for i in range(5):
sum += (1 - p) ** i * p
print('{:.3f}'.format(sum))
|
C#
|
UTF-8
| 2,322
| 2.625
| 3
|
[] |
no_license
|
using System;
using System.Threading.Tasks;
using Azure.Identity;
using Azure.Messaging.ServiceBus;
using Azure.Security.KeyVault.Secrets;
namespace ServiceBusQueueSender
{
/**
* ServiceBus namespace: namespacericopegnata
* ServiceBus queue: queuericopegnata
*/
public class Program
{
private const string TENNANT_ID = "";
private const string CLIENT_ID = "";
private const string CLIENT_SECRET = "";
private const string KEY_VAULT_URL = "";
private const string SENDER_CON_STR_KEY_NAME = "Sender";
private const string QUEUE_NAME = "queuericopegnata";
public static async Task Main(string[] args)
{
try
{
Console.WriteLine($"Retrive client credentials...");
var clientCredentials = GetClientSecretCredential();
Console.WriteLine($"Ok\n");
Console.WriteLine($"Retrive hub connection string from KeyVault");
var keyVaultSecretClient = new SecretClient(new Uri(KEY_VAULT_URL), clientCredentials);
var connStr = await keyVaultSecretClient
.GetSecretAsync(SENDER_CON_STR_KEY_NAME);
Console.WriteLine($"Ok\n");
var serviceBusClient = new ServiceBusClient(connStr.Value.Value);
var sender = serviceBusClient
.CreateSender(QUEUE_NAME);
var messageId = Guid.NewGuid();
var message = new ServiceBusMessage($"Message with id <{messageId}> sent from Sender");
Console.WriteLine($"Try to send message with id <{messageId}> ");
await sender
.SendMessageAsync(new ServiceBusMessage($"Message with id <{Guid.NewGuid()}> sent from Sender"));
Console.WriteLine($"Ok\n");
await sender
.DisposeAsync();
await Task.Delay(2000);
}
catch (Exception ex)
{
Console.WriteLine($"Unable to send the message: {ex.Message}");
}
}
private static ClientSecretCredential GetClientSecretCredential()
{
return new ClientSecretCredential(TENNANT_ID, CLIENT_ID, CLIENT_SECRET);
}
}
}
|
Python
|
UTF-8
| 943
| 3.234375
| 3
|
[] |
no_license
|
#!/usr/bin/python
import json
import os
srcPath = os.environ["cnf"] + "/"
dstPath = os.environ["HOME"] + "/"
def main():
jsonRaw = getJson()
jsonParsed = json.loads(jsonRaw)
for link in jsonParsed["symlinks"]:
src = srcPath + link["src"]
if "dst" in link:
dst = dstPath + link["dst"]
else:
dst = dstPath + link["src"]
try:
os.symlink(src, dst)
print("Made symlink %s -> %s" % (src, dst))
except FileExistsError:
print("Couldn't make symlink %s -> %s because file already exists" % (src, dst))
if os.path.islink(dst) and input("File is symlink. Replace? (y/n)") == "y":
os.remove(dst)
os.symlink(src, dst)
print("Replaced.")
except Exception as e:
print("Unexpected error: " + str(e))
def getJson():
f = open("symlinks.json", 'r')
text = ""
for line in f:
text += line
return text
if __name__ == "__main__":
main()
|
C++
|
UTF-8
| 2,038
| 2.890625
| 3
|
[] |
no_license
|
#include "Header.h"
int main() {
setlocale(LC_ALL, "ru");
SetConsoleCP(1251);
SetConsoleOutputCP(1251);
book a1("О дивный новый мир", 2016);
book a2("О дивный новый мир", 2016);
book a3("Три товарища", 2016);
book a4("Мастер и Маргарита", 2012);
book a5("Финансист", 2015);
multimap<string, book> lib = { { "Олдос Хаксли" , a1 },{ "Олдос Хаксли" ,a2 },{ "Эрих Мария Ремарк" , a3 },
{ "Михаил Булгаков" , a4 },{ "Теодор Драйзер" , a5 } };
int variant;
cout << "Выберите вариант\n" << endl;
cout << "1. Добавить вновь поступившую книгу\n"
<< "2. Удалить списанную книгу\n"
<< "3. Выдать список всех книг упорядоченных по фамилиям\n"
<< "5. выйти\n" << endl;
cout << ">>> ";
do
{
string vvod_author;
string vvod_titel;
string erase_book;
book a6;
pair <string, book> A6;
int vvod_year;
cin >> variant;
switch (variant) {
case 1:
cout << "Введите автора: " << endl;
cin.ignore();
getline(cin, vvod_author);
cout << "Введите название: " << endl;
cin >> vvod_titel;
cin.ignore();
getline(cin, vvod_titel);
cout << "Введите год издания: " << endl;
cin >> vvod_year;
a6.setYear(vvod_year);
A6.first = vvod_author;
A6.second = a6;
lib.insert(A6);
break;
case 2:
cout << "Введите автора удаляемой книги " << endl;
cin.ignore();
getline(cin, erase_book);
lib.erase(erase_book);
break;
case 3:
for (auto a : lib)
{
cout << a.first << a.second << endl;
}
break;
case 5:
cout << "Выход из программы..." << endl;
exit(EXIT_SUCCESS);
break;
default:
cerr << "Вы выбрали неверный вариант" << endl;
exit(EXIT_FAILURE);
}
} while (variant != 5);
return 0;
}
|
C#
|
UTF-8
| 939
| 2.96875
| 3
|
[] |
no_license
|
using System.Collections;
using System.Collections.Generic;
public class TileNeighborPrereq : TilePrereq
{
//Building prereqbuilding;
System.Type prereqNeighbbuildingType;
int num = 0;
public TileNeighborPrereq(System.Type buildinga, int howmany)
{
//prereqbuilding = buildinga;
prereqNeighbbuildingType = buildinga;
num = howmany;
}
//counts the number of times a neighbor tile has the prereq building type on it, returns true if its more than or equal to num
public override bool Condition_met(Tile tile)
{
int count = 0;
foreach (Tile tilen in tile.neighbors)
{
if (tilen == null || tilen.building==null)
{ continue; }
if(TileBuildingPrereq.BuildingCompare(tilen.building, prereqNeighbbuildingType))
{
count++;
}
}
return count>=num? true:false;
}
}
|
Java
|
UTF-8
| 3,583
| 2.09375
| 2
|
[
"Apache-2.0"
] |
permissive
|
package com.yapp.ios1.service.bucket;
import com.yapp.ios1.controller.dto.bucket.BucketRequestDto;
import com.yapp.ios1.mapper.BucketMapper;
import com.yapp.ios1.model.bucket.Bucket;
import com.yapp.ios1.validator.BucketValidator;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
import static com.yapp.ios1.enums.BucketLogStatus.*;
/**
* created by jg 2021/05/05
*/
@Slf4j
@RequiredArgsConstructor
@Service
public class BucketService {
private final BucketFindService bucketFindService;
private final BucketValidator bucketValidator;
private final BucketMapper bucketMapper;
@Transactional
public void saveBucket(BucketRequestDto registerDto) {
bucketMapper.registerBucket(registerDto);
Long bucketId = registerDto.getId();
saveTagList(bucketId, registerDto.getTagList());
saveImageUrlList(bucketId, registerDto.getImageList());
}
@Transactional
public void updateBucket(Long bucketId, BucketRequestDto updateDto, Long userId) {
Bucket bucketDto = bucketFindService.getBucket(bucketId, userId);
String updateBucketName = updateDto.getBucketName();
String updateEndDate = updateDto.getEndDate().toString();
updateDto.setId(bucketId);
bucketMapper.updateBucket(updateDto);
updateTag(bucketId, updateDto.getTagList());
updateImageUrlList(bucketId, updateDto.getImageList());
if (!updateBucketName.equals(bucketDto.getBucketName())) {
bucketMapper.saveBucketLog(bucketId, updateBucketName, BUCKET_NAME_LOG.get());
}
if (!updateEndDate.equals(bucketDto.getEndDate())) {
bucketMapper.saveBucketLog(bucketId, updateEndDate.replaceAll("-", ". "), BUCKET_END_DATE_LOG.get());
}
}
private void saveTagList(Long bucketId, List<String> tagList) {
if (!tagList.isEmpty()) {
bucketMapper.saveTagList(tagList);
bucketMapper.saveBucketIdAndTagId(bucketId, tagList);
}
}
private void updateTag(Long bucketId, List<String> tagList) {
bucketMapper.deleteTagListByBucketId(bucketId);
saveTagList(bucketId, tagList);
}
private void saveImageUrlList(Long bucketId, List<String> imageUrlList) {
if (!imageUrlList.isEmpty()) {
bucketMapper.saveBucketImageUrlList(bucketId, imageUrlList);
}
}
private void updateImageUrlList(Long bucketId, List<String> imageUrlList) {
bucketMapper.deleteImageListByBucketId(bucketId);
saveImageUrlList(bucketId, imageUrlList);
}
// TODO 모든 버킷마다 검증하는 메소드가 들어가는데 이거를 AOP 로 빼던가 해보아도 좋을 거 같음 (얘기 해보기)
public void saveBookmark(Long bucketId, Long userId, boolean isBookmark) {
bucketValidator.checkValidBucket(bucketId, userId);
bucketMapper.setBookmark(bucketId, isBookmark);
}
public void setBucketFin(Long bucketId, Long userId, boolean isFin) {
bucketValidator.checkValidBucket(bucketId, userId);
bucketMapper.setBucketFin(bucketId, isFin);
}
@Transactional
public void updateBucketState(Long userId, Long bucketId, int bucketStateId) {
bucketValidator.checkValidBucketStateId(bucketStateId);
bucketValidator.checkValidBucket(bucketId, userId);
bucketMapper.updateBucketState(bucketId, userId, bucketStateId);
}
}
|
Java
|
UTF-8
| 183
| 1.515625
| 2
|
[] |
no_license
|
package br.edu.ifms.lpivlaboratorio04;
import org.springframework.data.jpa.repository.JpaRepository;
public interface ClienteResource extends JpaRepository<Cliente,Integer>{
}
|
Java
|
UTF-8
| 1,911
| 2.265625
| 2
|
[] |
no_license
|
package com.backend.controller;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.backend.model.Comments;
import com.backend.service.CommentsService;
@CrossOrigin(origins = "*")
@RestController
@RequestMapping("/api")
public class CommentsController {
@Autowired
private CommentsService commentService;
/*-- send the comment for purticular trasher --*/
@PostMapping("/customer/trasher/comments/send")
public ResponseEntity<?> save(@RequestBody Comments comment){
commentService.save(comment);
return ResponseEntity.ok().body("comment id : "+comment.getComment_id());
}
/*-- getting all the comments of particular trasher -- */
@GetMapping("/dashboad/comments/smallTrasher")
public ResponseEntity<List<Comments>> getAllCommentsForSmallTrasher(){
List<Comments> smallTrasherComments=commentService.getSmallTrasherComments();
return ResponseEntity.ok().body(smallTrasherComments);
}
@GetMapping("/dashboad/comments/primumTrasher")
public ResponseEntity<List<Comments>> getAllCommentsForPrimumTrasher(){
List<Comments> primumTrasherComments=commentService.getPrimumTrasherComments();
return ResponseEntity.ok().body(primumTrasherComments);
}
@GetMapping("/dashboad/comments/largeTrasher")
public ResponseEntity<List<Comments>> getAllCommentsForLargeTrasher(){
List<Comments> largeTrasherComments=commentService.getLargeTrasherComments();
return ResponseEntity.ok().body(largeTrasherComments);
}
}
|
Markdown
|
UTF-8
| 943
| 2.578125
| 3
|
[] |
no_license
|
# Single-Page Application
## Inicializando a aplicação local
Para download do projeto utilize o seguinte comando via terminal bash:
$ git clone https://github.com/jozemaria/todo-react.git
> Feito o download do projeto, confirmar se o Node está instalando na máquina, utilizando o `node -v` e o `npm -v`, instalações confirmadas, podemos dar continuidade.
Dentro da pasta do projeto, executar o `npm install`, onde vai está instalando o *node_modules*(Gerenciador de pacotes do Node), dentro ainda do diretório do projeto, inserir, ainda via terminal, o `npm start`.
Agora é só esperar o navegador inicializar e visualizar a aplicação funcionando.
- [x] React
### Orientações dos projetos
- [Voltar para o README inicial](https://github.com/jozemaria/desafio-esig)
- [Aplicação Java + PostgreSQL](https://github.com/jozemaria/desafio-esig/blob/master/ORIENTACOES.md)
> Feito por: **José Maria Jr** - *@jozemariajr*
|
Markdown
|
UTF-8
| 5,707
| 2.625
| 3
|
[
"MIT",
"LicenseRef-scancode-public-domain",
"CC0-1.0",
"LicenseRef-scancode-unknown-license-reference"
] |
permissive
|
# `alto2txt`: Extract plain text from digital newspaper OCR scans
*Version extract_text 0.3.4*
  [](https://zenodo.org/badge/latestdoi/259340615) [](https://github.com/pre-commit/pre-commit)
`alto2txt` converts `XML` `ALTO`/`METS` Optical Character Recognition (OCR) scans into plaintext files with minimal metadata.
**`XML` compatibility: `METS 1.8`/`ALTO 1.4`, `METS 1.3`/`ALTO 1.4`, `BLN`, or `UKP` format**
`ALTO` and `METS` are industry standards maintained by the [US Library of Congress](https://www.loc.gov/librarians/standards) targeting newspaper digitization used by hundreds of modern, large-scale newspaper digitization projects. One text file is output per article, each complemented by one `XML` metadata file[^1] .
[`METS` (Metadata Encoding and Transmission Standard)](http://www.loc.gov/standards/mets/) is a standard for encoding descriptive, administrative, and structural metadata regarding objects within a digital library, expressed in `XML`. [`ALTO` (Analyzed Layout and Text Objects)](https://www.loc.gov/standards/alto/) is an [`XML schema`](https://en.wikipedia.org/wiki/XML_schema) for technical metadata describing the layout and content of text resources such as book or newspaper pages. `ALTO` is often used in combination with `METS` but can also be used independently. Details of the `ALTO` schema are avilable at https://github.com/altoxml/schema.
## Quick Install
### `pip`
As of verion `v0.3.4` `alto2txt` is available on [`PyPI`](https://pypi.org/project/alto2txt/) and can be installed via
```bash
pip install alto2txt
```
### `conda`
If you are comfortable with the command line, git, and already have Python & Anaconda installed, you can install `alto2txt` by navigating to an empty directory in the terminal and run the following commands:
```bash
git clone https://github.com/Living-with-machines/alto2txt.git
cd alto2txt
conda create -n py37alto python=3.7
conda activate py37alto
pip install pyproject.toml
```
[Click here](/Demo.md) for more in-depth installation instructions using demo files.
## Usage
> *Note*: the formatting below is altered for readability
```
usage: alto2txt [-h]
[-p [PROCESS_TYPE]]
[-l [LOG_FILE]]
[-d [DOWNSAMPLE]]
[-n [NUM_CORES]]
xml_in_dir txt_out_dir
Converts XML publications to plaintext articles
positional arguments:
xml_in_dir Input directory with XML publications
txt_out_dir Output directory for plaintext articles
optional arguments:
-h, --help show this help message and exit
-p [PROCESS_TYPE], --process-type [PROCESS_TYPE]
Process type. One of: single,serial,multi,spark Default: multi
-l [LOG_FILE], --log-file [LOG_FILE]
Log file. Default out.log
-d [DOWNSAMPLE], --downsample [DOWNSAMPLE]
Downsample. Default 1
-n [NUM_CORES], --num-cores [NUM_CORES]
Number of cores (Spark only). Default 1")
```
To read about downsampling, logs, and using spark see [Advanced Information](advanced.md).
## Process Types
`-p | -process-type` can be one of:
* `single`: Process single publication.
* `serial`: Process publications serially.
* `multi`: Process publications using multiprocessing (default).
* `spark`: Process publications using Spark.
## Process Multiple Publications
For default settings, (`multi`) multiprocessing assumes the following directory structure for multiple publications in `xml_in_dir`:
```
xml_in_dir/
├── publication
│ ├── year
│ │ └── issue
│ │ └── xml_content
│ └── year
└── publication
```
Assuming `xml_in_dir` follows this structure, run alto2txt with the following in the terminal:
```console
$ alto2txt xml_in_dir txt_out_dir
```
To downsample and only process every 100th edition:
```console
$ alto2txt xml_in_dir txt_out_dir -d 100
```
## Process Single Publication
[A demo for processing a single publication is available here.](Demo.md)
If `-p|--process-type single` is provided then `xml_in_dir` is expected to hold `XML` for a single publication, in the following structure:
```
xml_in_dir/
├── year
│ └── issue
│ └── xml_content
└── year
```
Assuming `xml_in_dir` follows this structure, run `alto2txt` with the following in the terminal in the folder `xml_in_dir` is stored in:
```console
$ alto2txt -p single xml_in_dir txt_out_dir
```
To downsample and only process every 100th edition from the one publication:
```console
$ alto2txt -p single xml_in_dir txt_out_dir -d 100
```
## Plain Text Files Output
`txt_out_dir` is created with an analogous structure to `xml_in_dir`.
One `.txt` file and one metadata `.xml` file are produced per article.
## Quality Assurances
Quality assurance is performed to check for:
* Unexpected directories.
* Unexpected files.
* Malformed `XML`.
* Empty files.
* Files that otherwise do not expose content.
## Future work
* Export more metadata from `ALTO`, probably by parsing `METS` first.
* Check and ensure that articles that span multiple pages are pulled into a single article file.
* Smarter handling of articles spanning multiple pages.
> Last updated 2023-02-22
[^1]: For a more detailed description see: https://www.coloradohistoricnewspapers.org/forum/what-is-metsalto/
|
C
|
UTF-8
| 3,439
| 2.671875
| 3
|
[
"MIT"
] |
permissive
|
/******************************************************************************
FFTLog-and-Beyond
https://github.com/xfangcosmo/FFTLog-and-beyond
by Xiao Fang
******************************************************************************/
#include <stdlib.h>
#include <math.h>
#include <complex.h>
#include "utils.h"
double complex gamma_lanczos_cfft(double complex z) {
/* Lanczos coefficients for g = 7 */
static double p[] = {
0.99999999999980993227684700473478,
676.520368121885098567009190444019,
-1259.13921672240287047156078755283,
771.3234287776530788486528258894,
-176.61502916214059906584551354,
12.507343278686904814458936853,
-0.13857109526572011689554707,
9.984369578019570859563e-6,
1.50563273514931155834e-7};
if(creal(z) < 0.5) {return M_PI / (csin(M_PI*z)*gamma_lanczos_cfft(1. - z));}
z -= 1;
double complex x = p[0];
for(int n = 1; n < 9; n++){ x += p[n] / (z + (double)(n));}
double complex t = z + 7.5;
return sqrt(2*M_PI) * cpow(t, z+0.5) * cexp(-t) * x;
}
double complex lngamma_lanczos_cfft(double complex z) {
/* Lanczos coefficients for g = 7 */
static double p[] = {
0.99999999999980993227684700473478,
676.520368121885098567009190444019,
-1259.13921672240287047156078755283,
771.3234287776530788486528258894,
-176.61502916214059906584551354,
12.507343278686904814458936853,
-0.13857109526572011689554707,
9.984369578019570859563e-6,
1.50563273514931155834e-7};
if(creal(z) < 0.5) {return clog(M_PI) - clog(csin(M_PI*z)) - lngamma_lanczos_cfft(1. - z);}
z -= 1;
double complex x = p[0];
for(int n = 1; n < 9; n++){ x += p[n] / (z + (double)(n));}
double complex t = z + 7.5;
return log(2*M_PI) /2. + (z+0.5)*clog(t) -t + clog(x);
}
void g_l_cfft(double l, double nu, double *eta, double complex *gl, long N) {
/* z = nu + I*eta
Calculate g_l = exp( zln2 + lngamma( (l+nu)/2 + I*eta/2 ) - lngamma( (3+l-nu)/2 - I*eta/2 ) ) */
long i;
double complex z;
for(i=0; i<N; i++) {
z = nu+I*eta[i];
// gl[i] = cexp(z*log(2.) + clog(gamma_lanczos((l+z)/2.) ) - clog(gamma_lanczos((3.+l-z)/2.)));
gl[i] = cexp(z*log(2.) + lngamma_lanczos_cfft((l+z)/2.) - lngamma_lanczos_cfft((3.+l-z)/2.) );
// if(isnan(gl[i])) {printf("nan at l,nu,eta, = %lf %lg %lg %lg %lg\n", l,nu, eta[i], gamma_lanczos((l+z)/2.),gamma_lanczos((3.+l-z)/2.));exit(0);}
}
}
void g_l_1_cfft(double l, double nu, double *eta, double complex *gl1, long N) {
/* z = nu + I*eta
Calculate g_l_1 = exp(zln2 + lngamma( (l+nu-1)/2 + I*eta/2 ) - lngamma( (4+l-nu)/2 - I*eta/2 ) ) */
long i;
double complex z;
for(i=0; i<N; i++) {
z = nu+I*eta[i];
gl1[i] = -(z-1.)* cexp((z-1.)*log(2.) + lngamma_lanczos_cfft((l+z-1.)/2.) - lngamma_lanczos_cfft((4.+l-z)/2.));
}
}
void g_l_2_cfft(double l, double nu, double *eta, double complex *gl2, long N) {
/* z = nu + I*eta
Calculate g_l_1 = exp(zln2 + lngamma( (l+nu-2)/2 + I*eta/2 ) - lngamma( (5+l-nu)/2 - I*eta/2 ) ) */
long i;
double complex z;
for(i=0; i<N; i++) {
z = nu+I*eta[i];
gl2[i] = (z-1.)* (z-2.)* cexp((z-2.)*log(2.) + lngamma_lanczos_cfft((l+z-2.)/2.) - lngamma_lanczos_cfft((5.+l-z)/2.));
}
}
void c_window_cfft(double complex *out, double c_window_width, long halfN) {
// 'out' is (halfN+1) complex array
long Ncut;
Ncut = (long)(halfN * c_window_width);
long i;
double W;
for(i=0; i<=Ncut; i++) { // window for right-side
W = (double)(i)/Ncut - 1./(2.*M_PI) * sin(2.*i*M_PI/Ncut);
out[halfN-i] *= W;
}
}
|
Python
|
UTF-8
| 1,052
| 2.96875
| 3
|
[] |
no_license
|
# 러시아 국기 같은 깃발
import sys
sys.stdin = open("4613_input.txt", "r")
T = int(input())
for TC in range(1, T+1):
N, M = map(int, input().split())
Flag = [list(input()) for _ in range(N)]
# 변경 최소값은 모든 칸의 수보다는 작으므로
# 최소값의 초기화를 모든 칸의 수로
minV = N*M
# 하얀색으로 변경
W_chg = 0
for w in range(N-2):
for i in range(M):
if Flag[w][i] != "W":
W_chg += 1
# 파란색으로 변경
B_chg = 0
for b in range(w+1, N-1):
for i in range(M):
if Flag[b][i] != "B":
B_chg += 1
# 빨간색으로 변경
R_chg = 0
for r in range(b+1, N):
for i in range(M):
if Flag[r][i] != "R":
R_chg += 1
# 최소값 구하기
if minV > W_chg + B_chg + R_chg:
minV = W_chg + B_chg + R_chg
print("#{} {}".format(TC, minV))
|
Python
|
UTF-8
| 3,615
| 2.96875
| 3
|
[] |
no_license
|
import platform
if platform.system()=='Darwin':
from tkinter import *
else:
from Tkinter import *
import random
finestra = Tk()
w=500
h=500
tela = Canvas(finestra,width=w,height=h)
tela.pack()
def _centro(c):
return ( (c[0]+c[2])/2, (c[1]+c[3])/2 )
def _distanzaQ(p1,p2):
return (p1[0]-p2[0])**2 + (p1[1]-p2[1])**2
class Auto:
global tela
def __init__(self):
self.punti=0
self.lato=20
L=self.lato/2
W=w/2
H=h/2
self.disegno = tela.create_oval(W-L,H-L,W+L,H+L,fill="green")
self.punteggio = tela.create_text(W,20,text=str(self.punti))
self.direzione = "O"
self.v = 1
self.continua = True
tela.focus_set()
tela.bind("<Key>",self._tastiera)
def _tastiera(self,event):
if event.char=='m': self.v = self.v + 1
if event.char=='n': self.v = self.v - 1
if self.v>3: self.v=3
if self.v<0: self.v=0
if event.char=='w': self.direzione = "N"
if event.char=='a': self.direzione = "E"
if event.char=='s': self.direzione = "S"
if event.char=='d': self.direzione = "O"
def _comando(self):
if self.direzione == "O": tela.move(self.disegno,self.v,0)
if self.direzione == "E": tela.move(self.disegno,-self.v,0)
if self.direzione == "N": tela.move(self.disegno,0,-self.v)
if self.direzione == "S": tela.move(self.disegno,0,self.v)
def _bordi(self):
c=tela.coords(self.disegno)
if c[0]<0:
c[0]=w-1
c[2]=w-1+self.lato
if c[0]>w:
c[0]=0
c[2]=self.lato
if c[1]<0:
c[1]=h-1
c[3]=h-1+self.lato
if c[1]>h:
c[1]=0
c[3]=self.lato
tela.coords(self.disegno,c[0],c[1],c[2],c[3])
def _collisioni(self):
c = tela.coords(self.disegno)
c = _centro(c)
for o in self.ostacoli:
co = tela.coords(o.disegno)
co = _centro(co)
if _distanzaQ(c,co) < (self.lato)**2:
tela.itemconfig(self.disegno,fill='red')
tela.itemconfig(o.disegno,fill='red')
self.continua = False
o.continua = False
def _avanza(self):
self._comando()
self._bordi()
self._collisioni()
self.punti=self.punti+self.v
tela.itemconfig(self.punteggio,text=str(self.punti))
if self.continua: tela.after(40,self._avanza)
def inizia(self):
self._avanza()
class Ostacolo:
global tela
def __init__(self):
self.lato=20
L=self.lato/2
W=random.randint(L,w-L)
H=random.randint(L,h-L)
self.disegno = tela.create_oval(W-L,H-L,W+L,H+L,fill="blue")
self.direzione = "O"
self.v = 1
self.continua = True
def _comando(self):
self.v=random.randint(0,4)
RX=random.randint(-self.v,self.v)
RY=random.randint(-self.v,self.v)
tela.move(self.disegno,RX,RY)
def _bordi(self):
c=tela.coords(self.disegno)
if c[0]<0:
c[0]=w-1
c[2]=w-1+self.lato
if c[0]>w:
c[0]=0
c[2]=self.lato
if c[1]<0:
c[1]=h-1
c[3]=h-1+self.lato
if c[1]>h:
c[1]=0
c[3]=self.lato
tela.coords(self.disegno,c[0],c[1],c[2],c[3])
def _avanza(self):
self._comando()
self._bordi()
if self.continua: tela.after(40,self._avanza)
def inizia(self):
self._avanza()
auto = Auto()
ostacoli=[]
for i in range(0,10):
ostacoli.append(Ostacolo())
auto.ostacoli=ostacoli
auto.inizia()
for o in ostacoli: o.inizia()
finestra.mainloop()
|
Java
|
UTF-8
| 3,909
| 2.734375
| 3
|
[
"BSD-3-Clause"
] |
permissive
|
/*
* NameAndEntryTypeSearcher.java
* ---------------------------------
* Copyright (c) 2020
* RESOLVE Software Research Group
* School of Computing
* Clemson University
* All rights reserved.
* ---------------------------------
* This file is subject to the terms and conditions defined in
* file 'LICENSE.txt', which is part of this source code package.
*/
package edu.clemson.cs.rsrg.typeandpopulate.query.searcher;
import edu.clemson.cs.rsrg.typeandpopulate.entry.SymbolTableEntry;
import edu.clemson.cs.rsrg.typeandpopulate.exception.DuplicateSymbolException;
import edu.clemson.cs.rsrg.typeandpopulate.symboltables.SymbolTable;
import java.util.List;
/**
* <p>
* A <code>NameAndEntryTypeSearcher</code> returns entries in a
* {@link SymbolTable} that have the
* specified name and entry type.
* </p>
*
* @param <E> The return type of the base <code>MultimatchTableSearcher</code>.
*
* @version 2.0
*/
public class NameAndEntryTypeSearcher<E extends SymbolTableEntry>
implements
MultimatchTableSearcher<E> {
// ===========================================================
// Member Fields
// ===========================================================
/**
* <p>
* A class that inherits from {@link SymbolTableEntry}
* </p>
*/
private final Class<E> myTargetClass;
/**
* <p>
* Name of the entry to be searched
* </p>
*/
private final String myTargetName;
/**
* <p>
* Boolean flag that indicates if we stop after we find the first or not.
* </p>
*/
private final boolean myStopAfterFirstFlag;
// ===========================================================
// Constructors
// ===========================================================
/**
* <p>
* This constructs a searcher that specifies a search string, an entry type
* and a boolean flag
* that indicates whether or not we stop after the first match.
* </p>
*
* @param name Name of the entry to be searched.
* @param targetClass A class that inherits from {@link SymbolTableEntry}.
* @param stopAfterFirst Boolean flag that indicates if we stop after we
* find the first or not.
*/
public NameAndEntryTypeSearcher(String name, Class<E> targetClass,
boolean stopAfterFirst) {
myTargetClass = targetClass;
myTargetName = name;
myStopAfterFirstFlag = stopAfterFirst;
}
// ===========================================================
// Public Methods
// ===========================================================
/**
* <p>
* Refines
* {@link TableSearcher#addMatches(SymbolTable, List, SearchContext)}} to
* guarantee that
* it will not throw a {@link DuplicateSymbolException}. Otherwise, behaves
* identically.
* </p>
*
* @param entries The set of symbol table entries to consider.
* @param matches A non-<code>null</code> accumulator of matches.
* @param l The context from which <code>entries</code> was drawn.
*
* @return <code>true</code> if <code>matches</code> now represents a final
* list of search
* results; i.e., no further symbol table entries should be
* considered. <code>false</code>
* indicates that the search should continue, provided there are
* additional un-searched
* scopes.
*/
@Override
public final boolean addMatches(SymbolTable entries, List<E> matches,
SearchContext l) {
SymbolTableEntry match = entries.get(myTargetName);
boolean foundOne = (match != null)
&& myTargetClass.isAssignableFrom(match.getClass());
if (foundOne) {
matches.add((E) match);
}
return myStopAfterFirstFlag && foundOne;
}
}
|
Rust
|
UTF-8
| 7,507
| 2.53125
| 3
|
[] |
no_license
|
use sdl2::render::{Canvas, RenderTarget};
use sdl2::event::Event;
use sdl2::keyboard::Keycode;
use sdl2::pixels::Color;
use sdl2::rect::Rect;
use std::fs::File;
use std::io::Read;
use std::time::{Duration, Instant};
extern crate env_logger;
extern crate log;
use crate::chip8::Chip8;
use log::debug;
use std::env;
extern crate spin_sleep;
const CELL_PIXEL_SIDE: u32 = 20;
const X_SIZE: u32 = CELL_PIXEL_SIDE * 64;
const Y_SIZE: u32 = CELL_PIXEL_SIDE * 32;
/*
let color_on: Color = Color::RGB(255, 255, 255);
let color_off: Color = Color::RGB(0, 0, 0);
*/
pub mod chip8;
fn main() {
env_logger::init();
let args: Vec<String> = env::args().collect();
if args.len() < 2 {
println!("ROM missing!");
return;
}
let sdl_context = sdl2::init().unwrap();
let audio_subsystem = sdl_context.audio().unwrap();
let desired_spec = AudioSpecDesired {
freq: Some(44100),
channels: Some(1),
samples: Some(512),
};
let buzzer = audio_subsystem
.open_playback(None, &desired_spec, |spec| {
// initialize the audio callback
SquareWave {
phase_inc: 440.0 / spec.freq as f32,
phase: 0.0,
volume: 0.25,
}
})
.unwrap();
let video_subsystem = sdl_context.video().unwrap();
let window = video_subsystem
.window("Chip-8", X_SIZE, Y_SIZE)
.position_centered()
.opengl()
.build()
.unwrap();
let mut canvas = window.into_canvas().build().unwrap();
canvas.set_draw_color(Color::RGB(0, 0, 0));
canvas.clear();
canvas.present();
let mut machine = Chip8::new();
machine.init();
let rom = read_file(&args[1]);
machine.load_rom(0x200, &rom);
machine.set_pc(0x200);
let mut keyboard = [false; 16];
let mut event_pump = sdl_context.event_pump().unwrap();
//600hz
let default_clock_cycle = Duration::new(0, 10_000_000 / 6);
let mut current_clock_cycle = default_clock_cycle;
'event_loop: loop {
let looping_time = Instant::now();
for event in event_pump.poll_iter() {
match event {
Event::Quit { .. }
| Event::KeyDown {
keycode: Some(Keycode::Escape),
..
} => break 'event_loop,
Event::KeyDown {
keycode: Some(Keycode::O),
..
} => {
machine = Chip8::default();
machine.init();
machine.load_rom(0x200, &rom);
machine.set_pc(0x200);
}
Event::KeyDown {
keycode: Some(Keycode::KpPlus),
..
} => current_clock_cycle /= 2,
Event::KeyDown {
keycode: Some(Keycode::KpMinus),
..
} => current_clock_cycle *= 2,
Event::KeyDown {
keycode: Some(Keycode::Kp0),
..
} => current_clock_cycle = default_clock_cycle,
Event::KeyDown {
keycode: Some(keycode),
..
} => handle_key(&mut keyboard, &mut machine, keycode, true),
Event::KeyUp {
keycode: Some(keycode),
..
} => handle_key(&mut keyboard, &mut machine, keycode, false),
_ => {}
}
}
process_sound(&machine, &buzzer);
machine.tick_clock(&keyboard);
if machine.video_memory_tainted {
draw_canvas(&machine, &mut canvas);
}
canvas.present();
let elapsed_time = looping_time.elapsed();
//debug!("Cycle: {}us, ", elapsed_time.as_micros());
if let Some(sleep_required) = current_clock_cycle.checked_sub(elapsed_time) {
let slept_time = Instant::now();
spin_sleep::sleep(sleep_required);
debug!(
"Loop time: {}us, Sleep Required: {}us, Slept for: {}us, Error: {}us",
elapsed_time.as_micros(),
sleep_required.as_micros(),
slept_time.elapsed().as_micros(),
sleep_required.as_micros() as i64 - slept_time.elapsed().as_micros() as i64,
);
}
}
}
pub fn process_sound<T: sdl2::audio::AudioCallback>(
machine: &Chip8,
device: &sdl2::audio::AudioDevice<T>,
) {
if machine.st == 0 {
device.pause();
} else {
device.resume();
}
}
fn draw_canvas<T: RenderTarget>(machine: &Chip8, canvas: &mut Canvas<T>) {
let color_on: Color = Color::RGB(255, 255, 255);
let color_off: Color = Color::RGB(0, 0, 0);
for y in 0..32 {
for x in 0..64 {
let pixel_value = machine.get_pixel(x, y);
let color = if pixel_value { color_on } else { color_off };
canvas.set_draw_color(color);
let (px, py) = (x as u32 * CELL_PIXEL_SIDE, y as u32 * CELL_PIXEL_SIDE);
canvas
.fill_rect(Rect::new(
px as i32,
py as i32,
CELL_PIXEL_SIDE,
CELL_PIXEL_SIDE,
))
.unwrap();
}
}
}
fn read_file(path: &str) -> [u8; 3584] {
let mut f = File::open(path).unwrap();
let mut buffer = [0u8; 3584];
let _len = f.read(&mut buffer).unwrap();
buffer
}
pub fn handle_key(
pad_state: &mut [bool; 16],
machine: &mut Chip8,
keycode: Keycode,
pressed: bool,
) {
/*
HEX PAD | QWERTY
1 2 3 C | 1 2 3 4
4 5 6 D | Q W E R
7 8 9 E | A S D F
A 0 B F | Z X C V
*/
match keycode {
// Keypad keys
Keycode::Num1 => pad_state[0x1] = pressed,
Keycode::Num2 => pad_state[0x2] = pressed,
Keycode::Num3 => pad_state[0x3] = pressed,
Keycode::Num4 => pad_state[0xC] = pressed,
Keycode::Q => pad_state[0x4] = pressed,
Keycode::W => pad_state[0x5] = pressed,
Keycode::E => pad_state[0x6] = pressed,
Keycode::R => pad_state[0xD] = pressed,
Keycode::A => pad_state[0x7] = pressed,
Keycode::S => pad_state[0x8] = pressed,
Keycode::D => pad_state[0x9] = pressed,
Keycode::F => pad_state[0xE] = pressed,
Keycode::Z => pad_state[0xA] = pressed,
Keycode::X => pad_state[0x0] = pressed,
Keycode::C => pad_state[0xB] = pressed,
Keycode::V => pad_state[0xF] = pressed,
// other keys
Keycode::P => {
if pressed {
machine.int()
}
}
Keycode::N => {
if pressed {
machine.next(pad_state)
}
}
_ => {}
}
}
use sdl2::audio::{AudioCallback, AudioSpecDesired};
// https://docs.rs/sdl2/0.32.2/sdl2/audio/index.html#example
struct SquareWave {
phase_inc: f32,
phase: f32,
volume: f32,
}
impl AudioCallback for SquareWave {
type Channel = f32;
fn callback(&mut self, out: &mut [f32]) {
// Generate a square wave
for x in out.iter_mut() {
*x = if self.phase <= 0.5 {
self.volume
} else {
-self.volume
};
self.phase = (self.phase + self.phase_inc) % 1.0;
}
}
}
|
C++
|
UTF-8
| 1,046
| 3.3125
| 3
|
[] |
no_license
|
#include<bits/stdc++.h>
using namespace std;
int Arr[100005];
int root(int i)
{
while(Arr[ i ] != i) //chase parent of current element until it reaches root
{
i = Arr[ i ];
}
return i;
}
/*modified union function where we connect the elements by changing the root of one of the elements*/
int union1(int A ,int B)
{
int root_A = root(A);
int root_B = root(B);
Arr[ root_A ] = root_B ; //setting parent of root(A) as root(B)
}
bool find(int A,int B)
{
if( root(A)==root(B) ) //if A and B have the same root, it means that they are connected.
return true;
else
return false;
}
int main()
{
for(int i=0;i<=100005;i++) Arr[i] =i;
int n,m;
cin>>n>>m;
for(int i=0;i<m;i++)
{
int u,v;
cin>>u>>v;
if(root(u)!=root(v))
union1(u,v);
}
for(int i=1;i<=n;i++)
{
int count =0;
for(int j=i+1;j<=m;j++)
{
if(Arr[i] ==j) count++;
}
cout<<count<<endl;
}
}
|
C++
|
UTF-8
| 804
| 2.515625
| 3
|
[] |
no_license
|
///////////////////////////////////////////////////////////
// cSpeed.h
// Implementation of the Class cSpeed
// Created on: 05-May-2010 3:28:58 AM
// Original author: shawn.mcginnis
///////////////////////////////////////////////////////////
#if !defined(EA_DBB8DA43_62AF_434c_83B7_A9C6B975B2E8__INCLUDED_)
#define EA_DBB8DA43_62AF_434c_83B7_A9C6B975B2E8__INCLUDED_
#include "cDigital.h"
#define WHEELSPEED_INT 0
/**
* The Speed class will be the interface between internal software and the
* hardware speed sensor.
*/
class cSpeed : public cDigital
{
public:
cSpeed();
virtual ~cSpeed();
virtual bool Update();
void* Read();
private:
unsigned int rpm;
float mph;
};
#endif // !defined(EA_DBB8DA43_62AF_434c_83B7_A9C6B975B2E8__INCLUDED_)
|
Python
|
UTF-8
| 1,731
| 3.53125
| 4
|
[] |
no_license
|
# id name email
# 1 Bob Smith, bsmith@hotmail.com
# 2 Sue Jones, suej@yahoo.com
# 3 Joe James, joejames@gmail.com
# define field descriptions widths
# pad field descriptions to make header printing less complex
field_width = (3, 10, 18)
field_desc = ("id".ljust(field_width[0]), "name".ljust(field_width[1]), "email")
# print the passed customer record
def print_cust():
informal_name = name.split(" ")[0]
print()
print("Here is " + informal_name + "'s record:")
print()
# print a header of field descriptions
for item in field_desc:
# add a null to match later formatting
print(item, "", end="")
print()
# adjust the field_width to account for spaces between items
print("-" * (sum(field_width) + 2))
# print customer, padded to field_width
print(str(id).ljust(field_width[0]), name.ljust(field_width[1]), email.ljust(field_width[2]))
# load address book
row1 = ( 1, "Bob Smith", "bsmith@hotmail.com")
row2 = ( 2, "Sue Jones", "suej@yahoo.com")
row3 = ( 3, "Joe James", "joejames@gmail.com")
address_book = (row1, row2, row3)
# give user some context
print()
print("Customer Address Database 2000")
print(" search mode")
print()
# search until user quits
while True:
search_name = input("Enter customer name, 'exit' to exit: ")
# exit if asked
if search_name.lower() == "exit":
break
# search each record for matching customer
customer_found = False
for customer_record in address_book:
(id, name, email) = customer_record
if search_name.lower() == name.lower():
print_cust()
customer_found = True
if not customer_found:
print("Sorry, could not find", search_name, "in the database")
print()
|
Java
|
UTF-8
| 577
| 2.359375
| 2
|
[] |
no_license
|
package com.java.utils;
import java.util.Date;
import com.java.contants.SecurityConstants;
import io.jsonwebtoken.Jwts;
import io.jsonwebtoken.SignatureAlgorithm;
public class Utils {
public Utils() {}
public String generatedResetPasswordToken(String email) {
Date now = new Date();
String token = Jwts.builder()
.setSubject(email)
.setIssuedAt(now)
.setExpiration(new Date(now.getTime() + SecurityConstants.RESET_PASSWORD_EXPIRATION_TIME))
.signWith(SignatureAlgorithm.HS256, SecurityConstants.tokenSecret)
.compact();
return token;
}
}
|
C++
|
UTF-8
| 497
| 3.46875
| 3
|
[] |
no_license
|
#include "Circle.h"
#include <iomanip>
#include <iostream>
#include <sstream>
#include <string>
using namespace std;
Circle::Circle(const string& color, double inRadius) : Shape(color)
{
radius = inRadius;
}
double Circle::area() const
{
return 3.141592654 * (radius * radius);
}
string Circle::toString() const
{
ostringstream oss;
string myString;
oss << getColor() << " circle with radius of " << radius << " and area of " << area();
myString = oss.str();
return myString;
}
|
JavaScript
|
UTF-8
| 3,348
| 3.109375
| 3
|
[
"MIT"
] |
permissive
|
import { hasRelationship } from './hasRelationship'
import { hasLoadableRelationship } from './hasLoadableRelationship'
import { hasLoadedRelationship } from './hasLoadedRelationship'
import { listRelationship } from './listRelationship'
import { loadRelationship } from './loadRelationship'
import { getRelationship } from './getRelationship'
export class ResourceBuilder {
constructor (store) {
this.store = store
}
/**
* Returns a new functional resource object
*
* Functional resource objects are structurally identical to
* normal JSON:API resource objects but are enhanced with
* methods to simplify access to relationships.
*
* @param {Object} jsonResourceObject
*/
build (jsonResourceObject) {
const obj = JSON.parse(JSON.stringify(jsonResourceObject.data)) // why tho?
obj.hasRelationship = hasRelationship(obj)
obj.hasLoadableRelationship = hasLoadableRelationship(obj)
obj.hasLoadedRelationship = hasLoadedRelationship(obj)
obj.get = (attributeName) => Object.prototype.hasOwnProperty.call(obj.attributes, attributeName) ? obj.attributes[attributeName] : new Error(`attribute "${attributeName}" not found`)
if (obj.hasRelationship) {
this.buildRelationshipMethods(obj)
}
return obj
}
/**
* Adds Methods (get, load, list) to the relationships for getting / loading them
* Adds Shorthand Methods (rel / loadRel)
*
* @param {Object} jsonResourceObject
*/
buildRelationshipMethods (obj) {
const relationships = obj.relationships
for (const currentRelationshipName in relationships) {
if (Object.prototype.hasOwnProperty.call(relationships, currentRelationshipName)) {
const relatedObject = relationships[currentRelationshipName]
const relationshipConfig = {
isToMany: relatedObject.data.constructor === Array
}
relatedObject.get = getRelationship(this.store, relatedObject, relationshipConfig)
relatedObject.load = loadRelationship(this.store, obj.id, obj.type, relatedObject, relationshipConfig)
if (relationshipConfig.isToMany) {
relatedObject.list = listRelationship(this.store, relatedObject)
}
relationships[currentRelationshipName] = relatedObject
}
}
// shorthand variant
obj.loadRel = (relationshipName) => {
return loadRelationship(this.store, obj.id, obj.type, relationships[relationshipName], getRelationshipConfig(relationships[relationshipName]))()
}
obj.rel = (relationshipName) => {
if (getRelationshipConfig(relationships[relationshipName]).isToMany) {
return listRelationship(this.store, relationships[relationshipName])()
} else {
return getRelationship(this.store, relationships[relationshipName], getRelationshipConfig(relationships[relationshipName]))()
}
}
}
/**
* Convenience method to get a spec-conforming version of
* a resource object
*
* @param {Object} functionalResourceObject
*/
static strip (functionalResourceObject) {
return JSON.parse(JSON.stringify(functionalResourceObject))
}
}
/**
* Config Getter for the RelationshipMethod
*
* @param relatedObject
* @return {{isToMany: boolean}}
*/
function getRelationshipConfig (relatedObject) {
return {
isToMany: relatedObject.data.constructor === Array
}
}
|
Markdown
|
UTF-8
| 2,326
| 3.859375
| 4
|
[] |
no_license
|
# Abbreviation
> [문제출처](https://www.hackerrank.com/challenges/abbr/problem)
## 문제
```
You can perform the following operations on the string, :
Capitalize zero or more of 's lowercase letters.
Delete all of the remaining lowercase letters in .
Given two strings, and , determine if it's possible to make equal to as described. If so, print YES on a new line. Otherwise, print NO.
For example, given and , in we can convert and delete to match . If and , matching is not possible because letters may only be capitalized or discarded, not changed.
Function Description
Complete the function in the editor below. It must return either or .
abbreviation has the following parameter(s):
a: the string to modify
b: the string to match
Input Format
The first line contains a single integer , the number of queries.
Each of the next pairs of lines is as follows:
- The first line of each query contains a single string, .
- The second line of each query contains a single string, .
Constraints
String consists only of uppercase and lowercase English letters, ascii[A-Za-z].
String consists only of uppercase English letters, ascii[A-Z].
Output Format
For each query, print YES on a new line if it's possible to make string equal to string . Otherwise, print NO.
Sample Input
1
daBcd
ABC
Sample Output
YES
Explanation
image
We have daBcd and ABC. We perform the following operation:
Capitalize the letters a and c in so that dABCd.
Delete all the remaining lowercase letters in so that ABC.
Because we were able to successfully convert to , we print YES on a new line.
```
## 풀이코드
```python
def abbreviation(a, b, i=0, j=0, checked=None):
checked = set() if checked is None else checked # 1
if j == len(b): # 2
more_uppers = any(char.isupper() for char in a[i:])
return "NO" if more_uppers else "YES"
for k in range(i, len(a)): # 3
if a[k].isupper() and a[k] != b[j]: # 4
return "NO"
if a[k].upper() == b[j]: # 5
if (k, j) in checked: # 6
pass
elif abbreviation(a,b,k+1,j+1,checked) == "YES": # 7
return "YES"
else:
checked.add((k, j))
if a[k].isupper(): # 8
return "NO"
return "NO" # 9
```
|
Python
|
UTF-8
| 1,129
| 3.765625
| 4
|
[] |
no_license
|
# basics_python
#find the value of a, b, c in the given array such that they add up to give value equal to the given target(here 0) return the list of lists wherein each list
#contains the value of set a, b, c .
class Solution:
def threeSum(self, nums: List[int]) -> List[List[int]]:
result=[]
nums.sort()
for i,value in enumerate(nums):
if i>0 and value == nums[i-1]: #this is used to prevent the appearance of two similar lists due to the presence of duplicate values
continue
l=i+1
r=len(nums)-1
while l<r:
if value+nums[l]+nums[r] > 0:
r -=1
elif value+nums[l]+nums[r] < 0:
l +=1
else:
result.append([value, nums[l], nums[r]])
l +=1
while l<r and nums[l]==nums[l-1]: #this is also used top prevent duplicate values , each of these eliminates the one escaped from each other
l +=1
return(result)
|
Python
|
UTF-8
| 8,685
| 2.59375
| 3
|
[] |
no_license
|
# Epipolar Stereopsis
# Alex Barnett, Spring 2019
# Code sourced from Dr. Peters
import numpy as np
import cv2
filename1 = './images/stereo_0.png'
filename2 = './images/stereo_1.png'
def orb_detector(img):
# Initiate ORB detector
orb = cv2.ORB_create()
# Find the keypoints with ORB
kp = orb.detect(img, None)
# Compute the descriptors with ORB
kp, des = orb.compute(img, kp)
# Draw keypoints location
img = cv2.drawKeypoints(img, kp, None, color=(0, 255, 0), flags=0)
return kp, des, img
def feature_matching(norm, img1, img2, kp1, kp2, des1, des2, numMatches, display, fileout):
# create BFMatcher object
bf = cv2.BFMatcher(norm, crossCheck=True)
# Match descriptors
matches = bf.match(des1, des2)
# Sort them in the order of their distance
matches = sorted(matches, key=lambda x: x.distance)
# Draw matches
img3 = np.array([])
img3 = cv2.drawMatches(img1, kp1, img2, kp2, matches[:numMatches], img3, flags=2)
cv2.imshow(display, img3)
if cv2.waitKey(0) & 0xff == 27:
cv2.destroyAllWindows()
cv2.imwrite('./results/feature_match.png', img3)
return matches
def drawlines(img1, img2, lines, pts1, pts2):
''' img1 - image on which we draw the epilines for the points in img2
lines - corresponding epilines '''
r, c, B = img1.shape
# img1 = cv2.cvtColor(img1,cv2.COLOR_GRAY2BGR)
# img2 = cv2.cvtColor(img2,cv2.COLOR_GRAY2BGR)
for r, pt1, pt2 in zip(lines, pts1, pts2):
color = tuple(np.random.randint(0, 255, 3).tolist())
x0, y0 = map(int, [0, -r[2]/r[1]])
x1, y1 = map(int, [c, -(r[2]+r[0]*c)/r[1] ])
img1 = cv2.line(img1, (x0,y0), (x1,y1), color,1)
# img1 = cv2.circle(img1,tuple(pt1),5,color,-1)
# img2 = cv2.circle(img2,tuple(pt2),5,color,-1)
return img1,img2
# Find good conjugate pixel pairs from feature matching on a stereo pair of images
''' ORB Detector '''
img_left = cv2.imread(filename1)
img_right = cv2.imread(filename2)
R, C, B = np.shape(img_left)
kp_left, des_left, img_left_orb = orb_detector(img_left)
kp_right, des_right, img_right_orb = orb_detector(img_right)
# Visualize ORB detector
cv2.imshow('ORB Corner Detector 1', img_left_orb)
cv2.imshow('ORB Corner Detector 2', img_right_orb)
if cv2.waitKey(0) & 0xff == 27:
cv2.destroyAllWindows()
#
# Write images to files
# cv2.imwrite('./results/orb/orb1.png', img1_orb)
# cv2.imwrite('./results/orb/orb2.png', img2_orb)
''' ORB Feature Matching '''
matches = feature_matching(cv2.NORM_HAMMING, img_left, img_right, kp_left, kp_right, des_left, des_right, 100,
'ORB Feature Matching', 'featureMatch_orb.png')
# Load camera parameters
calib = np.load('./data/calib.npz')
parameters = calib._files
Kn, distn, rvecn, tvecn = [parameters[0], parameters[1], parameters[2], parameters[3]]
cameraMatrix, distCoeffs, rvec, tvec = [calib[parameters[0]], calib[parameters[1]],
calib[parameters[2]], calib[parameters[3]]]
# Undistort images
img_left_undistorted = cv2.undistort(img_left, cameraMatrix, distCoeffs)
img_right_undistorted = cv2.undistort(img_right, cameraMatrix, distCoeffs)
# Display undistorted images
cv2.imshow('Undistorted Image Left', img_left_undistorted)
cv2.imshow('Undistorted Image Right', img_right_undistorted)
if cv2.waitKey(0) & 0xff == 27:
cv2.destroyAllWindows()
cv2.imwrite('./results/undistortleft.png', img_left_undistorted)
cv2.imwrite('./results/undistortright.png', img_right_undistorted)
newK, roi = cv2.getOptimalNewCameraMatrix(cameraMatrix, distCoeffs, (C, R), 0, (C, R))
print(cameraMatrix)
print(newK)
# N x 1 x 2
matched_kps_left = [kp_left[mat.queryIdx].pt for mat in matches]
matched_kps_right = [kp_right[mat.trainIdx].pt for mat in matches]
matched_kps_left = np.array(matched_kps_left)
matched_kps_right = np.array(matched_kps_right)
matched_kps_left = matched_kps_left[:, np.newaxis, :]
matched_kps_right = matched_kps_right[:, np.newaxis, :]
criteria = (cv2.TERM_CRITERIA_EPS + cv2.TERM_CRITERIA_MAX_ITER, 30, 1e-6)
# Undistort the image points
pts_left_undistorted = cv2.undistortPointsIter(matched_kps_left, cameraMatrix, distCoeffs,
R=None, P=newK, criteria=criteria)
pts_right_undistorted = cv2.undistortPointsIter(matched_kps_right, cameraMatrix, distCoeffs,
R=None, P=newK, criteria=criteria)
# Compute the fundamental matrix
F, mask = cv2.findFundamentalMat(pts_left_undistorted, pts_right_undistorted,
method=cv2.RANSAC, ransacReprojThreshold=0.5, confidence=.99)
# Compute the essential matrix
E = np.matmul(np.transpose(cameraMatrix), np.matmul(F, cameraMatrix))
# Recover inliers
inl_pts_left = matched_kps_left[mask.ravel() == 1]
inl_pts_right = matched_kps_right[mask.ravel() == 1]
nPts = inl_pts_left.shape[0]
newPts_left, newPts_right = cv2.correctMatches(F, np.reshape(inl_pts_left, (1, nPts, 2)),
np.reshape(inl_pts_right, (1, nPts, 2)))
newPts_left = newPts_left.reshape(-1, 1, 2)
newPts_right = newPts_right.reshape(-1, 1, 2)
# Draw epilines
lines1 = cv2.computeCorrespondEpilines(newPts_right.reshape(-1, 1, 2), 2, F)
lines1 = lines1.reshape(-1, 3)
img5, img6 = drawlines(img_left, img_right, lines1, newPts_left, newPts_right)
lines2 = cv2.computeCorrespondEpilines(newPts_left.reshape(-1, 1, 2), 1, F)
lines2 = lines2.reshape(-1, 3)
img3, img4 = drawlines(img_left, img_right, lines2, newPts_left, newPts_right)
# Display and write epilines
cv2.imshow('Left Image w/ epilines', img5)
cv2.imshow('Right Image w/ epilines', img3)
if cv2.waitKey(0) & 0xff == 27:
cv2.destroyAllWindows()
cv2.imwrite('./results/epilinesl.png', img5)
cv2.imwrite('./results/epilines2.png', img3)
# Decompose essential matrix into translational and rotational vectors
ret, rot, trans, mask, wPts = cv2.recoverPose(E, newPts_left, newPts_right, newK, distanceThresh=1000)
np.savez('./data/FMat.npz', F=F, E=E, rvec=rot, tvec=trans)
# Homogenize worldpoint estimates
wPts = cv2.convertPointsFromHomogeneous(np.transpose(wPts))
# Calculate left and right projection matrices
PL = np.append(newK, np.zeros((3, 1), dtype=float), axis=1)
PR = np.append(newK, np.append(rot, trans, axis=1))
invRot = np.transpose(rot)
invTrans = -np.matmul(invRot, trans)
# Compute rotation vector from rotation matrix
rotVec = cv2.Rodrigues(rot)
# Project triangulated world points onto the left image plane
proj_left = cv2.projectPoints(wPts, (0, 0, 0), (0, 0, 0), newK, distCoeffs)
# Project triangulated world points onto the right image plane
proj_right = cv2.projectPoints(wPts, rotVec[0], trans, newK, distCoeffs)
np.savez('./data/ptbased', rotVec=rotVec, trans=trans)
# Compute reprojection error
# Compare reprojected points to undistorted original points
# by computing average Euclidian norm of the difference
# Distance between points in all axes
dLx = np.squeeze(proj_left[0][:, 0, 0] - newPts_left[:, 0, 0])
dRx = np.squeeze(proj_right[0][:, 0, 0] - newPts_right[:, 0, 0])
dLy = np.squeeze(proj_left[0][:, 0, 1] - newPts_left[:, 0, 1])
dRy = np.squeeze(proj_right[0][:, 0, 1] - newPts_right[:, 0, 1])
# Error
pt_error_left_x = np.sum(np.abs(dLx))/nPts
pt_error_right_x = np.sum(np.abs(dRx))/nPts
pt_error_left_y = np.sum(np.abs(dLy))/nPts
pt_error_right_y= np.sum(np.abs(dRy))/nPts
print([pt_error_left_x, pt_error_left_y, pt_error_right_x, pt_error_right_y])
# Compute homography matrix
ret, HL, HR = cv2.stereoRectifyUncalibrated(newPts_left, newPts_right, F, (C, R), threshold=1)
print(HL)
print(HR)
# Rectify images
img_left_rect = cv2.warpPerspective(img_left_undistorted, HL, (C, R))
img_right_rect = cv2.warpPerspective(img_right_undistorted, HR, (C, R))
# Display rectified images
cv2.imshow('Rectified Left Image', img_left_rect)
cv2.imshow('Rectified Right Image', img_right_rect)
if cv2.waitKey(0) & 0xff == 27:
cv2.destroyAllWindows()
cv2.imwrite('./results/rect_left.png', img_left_rect)
cv2.imwrite('./results/rect_right.png', img_right_rect)
gray_left_rect = cv2.cvtColor(img_left_rect, cv2.COLOR_BGR2GRAY)
gray_right_rect = cv2.cvtColor(img_right_rect, cv2.COLOR_BGR2GRAY)
stereoMatcher = cv2.StereoBM_create(256, 25)
disparity = stereoMatcher.compute(gray_left_rect, gray_right_rect)
disparity = cv2.normalize(src=disparity, dst=disparity, beta=-16, alpha=255, norm_type=cv2.NORM_MINMAX)
disp_color = cv2.applyColorMap(np.uint8(disparity), 2)
cv2.imshow('Disparity map', disp_color)
if cv2.waitKey(0) & 0xff == 27:
cv2.destroyAllWindows()
cv2.imwrite('./results/disparity.png', disp_color)
|
Markdown
|
UTF-8
| 4,355
| 3.390625
| 3
|
[] |
no_license
|
# evesim
evesim is a toy program to experiment with the probability of a particular Mitochondrial DNA lineage dominating a population.
## What?
Mitochondrial DNA is only passed from a mother to her children. If a mother has no children, or only a son, her mitochondrial DNA line dies with her. There's a relatively recent discovery that all humans are descended from a single mitochondrial line, traced back to "Mitochondrial Eve". Unlike her biblical namesake, it's generally accepted that "Mitochondrial Eve" did not live alone as the sole initial representative of the human race, but she is the only of her contemperaries (except her mother) whose produced an unbroken matrilineal line, from which all modern humans are descended.
## Why code?
This repository was born out of a conversation with my wife, who is reading Gene, by Siddhartha Mukherjee. There is some debate between us about exactly how the proposition started, but I essentially started contemplating the following problem statement: How likely is it that a given line of mitchondrial DNA will become dominant? There are many discussions, graphics, and debates online, ranging from respected geneticists debating the history of early humans, to reddit comment threads. I wanted to approach the problem from first principals, and writing some code felt like the right way to explore the problem space. My starting assumptions are:
1. There are N homo sapien females at T0.
1. Their various genetic lines reproduce with equal fitness.
1. Mitochondrial DNA is only inherited through female children.
1. The likelihood of having female children is a random value, between 0 and the maximum number of female children (which turns out to be an important variable).
Given those conditions, how likely is a stable equilibrium of more than one mitochondrial line? Contrary to my expectations, it seems the answer is, "not very likely".
## What I learned
The two critical variables are the number of initial females, and the maximum number of girls that can be produced in a given generation. The mean "replacement rate" will be one half of the maximum, because of the assumption of a random number of children between 0 and max. If the "replacement rate" of children is too low, over enough generations randomness wins out, and all of the genetic lines fail. The necessary replacement rate to sustain an initial population of 10 females seems to be a maxGirls value of 3.0, or an average rate of 1.5 children for every mother. Allowing for a larger starting population of females (and thus mitochondrial DNA lines) makes the populations less likely to die out, but reaffirms that one line will dominate on the way to very large population sizes.
Depending on the variables you choose, it's likely but possible that more than 1% of the population will have mitochondrial line which is different from the dominant line. Unless you assume a very large starting population and/or a very high replacement rate, it's very unlikely that more than 10% of the population will have an alternate mitochondrial line. The probability of having two stable lines, where the second-most dominant line captures more than 25% of the children, is typically less than a 1% chance.
## Example output
A sample run with the following values:
1. initialPopulation := 10
1. maxGirls := 3.1
~~~~
$ go run evesim.go
26% of the populations died out.
Averaged 76.564000 generations.
Last generation: 426.
Odds of a second lineage of > 1% of the population: 8.00 %
Odds of a second lineage of >10% of the population: 2.20 %
Odds of a second lineage of >25% of the population: 0.60 %
$
~~~~
## What could be improved
I strongly suspect that the likelihood of female children is not linear between 0 and maxGirls. It's probably heavily weighted towards the bottom of that spectrum, probably a logarithmic scale. It would be interesting to research real values for the number of children couples have at various points of societal development (I seem to recall it goes down in modern developed countries), and attempt to calculate a better formula for the number of children offset by the likelihood of having a girl.
Or I could just invesitage one of the several dozen simulations listed on the Coalescent theory Wikipedia page which seem to approach this problem from the opposite direction.
|
C++
|
UTF-8
| 1,040
| 2.5625
| 3
|
[] |
no_license
|
//
// particle.cpp
// leap_ver2
//
// Created by yoji yamaura on 2013/08/05.
//
//
#include "particle.h"
#include "ofMain.h"
// コンストラクタ
particle::particle(){
setInitialCondition(0, 0);
damping = 0.06f;
}
//
void particle::resetForce(){
frc.set(0,0);
}
//
void particle::addForce(float x, float y){
frc.x = frc.x + x;
frc.y = frc.y + y;
}
//
void particle::addDampingForce(){
frc.x = frc.x - vel.x * damping;
frc.y = frc.y - vel.y * damping;
}
//
/*void particle::setInitialCondition(float px, float py, float vx, float vy){
pos.set(px,py);
vel.set(vx,vy);
}*/
void particle::setInitialCondition(float px, float py){
pos.set(px,py);
//vel.set(vx,vy);
}
//------------------------------------------------------------
void particle::update(){
vel = vel + frc;
pos = pos + vel;
}
/*void particle::update(float x, float y){
//vel = vel + frc;
pos = pos + vel;
}*/
//------------------------------------------------------------
void particle::draw(){
ofCircle(pos.x, pos.y, 3);
}
|
Markdown
|
UTF-8
| 4,691
| 3.171875
| 3
|
[
"Apache-2.0"
] |
permissive
|
# liblily
适用于`linux`的协程库,使用`boost.context``[1.70.0]`。
编译器至少需要支持`C++11`。
## 主要特性
### go
模拟golang的`go`:
```C++
int i1 = 1024;
go([i1](int i2){
std::cout << i1 + i2 << std::endl;
});
```
### channel
模拟golang的`chan`:
使用`operator<<`将数据送入`channel`,使用`operator()`取出数据,或使用`operator>>`取出数据并赋值给一个变量。
```C++
auto ticker = Ticker::New();
// ticker->C : Channel<Duration>
int times = 10;
while (times-- > 0) {
auto c = ticker->C();
std::cout << times << ": " << c << std::endl;
}
ticker->C << times;
ticker->C >> times;
ticker->Stop = true;
```
### select
模拟golang的`select`:
```C++
Channel<int> ci;
Channel<double> cd;
Channel<std::string> cs;
go([&]() {
auto s = Select(
_case(i, ci,
std::cout << "int: " << i << std::endl;
),
_case(d, cd,
std::cout << "double: " << d << std::endl;
),
_case(s, cs,
std::cout << "string: " << s << std::endl;
)
);
for (;;) {
s.Select();
}
});
int times = 10;
while (times-->0) {
if (times % 3 == 0)ci << times;
else if (times % 3 == 1) cd << times;
else cs << std::to_string(times);
}
```
使用`Select()`函数创建一个`Selector`对象,使用`_case(变量名,channel名,语句)`表示一种case,对`Selector`对象调用`Select`方法表示进行一次`select`。
## 实现
liblily的底层框架由三部分组成:`Task`,`Manager`,`Dispatcher`。
`Task`代表一个任务,即一个协程。
`Manager`代表当前线程的管理者,负责管理`Task`的状态并执行它们,是一个线程局部对象。
`Dispatcher`代表一个调度器,负责将`Task`分发到各个`Manager`中,并监控各个`Manager`状态,在所有`Task`结束后结束进程。是一个全局单例对象。
### Task
`Task`基于`boost.context(v2)`库,保存有`callable`(要执行的函数对象)、`from`(调用者的上下文)、`context`(该Task的上下文)、`status`(该Task的状态)。
`status`有`Ready`(等待执行)、`Running`(运行中)、`Blocking`(处于阻塞状态)、`Finished`(结束)三种。
主要接口有:
- `Resume() {context = context();}` 将控制流转给该`Task`,继续执行该`Task`的内容。
- `Yield() {from = from();}` 将执行流转回给调用者
- `Get/SetStatus()` 设置`Task`状态
### Manager
`Manager`管理一个`epoller`、一个`Task`队列,一个`PreparedTask`队列(`Dispatcher`会将一个函数对象放到该队列中)。
它循环执行以下流程:
- 尝试从`PreparedTask`队列中取出`PreparedTask`,从中构建`Task`对象并放入`Task`队列。
- 通过一次立即返回的`epoll_wait`,将已经准备就绪的`Task`的状态从`Blocking`设置为`Ready`。
- 如果`Task`队列为空,它将一个`eventfd`加入`epoller`中,然后进入无限期`epoll_wait`,并等待`Dispatcher`唤醒(通过一个`eventfd`)
- 通过以上步骤后,`Task`队列不为空。
- 从`Task`队列中取出一个`Task`。
- 如果该`Task`是`Ready`状态,执行其`Resume`方法,然后将该`Task`放回队列中。
- 如果该`Task`是`Blocking`状态,直接将其放回队列。
- 如果该`Task`是`Finished`状态,不放回队列。
### Dispathcer
`Dispatcher`负责分发`PreparedTask`到各个`Manager`中,通过`go`函数来进行调用它的`PutTask`方法。
当前采用`Round-Robin`算法进行分发。
每一次分发会使计数器+1,而当`Task`结束时会使计数器-1,当计数器归0时,程序结束。
### Hook
对常用的会造成阻塞的IO函数进行了hook,当调用这些函数时,会将`fd`加入到当前线程的`Manager`的`epoller`中,并将`event_data_t`设置为当前`Task`的指针,然后将当前`Task`的状态设置为`Blocking`,最后调用当前`Task`的`Yield`方法将控制流交回给`Manager`。`Manager`在下一次循环时,进行一次`epoll_wait`,将所有已就绪的`fd`对应的`Task`的状态设置为`Ready`。
### 流程

`main`函数启动后,首先会将`Main`函数加入到一个`Manager`并在一个新线程中启动该`Manager`,然后主线程进入无限期`epoll_wait`。
`Manager`进行调度,轮流执行`Task`,执行到`go`函数的时候会将一个`PreparedTask`通过`Dispatcher`分发到一个`Manager`中,并向该`Manager`的`eventfd`写入数据以唤醒该`Manager`。
`Task`执行结束时将`Dispatcher`的计数器减一,如果该操作使计数器归0,则向`Dispatcher`的`eventfd`写入数据,唤醒主线程并结束整个进程。
|
C#
|
UTF-8
| 1,258
| 2.859375
| 3
|
[] |
no_license
|
using HotelOrigin.Core.Domain;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HotelOrigin.Core.Repository
{
public class CustomerRepository
{
private static ObservableCollection<Customer> customers = new ObservableCollection<Customer>();
//Create
public static Customer Create()
{
Customer customer = new Customer();
customers.Add(customer);
return customer;
}
public static void Add(Customer customer)
{
customers.Add(customer);
}
//Read
public static Customer GetById(int id)
{
return customers.FirstOrDefault(c => c.Id == id);
}
public static ObservableCollection<Customer> GetAll()
{
return customers;
}
//Update
//Delete
public static void Delete(int id)
{
var customer = GetById(id);
customers.Remove(customer);
}
public static void Delete(Customer customer)
{
customers.Remove(customer);
}
}
}
|
Java
|
UTF-8
| 480
| 3.578125
| 4
|
[] |
no_license
|
package lesson21;
import java.util.Scanner;
public class WhileScanner {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
int age;
System.out.println("Сколько тебе лет? ");
age = input.nextInt();
while (age >= 18) {
System.out.println("Ты можешь купить на вечер что-то более крепкое, чем чай");
break;
}
}
}
|
Markdown
|
UTF-8
| 7,357
| 2.578125
| 3
|
[] |
no_license
|
## JPEG-Nachfolger: Einführung in das sparsame Bildformat WebP
> WebP will die Komprimierung und Optimierung der Bilder im Web revolutionieren: Bessere Qualität wie JPEGs in kleinerer Dateigröße verpackt.
Technikaffine Web-Nutzer haben sicherlich von [WebP](http://de.wikipedia.org/wiki/WebP) gehört – ein von Google [entwickeltes](https://developers.google.com/speed/webp/) Bildformat für überlegene Komprimierung der Fotos. JPEG gilt als veraltet und nicht effizient genug. Mit WebP kommt eine ausgefeilte Alternative auf den Markt, Bilder vorteilhaft zu komprimieren. JPEG vs. WebP: Reduktion der Dateigröße um bis zu 80 % ist keine Seltenheit.
### Browser-Support
Hört sich lukrativ und vielversprechend an: Feinere Qualität wie JPEGs, jedoch deutlich kleinere Datei. Doch wo Licht, da auch Schatten. Die aktuelle [Browser-Unterstützung](http://caniuse.com/#feat=webp) ist zurzeit der größte Nachteil der WebP-Technik: Zum jetzigen Zeitpunkt beherrschen Opera und Chrome das moderne Bildformat. Firefox hat die Unterstützung für WebP-Bilder [angekündigt](http://www.zdnet.de/88150393/mozilla-gibt-googles-bildformat-webp-eine-neue-chance/). Internet Explorer und Safari bleiben komplett außer vor.
Dennoch lohnt es sich, Bilder im WebP-Format für genannte Browser auszuliefern. Noch sind es offiziell zwei, bald sind es schon drei Browser mit dem Support für WebP – wenn Firefox keinen Rückzieher macht. Ein Blick auf die Statistik eigener Website gibt Auskunft, ob es sich rentieren wird, Bilder im Projekt in zwei Dateiformaten zu führen: WebP für Chrome, Opera, (bald) Firefox und JPEG für restliche Browser.
### RewriteRules für .htaccess
Eine Weiterleitungsregel auf der Server-Ebene würde die Verteilung der Anfragen auf das korrekte Dateiformat – abhängig vom Browser – übernehmen. Im Klartext: Die Einbindung der Bilder im HTML-Sourcecode ändert sich in keiner Weise und bleibt unberührt (z.B. `<img src="bild.jpg" />`). Die Auslieferung des richtigen Bildes übernimmt das RewriteRule in der Systemdatei `.htaccess`:
```apache
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_ACCEPT} image/webp
RewriteCond %{DOCUMENT_ROOT}/$1.webp -f
RewriteRule ^(wp-content/uploads.+)\.(jpe?g|png)$ $1.webp [T=image/webp,E=accept:1]
</IfModule>
<IfModule mod_headers.c>
Header append Vary Accept env=REDIRECT_accept
</IfModule>
AddType image/webp .webp
```
Beim Aufruf einer JPEG- bzw. PNG-Grafik im Browser wird diese vom Server gegen WebP ausgetauscht und mit dem [MIME-Type](http://de.wikipedia.org/wiki/Internet_Media_Type) `image/webp` versehen. Die Dateiendung (Dateiformat) ändert sich dabei nicht.
Wichtig: Das Snippet innerhalb von `.htaccess` relativ weit oben platzieren.
### RewriteRules für nginx.conf
Analog zum Apache-Webserver existiert eine Lösung für Nginx:
```nginx
location ~ ^(/wp-content/uploads.+)\.(jpe?g|png)$ {
if ( $http_accept ~* webp ) {
set $webp "A";
}
if ( $request_filename ~ (.+)\.(png|jpe?g)$ ) {
set $file_without_ext $1;
}
if ( -f $file_without_ext.webp ) {
set $webp "${webp}E";
}
if ( $webp = AE ) {
add_header Vary Accept;
rewrite ^(.+)\.(png|jpe?g)$ $1.webp break;
}
}
```
In diesem Zusammenhang ist der Eintrag `image/webp webp;` in der Nginx-Systemdatei `mime.types` sehr wichtig – auf diese Weise sendet Nginx den korrekten [MIME-Type](http://de.wikipedia.org/wiki/Internet_Media_Type) an den Browser.
### Kosten-Nutzen-Verhältnis
Hochgerechnet: Zwei Bildformate pro Foto. Das dann entsprechend für jede angelegte Bildgröße, wenn es sich um CMS-Systeme wie WordPress handelt. Hört sich umständlich und nach viel Arbeit an. Wozu das ganze? Lohnt sich der Aufwand? Die Entscheidung fällt je nach Projekt und Zielgruppe unterschiedlich aus.
Fakt ist: Geringe Größe der Bilddateien steht für kürzere Ladevorgänge einer Webseite. Dass Website-Performance ein SEO-Faktor ist, wurde mehrmals angesprochen und steht nicht länger zur Debatte. Auch freut sich der Leser über zügige Darstellung der Blogseiten.
Der eingesparte Traffic darf nicht ungeachtet bleiben: Je nach Projekt kommt schnell ein runder Betrag zusammen. Auslieferung weniger Bytes entlastet den Server letztendlich.
### Werkzeuge
Aktuell steht eine durchaus überschaubare Anzahl an Tools für die Generierung von WebP-Grafiken zur Verfügung – verständlich, denn die Methode steckt noch in Kinderschuhen, viele Entwicklungsstände sind als _experimentell_ markiert.
* [Pixelmator](http://www.pixelmator.com/)
* [IrfanView](http://www.irfanview.com/)
* Photoshop mit [WebP-Addon](http://blog.kulturbanause.de/2011/05/webp-grafiken-mit-photoshop-plugin-erstellen/)
* GIMP mit [WebP-Plugin](https://groups.google.com/a/webmproject.org/d/msg/webp-discuss/-3E_t2nhFbk/oCrV5ZHv0UEJ)
### Analyse
Wurden WebP-Varianten der Bilder auf dem Server abgelegt und die Weiterleitungsregel in der Datei `.htaccess` eingefügt, steht einer Auslieferung der optimierten Bilddateien nichts im Weg. Doch wie genau erfolgt die Kontrolle, ob WebP-Bilder auch tatsächlich an ausgewählte Browser gesendet werden? Denn im Browser gibt es ja keinen optischen Unterschied: JPEG- und WebP-Bilder sehen nahezu identisch aus.
Die Antwort ist simpel: Die Rückgabe der Grafiken an den Browser begleitet der Server stets mit der Angabe des [MIME-Types](http://de.wikipedia.org/wiki/Internet_Media_Type): Bei JPEGs ist es `image/jpeg`, bei PNGs `image/png` und bei WebP entsprechend `image/webp`. So lässt sich jedes Grafikformat leicht identifizieren und zuordnen, auch wenn die Datei eine “fremde” Dateiendung aufweist.
Browser wie Chrome und Opera verfügen über sogenannte [Developer Tools](https://developers.google.com/chrome-developer-tools/), die solche Informationen wie MIME-Type einer Datei sichtbar machen.
Aktivierung der Developer Tools in Browsern:
* **Chrome:** Anzeigen/Entwickler/Entwickler-Tools → Tab _Network_
* **Opera:** Darstellung/Entwicklerwerkzeuge/Opera Dragenfly → Tab _Netzwerk_
### Zusammenfassung
* WebP ist von der Dateigröße her kleiner als JPEG
* WebP sieht auch bei stärkerer Kompression besser aus als JPEG
* WebP wird von Chrome, Opera und bald Firefox unterstützt
* WebP beschleunigt Ladezeiten und spart Traffic
* WebP muss mithilfe von Tools konvertiert werden
Riesiger Vorteil: Mit der Ausgabe der WebP-Bilder im Projekt kann jederzeit begonnen werden: Keine Anpassung an der Einbindung der Grafiken im HTML-Code notwendig. Die oben vorgestellte Weiterleitungsregel für `.htaccess` prüft, ob für die aufgerufene (JPEG-)Bilddatei auf dem Server eine WebP-Variante gibt – im Erfolgsfall wird WebP an unterstützte Browser gesenden, andernfalls kommt das Standard-(JPEG-)Bild zum Einsatz.
---
###### Fazit
Facebook [experimentiert](http://www.zdnet.de/88152324/facebook-testet-googles-jpeg-alternative-webp/) bereits mit der Bildausgabe im WebP-Format. Ob man sich als Entwickler oder Blogger die Mühe macht, Fotos in mehreren Dateiformaten zu führen, hängt stark von der Größe der Website und eingesetzten Werkzeugen ab. Entscheidend dürfte auch die Browser-Nutzung der Leserschaft sein. Kurz: Das Kosten-Nutzen-Verhältnis muss stimmen.
<!--stackedit_data:
eyJoaXN0b3J5IjpbLTEwOTMwMzU3NTFdfQ==
-->
|
C++
|
MacCentralEurope
| 1,467
| 3.96875
| 4
|
[] |
no_license
|
#include <iostream>
#include <string>
#include <cctype>
using namespace std;
int main() {
cout << "Enter words (q to quit): " << endl;
string word;
int number_of_vowels = 0;
int number_of_consonants = 0;
int number_of_other = 0;
do {
cin >> word;
cin.get();
if ( isalpha(word[0]) ) {
if ( word[0] == 'a' || word[0] == 'e' || word[0] == 'o' || word[0] == 'u' || word[0] == 'i' || word[0] == 'y' ) {
number_of_vowels++;
} else {
number_of_consonants++;
}
} else {
number_of_other++;
}
} while ( word != "q" );
cout << number_of_vowels << " words beginning with vowels." << endl;
cout << number_of_consonants << " words beginning with consonants." << endl;
cout << number_of_other << " other." << endl;
system("PAUSE");
return 0;
}
//Write a program that reads input a word at a time until a lone q is entered. The
//program should then report the number of words that began with vowels,the num-
//ber that began with consonants,and the number that fit neither of those categories.
//One approach is to use isalpha()to discriminate between words beginning with
//letters and those that dont and then use an if or switch statement to further iden-
//tify those passing the isalpha()test that begin with vowels. A sample run might
//look like this:
//Enter words (q to quit):
//The 12 awesome oxen ambled
//quietly across 15 meters of lawn. q
//5 words beginning with vowels
//4 words beginning with consonants
//2 others
|
Java
|
UTF-8
| 2,363
| 2.34375
| 2
|
[] |
no_license
|
package es.fjtorres.pruebas.juan.ejemplo.servicios.impl;
import java.io.Serializable;
import org.springframework.transaction.annotation.Transactional;
import es.fjtorres.pruebas.juan.ejemplo.comun.PageWrapper;
import es.fjtorres.pruebas.juan.ejemplo.persistencia.modelo.AbstractModel;
import es.fjtorres.pruebas.juan.ejemplo.persistencia.servicio.IPersistenceService;
import es.fjtorres.pruebas.juan.ejemplo.servicios.IGenericModelService;
@Transactional(readOnly = true)
public abstract class AbstractGenericModelService<T extends AbstractModel, Id extends Serializable>
implements IGenericModelService<T, Id> {
private final IPersistenceService<T, Id> persistenceService;
private final Class<T> persistenceClass;
public AbstractGenericModelService(
final IPersistenceService<T, Id> pPersistenceService,
final Class<T> pPersistenceClass) {
this.persistenceService = pPersistenceService;
this.persistenceClass = pPersistenceClass;
}
public IPersistenceService<T, Id> getPersistenceService() {
return persistenceService;
}
/**
* @see IPersistenceService#persist(AbstractModel)
*/
@Override
@Transactional
public void persist(final T entity) {
getPersistenceService().persist(entity);
}
/**
* @see IPersistenceService#update(AbstractModel)
*/
@Override
@Transactional
public T update(final T entity) {
return getPersistenceService().update(entity);
}
/**
* @see IPersistenceService#delete(AbstractModel)
*/
@Override
@Transactional
public void delete(final T entity) {
getPersistenceService().delete(entity);
}
/**
* @see IPersistenceService#findById(Serializable, Class)
*/
@Override
public T findById(final Id identifier) {
return getPersistenceService().findById(identifier, persistenceClass);
}
@Override
public PageWrapper<T> find(final PageWrapper<T> pWrapper) {
pWrapper.setTotalResults(getPersistenceService().count(persistenceClass));
final int startPosition = (pWrapper.getCurrentPage() - 1)
* pWrapper.getPageSize();
pWrapper.setItems(getPersistenceService().find(startPosition,
pWrapper.getPageSize(), pWrapper.getSortField(),
pWrapper.getSortDirection(), persistenceClass));
return pWrapper;
}
}
|
C++
|
UTF-8
| 5,995
| 2.5625
| 3
|
[] |
no_license
|
#include "Branch.h"
#include "BranchRegister.h"
#include "Git.h"
#include "Lista.h"
#include "CommitBag.h"
#include "CommitGraph.h"
#include "BFS.h"
#include <iostream>
using UBfs::RecorridoAnchura;
using UGit::Branch;
using UGit::Git;
using UGit::GitEvent;
using UndavList::List;
using UGitCommitGraph::CommitGraph;
struct UGit::Git{
UndavList::List* listaHooksBranchs;
UndavList::List* listahooksCommits;
UGitCommitGraph::CommitGraph* commitGraph;
};
UGit::CommitBag* garbageCollector = UGit::CreateBag();
UGitCommitGraph::CommitGraph* commitGraph = UGitCommitGraph::Create();
/*Funciones auxiliares*/
void CollectCommit(void* commit);
void FreeGarbageCollector();
void ShowLog(Commit* commit);
//Precondicion: @lista es una instancia valida , @item es una instancia valida
//Postcondicion: ejecuta todos los punteros a funciones con los parametros item.
void RunHooks(UndavList::List* list,void * item){
UndavList::IteratorListitems::Iterator* iterador=UndavList::IteratorListitems::Begin(list);
while(!UndavList::IteratorListitems::IsTheEnd(iterador)){
UGit::Hook miHook= (UGit::Hook)UndavList::IteratorListitems::ObtainsItem(iterador);
miHook(item);
UndavList::IteratorListitems::Next(iterador);
}
UndavList::IteratorListitems::Destroy(iterador);
}
UGit::Git* UGit::CreateGit(){
UGit::Git* git = new UGit::Git;
git->listaHooksBranchs=UndavList::CreateListEmpty();
git->listahooksCommits=UndavList::CreateListEmpty();
git->commitGraph=UGitCommitGraph::Create();
return git;
}
UGit::Branch* UGit::CreateBranch(Git* git, string branchName, Branch* baseBranch){
UGit::Branch* myBranch=NULL;
UGit::BranchRegister* instance = UGit::GetInstance();
if(!UGit::Get(instance,branchName)){
myBranch=(baseBranch!=NULL)?UGit::CreateBranch(branchName,UGit::GetLastCommit(baseBranch)):UGit::CreateBranch(branchName,NULL);
UGit::Add(instance,myBranch);
RunHooks(git->listaHooksBranchs,myBranch);
}
return myBranch;
}
void UGit::DeleteBranch(Git* git, string branchName){
UGit::BranchRegister* instance = UGit::GetInstance();
UGit::Remove(instance,UGit::Get(instance,branchName));
}
UGit::Commit* UGit::NewCommit(Git* git, string branchName, string message){
UGit::Commit* myCommit=NULL;
UGit::BranchRegister* instance = UGit::GetInstance();
UGit::Branch* myBranch=UGit::Get(instance,branchName);
if(myBranch!=NULL){
UGit::Commit* myLastCommit=UGit::GetLastCommit(myBranch);
myCommit=UGit::CreateCommit(myLastCommit,message);
UGitCommitGraph::Connect(git->commitGraph,myCommit,myLastCommit);
SetLastCommit(myBranch,myCommit);
CollectCommit(myCommit);
RunHooks(git->listahooksCommits,myCommit);
}
return myCommit;
}
void UGit::AddHook(Git* git, UGit::GitEvent event, Hook hook){
switch (event){
case UGit::GitEvent::NewBranchCreated:
UndavList::Add(git->listaHooksBranchs,(void*)hook);
break;
case UGit::GitEvent::NewCommitAdded:
UndavList::Add(git->listahooksCommits,(void*)hook);
break;
}
}
bool IsEqualsCommit(Branch *from, Branch *to) {
string commitFrom = GetLastCommit(to) == NULL ? "" : GetHashCode(GetLastCommit(to));
string commitTo = GetLastCommit(from) == NULL ? "" : GetHashCode(GetLastCommit(from));
return commitFrom==commitTo;
}
void UGit::Merge(Git* git, string from, string to){
UGit::BranchRegister* instance = UGit::GetInstance();
if(UGit::Get(instance,from)!=NULL && UGit::Get(instance,to)!=NULL && IsEqualsCommit(UGit::Get(instance,from),UGit::Get(instance,to))!=true){
UGit::CommitBag* parents= UGit::CreateBag();
Commit* commitFrom=UGit::GetLastCommit(UGit::Get(instance,from));
Commit* commitTo=UGit::GetLastCommit(UGit::Get(instance,to));
UGit::Add(parents,commitFrom);
UGit::Add(parents,commitTo);
string message="branch [" + UGit::GetName(UGit::Get(instance,from))+"]" + " merged on [" + UGit::GetName(UGit::Get(instance,to)) +"]";
UGit::Commit* myCommit = UGit::CreateCommit(parents,message);
UGit::SetLastCommit(UGit::Get(instance,to),myCommit);
UGitCommitGraph::Connect(git->commitGraph, myCommit,commitFrom);
UGitCommitGraph::Connect(git->commitGraph, myCommit,commitTo);
RunHooks(git->listahooksCommits,myCommit);
}
}
void UGit::LogGraph(Git *git, string branchName, bool oneLine) {
if (UGit::Exists(UGit::GetInstance(),branchName)) {
UGit::Branch * branch = UGit::Get(UGit::GetInstance(),branchName);
Commit * lastCommit = UGit::GetLastCommit(branch);
UGitCommitGraph::print(git->commitGraph);
UBfs::Crear(git->commitGraph, lastCommit, ShowLog);
}
}
void UGit::Destroy(Git* git){
UndavList::Destroy(git->listaHooksBranchs);
UndavList::Destroy(git->listahooksCommits);
FreeGarbageCollector();
delete git;
}
void CollectCommit(void* commit){
if(commit!=NULL){
UGit::Add(garbageCollector, (Commit*) commit);
}
}
void FreeGarbageCollector(){
if(garbageCollector!=NULL){
UGit::UCommitBagIterator::CommitBagIterator* iterator = UGit::UCommitBagIterator::Begin(garbageCollector);
while(!UGit::UCommitBagIterator::IsEnd(iterator)){
Commit* commit = UGit::UCommitBagIterator::GetCommit(iterator);
UGit::DestroyCommit(commit);
UGit::UCommitBagIterator::Next(iterator);
}
UGit::UCommitBagIterator::DestroyIterator(iterator);
UGit::DestroyBag(garbageCollector);
garbageCollector = NULL;
}
}
void ShowLog(Commit* commit){
Commit * myCommit = commit;
std::cout << "Commit " << UGit::GetHashCode(myCommit) << " (branch)" <<std::endl;
std::cout << "Author: " << UUser::GetNickName(UGit::GetAuthor(myCommit)) <<std::endl;
std::cout << "Date: " << UDateTime::ToFormat(UGit::GetDate(myCommit), UDateTime::DDMMYYYY_HHmmss) <<std::endl;
std::cout << "\t " << UGit::GetMessage(myCommit) << std::endl;
}
|
Java
|
UTF-8
| 6,710
| 2.046875
| 2
|
[] |
no_license
|
package hu.unideb.smartcampus.service.api.impl;
import java.sql.Timestamp;
import java.time.DayOfWeek;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.Arrays;
import java.util.List;
import java.util.Set;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.internal.util.collections.Sets;
import org.mockito.runners.MockitoJUnitRunner;
import hu.unideb.smartcampus.persistence.entity.FromToDateEmbeddedEntity;
import hu.unideb.smartcampus.persistence.entity.InstructorEntity;
import hu.unideb.smartcampus.persistence.entity.SubjectDetailsEntity;
import hu.unideb.smartcampus.persistence.repository.ConsultingDateRepository;
import hu.unideb.smartcampus.persistence.repository.InstructorRepository;
import hu.unideb.smartcampus.service.api.ConsultingHourService;
import hu.unideb.smartcampus.service.api.OfficeHourGeneratorService;
import hu.unideb.smartcampus.service.api.calendar.domain.subject.SubjectDetails;
import hu.unideb.smartcampus.service.api.converter.toentity.ConsultingDateToConsultingDateEntityConverter;
import hu.unideb.smartcampus.service.api.converter.toentity.FromToDateToFromToDateEntityConverter;
import hu.unideb.smartcampus.service.api.domain.ConsultingDate;
import hu.unideb.smartcampus.service.api.domain.FromToDate;
import hu.unideb.smartcampus.shared.officehour.OfficeHour;
import hu.unideb.smartcampus.shared.officehour.OfficeHourIntervall;
import hu.unideb.smartcampus.shared.util.DateUtil;
/**
* Test for {@link ConsultingHourService}.
*/
@RunWith(MockitoJUnitRunner.class)
@SuppressWarnings({"PMD"})
public class ConsultingHourServiceImplTest {
/**
* To timestamp date.
*/
private static final LocalDateTime TO_DATE = DateUtil.getInLocalDateTimeByEpochSecond(15L);
/**
* From timestamp date.
*/
private static final LocalDateTime FROM_DATE = DateUtil.getInLocalDateTimeByEpochSecond(10L);
/**
* Date in string.
*/
private static final String DATE_IN_STRING = "Monday 12:00-14:00";
/**
* Subject name.
*/
private static final String AI = "AI";
/**
* Result subject.
*/
private static final SubjectDetails SUBJECT_DOMAIN = SubjectDetails.builder().subjectName(AI).build();
/**
* Expected set of subjects.
*/
private static final Set<SubjectDetails> EXPECTED_DOMAIN_SET = Sets.newSet(SUBJECT_DOMAIN);
/**
* SubjectEvent entity.
*/
private static final SubjectDetailsEntity SUBJECT_ENTITY =
SubjectDetailsEntity.builder().subjectName(AI).build();
/**
* Set of entities.
*/
private static final Set<SubjectDetailsEntity> RESULT_ENTITY_SET = Sets.newSet(SUBJECT_ENTITY);
/**
* Instructor id.
*/
private static final Long INSTRUCTOR_ID = 1L;
/**
* To date in string.
*/
private static final String TO_IN_STRING = "14:00";
/**
* From date in string.
*/
private static final String FROM_IN_STRING = "12:00";
/**
* Generated hours.
*/
private static final Integer GENERATED_HOURS = 14;
/**
* Office hours.
*/
private static final List<OfficeHour> OFFICEHOURS = Arrays.asList(
OfficeHour.builder().day(DayOfWeek.MONDAY).from(FROM_IN_STRING).to(TO_IN_STRING).build());
/**
* Intervall.
*/
private static final OfficeHourIntervall INTERVALL = OfficeHourIntervall.builder()
.fromDate(Timestamp.valueOf(LocalDate.of(2017, 2, 20).atStartOfDay()))
.toDate(Timestamp.valueOf(LocalDate.of(2017, 5, 26).atStartOfDay())).build();
/**
* Consulting dates.
*/
private static final List<ConsultingDate> CONSULTING_DATES =
Arrays.asList(ConsultingDate.builder().date(DATE_IN_STRING).sum(0).build());
/**
* Instructor entity.
*/
private static final InstructorEntity INSTRUCTOR_ENTITY =
InstructorEntity.builder().id(INSTRUCTOR_ID).consultingDates(Sets.newSet()).build();
/**
* From to date source.
*/
private static final FromToDate FROM_TO_DATE_SOURCE =
FromToDate.builder().fromDate(FROM_DATE).toDate(TO_DATE).build();
/**
* UserService with UserRepository and ConversionService mocks.
*/
@InjectMocks
private ConsultingHourServiceImpl consultingHoursService;
/**
* UserRepository mock.
*/
/*@Mock
private UserRepository userRepository;
/**
* SubjectDetailsEntityToSubjectDetailsConverter implementation.
*/
/*@Spy
private SubjectDetailsEntityToSubjectDetailsConverter conversionService;
/**
* Office hour generator service.
*/
@Mock
private OfficeHourGeneratorService officeHourGeneratorService;
/**
* Consulting date repository.
*/
@Mock
private ConsultingDateRepository consultingDateRepository;
/**
* Instructor repository.
*/
@Mock
private InstructorRepository instructorRepository;
/**
* Converter spy.
*/
@Mock
private ConsultingDateToConsultingDateEntityConverter converter;
/**
* From to date converter.
*/
@Mock
private FromToDateToFromToDateEntityConverter fromToDateConverter;
/**
* Test subject list is empty.
*/
/*@Test
public void getSubjectsByUserIdShouldReturnEmptySet() {
// given
// when
given(userRepository.getSubjectsByUserId(1L)).willReturn(Collections.emptySet());
// then
Set<SubjectDetails> subjects = consultingHoursService.getSubjectsByUserId(1L);
Assert.assertTrue(subjects.isEmpty());
}
/**
* Test should return user's subjects.
*/
/*@Test
public void getSubjectsByUserIdShouldReturnUsersSubjects() {
// given
// when
given(userRepository.getSubjectsByUserId(1L)).willReturn(RESULT_ENTITY_SET);
// then
Set<SubjectDetails> subjects = consultingHoursService.getSubjectsByUserId(1L);
assertThat(ASSERTION_EQUAL_TO_ERROR_MESSAGE, subjects, equalTo(EXPECTED_DOMAIN_SET));
}
/**
* Test generate office hours for instructor in given intervall.
*/
@Test
public void generateOfficeHoursForInstructor() {
// given
// when
Mockito.when(officeHourGeneratorService.generateOfficeHoursInIntervall(INTERVALL, OFFICEHOURS))
.thenReturn(CONSULTING_DATES);
Mockito.when(instructorRepository.findOne(INSTRUCTOR_ID)).thenReturn(INSTRUCTOR_ENTITY);
Mockito.when(fromToDateConverter.convert(FROM_TO_DATE_SOURCE))
.thenReturn(FromToDateEmbeddedEntity.builder().fromDate(FROM_DATE).toDate(TO_DATE).build());
// then
Integer generateOfficeHoursForInstructor = consultingHoursService
.generateOfficeHoursForInstructor(INSTRUCTOR_ID, OFFICEHOURS, INTERVALL);
Assert.assertEquals(Integer.valueOf(1), generateOfficeHoursForInstructor);
}
}
|
Java
|
UTF-8
| 3,354
| 2.015625
| 2
|
[] |
no_license
|
package com.kt.managermode.controller.system;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import com.kt.managermode.bean.ResultUtilBeanSingle;
import com.kt.managermode.bean.system.ServerResponse;
import com.kt.managermode.util.ResultCodes;
import com.kt.managermode.util.StringUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import com.kt.managermode.bean.ResultUtilBean;
import com.kt.managermode.bean.system.MenuBean;
import com.kt.managermode.bean.system.MenuBeanTree;
import com.kt.managermode.service.system.IMenuService;
@Controller
@RequestMapping("/menuController")
public class MenuController
{
@Autowired
private IMenuService menuService;
@ResponseBody
@RequestMapping(value = "/loadMenu",method = RequestMethod.POST)
public List<MenuBeanTree> loadMenu(Model model)
{
return menuService.loadMenu();
}
@ResponseBody
@RequestMapping(value = "/userinfoAndPermission",method = RequestMethod.POST)
public ServerResponse userinfoAndPermission(Model model)
{
Map<String,Object> resultData = new HashMap<String,Object>();
List<String> roules = new ArrayList<String>();
roules.add("admin");
roules.add("test");
resultData.put("name","admin");
resultData.put("avatar","https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif");
resultData.put("roles",roules);
ServerResponse serverResponse = ServerResponse.createDefaultResult(ResultCodes.SUCCESS,"success",resultData);
return serverResponse;
}
@RequestMapping(value = "/getChildrenMenu",method = RequestMethod.POST)
public List<MenuBeanTree> getChildrenMenu(Integer permissionId, Model model)
{
return menuService.getChildrenMenu(permissionId);
}
@ResponseBody
@RequestMapping(value = "/queryMenuList",method = RequestMethod.POST)
public ResultUtilBean queryMenuList(Model model,MenuBean menuBean)
{
ResultUtilBean result = ResultUtilBean.getResult(menuBean.getPage(),
menuService.getCount(menuBean),
menuBean.getRows(),
menuService.queryMenuList(menuBean));
return result;
}
@RequestMapping(value = "/showAllMenu")
public String showAllMenu(Model model)
{
return "system/menuManager";
}
@ResponseBody
@RequestMapping(value = "/getMenuNameByid")
public ResultUtilBeanSingle getMenuNameByid(Model model,MenuBean menuBean)
{
if(menuBean==null|| StringUtil.isEmpty(menuBean.getPermissionId()))
{
return ResultUtilBeanSingle.getResult(ResultCodes.PARAM_ERROR,"参数异常",null);
}
MenuBean resultMenuBean = menuService.getMenuNameByid(menuBean);
ResultUtilBeanSingle result = ResultUtilBeanSingle.getResult(ResultCodes.SUCCESS,"成功",resultMenuBean);
return result;
}
}
|
C++
|
UTF-8
| 6,370
| 2.546875
| 3
|
[] |
no_license
|
#include "CNF.h"
using namespace Minisat;
bool calculate_vertex_cover(int vertices_num,std::vector<int> edge,int k,std::vector<int> &vertex_cover)
{
Solver S;
Var propositions[vertices_num][k];
for(int i = 0;i < vertices_num;i++)
{
for(int j = 0;j < k;j++)
{
propositions[i][j] = S.newVar();
}
}
vec<Lit> clause;
for(int i = 0;i < k;i++)
{
for(int j = 0;j < vertices_num;j++)
{
clause.push(mkLit(propositions[j][i]));
}
S.addClause(clause);
clause.clear();
}
for(int i = 0;i < vertices_num;i++)
{
for(int j = 0;j < k - 1;j++)
{
for(int h = j + 1;h < k;h++)
{
S.addClause(mkLit(propositions[i][j],true),mkLit(propositions[i][h],true));
}
}
}
for(int i = 0;i < k;i++)
{
for(int j = 0;j < vertices_num - 1;j++)
{
for(int h = j + 1;h < vertices_num;h++)
{
S.addClause(mkLit(propositions[j][i],true),mkLit(propositions[h][i],true));
}
}
}
for(int i = 0;i < edge.size();i+=2)
{
for(int j = 0;j < k;j++)
{
clause.push(mkLit(propositions[edge[i]][j]));
clause.push(mkLit(propositions[edge[i+1]][j]));
}
S.addClause(clause);
clause.clear();
}
if(S.solve())
{
vertex_cover.clear();
for(int i = 0;i < k;i++)
{
for(int j = 0;j < vertices_num;j++)
{
if(S.modelValue(propositions[j][i]) == l_True)
{
vertex_cover.push_back(j);
break;
}
}
}
return 1;
}
return 0;
}
bool binary_calculate_vertex_cover(int vertices_num,std::vector<int> edge,std::vector<int> &vertex_cover)
{
if(vertices_num == 0)
std::cout << "CNF-SAT-VC: " << std::endl;
else if(vertices_num == 1)
std::cout << "CNF-SAT-VC: " << "0" << std::endl;
else if(edge.size() == 0)
std::cout << "CNF-SAT-VC: " << std::endl;
else
{
int hi = vertices_num;
int lo = 1;
int mid;
while(hi >= lo)
{
mid = (hi+lo)/2;
if(calculate_vertex_cover(vertices_num,edge,mid,vertex_cover) != 1)
{
lo = mid+1;
}
else
{
hi = mid - 1;
}
}
//print_vertex_cover(vertex_cover,"CNF-SAT-VC: ");
return 1;
}
return 0;
}
bool approx_vc_1(int vertices_num,std::vector<int> edge,std::vector<int> &vertex_cover)
{
if(vertices_num == 0)
std::cout << "APPROX-VC-1: " << std::endl;
else if(vertices_num == 1)
std::cout << "APPROX-VC-1: " << "0" << std::endl;
else if(edge.size() == 0)
std::cout << "APPROX-VC-1: " << std::endl;
else
{
int count[vertices_num];
int edge_num = edge.size();
while(edge_num != 0)
{
for(int i = 0;i < vertices_num;i++)
{
count[i] = 0;
}
for(int i = 0;i < edge.size();i++)
{
if(edge[i] != INF)
count[edge[i]]++;
}
int max = std::max_element(count, count + vertices_num) - count;
vertex_cover.push_back(max);
for(int i = 0;i < edge.size();i+=2)
{
if(edge[i] == max || edge[i+1] == max)
{
edge[i] = INF;
edge[i+1] = INF;
edge_num -= 2;
}
}
}
//print_vertex_cover(vertex_cover,"APPROX-VC-1: ");
return 1;
}
return 0;
}
bool approx_vc_2(int vertices_num,std::vector<int> edge,std::vector<int> &vertex_cover)
{
if(vertices_num == 0)
std::cout << "APPROX-VC-2: " << std::endl;
else if(vertices_num == 1)
std::cout << "APPROX-VC-2: " << "0" << std::endl;
else if(edge.size() == 0)
std::cout << "APPROX-VC-2: " << std::endl;
else
{
for(int i = 0;i < edge.size();i+=2)
{
if(edge[i] != INF)
{
vertex_cover.push_back(edge[i]);
vertex_cover.push_back(edge[i+1]);
for(int j = i + 2;j < edge.size();j+=2)
{
if(edge[j] == edge[i] || edge[j+1] == edge[i] || edge[j] == edge[i+1] || edge[j+1] == edge[i+1])
{
edge[j] = INF;
edge[j+1] = INF;
}
}
edge[i] = INF;
edge[i+1] = INF;
}
}
//print_vertex_cover(vertex_cover,"APPROX-VC-2: ");
return 1;
}
return 0;
}
void print_vertex_cover(std::vector<int> vertex_coverC,std::vector<int> vertex_cover1,std::vector<int> vertex_cover2)
{
std::sort(vertex_coverC.begin(),vertex_coverC.end());
std::sort(vertex_cover1.begin(),vertex_cover1.end());
std::sort(vertex_cover2.begin(),vertex_cover2.end());
std::cout << "CNF-SAT-VC: ";
for (int i = 0;i < vertex_coverC.size();i++)
{
std::cout << vertex_coverC[i];
if(i != vertex_coverC.size() - 1)
std::cout << ',';
}
std::cout << '\n';
std::cout << "APPROX-VC-1: ";
for (int i = 0;i < vertex_cover1.size();i++)
{
std::cout << vertex_cover1[i];
if(i != vertex_cover1.size() - 1)
std::cout << ',';
}
std::cout << '\n';
std::cout << "APPROX-VC-2: ";
for (int i = 0;i < vertex_cover2.size();i++)
{
std::cout << vertex_cover2[i];
if(i != vertex_cover2.size() - 1)
std::cout << ',';
}
std::cout << '\n';
}
/*void print_vertex_cover(std::vector<int> vertex_cover,char *name)
{
std::sort(vertex_cover.begin(),vertex_cover.end());
std::cout << name;
for (int i = 0;i < vertex_cover.size();i++)
{
std::cout << vertex_cover[i];
if(i != vertex_cover.size() - 1)
std::cout << ',';
}
std::cout << '\n';
}*/
|
Markdown
|
UTF-8
| 8,839
| 2.515625
| 3
|
[] |
no_license
|
---
description: "Recipe of Favorite Breakfast hash"
title: "Recipe of Favorite Breakfast hash"
slug: 1036-recipe-of-favorite-breakfast-hash
date: 2020-11-25T19:27:36.010Z
image: https://img-global.cpcdn.com/recipes/15f272f65eb5d9b9/751x532cq70/breakfast-hash-recipe-main-photo.jpg
thumbnail: https://img-global.cpcdn.com/recipes/15f272f65eb5d9b9/751x532cq70/breakfast-hash-recipe-main-photo.jpg
cover: https://img-global.cpcdn.com/recipes/15f272f65eb5d9b9/751x532cq70/breakfast-hash-recipe-main-photo.jpg
author: Sophia Freeman
ratingvalue: 4.6
reviewcount: 39397
recipeingredient:
- "150 g baby spinach"
- "1 red onion"
- "1 small capcicum"
- "2 cloves garlic"
- "6 eggs"
- " Corriander"
- "5-6 frozen hash browns or home fries if youd preffer"
- "1 chilli"
- "2 small chorizo sausages"
- "50 g parmesan cheese"
- "50 g Mozzarella cheese"
- " Salt pepper to season"
recipeinstructions:
- "Get a cast iron skillet and aet on medium high heat. Cut up and brown the chorizo. Whilst this is happening, preheat the oven to 200 degrees, finely dice your vegetables, and cut the hashbrowns or potatoes in to sizable chunks."
- "Once the chorizo is browned, remove from the pan and set aside.leaving the sausage fat Start frying the hash browns in the pan until golden and crisp. Season with salt and pepper. Remove and set aside with the chorizo."
- "Add a generous knob of butter and put your onion, capsicum, chili and garlic to the pan and saute for one minute. Season with salt and pepper before adding the chorizo and hash browns back to the pan."
- "Toss together and cook for a further two minutes. Adding a few sprigs of finely chopped, fresh corriander, before taking off the heat and covering the top with spinach. Scatter with parmesan cheese. I like to mix half in to the dish and leave the other half on top. To add a barrier for the eggs and cheese to sit on."
- "Crack about 4 -6 eggs intermittently over the dish, separating with pockets of the grated mozzarella cheese and season the eggs before placing in the oven for 15 minutes or until the eggs set."
- "Allow 5 minutes to cool. Then serve right in the pan. Feeds 2-3 very hungover people"
categories:
- Recipe
tags:
- breakfast
- hash
katakunci: breakfast hash
nutrition: 134 calories
recipecuisine: American
preptime: "PT40M"
cooktime: "PT59M"
recipeyield: "1"
recipecategory: Dinner
---

Hello everybody, hope you're having an incredible day today. Today, we're going to make a distinctive dish, breakfast hash. It is one of my favorites. For mine, I'm gonna make it a little bit unique. This will be really delicious.
This simple but tasty Chorizo Breakfast Hash is a breakfast classic. Perfect for your lazy weekend brunch, or even "breakfast for dinner". The Meatless Breakfast Hash of Your Dreams. Hash is most well known in its corned beef iteration, complete with a couple of fried eggs on top.
Breakfast hash is one of the most favored of recent trending meals in the world. It's appreciated by millions every day. It is easy, it's fast, it tastes delicious. Breakfast hash is something that I've loved my entire life. They're fine and they look fantastic.
To begin with this recipe, we have to first prepare a few components. You can cook breakfast hash using 12 ingredients and 6 steps. Here is how you cook that.
<!--inarticleads1-->
##### The ingredients needed to make Breakfast hash:
1. Get 150 g baby spinach
1. Get 1 red onion
1. Get 1 small capcicum
1. Take 2 cloves garlic
1. Prepare 6 eggs
1. Get Corriander
1. Make ready 5-6 frozen hash browns (or home fries if you'd preffer
1. Prepare 1 chilli
1. Make ready 2 small chorizo sausages
1. Get 50 g parmesan cheese
1. Get 50 g Mozzarella cheese
1. Prepare Salt &pepper to season
Having a guests over for brunch? Sausage and onion hash with a couple of eggs cracked over is definitely worth getting out of bed for. Not that kind of hash (we're D. We mean the glorious hangover helpers that You could call breakfast hash the final destination of leftovers, but we just call it damn delicious.
<!--inarticleads2-->
##### Steps to make Breakfast hash:
1. Get a cast iron skillet and aet on medium high heat. Cut up and brown the chorizo. Whilst this is happening, preheat the oven to 200 degrees, finely dice your vegetables, and cut the hashbrowns or potatoes in to sizable chunks.
1. Once the chorizo is browned, remove from the pan and set aside.leaving the sausage fat Start frying the hash browns in the pan until golden and crisp. Season with salt and pepper. Remove and set aside with the chorizo.
1. Add a generous knob of butter and put your onion, capsicum, chili and garlic to the pan and saute for one minute. Season with salt and pepper before adding the chorizo and hash browns back to the pan.
1. Toss together and cook for a further two minutes. Adding a few sprigs of finely chopped, fresh corriander, before taking off the heat and covering the top with spinach. Scatter with parmesan cheese. I like to mix half in to the dish and leave the other half on top. To add a barrier for the eggs and cheese to sit on.
1. Crack about 4 -6 eggs intermittently over the dish, separating with pockets of the grated mozzarella cheese and season the eggs before placing in the oven for 15 minutes or until the eggs set.
1. Allow 5 minutes to cool. Then serve right in the pan. Feeds 2-3 very hungover people
Not that kind of hash (we're D. We mean the glorious hangover helpers that You could call breakfast hash the final destination of leftovers, but we just call it damn delicious. Breakfast Hash is the perfect dish for a lazy Sunday morning, when you have a little more time and want something really hearty and filling. Golden brown roasted potatoes mixed with pan cooked onion. See more ideas about Breakfast hash, Recipes, Hash recipe.
Foods That Can Make Your Mood Better
Many of us think that comfort foods are terrible for us and that we need to stay away from them. Sometimes, if the comfort food is a high sugar food or another junk food, this holds true. Otherwise, comfort foods may be very healthy and good for you. There are a number of foods that, when you eat them, may better your mood. When you feel a little down and are needing an emotional boost, try some of these.
Eggs, believe it or not, can be truly wonderful at beating back depression. Just see to it that you don't get rid of the egg yolk. Whenever you would like to cheer yourself up, the yolk is the most crucial part of the egg. Eggs, the egg yolk particularly, are stuffed full of B vitamins. B vitamins can be fantastic for elevating your mood. This is because the B vitamins help your neural transmitters--the parts of your brain that dictate your mood--function better. Eat a couple of eggs to jolly up!
Put together a few trail mix of nuts or seeds. Peanuts, cashews, sunflower seeds, almonds, pumpkin seeds, etc are all great for helping to elevate your mood. This is possible since these foods have a bunch of magnesium which promotes your production of serotonin. Serotonin is a feel-good chemical that tells the brain how to feel at any given time. The more serotonin you have, the more pleasant you will feel. Not only that but nuts, specifically, are a great protein food source.
Cold water fish are great if you wish to feel happier. Cold water fish such as tuna, trout and wild salmon are high in DHA and omega-3 fats. Omega-3 fatty acids and DHA are two things that promote the quality and the function of your brain's gray matter. It's the truth: consuming tuna fish sandwiches can actually help you battle your depression.
Grains can be wonderful for fighting a terrible mood. Quinoa, barley, teff, millet, etc are all great for helping you feel happier. These grains fill you up better and that can help elevate your moods as well. It's not difficult to feel a little bit off when you feel famished! The reason these grains elevate your mood is that they are not difficult for your body to digest. They are simpler to digest than other foods which helps bring up your blood sugar levels and that, in turn, raises your mood.
Your mood can actually be helped by green tea. You just knew green tea had to be mentioned, right? Green tea has a lot of an amino acid referred to as L-theanine. Research has found that this amino acid promotes the production of brain waves. This helps improve your mental focus while having a relaxing effect on the rest of your body. You already knew that green tea helps you be better. Now you are well aware that green tea helps you to raise your moods too!
As you can see, you don't need to stuff your face with junk food when you wish to feel better! Try a couple of of these hints instead.
|
Java
|
UTF-8
| 2,663
| 1.882813
| 2
|
[] |
no_license
|
package com.accp.domain;
public class Vendor {
private String supid;
private String supcode;
private String supname;
private String address;
private String scase;
private String url;
private String bank;
private String banknum;
private String way;
private String grade;
private String brand;
private String unitsname;
private String contacts;
private String phone;
private String mobile;
private String email;
private String days;
private String remark;
public String getSupid() {
return supid;
}
public void setSupid(String supid) {
this.supid = supid;
}
public String getSupcode() {
return supcode;
}
public void setSupcode(String supcode) {
this.supcode = supcode;
}
public String getSupname() {
return supname;
}
public void setSupname(String supname) {
this.supname = supname;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
public String getScase() {
return scase;
}
public void setScase(String scase) {
this.scase = scase;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public String getBank() {
return bank;
}
public void setBank(String bank) {
this.bank = bank;
}
public String getBanknum() {
return banknum;
}
public void setBanknum(String banknum) {
this.banknum = banknum;
}
public String getWay() {
return way;
}
public void setWay(String way) {
this.way = way;
}
public String getGrade() {
return grade;
}
public void setGrade(String grade) {
this.grade = grade;
}
public String getBrand() {
return brand;
}
public void setBrand(String brand) {
this.brand = brand;
}
public String getUnitsname() {
return unitsname;
}
public void setUnitsname(String unitsname) {
this.unitsname = unitsname;
}
public String getContacts() {
return contacts;
}
public void setContacts(String contacts) {
this.contacts = contacts;
}
public String getPhone() {
return phone;
}
public void setPhone(String phone) {
this.phone = phone;
}
public String getMobile() {
return mobile;
}
public void setMobile(String mobile) {
this.mobile = mobile;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getDays() {
return days;
}
public void setDays(String days) {
this.days = days;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
}
|
Swift
|
UTF-8
| 5,696
| 2.515625
| 3
|
[] |
no_license
|
//
// RolodexPageViewController.swift
// Wizcard
//
// Created by Akash Jindal on 06/05/18.
// Copyright © 2018 Akash Jindal. All rights reserved.
//
import UIKit
protocol RolodexPageViewControllerDelegate{
func currentSelectedIndex(index : Int)
}
class RolodexPageViewController: UIPageViewController {
var currentIndex : Int = 0
var delegateProperty : RolodexPageViewControllerDelegate!
var wizcard : Wizcard!
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
self.delegate = self
self.dataSource = self
let viewController = viewControllerAtIndex(index: 0)
let viewControllers:[UIViewController] = [viewController!];
self.setViewControllers(viewControllers, direction: .forward, animated: true, completion: nil)
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
/*
// MARK: - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
// Get the new view controller using segue.destinationViewController.
// Pass the selected object to the new view controller.
}
*/
func viewControllerAtIndex(index : Int)-> UIViewController?{
var viewController :UIViewController!
let storyboard = UIStoryboard(name: StoryboardNames.LandingScreen, bundle: nil)
switch index {
case 0:
let rolodexInforFirstPageViewController = storyboard.instantiateViewController(withIdentifier:IdentifierName.LandinScreen.rolodexInfoFirstPageConstroller) as! RolodexInforFirstPageViewController
rolodexInforFirstPageViewController.currentIndex = index
rolodexInforFirstPageViewController.wizcard = wizcard
viewController = rolodexInforFirstPageViewController
case 1:
let contactContainerViewController = storyboard.instantiateViewController(withIdentifier:IdentifierName.LandinScreen.contactConatinerImageController) as! ContactContainerViewController
contactContainerViewController.currentIndex = index
contactContainerViewController.wizcard = wizcard
viewController = contactContainerViewController
case 2:
let videViewController = storyboard.instantiateViewController(withIdentifier:IdentifierName.LandinScreen.videoViewController) as! VideViewController
videViewController.currentIndex = index
videViewController.wizcard = wizcard
viewController = videViewController
default:
break
}
return viewController;
}
}
extension RolodexPageViewController : UIPageViewControllerDataSource, UIPageViewControllerDelegate{
func pageViewController(_ pageViewController: UIPageViewController, viewControllerBefore viewController: UIViewController) -> UIViewController? {
var index = 0;
let firstPageViewController = (viewController as! BaseViewController)
index = firstPageViewController.currentIndex
self.delegateProperty.currentSelectedIndex(index: index)
if index == 0{
return nil
}
index -= 1
return viewControllerAtIndex(index: index)
}
func pageViewController(_ pageViewController: UIPageViewController, viewControllerAfter viewController: UIViewController) -> UIViewController? {
var index = 0;
let baseViewController : BaseViewController!
baseViewController = viewController as! BaseViewController
index = (baseViewController?.currentIndex)!
self.delegateProperty.currentSelectedIndex(index: index)
if index == NSNotFound{
return nil
}
index += 1
let contactContainer = wizcard.contactContainers?.allObjects as! [ContactContainer]
if let mediaSet = contactContainer[0].media{
let media = mediaSet.allObjects as! [Media]
if media.count > 0{
if URL(string:media[0].media_element!) != nil && index == 1
{
return viewControllerAtIndex(index: index)
}
}
}
if let media = HelperFunction.getWizcardVideo(arrayList: wizcard.media?.allObjects as? [Media]){
if let _ = URL(string:media.media_element!)
{
return viewControllerAtIndex(index: index)
}else{
return nil
}
}else{
return nil
}
index+=1
if index >= 3 {
return nil
}
return viewControllerAtIndex(index: index)
}
func pageViewController(_ pageViewController: UIPageViewController, didFinishAnimating finished: Bool, previousViewControllers: [UIViewController], transitionCompleted completed: Bool)
{
if (!completed)
{
return
}
if let currentViewController = pageViewController.viewControllers![0] as? BaseViewController {
currentIndex = currentViewController.currentIndex
}
// currentIndex = pageViewController.viewControllers!.first!.view.tag //Page Index
}
}
|
Shell
|
UTF-8
| 719
| 3.203125
| 3
|
[] |
no_license
|
#!/bin/bash
#set -x
# damit das Script LSB-konform ist
. /etc/ha.d/pidfile.cfg
KOMMANDO="$(echo "${@}" | awk '{print $NF}')"
case ${KOMMANDO} in
start)
pid_beginn
cat $(find /sys/ -type f | fgrep 'address' | fgrep "${1}") > ${PIDDATEI}
ifdown ${1}
ifconfig ${1} hw ether ${2}
ifup ${1}
;;
status)
pid_status
;;
stop)
if [ -e "${PIDDATEI}" ] ; then
ifdown ${1}
ifconfig ${1} hw ether $(cat ${PIDDATEI})
ifup ${1}
fi
pid_ende
;;
esac
exit 0
|
C++
|
UHC
| 1,295
| 3.625
| 4
|
[] |
no_license
|
#include <stdio.h>
#include <iostream>
//Ž ̿()
int _BinSearch(int arr[], int left, int right, int data) {
if (left <= right) {
int middle = (left + right) / 2;
if (data < arr[middle]) {
return _BinSearch(arr, left, right - 1, data);
}
else if (data > arr[middle]) {
return _BinSearch(arr, left, right - 1, data);
}
else {
return middle;
}
}
}
int BinSearch(int arr[], int size, int data) {
return _BinSearch(arr, 0,size-1, data);
}
int main() {
int arr[10] = { 10,35,45,48,50,57,69,72,83,96 };
int size = 10;
int idx = BinSearch(arr, size, 48);
if (idx != -1)
printf("[%d]: %d\n", idx, arr[idx]);
return 0;
}
//Fibonacci()
//int Fibonacci(int n) {
// if (n == 1)
// return 1;
// else if (n == 2)
// return 2;
// else
// return Fibonacci(n - 1) + Fibonacci(n - 2);
//}
//
//int main() {
// int result = Fibonacci(5);
// printf("%d\n", result);
// return 0;
//}
//factorial()
//int Factorial(int n){
// if (n == 1)
// return 1;
// else
// return Factorial(n-1)*n;
//}
//int main()
//{
// int result = Factorial(5);
// return 0;
//}
// Լ
//void Print(int n) {
// printf("+%d\n", n);
// if (n > 0)
// Print(n - 1);
// printf("-%d\n", n);
//}
//int main()
//{
// Print(3);
// return 0;
//}
|
C
|
UTF-8
| 541
| 3.125
| 3
|
[] |
no_license
|
#include <stdio.h>
#include <assert.h>
#include <stdlib.h>
void swap_max(int [], int, int );
void ssort(int [], int);
void swap_max(int a[], int n, int k)
{
int i=0;
int z=a[k], c=0;
for(i=k;i<=n-1;i++)
{
if(a[i]>z)
{
c=i;
z=a[i];
}
}
if(z!=a[k])
{
a[c] = a[k];
a[k]=z;
}
}
void ssort(int a[], int n){
int i;
for(i=0;i<n;i++)
{
swap_max(a,n,i);
}
}
|
Python
|
UTF-8
| 10,885
| 2.609375
| 3
|
[
"MIT"
] |
permissive
|
from __future__ import print_function
from copy import deepcopy
from random import seed, randint, shuffle
import numpy as np
from groupy.gbb import Gbb
from groupy.box import Box
from groupy.lattice import Lattice
import pdb
class Bilayer():
"""Class for initializing a bilayer.
"""
def __init__(self, lipids, n_x=10, n_y=10,
area_per_lipid=1.0, solvent=None, solvent_per_lipid=None,
random_seed=12345,
mirror=True, solvent_density=1.0/1.661,
lipid_positions=None):
"""Constructor. Builds a bilayer with several tunable parameters.
Args
----
lipids : list((groupy.gbb, fraction))
The lipid prototypes to go into the bilayer
n_x : int
The number of lipids in x
n_y : int
The number of lipids in y
area_per_lipid : float
area per lipid, determines box cross-sectional area
solvent : groupy.gbb
Solvent molecule
solvent_per_lipid : int
Number of solvent molecules per lipid
random_seed : int
Initialize random number generator
mirror : bool
If True, make the leaflets mirror images
solvent_density : float
Mass density of solvent to use
lipid_positions : list(list(int))
Positions of each component, used to phase-separated systems
"""
# set constants from constructor call
self.lipids = lipids
self.solvent = solvent
self.apl = area_per_lipid
self.n_x = n_x
self.n_y = n_y
self.mirror = mirror
self.random_seed = random_seed
self.n_solvent_per_lipid = solvent_per_lipid
self.molecules = []
self.solvent_density = solvent_density
self.lipid_positions = lipid_positions
# parse the spacing_z and shift lipids as necessary
for i, lipid in enumerate(lipids):
lipid[0].shift_com_to_origin()
lipid[0].translate(xyz=[0.0, 0.0, lipid[2]])
# a few calculations to figure things out
self.n_lipids_per_layer = self.n_x * self.n_y
self.n_solvent_per_layer = self.n_lipids_per_layer * self.n_solvent_per_lipid
self.area = n_x * n_y * self.apl
self.box = Box(lengths=np.array(
[np.sqrt(self.area),
np.sqrt(self.area),
1.0]))
self.mask = Lattice()
self.mask.grid_mask_2d(n_x, n_y, box=self.box)
self._n_each_lipid_per_layer = list()
# safety checks
self.check_fractions()
if lipid_positions:
assert(len(lipids) == len(lipid_positions))
for pos in range(n_x * n_y):
found = False
for comp_pos in lipid_positions:
if pos in comp_pos:
found = True
break
if found == False:
print('Not all lattice positions accounted for')
exit()
# for finding location of water boxes
self.top_bound = -np.inf
self.bottom_bound = np.inf
# assemble the lipid layers
seed(self.random_seed)
if lipid_positions:
top_layer, new_lipid_labels = self.create_layer(lipid_labels=lipid_positions,
random_mixing=False)
bottom_layer, bottom_lipid_labels = self.create_layer(
lipid_labels=lipid_positions, random_mixing=False,
flip_orientation=True)
else:
top_layer, top_lipid_labels = self.create_layer()
if self.mirror == True: # ugly
bottom_layer, bottom_lipid_labels = self.create_layer(
lipid_labels=new_lipid_labels,
flip_orientation=True)
else:
bottom_layer, bottom_lipid_labels = self.create_layer(
flip_orientation=True)
for lipid in top_layer:
self.molecules.append(lipid)
for lipid in bottom_layer:
self.molecules.append(lipid)
if self.n_solvent_per_lipid > 0:
solvents = self.add_solvent()
for solvent in solvents:
self.molecules.append(solvent)
def check_fractions(self):
frac_sum = 0
for lipid in self.lipids:
frac_sum += lipid[1]
assert frac_sum == 1.0, 'Bilayer builder error: Lipid fractions do not add up to 1.'
def n_each_lipid_per_layer(self):
if self._n_each_lipid_per_layer:
return self._n_each_lipid_per_layer
self._n_each_lipid_per_layer = []
for lipid in self.lipids[:-1]:
self._n_each_lipid_per_layer.append(
int(round(lipid[1] * self.n_lipids_per_layer)))
# TODO: give warning if frac*n different than actual
# rounding errors may make this off by 1, so just do total - whats_been_added
self._n_each_lipid_per_layer.append(
self.n_lipids_per_layer - sum(self._n_each_lipid_per_layer))
assert len(self._n_each_lipid_per_layer) == len(self.lipids)
return self._n_each_lipid_per_layer
@property
def n_each_lipid_per_layer(self):
import pdb
if self._n_each_lipid_per_layer:
return self._n_each_lipid_per_layer
self._n_each_lipid_per_layer = []
for lipid in self.lipids[:-1]:
self._n_each_lipid_per_layer.append(
int(round(lipid[1] * self.n_lipids_per_layer)))
# TODO: give warning if frac*n different than actual
# rounding errors may make this off by 1, so just do total - whats_been_added
self._n_each_lipid_per_layer.append(
self.n_lipids_per_layer - sum(self._n_each_lipid_per_layer))
assert len(self._n_each_lipid_per_layer) == len(self.lipids)
return self._n_each_lipid_per_layer
def create_layer(self, lipid_labels=None, flip_orientation=False,
random_mixing=True):
"""
Parameters
----------
lipid_labels : list(int)
An integer label for each lipid
flip_orientation : bool
If True, rotate lipids aboux x-axis (to create an opposite layer)
random_mixing : bool
If True, place the lipids randomly on a lattice
"""
layer = []
if not lipid_labels:
lipid_labels = range(self.n_lipids_per_layer)
shuffle(lipid_labels)
lipids_placed = 0
for i, n_of_lipid_type in enumerate(self.n_each_lipid_per_layer):
if self.lipid_positions:
assert(len(self.lipid_positions[i]) == n_of_lipid_type)
current_type = self.lipids[i][0]
for j, n_this_lipid_type in enumerate(range(n_of_lipid_type)):
new_lipid = deepcopy(current_type)
if flip_orientation == True:
new_lipid.rotate(angles=np.array([np.pi, 0.0, 0.0]))
# Move to point on mask
if random_mixing == True:
random_index = lipid_labels[lipids_placed]
position = self.mask.points[random_index]
new_lipid.translate(position)
else:
position = self.mask.points[self.lipid_positions[i][j]]
new_lipid.translate(position)
# see if lipid bounds change
if np.amax(new_lipid.xyz[:, 2]) > self.top_bound:
self.top_bound = np.amax(new_lipid.xyz[:, 2])
if np.amin(new_lipid.xyz[:, 2]) < self.bottom_bound:
self.bottom_bound = np.amin(new_lipid.xyz[:, 2])
layer.append(new_lipid)
lipids_placed += 1
return layer, lipid_labels
def add_solvent(self):
# just do this in a very basic manner for now
# TODO: add in smart solvate like mBuild
# first find the xy area of the box
solvent_list = []
box_area = self.box.lengths[0] * self.box.lengths[1]
MW_solvent = np.sum(self.solvent.masses)
water_box_z = self.n_solvent_per_layer * MW_solvent / (
box_area * self.solvent_density)
top_box_min = self.top_bound + (0.5 * float(self.n_x) / self.box.lengths[0])
bottom_box_max = self.bottom_bound - (0.5 * float(self.n_x) / self.box.lengths[0])
top_water_box = Box(mins=np.array(
[self.box.mins[0],
self.box.mins[1],
top_box_min]),
maxs=np.array(
[self.box.maxs[0],
self.box.maxs[1],
top_box_min + water_box_z]))
bottom_water_box = Box(
mins=np.array(
[self.box.mins[0],
self.box.mins[1],
bottom_box_max - water_box_z]),
maxs=np.array(
[self.box.maxs[0],
self.box.maxs[1],
bottom_box_max]))
self.box = Box(mins=np.array(
[self.box.mins[0],
self.box.mins[1],
bottom_water_box.mins[2]]),
maxs = np.array(
[self.box.maxs[0],
self.box.maxs[1],
top_water_box.maxs[2]]))
n_water_x = int((top_water_box.lengths[0]**2.0 * self.n_solvent_per_layer / (
top_water_box.lengths[2] * top_water_box.lengths[1]))**(1.0/3.0))
n_water_y = int((top_water_box.lengths[1] * self.n_solvent_per_layer / (
top_water_box.lengths[2] * n_water_x))**0.5)
# add 1 for rounding purposes, stop adding when n_added = n_solvent_per_layer
# TODO: will this always work? test to make sure
n_water_z = 1 + int(self.n_solvent_per_layer / (n_water_x * n_water_y))
top_water_points = Lattice()
top_water_points.grid_mask_3d(n_water_x, n_water_y, n_water_z,
box=top_water_box)
bottom_water_points = Lattice()
bottom_water_points.grid_mask_3d(n_water_x, n_water_y, n_water_z,
box=bottom_water_box)
self.solvent.shift_com_to_origin()
for point in top_water_points.points[:self.n_solvent_per_layer]:
t = deepcopy(self.solvent)
t.translate(point)
solvent_list.append(t)
for point in bottom_water_points.points[:self.n_solvent_per_layer]:
t = deepcopy(self.solvent)
t.translate(point)
solvent_list.append(t)
return solvent_list
|
PHP
|
UTF-8
| 1,744
| 2.671875
| 3
|
[] |
no_license
|
<?php
function email_av($email_avocat_rdv,$date_rdv){
global $conn;
$e = array('email_avocat_rdv' => $email_avocat_rdv,
'date_rdv' => $date_rdv
);
$sql = 'SELECT * FROM client WHERE email_avocat_rdv = :email_avocat_rdv && date_rdv=:date_rdv';
$req = $conn->prepare($sql);
$req->execute($e);
$free = $req->rowCount($sql);
return $free;
}
function verifie($donnees){
$donnees = (string) $donnees;
if (isset($donnees) && !empty($donnees)) {
return $donnees;
}
else {
return false;
}
}
if (isset($_POST['mis'])){
$email_avocat_rdv = $_POST['email_avocat_rdv'];
$date_rdv = $_POST['date_rdv'];
/* on test si les champ sont bien remplis */
if(verifie($_POST['email_avocat_rdv'])and verifie($_POST['date_rdv'])){
//
$seq=$conn->query("SELECT * FROM client WHERE email ='{$email_avocat_rdv}'");
$tab=array();
foreach ($seq as $key) {
$tab[]=$key;
}
if ($key['fonction']=='avocat') {
//
if (email_av($email_avocat_rdv,$date_rdv) <= 1) {
$statut='P';
$sq="UPDATE client SET email_avocat_rdv='{$email_avocat_rdv}',statut = '{$statut}',date_rdv='{$date_rdv}' WHERE id_ar ='{$id_ar}'";
$sql=$conn->query($sq);
if ($sql) {
$success='rdv programmé avec success';
}else
$error='dommage';
}else $error="ce avocat est assez occupé le ".$date_rdv." Veuillez choisir un autre avocat ou changer de date";
//
}else $error= "ce mail ne correspond a aucun avocat";
//
}else $error= "Veuillez saisir tous les champs !";
}
?>
<?php
?>
|
PHP
|
UTF-8
| 748
| 2.703125
| 3
|
[
"MIT"
] |
permissive
|
<?php declare(strict_types=1);
namespace Dynamap\Mapping\Field;
class DateTimeField implements DynamoDBField
{
/** @var string */
private $originalFieldType;
public function __construct(string $originalFieldType)
{
$this->originalFieldType = $originalFieldType;
}
public function getDynamoDBFieldType(): string
{
return 'S';
}
public function getOriginalFieldType(): string
{
return $this->originalFieldType;
}
public function castToDynamoDBType($value)
{
return $value->format(\DateTime::ATOM);
}
public function restoreFromDynamoDBType($value): \DateTimeInterface
{
return \DateTime::createFromFormat(\DateTime::ATOM, $value);
}
}
|
Python
|
UTF-8
| 5,208
| 2.875
| 3
|
[] |
no_license
|
import requests
import json
import pandas as pd
import math
import datetime
def write_json(D, filename):
'''
Writes a dictionary D as a json file.
'''
with open(filename, 'w') as json_file:
json.dump(D, json_file, indent = 4, sort_keys=True)
def hypercell_api(time_start, time_stop):
'''
Wrapper for Business Finland Hypercell API (people flow)
Args:
time_start: str
time_stop: str
Returns:
dictionary D where:
D['raw'] = [
{
"distance": 17.4,
"hash": "144afc51fc2443c7031a2912566eff2ce60226a49d6d2bd7c2923700",
"latitude": 60.16544,
"longitude": 24.95398,
"serial": "0000000038d83d41",
"time": "2019-08-01T12:00:00Z"
},
{
...
}
]
Example:
data_json = hypercell_api("2019-08-01T12:00:00Z", "2019-08-01T12:00:10Z")
write_json(data_json, 'data/example_data_from_hypercell_api.json')
'''
url = "https://api.hypr.cl/raw/"
headers = {
'x-api-key': "iQ0WKQlv3a7VqVSKG6BlE9IQ88bUYQws6UZLRs1B",
'time_start': time_start,
'time_stop': time_stop,
'Accept': "*/*",
'Cache-Control': "no-cache",
'Host': "api.hypr.cl",
'Accept-Encoding': "gzip, deflate",
'Content-Length': "0",
'Connection': "keep-alive",
'cache-control': "no-cache"
}
response = requests.request("POST", url, headers=headers)
output = response.json()
return output
def linked_events_api(start_time="2019-08-01", stop_time="2019-08-02", location=[None, None], radius=):
'''
Wrapper for Helsinki City Linked Events (http://api.hel.fi/linkedevents/v1/event/?location=tprek:28473).
Returns list of event names in a specified location and time.
'''
url = "http://api.hel.fi/linkedevents/v1/event"
url = url + "/?start=" + start_time + "&end=" + stop_time
if location != None:
url = url + "?bbox=" + ','.join([str(s) for s in compute_bbox(location, radius)]) #TODO Debug
response = requests.request("GET", url)
return response
def azureml_main(dataframe1 = None, dataframe2 = None):
'''
Connecting function required by Azure.
Has to take two inputs dataframe1 and datafram2 and return a pd.DataFrame.
'''
data_json = hypercell_api("2019-08-01T12:00:00Z", "2019-08-01T12:00:10Z")
data = pd.DataFrame(data_json['raw'])
return data
def get_some_data(time_start="2019-08-01T12:00:00Z", time_stop="2019-08-01T12:00:10Z", filename='data/data.json'):
'''
Convenience function to quickly access the API and save a file data/data.json
'''
data_json = hypercell_api(time_start, time_stop)
write_json(data_json, filename)
#get_some_data(time_start="2019-08-01T12:00:00Z", time_stop="2019-08-01T12:05:00Z", filename='data/data.json')
def hypercell_api_parallel(time_start, time_stop):
'''
Make parallel requests to API. The request times out if you try to get more than 1 minute of data.
See example here: https://skipperkongen.dk/2016/09/09/easy-parallel-http-requests-with-python-and-asyncio/
'''
#TODO write this
return None
def print_json(json_file):
'''
Print a json file in pretty format.
'''
print(json.dumps(json_file, indent=4, sort_keys=True))
def compute_bbox(location = [None, None], box_size=100):
'''
Returns a bounding box around a location = [lon, lat]
box_size in meters
Reference: https://stackoverflow.com/questions/2839533/adding-distance-to-a-gps-coordinate
Returns vertices of bounding box of size box_size
west is the longitude of the rectangle's western boundary, south is the latitude of the rectangle's southern boundary, and so on.
'''
lon0=location[0]
lat0=location[1]
east = lat0 + (180/math.pi)*(box_size/6378137)
north = lon0 + (180/math.pi)*(box_size/6378137)/math.cos(lat0)
west = lat0 + (180/math.pi)*(-box_size/6378137)
south = lon0 + (180/math.pi)*(-box_size/6378137)/math.cos(lat0)
return [west,south,east,north]
def sample_10sec_per_hour_from_day(date="2019-08-01"):
'''
Sample one second every hour for a day to get more data.
NOTE: Very sloppily made. Rewrite this.
Returns dictionary with keys=hours_in_date and values=hypercell_api(time, time_plus_10sec)
#TODO Return a data frame.
'''
hours_in_date = [date+"T"+str.zfill(str(hour), 2)+":00:00Z" for hour in range(24)]
result = dict()
for time in hours_in_date:
time_plus_10sec = time.replace('00Z', '10Z')
print("Calling hypercell_api for time="+time)
result[time] = hypercell_api(time, time_plus_10sec)
return result
def sample_day_and_previous_days(date="2019-05-27", n_previous=5):
result = dict()
date_obj = datetime.datetime.strptime(date, "%Y-%m-%d")
previous_n_days = [(date_obj - datetime.timedelta(days=n_days)).strftime("%Y-%m-%d") for n_days in range(n_previous+1)]
res = dict()
for day in previous_n_days:
res[day] = sample_10sec_per_hour_from_day(day)
return res
# Draft
#august = sample_day_and_previous_days(date="2019-08-31", n_previous=31)
#write_json(august, 'data/august.json')
|
Markdown
|
UTF-8
| 27,536
| 2.859375
| 3
|
[] |
no_license
|
<p class="group-question"><strong>Group question:</strong> Q’uo, today we’ve been discussing the interaction and relationship between the universe and the seeker. We would like you to discuss how it is that the universe answers the seeker’s questions of identity, service and transformation and how it is that the seeker can best listen for, respond and know those answers that the universe offers. Additionally, what do these lessons teach of patience and how may we invoke and implement that quality in our lives?</p>
<p class="channel-type">(Carla channeling)</p>
<p>We are known to you as those of the principle of Q’uo and we greet you in the love and in the light of the one infinite Creator, in Whose service we come to you today. We thank each of you for taking the time and the energy to dedicate this working to the seeking of truth. It is a great privilege to enter meditation with you and to be a part of that still, small voice that speaks in the quiet of such times. We are most happy to speak with you this day concerning the nature of the relationship between the seeker and the creation, the questioner and the answerer, and thank you for that opportunity to speak. As always, we would ask that each of you govern those things which you would take in of what we would have to say with exquisite discrimination, for each of you has a very good power of discrimination and can feel the resonance of those thoughts that are helpful at a particular time. We would ask that, unless you feel that resonance, you allow the thoughts simply to pass by and be dropped without further thought. In this way we feel that we can share our hearts with you without being concerned that we will infringe upon your free will, for we truly do not wish to constitute a stumbling block for anyone.</p>
<p>Your query this day is one which drives to the heart of the nature of being. Perhaps it was not intended that this question probe so deeply, yet the question was that of the relationship betwixt the seeker and the system of information which constitutes the creative principle, the godhead principle, or the one infinite Creator. So we would first back up to gaze at that one infinite Creator, for that concept, in and of itself, is a key to that question that was asked. Each who is taking breath in and letting breath out within this circle of seeking and each who may read these words as a part of their life experience of a particular moment: at the moment you hear or read these words, each is a part of the one infinite Creator. The realest part of each spirit or soul in manifestation or third-density incarnation, alike and equally, is a part of the Godhead, a part that has never been separated from the Godhead, a spark that shall never know separation from the original Thought that created the “house” that you experience as the universe and all of the furnishings or dimensions or densities of it.</p>
<p>Becoming able to realize one’s part in the creative principle is, within waking consciousness, virtually impossible, the limitations of body, flesh, and physical senses narrowing the doors of perception and, in many cases, closing them entirely. All of the massive indoctrination that you as very young entities within incarnation are carefully taken through by parents and teachers guarantee that if there are any who may come to awareness free of bias and full of the knowledge of the self as Creator, then that is a very tiny group. For the rest of those upon your sphere at this time, we believe it is safe to say that each has lost that direct sense of insight and union with the one infinite Creator. Yet there is a unity there. Perhaps each is not leaning into that unity, yet it subsists. It cannot be shed, it is not a skin that can be molted, and it is nothing that shall ever be renewed. The human experience, shall we say, the third-density incarnational experience, is all about death and renewal, endings and beginnings. Yet throughout the process of incarnational living, the most fundamental part of your essential being is not that which will change, grow or alter. Rather, it is that which is. How in the holy work that this instrument knows as the Bible did the Creator express itself? “I AM.”</p>
<p>So part of each of you is an I AM. Can you feel the difference between “I” and “I AM”? Can you feel the shift from personhood to essence? It is an important shift of which to remain aware, not simply for the purpose of this discussion but in terms of the basic skills of living life awake and conscious of who you are and why you are here. What this instrument would say about the relationship between the I and the I AM is that she hopes, in each day, to allow the I that is I AM, to become her, so that the I of her is what she would call the Christ or Christ Consciousness or unconditional love. It is not a taking of the self, tossing the self away, and then replacing it with the Creator, the Christ, or the Christ principle. Rather, it is allowing oneself to remember that the I AM is the deepest essential self that is a true part of the whole being that is the one known as Carla.</p>
<p>Now, we feel that each within the circle has hopes along similar lines, that is, each has hopes of expanding personal consciousness into a truer, more whole and deeper consciousness; expressing a more essential and more vital self. If infinite consciousness is living your life, then there is no questioner and no answerer but rather a state of being which is unitary; in which there is no necessity for questioning, for waiting, for looking, for all is perfect. This is a valuable tool and resource. No matter what the circumstances, this level of consciousness is always a powerful resource in centering the self and allowing the self to lift away from peripheral details of a particular given situation that has the energy of a bubble of topical interest at the time. One cannot, for the most part, stay within unitary consciousness, within the I AM, a hundred percent of the time within consensus reality. Consensus reality was specifically designed to pull one away from calm, smugness and the acceptance of things as they are. Consensus reality is carefully designed to pull one’s energies out of their comfort zone not once, but again, and again, in cycles, from birth until the death of the physical body. Consequently, we do not suggest that each attempt at all times to remain completely submerged in the I AM of Creatorship. Yet when there is that forest of confusion out of which one cannot find a way, when there seems to be a failure of the rational way of gazing at a situation, we encourage each to take a moment to rest the self from all of the labors of the mind and emotions, to sit or rest while walking, and simply allow that consciousness of I AM to permeate and take over the mind and the focus of the mind, for in that utter lack of personality or condition lies the deepest treasure of the incarnate spirit, the connection with all that there is.</p>
<p>Now let us move into gazing at a less unitary and more dualistic view of spiritual process, that view which posits that the seeker is the questioner and the universe, the creation, or guidance, is that which is responding the question. This is much closer to the level of consensus reality. This offers no challenge to the personality that is locked into the roles that he or she is playing and that have perhaps have been thrust upon him or her. Many times, the way the creation chooses to respond to the questions which seekers ask depends upon the most flimsy, fragile nuances in the way questions are put. Many times as this instrument has given personal channelings, private readings, for individuals she has asked for the entity asking the question to go back and study again the question that has been asked to be sure that it catches the absolute center of that concern with which the entity has come to request the reading. And this entity is correct to do so, for that which the universe naturally can flower into in response to a question is completely dependant upon the shape of the intent, the mood, the very tiniest wording of the question asked. And when that shape is heard by the creation it brings about an absolutely automatic, natural process of response. It is not a response that can be detailed in a linear fashion—first this happens, then that, and then the other—for it is a response upon as many levels of intent as the energy of the question discloses. What entity can truly know all of the levels at which he is asking a question? How can an entity truly penetrate so deeply into the unknown country of his own archetypical mind that he is even aware of the full nature of that which he seeks?</p>
<p>Earlier there was a discussion of a movie recently seen concerning the life of the one known as Jesus the Christ and in that movie the character of Pontius Pilate asks the question, “What is truth?” And this is basically what we are saying to you, “What is your question?” It is difficult to know the truth of a situation or a question. It is almost impossible to know what you are asking to the full limit of that question. Hidden within the folds of the silence between the words lie worlds of requested information that is pointed very precisely by the attitude, the hopes, and the feelings that go into that moment of asking.</p>
<p>So one thing that we would say about the relationship between questioner and response is that the questioner has the deepest of personal individual power and responsibility for the quest, the question, the intent of the question, and everything that surrounds the moment of coming to crux, coming to crisis, and accepting that there is a cusp which must be met. Then when that is realized, it is well to take that realization and employ that patience of which you asked first, in the forming of your question. How deeply can you probe into your secret heart? How carefully can you sense those feelings that perhaps have not seen the light of day? What work might there be for you to do in reaching out to those dark places within yourself where questions have not been fully asked because the essence beneath those questions has not yet been fully redeemed within the self, to the self? What powers of forgiveness can your heart bring to the process of coming into the present moment and releasing the past? How high can you hold up your hope, your intent, and your aim? And to what sharpness of focus can you bring that part of yourself that carries pride, so that you are able to give it as a gift, as you kneel in humility with empty hands at last before the truth itself.</p>
<p>Once the seeker has asked the question there is that time of release and then, skill and art lie in that which the one known as G referred to as the light touch. Once you have awakened the universe to your need, you may be sure that the universe will find many ways to communicate with you concerning your query. Again, because it is the universe of the Creator, rather than the universe of humankind, it is often that this information does not come in words at all, but rather in coincidences, signs, hints, chance thoughts heard in unusual circumstances, and many subjectively interesting occurrences such as the dreams of yourself and others about you, the chance comments of others about you upon topics that do not seem to have a relationship to your question but yet which angle in tangentially and have their own eerie but very true meaning in terms of your situation. Many are the times that we have discussed within this group all of the amazing ways in which the world of nature as well as the world of humankind finds ways to express its connectedness with you, its care for you, and its affiliation with you.</p>
<p>When there is a question which seems to be intensely important, it is especially difficult to retain a sense of proportion, a sense of peace, a sense of patience, shall we say. There is the feeling of a need for immediate change. And while we have complete sympathy for that wish to see results, at the same time we would encourage each to consider the possibility that the question that has been asked is expressing on many different levels, only one of which shows above the ground of the conscious mind, the limen or threshold of the waking consciousness. Most of the information that comes into the deeper self to inform and prepare that self for the changes in energy that are taking place come into the web of the self below the level of conscious awareness and only bubble up into conscious awareness in that very subtle way of yeast bubbling up into bread in order to make the situation rise, shall we say. One becomes aware that there is space where there had not been space, there is information, or an opinion, or a feeling where previously there had not been a feeling. Look for and lean into those perceptions that seem simply to be bubbling up from within because that is the end result of a fairly lengthy process of information-gathering by the self from the creation. It has bubbled in through notice of coincidences of conversations, the messengers of animals and flowers, the speaking of trees and the blowing of the wind. All of these things move into the web of self and touch various inner bodies of the energy-body system that is instinct within the outer physical shell that each of you enjoys.</p>
<p>It is a tremendous gift simply to have faith that this process is taking place. One may see that such a process shall, through the limitations of the physical body, take time. It takes time to wake and sleep and wake and sleep and wake again, allowing this process of recovery of information through dreams and through subtle processes that occur inwardly to have time to complete themselves. So it is not simply patience within a vacuum that we encourage you to adopt but rather patience that is a knowing patience, a patience that contains the awareness that things are occurring of which the conscious mind cannot know. The ability to take on faith that this [is the] way the spirit works within entities is a tremendous asset. Use it if you have it and attempt to cultivate it if you do not. How can you cultivate the faith in these subtle processes but by taking the leap of faith, taking the effort and the time to have patience with the process of seeking the answer to the question, and then evaluating, after the fact, what sources of information in fact came through to you and what kind of efficacy those processes have had in bringing into manifestation the blooming and development of that which was a budding situation of which there was great question as to the appropriate way of blooming or maturing.</p>
<p>When seeking the truth, there is much to be said for leaning into the interiority of the process. Much energy can be wasted in the reaching outward, for outer authority and outer knowledge. When there is a question of spiritual evolution involved it is seldom that the outer world will have a <em>prima facie</em> <a id="_ftnref1" href="#_ftn1" name="_ftnref1">[1]</a>, direct way of speaking to the heart of the problem, the situation, or the question. The deeper the question, the less effective consulting outer authority shall be.</p>
<p>Yet there is a system of inner authority to which one may go in mind and in heart. And we would not limit this for entities by saying it is this or it is that. To many, a guidance system is a unitary or singular phenomenon. This instrument would call it the Holy Spirit. The one known as David would call it the Guidance System, and so forth. And yet we assure each that the guidance system of each of you is massive and tremendously complex, moving not simply into the inner planes of third density but into the family connections, shall we say, between those in soul groups and their connections in other densities and so forth, so that the guidance system that can be approached by the asking of a question amounts to the complete awareness of your own inner planes and [outer] densities as well as that center of guidance for each of you that is that self of sixth density that is looking back to self in third density and offering that harvest in awareness that it has within that particular illusion.</p>
<p>This massive family that backs up each of you may take some of your time to
respond so that it manifests within your own awareness. And so we give to this
instrument the image of that figure within the Bible of which the one known as
Jesus spoke, of the one who goes into his room to pray in secret <a id="_ftnref2" href="#_ftn2" name="_ftnref2">[2]</a>, to express suffering in secret, to offer in the utmost privacy of self, the heart of self, the suffering of self, and all of the self that can be brought to that room in the asking of what is the situation and what is the truth of the situation. Keeping it quiet, keeping it silent, keeping it completely inner is a very helpful technique for it allows a kind of intensity to build up within that tiny room of prayer. Perhaps each of you is familiar with the way that a materialization medium gathers ectoplasm within its closet so that it may manifest that which this entity would call a ghost or spirit in a séance. Just in such a way can you gather the energy of your prayer, keeping it within that tiny closet, within that point of union between you, the question, and the response system—that point that is the gateway to intelligent infinity—staying just there, just past the lions at the gate, just in the door, not anywhere nearer than moving into the interior, resting and allowing the process to move.</p>
<p>The one known as V was speaking the other day of the connectedness of all things, the labyrinth that turns out to be that which connects everything to everything. It is at that point, just within that tiny room of prayer, that that connection point is. So the more interior that you are able to make your seeking, the more quiet, private and special, the more opportunity you will have to move into that deep rest that lifts you in a hammock just where you wish to be and allows you to rock, waiting in total comfort, resting in the cradle of the love of the infinite Creator. If you can do this for yourself, daily if possible, when working through a situation, you shall be touching into the most efficacious and helpful place within you for truly listening to that still, small voice of the one infinite Creator.</p>
<p>Each is aware of many techniques for determining the rightness of a particular fact or action. The use of the pendulum has been discussed often, the use of readings, whether they be tarot or astrology, and the use of psychic or spiritual counselors. All of these ways of getting more information are very helpful but you may see how diffused and outward they become and how quickly one loses that precious focus, that honed intent, and that quiet, listening ear. One may employ crystals, one may employ pyramids, one may employ such a large number of techniques for finding out more information concerning the outer details of a situation that we could not possibly mention them all. But each is aware of the size of the spiritual supermarket, about which this group has often joked and enjoyed conversation. There are many, many ways to know more about the energies around you. Yet, in terms of how the universe works, the best connection between questioner, question and guidance system is the gateway that lies within each of you.</p>
<p>At this time this instrument requests that we move on to ask if there are further questions that we may answer at this time. Is there a query that we may answer at this time?</p>
<p><strong>B:</strong> I have one. When you were speaking initially, you spoke of a duality and you really only talked about one side. Would the other side be where the one infinite Creator becomes the seeker?</p>
<p>We are those of Q’uo. We are aware of your query, my brother. The duality of which we were speaking is that duality that is self perceived by the questioner, when the questioner sees itself as one dynamic of a duality and the answer as the other part of a duality. The unitary attitude, on the other hand, would see the questioner, the question, and the guidance as one system which is not at all separate from itself but which is a unit working to expand the self and, in that way, we would say that indeed when there is a unitary attitude the questioner is the Creator. This is correct, my brother.</p>
<p>Is there a further query?</p>
<p><strong>G:</strong> Q’uo, I have one. Ra speaks about the will and says that it is paramount, it is not to be underestimated, and its use in faith can create change and can accelerate the path. Yet, I am feeling doubtful about the ritual that I want to undertake tonight, in which I would use the will to create a change or shift in consciousness. I know, reading through past transcripts, that this philosophical point between willing change [to occur] and waiting for change has been discussed much but I was wondering if you can speak more specifically to this particular situation?</p>
<p>We are those of Q’uo, my brother, and are aware of your query. The state of willing that which one feels is correct for the self is that state in which the entity is sure, in a way that this instrument would call “gnosis,” of that which is intended. It is a matter of knowing one’s own heart, knowing one’s true feelings to the point where one is willing to stand upon the ground and say, “This is who I am. This is how I wish to express my will.” In that way of offering the will, there is an inner knowing that lies behind that ability to cast off all fear and doubt and simply apply the will directly, straightforwardly, forthrightly, to the goal at hand. The purity with which one maintains honesty with the self is a great key to the achieving of this kind of gnosis or sure insight concerning the self.</p>
<p>When a situation is upcoming in which the will to serve is known by the person but not which situation needs to be served, [it] brings forth the second kind of use of will, which is to abnegate one’s own will in favor of the will of the infinite Creator, the guidance system, and the basic incarnational plan that one has had in place for the entire incarnation and in which one does have faith. In this latter situation, it would be folly to force one outcome over another. In that case the will is involved simply in bringing the whole self to a point of surrender so that as the will of the Creator becomes obvious, it may be followed with a complete and full intensity of effort and focus.</p>
<p>May we answer you further my brother?</p>
<p><strong>G:</strong> Yes. I think I was skillful enough to create the ritual so that I was not forcing one outcome or another or requesting any kind of specific unfolding of events but I did steer the will, especially at the end of it, to one of surrender to the Creator. So my question then is: if one feels that they are not fully, one hundred percent, in totality, surrendered to the Creator, can one then marshal what will that they are aware of within themselves to create a more full surrender to whatever outcome that the Creator will give, whatever catalyst that will come one’s way, to bring the rest of that self lagging behind and up to that surrendered and accepted state to know the Creator’s will?</p>
<p>We are those of Q’uo, and are aware of your query, my brother. Yes.</p>
<p><strong>G:</strong> You’re awesome. Thank you Q’uo.</p>
<p>We thank you, my brother. Is there a further query at this time?</p>
<p><strong>B:</strong> Q’uo, you used the word, faith, on numerous occasions. Could you please define what you mean by faith?</p>
<p>We are those of Q’uo, and are aware of your query, my brother. We use the words that this instrument has in her vocabulary. Often there are intangible differences in the way we use that word which you may have noticed, my brother. Faith, in general, is intended to indicate surety. The way that this instrument sees faith is fairly acceptable to us. In her mind faith is connected with knowing that all is well. That is what this instrument tends to mean when she speaks of faith. It is not that she attaches any fact or dogmatic principle or tenet to the word, faith, but rather it is a noun expressing an attitude of inner surety of the reality of the perfection and the rightness of the pattern of creation in which she is involved and of which she is an active and creative part.</p>
<p>When we use that word we are attempting to express a sense of confidence that is not aggressive but rather rests in peace and confidence and sureness, so that the knowingness is not confrontive, argumentative or even filled with fact but is simply an attitude of mind which assumes and stands on the rightness and the goodness of creation, of each entity’s place in it, and of the patterns of suffering and expression, and experience that seem to be moving about one at any particular time.</p>
<p>May we answer you further, my brother?</p>
<p><strong>B:</strong> No, thank you, that was fine.</p>
<p>We thank you, my brother.</p>
<p>Is there a final query at this time?</p>
<p><strong>T:</strong> Q’uo, I’m not sure how much you can say but are you able to comment at all upon the decisions that I’ve made in relation to employment and the idea that I’m now pursuing?</p>
<p>We are those of Q’uo, and the warmth of our affection for you makes this instrument smile, my brother. We are able to say that we feel that you do indeed stand on faith. We express our complete faith in you and in those decisions that you have made. And we are with you and with each as each moves into those areas which have been beyond the comfort zone and which now have the attraction of that which shall be and that which even now is growing into maturity within you.</p>
<p>May we answer you further, my brother?</p>
<p><strong>T:</strong> No, no thank you, Q’uo. I just want to send my thanks and love to you and also to those of Hatonn.</p>
<p>We are those of Q’uo, and may we say, my brother, that your words are most welcome to those of Hatonn that are with us, as always, at this time.</p>
<p>We thank this group in our hearts for allowing us to be a part of your beautiful nature, your sweet meditation, and your community of seeking. It is such a privilege to us and such a blessing to be able to be of some small service within your patterns. We assure you that you are of tremendous service to us. And we thank you.</p>
<p>We leave each of you, as always, in the love and in the light of the one infinite Creator. Adonai. We are those known to you as the principle of Q’uo.</p>
<p class="separator-left-33"> </p>
<p class="footnote"><a id="_ftn1" href="#_ftnref1" name="_ftn1">[1]</a> <em>Prima facie</em> is defined as meaning “at first sight; before closer inspection.”</p>
<p class="footnote"><a id="_ftn2" href="#_ftnref2" name="_ftn2">[2]</a> This reference is Matthew 6:18; “Whenever you fast, do not put on a gloomy face as the hypocrites do, for they neglect their appearance in order to be seen fasting by men. Truly I say to you, they have their reward in full. But you, when you fast, anoint your head, and wash your face so that you may not be seen fasting by men, but by your Father who is in secret; and your Father who sees in secret will repay you.”</p>
|
Java
|
UTF-8
| 2,280
| 1.921875
| 2
|
[] |
no_license
|
package com.qintess.desafio0604.util;
import java.util.Properties;
import org.hibernate.SessionFactory;
import org.hibernate.boot.registry.StandardServiceRegistryBuilder;
import org.hibernate.cfg.Configuration;
import org.hibernate.cfg.Environment;
import org.hibernate.service.ServiceRegistry;
import com.qintess.desafio0604.model.Cerveja;
import com.qintess.desafio0604.model.Cidade;
import com.qintess.desafio0604.model.Cliente;
import com.qintess.desafio0604.model.Estado;
import com.qintess.desafio0604.model.Estilo;
import com.qintess.desafio0604.model.Grupo;
import com.qintess.desafio0604.model.ItemVenda;
import com.qintess.desafio0604.model.Permissao;
import com.qintess.desafio0604.model.Usuario;
import com.qintess.desafio0604.model.Venda;
public class HibernateConfig {
private static SessionFactory sessionFactory;
public static SessionFactory getSessionFactory() {
if (sessionFactory == null) {
try {
Configuration config = new Configuration();
Properties prop = new Properties();
//prop do bd
prop.put(Environment.DRIVER, "org.h2.Driver");
prop.put(Environment.URL, "jdbc:h2:~/desafio0604");
prop.put(Environment.USER, "sa");
prop.put(Environment.PASS, "");
prop.put(Environment.DIALECT, "org.hibernate.dialect.H2Dialect");
prop.put(Environment.SHOW_SQL, "true");
prop.put(Environment.HBM2DDL_AUTO, "create-drop");
config.setProperties(prop);
config.addAnnotatedClass(Cerveja.class);
config.addAnnotatedClass(Cidade.class);
config.addAnnotatedClass(Cliente.class);
config.addAnnotatedClass(Estado.class);
config.addAnnotatedClass(Estilo.class);
config.addAnnotatedClass(Grupo.class);
config.addAnnotatedClass(ItemVenda.class);
config.addAnnotatedClass(Permissao.class);
config.addAnnotatedClass(Usuario.class);
config.addAnnotatedClass(Venda.class);
ServiceRegistry serviceRegistry = new StandardServiceRegistryBuilder()
.applySettings(config.getProperties())
.build();
sessionFactory = config.buildSessionFactory(serviceRegistry);
} catch (Exception e) {
e.printStackTrace();
}
}
return sessionFactory;
}
}
|
Java
|
UTF-8
| 5,684
| 2.484375
| 2
|
[] |
no_license
|
/*
* JBoss, Home of Professional Open Source.
* Copyright 2013 Red Hat, Inc., and individual contributors
* as indicated by the @author tags.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.flurg.thimbot.util;
/**
* A string builder wrapper that supports colors.
*
* @author <a href="mailto:david.lloyd@redhat.com">David M. Lloyd</a>
*/
public final class IRCStringBuilder {
private final StringBuilder b;
public IRCStringBuilder() {
b = new StringBuilder();
}
public IRCStringBuilder(final int length) {
b = new StringBuilder(length);
}
public IRCStringBuilder clear() {
b.setLength(0);
return this;
}
/**
* Set foreground color.
*
* @param color the color 0-15
* @return this builder
*/
public IRCStringBuilder fc(int color) {
if (color >= 0 && color <= 15) {
b.append((char)3).append(color);
}
return this;
}
/**
* Set background color; might restore foreground color depending on the client.
*
* @param color the color 0-15
* @return this builder
*/
public IRCStringBuilder bc(int color) {
if (color >= 0 && color <= 15) {
b.append((char)3).append(',').append(color);
}
return this;
}
/**
* Set foreground and background color.
*
* @param color the fg color 0-15
* @param color2 the bg color 0-15
* @return this builder
*/
public IRCStringBuilder c(int color, int color2) {
if (color >= 0 && color <= 15 && color2 >=0 && color2 <= 15) {
b.append((char)3).append(color).append(',').append(color2);
}
return this;
}
/**
* Set normal (default) colors. On some clients this also resets boldface and other attributes.
*
* @return this builder
*/
public IRCStringBuilder nc() {
b.append((char)15);
return this;
}
/**
* Set fixed-pitch font. Not supported by all clients.
*
* @return this builder
*/
public IRCStringBuilder f() {
b.append((char)17);
return this;
}
/**
* Toggle reverse video. Not supported by all clients. On some clients this just swaps FG and BG color.
*
* @return this builder
*/
public IRCStringBuilder iv() {
b.append((char)18);
return this;
}
/**
* Toggle boldface.
*
* @return this builder
*/
public IRCStringBuilder b() {
b.append((char)2);
return this;
}
/**
* Toggle underline.
*
* @return this builder
*/
public IRCStringBuilder u() {
b.append((char)31);
return this;
}
/**
* Toggle inverse or italics, depending on the client.
*
* @return this builder
*/
public IRCStringBuilder i() {
b.append((char)22);
return this;
}
/**
* Toggle italics. Not supported by all clients.
*
* @return this builder
*/
public IRCStringBuilder it() {
b.append((char)29);
return this;
}
public IRCStringBuilder append(final Object obj) {
b.append(obj);
return this;
}
public IRCStringBuilder append(final String str) {
b.append(str);
return this;
}
public IRCStringBuilder append(final StringBuffer sb) {
b.append(sb);
return this;
}
public IRCStringBuilder append(final CharSequence s) {
b.append(s);
return this;
}
public IRCStringBuilder append(final CharSequence s, final int start, final int end) {
b.append(s, start, end);
return this;
}
public IRCStringBuilder append(final char[] str) {
b.append(str);
return this;
}
public IRCStringBuilder append(final char[] str, final int offset, final int len) {
b.append(str, offset, len);
return this;
}
public IRCStringBuilder append(final boolean b) {
this.b.append(b);
return this;
}
public IRCStringBuilder append(final char c) {
b.append(c);
return this;
}
public IRCStringBuilder append(final int i) {
b.append(i);
return this;
}
public IRCStringBuilder append(final long lng) {
b.append(lng);
return this;
}
public IRCStringBuilder append(final float f) {
b.append(f);
return this;
}
public IRCStringBuilder append(final double d) {
b.append(d);
return this;
}
public IRCStringBuilder appendCodePoint(final int codePoint) {
b.appendCodePoint(codePoint);
return this;
}
public int length() {
return b.length();
}
public int capacity() {
return b.capacity();
}
public void trimToSize() {
b.trimToSize();
}
public void ensureCapacity(final int minimumCapacity) {
b.ensureCapacity(minimumCapacity);
}
public void setLength(final int newLength) {
b.setLength(newLength);
}
public String toString() {
return b.toString();
}
}
|
Markdown
|
UTF-8
| 456
| 2.734375
| 3
|
[] |
no_license
|
# Assignment1
## Author
Trent Geraty <br/>
github username:
**trentgeraty**
### user stories
* AS A marketing agency <br/>
I WANT a codebase that follows accessibility standards <br/>
SO THAT our own site is optimized for search engines
#### description
I made a marketing tool landing page. With the knowledge I have gained I used html, css ad github pages to deploy the site. <br/>
**before**
Deployed Link: https://trentgeraty.github.io/Assignment1/
|
C++
|
UTF-8
| 1,874
| 2.921875
| 3
|
[] |
no_license
|
class Solution {
public:
vector<string> findWords(vector<string>& words) {
vector <string> ans;
unordered_map <char, int> hashmap;
hashmap['a'] = 1;
hashmap['s'] = 1;
hashmap['d'] = 1;
hashmap['f'] = 1;
hashmap['g'] = 1;
hashmap['h'] = 1;
hashmap['j'] = 1;
hashmap['k'] = 1;
hashmap['l'] = 1;
hashmap['A'] = 1;
hashmap['S'] = 1;
hashmap['D'] = 1;
hashmap['F'] = 1;
hashmap['G'] = 1;
hashmap['H'] = 1;
hashmap['J'] = 1;
hashmap['K'] = 1;
hashmap['L'] = 1;
hashmap['q'] = 0;
hashmap['w'] = 0;
hashmap['e'] = 0;
hashmap['r'] = 0;
hashmap['t'] = 0;
hashmap['y'] = 0;
hashmap['u'] = 0;
hashmap['i'] = 0;
hashmap['o'] = 0;
hashmap['p'] = 0;
hashmap['Q'] = 0;
hashmap['W'] = 0;
hashmap['E'] = 0;
hashmap['R'] = 0;
hashmap['T'] = 0;
hashmap['Y'] = 0;
hashmap['U'] = 0;
hashmap['I'] = 0;
hashmap['O'] = 0;
hashmap['P'] = 0;
hashmap['z'] = 2;
hashmap['x'] = 2;
hashmap['c'] = 2;
hashmap['v'] = 2;
hashmap['b'] = 2;
hashmap['n'] = 2;
hashmap['m'] = 2;
hashmap['Z'] = 2;
hashmap['X'] = 2;
hashmap['C'] = 2;
hashmap['V'] = 2;
hashmap['B'] = 2;
hashmap['N'] = 2;
hashmap['M'] = 2;
for (string word: words) {
int row = hashmap[word[0]];
int c = 1;
for (c = 1; c < word.length(); ++c) {
if (row != hashmap[word[c]]) {
break;
}
}
if (c == word.length())
ans.push_back(word);
}
return ans;
}
};
|
PHP
|
UTF-8
| 6,627
| 3.09375
| 3
|
[] |
no_license
|
<?php
class HtmlTable{
/** @var current row count*/
private $row = 0;
/** @var current collumn count*/
private $col = 0;
private $colSize = 0;
private $auto_grow = true;
private $buffer = '';
private $autoFill = ' ';
private $rowAttributes = '';
private $rowAttributesSize = -1;
private $colAttributes = '';
private $colAttributesSize = -1;
private $tableAttr = '';
private $type;
const TYPE_BYROW = 1; //1st - 1st row, 2nd element - 2nd row
const TYPE_BYCOL = 2; //1st - 1st row, 2nd element - 2nd col
private $cells = array();
public $onEmptyInsert = '<tr><td> </td></tr>';
/**
* @param int $size column size
* @param string $tableAttr tables attributes
* @param mixed $rowAttributes string to insert for every row or an array with alternate values
* @param mixed $colAttributes string or an array to apply to corresponding columns
* @param int $typeOfTable wherever to alling values by collumn or by row
*(ex: <tr $rowAttributes> or <tr $rowAttributes[0]>...<tr $rowAttributes[1])
*/
function HtmlTable($size = 0,$tableAttr = '',$rowAttributes = '',$colAttributes = '',
$typeOfTable = self::TYPE_BYCOL){
assert(is_numeric($size)
&& (is_string($tableAttr))
&& (is_string($rowAttributes) || is_array($rowAttributes))
&& (is_string($colAttributes) || is_array($colAttributes)));
$this->colSize = $size;
$this->tableAttr = $tableAttr;
$this->rowAttributes = $rowAttributes;
if (is_array($rowAttributes))
$this->rowAttributesSize = count($rowAttributes);
$this->colAttributes = $colAttributes;
if (is_array($colAttributes))
$this->colAttributesSize = count($colAttributes);
$this->type = $typeOfTable;
}
/**
* @param int $size new number of collumns
*/
private function _adjustSize($size){
assert(is_numeric($size));
if ($this->auto_grow && $row <= 1){
$this->colSize = $size;
return true;
}else{
return false;
}
}
/**
* @param string $value value to insert inside of the td cell
* @param string $attr string that overwrites default td attributes(i.e. bgcolor="" style=""...)
*/
public function addCell($value = null,$attr = null){
if (is_null($value))
$value = $this->autoFill;
if ($this->type == self::TYPE_BYCOL){
if ($this->col == 0){
$this->addNewRow(array($value),$attr);
}else{
$this->_insureColAttributes($attr);
$this->buffer .= "<td".((!empty($attr[$this->col]))?' '.$attr[$this->col]:'').">$value</td>";
$this->col++;
if ($this->col == $this->colSize){
$this->col = 0;
$this->buffer .= '</tr>';
}
}
}else{
$this->cells[] = array($value,$attr);
}
}
private function _insureColAttributes(&$temp = null){
if (is_null($temp)){
$temp = $this->colAttributes;
$tempSize = $this->colAttributesSize;
}elseif(is_array($temp)){
$tempSize = count($temp);
//set default values for the rest of the unspecified indexes
for ($i=$tempSize;$i<$this->colAttributesSize;$i++){
$temp[] = $this->colAttributes[$i];
}
}else{
$tempSize = -1;
}
//if we have just one default value, then set indexes to point to
if ($tempSize == -1){
$str = $temp;
$temp = array();
if(!empty($str)){
for($i=0;$i<$this->colSize;$i++){
$temp[] = $str;
}
}
}
}
private function _insureRowAttribute(&$rowAttr = null){
if (is_null($rowAttr)){
$rowAttr = $this->rowAttributes;
$rowAttrSize = $this->rowAttributesSize;
}
$strAttr = '';
if (!empty($rowAttr))
$strAttr = ' ';
if (is_string($rowAttr)){
$strAttr .= $rowAttr;
}elseif ($this->row < $rowAttrSize){
$strAttr .= $rowAttr[$this->row];
}else{
$strAttr .= $rowAttr[$this->row%$rowAttrSize];
}
$rowAttr = $strAttr;
}
/**
* @param array $value array('value1','value2')
* @param mixed $colAttr either a string of attributes applied to all or an array('attributes1','attributes2')
* @param string $rowAttr overwrites default row attributes
*/
public function addNewRow($value,$colAttr = null,$rowAttr = null){
assert($this->type == self::TYPE_BYCOL);
assert(is_array($value));
$valSize = count($value);
//if size is not yet set, then set it
if ($this->row == 0 && $this->colSize == 0)
$this->colSize = $valSize;
elseif($this->col != 0){
$this->_finishLastRow();
}
assert($valSize <= $this->colSize);
$this->_insureRowAttribute($rowAttr);
$this->row++;
$this->_insureColAttributes($colAttr);
$buffer = "<tr$rowAttr>";
for(;$this->col<$this->colSize && isset($value[$this->col]);$this->col++){
$strAttr = '';
if (!empty($colAttr[$this->col]))
$strAttr = " {$colAttr[$this->col]}";
$buffer .= "<td$strAttr>{$value[$this->col]}</td>";
}
if ($this->col == $this->colSize){
$buffer .= '</tr>';
$this->col = 0;
}
$this->buffer .= $buffer;
}
private function _finishLastRow(){
$col = $this->col;
if ($col != 0){
while($this->col != 0){
$this->addCell();
}
}
}
/**
*returns a reference to the finalized buffered table content*/
public function &flush(){
if ($this->type == self::TYPE_BYCOL){
$this->_finishLastRow();
$this->buffer = '<table'.((!empty($this->tableAttr))?" $this->tableAttr":'').'>'.$this->buffer.'</table>';
if (empty($this->cells)){
if (!is_null($this->onEmptyInsert)){
$this->buffer = '<table'.((!empty($this->tableAttr))?" $this->tableAttr":'').'>'
.$this->onEmptyInsert.'</table>';
}else{
$this->buffer = '';
}
}
}else{
$this->buffer = '<table'.((!empty($this->tableAttr))?" $this->tableAttr":'').'>';
if (empty($this->cells)){
if (!is_null($this->onEmptyInsert)){
$this->buffer .= $this->onEmptyInsert;
}else{
$this->buffer = '';
return '';
}
}
$this->_finishLastRow();
$total = count($this->cells);
$colSize =& $this->colSize;
//finish line
$remainder = ($total>$colSize)?$colSize-$total%$colSize:$colSize-$total;
for($i=0;$i<$remainder;$i++){
$this->addCell();
}
$total += $remainder;
$cells =& $this->cells;
$eachLength = $total/$colSize;
for($key=0;$key<$eachLength;$key++){
$this->row++;
$attr = null;
$this->_insureRowAttribute($attr);
$this->buffer .= "<tr$attr>";
for($this->col=0;$this->col<$colSize;$this->col++){
$attr = $cells[$key+($eachLength*$this->col)][1];
$this->_insureColAttributes($attr);
$this->buffer .= '<td'.(!empty($attr[$this->col])?" {$attr[$this->col]}":'').'>'
.$cells[$key+($eachLength*$this->col)][0].'</td>';
}
$this->buffer .= '</tr>';
}
$this->buffer .= '</table>';
unset($this->cells);
}
return $this->buffer;
}
}
?>
|
C++
|
UTF-8
| 6,198
| 3.53125
| 4
|
[] |
no_license
|
/*
* This file fully contains the methods necessary to run the popularityfinder
* program, which finds actors of a certain popularity through k-core graph
* decomposition.
*/
#include <algorithm>
#include <string>
#include <sstream>
#include <iostream>
#include <fstream>
#include <unordered_map>
#include <vector>
using namespace std;
// Usage string
const static string USAGE =
"./popularityfinder called with "
"incorrect arguments.\nUsage: ./popularityfinder "
"data.tsv k pop_actors\n";
// Function declarations for main
static void BuildStructures(ifstream&);
// Bidirectional map for string <-> int conversions for matrix
static unordered_map<string, int> name_to_int;
static vector<string> int_to_name;
// Names of actors to find
static vector<string> actors;
// Adjacency matrix for graph that holds actor connections. [i][j] = connection
// from actor i to actor j.
static vector<vector<int>> graph;
// Holds count of each actor
static vector<int> counts;
/*
* Runs the popularityfinder program, performing k-core graph decomposition
* based on passed k. Edges between actors based on mutual movies.
*
* Parameters:
* argv[1] - data.tsv
* Tab delimited file of movie actor relationships. Header row expected.
* Rows should be formatted as actor name, movie title, and movie year.
* argv[2] - k
* The minimum number of connections between actors to remain in the output
* file. The target used for k-core decomposition.
* argv[3] - pop_actors
* The output file name of actors popular enough, with at least k
* connections.
*/
int main(int argc, char *argv[]) {
// Check number of cmdline args
if (argc != 4) {
cout << USAGE;
return -1;
}
// Open files and save min num
ifstream tsv_file(argv[1]);
int k = stoi(argv[2]);
ofstream out_file(argv[3]);
// Check proper file opening
if (!tsv_file || !out_file) {
cout << "Error opening file!" << endl;
return -1;
}
// Create structures
BuildStructures(tsv_file);
bool not_done = true;
// Perform k-core pruning
while (not_done) {
cout << "Pruning...\n";
not_done = false;
// Remove vertices lower than count
for (int i = 0; i < (int)counts.size(); i++) {
// If vertex lower than count and not already deleted
if (counts[i] < k && counts[i] > -(int)counts.size()) {
not_done = true;
// Deinc each neighbor of vertex i
for (int j = 0; j < (int)counts.size(); j++) {
if (graph[i][j])
counts[j]--;
}
// Set vertex to 'deleted', with negative counts
counts[i] = -(int)counts.size();
}
}
}
// Keep actors with greater than k connections
vector<string> names;
for (int i = 0; i < (int)counts.size(); i++) {
if (counts[i] >= k)
names.push_back(int_to_name[i]);
}
// Sort the actors alphabetically by name
sort(names.begin(), names.end());
out_file << "Actor\n";
for (string s : names) {
out_file << s << '\n';
}
tsv_file.close();
out_file.close();
return 0;
}
/*
* Builds adjacency matrix and bidirectional map for matrix access.
* Modifies graph, name_to_int, and int_to_name.
*
* Params
* tsv -
* Input file of actors and their movies. Assumes tsv file is 3 columns,
* with a header. First column contains actor name, second movie, third
* movie year.
* Used to build graph, name_to_int, int_to_name
*/
static void BuildStructures(ifstream& tsv_file) {
// Holds the next line when reading in the file
string line;
// Discard the header
getline(tsv_file, line);
// Temporary data structure to build adjacency matrix, maps movies to actors
unordered_map<string, vector<string>> movie_to_actor;
// Read in the tsv file, ending when EOF reached
while (getline(tsv_file, line)) {
// Tokenize the line into strings
istringstream ss(line);
vector<string> record;
// Parse the line by tabs, storing each word in record
string next;
while (getline(ss, next, '\t')) {
record.push_back(next);
}
string actor_name(record[0]);
string movie_title(record[1].append(record[2]));
// Build name_to_int, int_to_name
if (!name_to_int.count(actor_name)) {
name_to_int[actor_name] = int_to_name.size();
int_to_name.push_back(actor_name);
}
// Build temporary data structure which maps movies to actors
if (!movie_to_actor.count(movie_title)) {
movie_to_actor[movie_title] = vector<string>();
}
movie_to_actor[movie_title].push_back(actor_name);
}
cout << "Finished reading tsv..." << endl;
// Create adjacency matrix of correct size
graph = vector<vector<int>>(int_to_name.size(),
vector<int>(int_to_name.size(), 0));
// Create adjacency matrix from movie_to_actor
for (auto pair : movie_to_actor) {
vector<string>& actors = pair.second;
int size = (int) actors.size();
int actor_i, actor_j;
for (int i = 0; i < size; i++) {
actor_i = name_to_int[actors[i]];
for (int j = i + 1; j < size; j++) {
actor_j = name_to_int[actors[j]];
graph[actor_i][actor_j] = 1;
graph[actor_j][actor_i] = 1;
}
}
}
cout << "Finished creating graph..." << endl;
// Init counts vector
counts = vector<int>(int_to_name.size(), 0);
for (int i = 0; i < (int)graph.size(); i++) {
for (int j = 0; j < (int)graph.size(); j++) {
counts[i] += graph[i][j];
}
}
cout << "Finished first pass counts..." << endl;
}
|
TypeScript
|
UTF-8
| 176
| 2.875
| 3
|
[] |
no_license
|
// import { hi } from './../m'
let a = 10;
//1111111
// console.log(hi)
function fn (a:number , b:number) {
return a + b
}
function fnThis() {
// console.log(this)
}
|
Java
|
UTF-8
| 2,698
| 2.53125
| 3
|
[
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] |
permissive
|
package com.ml.core.impl;
import java.sql.Timestamp;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.function.Predicate;
import java.util.stream.Collectors;
import org.apache.commons.lang.builder.ReflectionToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;
import com.ml.dto.DataColumn;
import com.ml.dto.DataRow;
import com.ml.dto.DataColumn.ValueTypeEnum;
public class DecisionPredicate implements Predicate<Object>{
private DataColumn colDetails;
private Object decisionVal;
public DecisionPredicate(Object decisionVal,DataColumn colDetails) {
super();
this.colDetails = colDetails;
this.decisionVal = decisionVal;
}
public DataColumn getColDetails() {
return colDetails;
}
public void setColDetails(DataColumn colDetails) {
this.colDetails = colDetails;
}
public Object getDecisionVal() {
return decisionVal;
}
public void setDecisionVal(Object decisionVal) {
this.decisionVal = decisionVal;
}
public Map<Boolean, List<DataRow>> split(List<DataRow> data) {
Map<Boolean, List<DataRow>> split = data.parallelStream().collect(Collectors.partitioningBy(datarow -> canAccept(datarow)));
return split;
}
public boolean canAccept(DataRow row){
Object val = row.getColumn(this.colDetails.getColIndex());
return val != null ? test(val) : false;
}
public boolean test(Object value) {
boolean retVal = false;
if(null != value){
if(colDetails.getType().equals(ValueTypeEnum.INT_TYPE)){
if((Integer)(value) >= (Integer)decisionVal){
retVal = true;
}
}else if(colDetails.getType().equals(ValueTypeEnum.DOUBLE_TYPE)){
if((Double)(value) >= (Double)decisionVal){
retVal = true;
}
}else if(colDetails.getType().equals(ValueTypeEnum.BOOL_TYPE)){
if((Boolean)(value) == (Boolean)decisionVal){
retVal = true;
}
}else if(colDetails.getType().equals(ValueTypeEnum.STRING_TYPE)){
if(((String)(value)).equals((String)decisionVal)){
retVal = true;
}
}else if(colDetails.getType().equals(ValueTypeEnum.STRINGBOOL_TYPE)){
if(((String)(value)).equals((String)decisionVal)){
retVal = true;
}
}else if(colDetails.getType().equals(ValueTypeEnum.DATE_TYPE)){
if(((Date)(value)).equals((Date)decisionVal)){
retVal = true;
}
}else if(colDetails.getType().equals(ValueTypeEnum.TIME_TYPE)){
if(((Timestamp)(value)).equals((Timestamp)decisionVal)){
retVal = true;
}
}
}
return retVal;
}
public String toString() {
return ReflectionToStringBuilder.toString(this, ToStringStyle.SIMPLE_STYLE, true, true);
}
}
|
Java
|
UTF-8
| 200
| 2.0625
| 2
|
[
"Apache-2.0"
] |
permissive
|
package com.jambit.onboarding2020.tbrpg.domain.Player;
public class PlayerDeadException extends EnemyDeadException {
public PlayerDeadException(String message) {
super(message);
}
}
|
Rust
|
UTF-8
| 1,210
| 3.59375
| 4
|
[] |
no_license
|
#[derive(Debug)]
pub enum ParseErrorKind {
Expected(&'static str),
SExpr,
Integer,
}
pub type ParseResult<'a, T> = Result<(T, &'a str), ParseErrorKind>;
pub trait Parse<'a>: Sized {
fn parse(input: &'a str) -> ParseResult<Self>;
}
/// Skip spaces at the beginning of a string.
pub fn skip_space(input: &str) -> &str {
let iter = input.chars();
let taken = iter.take_while(|c| c.is_ascii_whitespace()).count();
&input[taken..]
}
/// Assert that the beginning of the string matches what is expected. Return the
/// input with the match removed if the check is successful.
pub fn expect<'a>(
expected: &'static str,
input: &'a str,
) -> Result<&'a str, ParseErrorKind> {
if input.starts_with(expected) {
Ok(&input[expected.len()..])
} else {
Err(ParseErrorKind::Expected(expected))
}
}
pub fn take_while<'a, F: Fn(&char) -> bool>(
input: &'a str,
what: &'static str,
f: F,
) -> ParseResult<'a, &'a str> {
let end = input.chars().take_while(f).count();
if end != 0 {
let take = &input[..end];
let rest = &input[end..];
Ok((take, rest))
} else {
Err(ParseErrorKind::Expected(what))
}
}
|
Python
|
UTF-8
| 344
| 3.09375
| 3
|
[] |
no_license
|
def main():
a, b, c, d = map(int, input().split())
if b < c or d < a:
print(0)
elif a <= c <= d <= b:
print(d-c)
elif c <= a <= b <= d:
print(b-a)
elif a <= c <= b or c <= b <= d:
print(b-c)
elif c <= a <= d or a <= d <= b:
print(d-a)
if __name__ == '__main__':
main()
|
C++
|
UTF-8
| 1,325
| 2.515625
| 3
|
[] |
no_license
|
#pragma once
#include "toolbox/gl_handles.hpp"
#include <GL/glew.h>
#include <glm/vec2.hpp>
#include <glm/vec3.hpp>
#include <glm/vec4.hpp>
#include <glm/mat4x4.hpp>
#include <string>
class Shader {
public:
Shader(
std::string const& vertexShaderFile,
std::string const& fragmentShaderFile);
~Shader();
void start() const;
void stop() const;
protected:
void initialize();
virtual void bindAttributes() = 0;
void bindAttribute(GLuint attribute, GLchar const* variableName);
virtual void getAllUniformLocations() = 0;
GLint getUniformLocation(GLchar const* name) const;
void loadFloat (GLint location, GLfloat value) const;
void loadInteger(GLint location, GLint value) const;
void loadVector2(GLint location, glm::vec2 const& value) const;
void loadVector3(GLint location, glm::vec3 const& value) const;
void loadVector4(GLint location, glm::vec4 const& value) const;
void loadMatrix (GLint location, glm::mat4 const& matrix) const;
private:
void printLog(GLuint handle, std::string const& filename="");
void readTextFromFile(std::string const& filename, char*& output);
GLuint compileShader(std::string const& filename, GLenum shaderType);
gl::ShaderHandle program_;
std::string vertexShaderFile_, fragmentShaderFile_;
};
|
Python
|
UTF-8
| 391
| 3.546875
| 4
|
[] |
no_license
|
nilai1 = int(input("masukan nilai praktek : "))
nilai2 = int(input("masukan nilai teori : "))
#if(kondisi):
if (nilai1<=70):
print("Anda Harus Ujian Praktik")
elif(nilai2>=70) :
print ("selamat anda lulus")
elif(nilai2<=70) :
print ("Anda harus ujian Teori")
elif (nilai1>=70):
print("selamat anda lulus")
else :
print ("Anda harus ujian teori dan praktik")
|
Swift
|
UTF-8
| 894
| 2.6875
| 3
|
[] |
no_license
|
//
// ActionBeaconCell.swift
// Beacon Handler Colocator
//
// Created by TCode on 26/02/2020.
// Copyright © 2020 Crowd Connected. All rights reserved.
//
import Foundation
import UIKit
class ActionBeaconCell: UITableViewCell {
@IBOutlet weak var descriptionLabel: UILabel!
@IBOutlet weak var UUIDLabel: UILabel!
@IBOutlet weak var coordinatesLabel: UILabel!
public func configure(action: BeaconAction) {
descriptionLabel.text = action.description
UUIDLabel.text = "UUID \(action.regionUUID)"
if let coord = action.coordinates {
coordinatesLabel.text = "Lat \(coord.latitude) Lon \(coord.longitude)"
} else if let position = action.position {
coordinatesLabel.text = "X \(position.x) Y \(position.y)"
} else {
coordinatesLabel.text = "Beacon Retrieved"
}
}
}
|
Java
|
UTF-8
| 1,830
| 3.203125
| 3
|
[] |
no_license
|
package HashMap_Heap;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
public class All_anagram_in_a_String {
public static ArrayList<Integer> findAnagrams(String s, String p) {
ArrayList<Integer> arr = new ArrayList<>();
int[] charhash = new int[26];
for (char c : p.toCharArray()) {
charhash[c - 'a']++;
}
if (s.length() < p.length()) {
return arr;
}
int[] windowcharhash = new int[26];
int start = 0 - p.length();
int end = -1;
int matchedcount = 0;
while (true) {
if (matchedcount == p.length()) {
arr.add(start);
}
end++;
if (end >= s.length()) {
break;
}
if (end < 0) {
} else {
if (windowcharhash[s.charAt(end) - 'a'] < charhash[s.charAt(end) - 'a']) {
matchedcount++;
}
windowcharhash[s.charAt(end) - 'a']++;
}
if (start < 0) {
} else {
if (charhash[s.charAt(start) - 'a'] > 0
&& windowcharhash[s.charAt(start) - 'a'] <= charhash[s.charAt(start) - 'a']) {
matchedcount--;
}
windowcharhash[s.charAt(start) - 'a']--;
}
start++;
}
return arr;
}
public static List<Integer> findAnagramss(String s, String p) {
int[] map = new int[256];
for (int i = 0; i < p.length(); i++) {
map[p.charAt(i)]++;
}
List<Integer> ans = new ArrayList<>();
int left = 0;
int right = 0;
while (right < s.length()) {
if (map[s.charAt(right)] > 0) {
map[s.charAt(right)]--;
right++;
if (right - left == p.length()) {
ans.add(left);
}
} else {
map[s.charAt(left)]++;
left++;
}
}
return ans;
}
// -----------------------------------------------------
public static void main(String[] args) {
Scanner scn = new Scanner(System.in);
String s = scn.next();
String p = scn.next();
System.out.println(findAnagrams(s, p));
}
}
|
Ruby
|
UTF-8
| 639
| 4.3125
| 4
|
[] |
no_license
|
# Each new term in the Fibonacci sequence is generated by adding the
# previous two terms. By starting with 1 and 2, the first 10 terms
# will be:
#
# 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, ...
#
# By considering the terms in the Fibonacci sequence whose values do
# not exceed four million, find the sum of the even-valued terms.
def fib(n)
current_value = 0
next_value = 1
n.times do |i|
current_value, next_value = next_value, current_value + next_value
end
return current_value
end
sum = 0
(1...100).each do |x|
z = fib(x)
if z > 4000000
break
else
if z.even?
sum += z
end
end
end
puts sum
|
C++
|
UTF-8
| 954
| 2.984375
| 3
|
[] |
no_license
|
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
// int n, m;
// vector<int> array_(100), ans;
// void dfs(int op, int level, int sum)
// {
// if(level == n)
// {
// return;
// }
// if(op == 1)
// {
// sum += array_[level];
// ans.push_back(array_[level]);
// if(sum > m)
// {
// ans.clear();
// return;
// }
// else if(sum == m)
// {
// for(auto it : ans)
// {
// cout << it << " ";
// }
// cout << endl;
// }
// }
// dfs(1, level + 1, sum);
// dfs(0, level + 1, sum);
// }
int main()
{
int n, m;
cin >> n >> m;
vector<int> array_(n);
for(int i = 0; i < n; i++)
{
cin >> array_[i];
}
sort(array_.begin(), array_.end());
int left = 0, right = 0;
dfs(1, 0, 0);
dfs(0, 0, 0);
}
|
C#
|
UTF-8
| 1,637
| 2.953125
| 3
|
[] |
no_license
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Xynapse.UI {
public struct PxRect {
public readonly int X, Y, W, H;
public PxRect(int x, int y, int w, int h) { X = x; Y = y; W = w; H = h; }
public PxRect(PxVector position, PxVector size) { X = position.X; Y = position.Y; W = size.X; H = size.Y; }
public static PxRect MinMax(PxVector min, PxVector max) { return new PxRect(min.X, min.Y, max.X-min.X, max.Y-min.Y); }
public PxVector Position { get { return new PxVector(X, Y); } }
public PxVector Size { get { return new PxVector(W, H); } }
public PxVector Min { get { return new PxVector(X, Y); } }
public PxVector Max { get { return new PxVector(X+W, Y+H); } }
public static PxRect operator +(PxRect rect, PxVector vec) { return new PxRect(rect.Position + vec, rect.Size); }
public static PxRect operator -(PxRect rect, PxVector vec) { return new PxRect(rect.Position - vec, rect.Size); }
// public bool Intersects(PxRect that) { return this.X >= that.X + that.W && that.X >= this.X + this.W && this.Y >= that.Y + that.H && that.Y >= this.Y + this.H; }
public bool Intersects(PxRect that) { return !(this.X > that.X + that.W || that.X > this.X + this.W || this.Y > that.Y + that.H || that.Y >= this.Y + this.H); }
public bool Contains(PxVector vec) { return vec.X >= X && vec.Y >= Y && vec.X <= X + W && vec.Y <= Y + H; }
public override string ToString() { return "{ { " + X + ", " + Y + " }, { " + W +", " + H + " } }"; }
}
}
|
PHP
|
UTF-8
| 1,020
| 2.53125
| 3
|
[] |
no_license
|
<?php
session_start();
require("conexion.php");
$resultados_de_validacion = array( 'error' => 'NO',
'datos' => array()
);
if(isset($_POST["idusuario"]))
{
$conn = getConnection();
$sql="SELECT * FROM establecimientos WHERE establecimientos.ID_USUARIO=:id_usuario";
$resultados=$conn->prepare($sql);
$resultados->execute(array(":id_usuario" => $_POST["idusuario"]));
$registros=$resultados->fetchAll(PDO::FETCH_ASSOC);
closeConnection($conn);
if($registros) {//si encuentra que tiene algun establecimiento registrado le mostrara un menu
$resultados_de_validacion['error']="NO";
$resultados_de_validacion['datos']="ok";
}
else{//si no, les mostrará un formulario para que registre su primer establecimiento.
$resultados_de_validacion['error']="NO";
$resultados_de_validacion['datos']="fail";
}
}
else{
$resultados_de_validacion['error']="El id del usuario no esta definido.";
}
echo json_encode($resultados_de_validacion);
?>
|
Java
|
UTF-8
| 590
| 3.53125
| 4
|
[] |
no_license
|
package Q11_20;
import java.time.DayOfWeek;
import java.time.LocalDate;
import java.time.Month;
public class Q19 {
public static int countingSundays(int startYear, int endYear) {
int result = 0;
LocalDate start = LocalDate.of(startYear, Month.JANUARY, 1);
while (start.getDayOfWeek() != DayOfWeek.SUNDAY)
start = start.plusDays(1);
LocalDate end = LocalDate.of(endYear, Month.DECEMBER, 31);
while(start.isBefore(end)) {
start = start.plusWeeks(1);
if (start.getDayOfMonth() == 1) {
result++;
System.out.println(result);
}
}
return result;
}
}
|
JavaScript
|
UTF-8
| 1,613
| 2.546875
| 3
|
[] |
no_license
|
const Sequelize = require("sequelize");
// creates new connection
const sequelize = new Sequelize("sql7293249", "sql7293249", "q2KcEheqdN", {
host: "sql7.freesqldatabase.com",
dialect: "mysql"
});
sequelize.authenticate()
.then(() => console.log('Db Connected'))
.catch(err => console.log('Error: ' + err)) // this is the same as sync but alot of people are using it instead of sync
// new schemas
const Chef = sequelize.define("chef", {
id: { type: Sequelize.INTEGER, autoIncrement: true, primaryKey: true }, // we can also use serial for id tpye, its basically an int that will auto increment
username: { type: Sequelize.STRING, required: true, unique: true },
password: { type: Sequelize.STRING, required: true },
location: { type: Sequelize.STRING, required: true },
phoneNumber: { type: Sequelize.INTEGER, required: true, unique: true },
description: { type: Sequelize.STRING },
rating: { type: Sequelize.INTEGER },
});
const User = sequelize.define("user", {
id: { type: Sequelize.INTEGER, autoIncrement: true, primaryKey: true },
username: { type: Sequelize.STRING, required: true, unique: true },
password: { type: Sequelize.STRING, required: true },
location: { type: Sequelize.STRING, required: true }
});
const Meal = sequelize.define("meal", {
id: { type: Sequelize.INTEGER, autoIncrement: true, primaryKey: true },
name: { type: Sequelize.STRING, required: true },
description: { type: Sequelize.STRING }
});
Chef.hasMany(Meal);
Meal.belongsTo(Chef);
sequelize.sync();
module.exports.User = User;
module.exports.Chef = Chef;
module.exports.Meal = Meal;
|
Java
|
UTF-8
| 3,044
| 1.835938
| 2
|
[] |
no_license
|
package com.xianglin.appserv.common.dal.dataobject;
import java.io.Serializable;
import java.util.Date;
public class AppPrizeUserRelDO extends PageReq implements Serializable {
/**
*
*/
private static final long serialVersionUID = 5889100777310306091L;
private Long relId;
private String partyid;
private String nikerName;
private String loginName;
private String userType;
private Long activeid;
private Long prizeid;
private String ptype;
private String pname;// 奖品名称
private Date prizetime;
private String dataStatus;
private Date createTime;
private Date updateTime;
public Long getRelId() {
return relId;
}
public void setRelId(Long relId) {
this.relId = relId;
}
public String getPartyid() {
return partyid;
}
public String getPtype() {
return ptype;
}
public void setPtype(String ptype) {
this.ptype = ptype;
}
public void setPartyid(String partyid) {
this.partyid = partyid == null ? null : partyid.trim();
}
public Long getActiveid() {
return activeid;
}
public void setActiveid(Long activeid) {
this.activeid = activeid;
}
public Long getPrizeid() {
return prizeid;
}
public void setPrizeid(Long prizeid) {
this.prizeid = prizeid;
}
public String getLoginName() {
return loginName;
}
public void setLoginName(String loginName) {
this.loginName = loginName;
}
public Date getPrizetime() {
return prizetime;
}
public void setPrizetime(Date prizetime) {
this.prizetime = prizetime;
}
public String getDataStatus() {
return dataStatus;
}
public void setDataStatus(String dataStatus) {
this.dataStatus = dataStatus == null ? null : dataStatus.trim();
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
public String getPname() {
return pname;
}
public void setPname(String pname) {
this.pname = pname;
}
public String getNikerName() {
return nikerName;
}
public void setNikerName(String nikerName) {
this.nikerName = nikerName;
}
public String getUserType() {
return userType;
}
public void setUserType(String userType) {
this.userType = userType;
}
@Override
public String toString() {
StringBuilder builder = new StringBuilder();
builder.append("AppPrizeUserRelDTO [relId=");
builder.append(relId);
builder.append(", partyid=");
builder.append(partyid);
builder.append(", activeid=");
builder.append(activeid);
builder.append(", prizeid=");
builder.append(prizeid);
builder.append(", pname=");
builder.append(pname);
builder.append(", prizetime=");
builder.append(prizetime);
builder.append(", dataStatus=");
builder.append(dataStatus);
builder.append(", createTime=");
builder.append(createTime);
builder.append(", updateTime=");
builder.append(updateTime);
builder.append("]");
return builder.toString();
}
}
|
Java
|
UTF-8
| 234,486
| 2.09375
| 2
|
[
"Apache-2.0"
] |
permissive
|
//----------------------------------------------------
// The following code was generated by CUP v0.11a beta 20060608
// Wed Aug 27 06:45:31 BRT 2014
//----------------------------------------------------
import java_cup.runtime.*;
import java.io.*;
import java.util.*;
import utils.SemanticManager;
import utils.Objeto;
/** CUP v0.11a beta 20060608 generated parser.
* @version Wed Aug 27 06:45:31 BRT 2014
*/
public class parser extends java_cup.runtime.lr_parser {
/** Default constructor. */
public parser() {super();}
/** Constructor which sets the default scanner. */
public parser(java_cup.runtime.Scanner s) {super(s);}
/** Constructor which sets the default scanner. */
public parser(java_cup.runtime.Scanner s, java_cup.runtime.SymbolFactory sf) {super(s,sf);}
/** Production table. */
protected static final short _production_table[][] =
unpackFromStrings(new String[] {
"\000\u0126\000\002\002\004\000\002\002\005\000\002\003" +
"\006\000\002\220\005\000\002\220\002\000\002\004\004" +
"\000\002\007\007\000\002\011\006\000\002\260\005\000" +
"\002\260\002\000\002\240\003\000\002\240\002\000\002" +
"\012\006\000\002\275\005\000\002\275\002\000\002\241" +
"\003\000\002\241\002\000\002\017\005\000\002\013\006" +
"\000\002\274\005\000\002\274\002\000\002\242\003\000" +
"\002\242\002\000\002\021\005\000\002\014\006\000\002" +
"\273\005\000\002\273\002\000\002\243\003\000\002\243" +
"\002\000\002\022\005\000\002\015\003\000\002\272\005" +
"\000\002\272\002\000\002\250\003\000\002\250\003\000" +
"\002\024\005\000\002\024\005\000\002\024\005\000\002" +
"\026\003\000\002\030\005\000\002\030\005\000\002\030" +
"\005\000\002\032\003\000\002\034\003\000\002\034\003" +
"\000\002\010\005\000\002\230\003\000\002\025\005\000" +
"\002\031\007\000\002\040\003\000\002\027\004\000\002" +
"\033\004\000\002\036\005\000\002\266\005\000\002\266" +
"\002\000\002\237\003\000\002\237\002\000\002\052\003" +
"\000\002\052\003\000\002\052\003\000\002\052\003\000" +
"\002\053\005\000\002\054\006\000\002\055\003\000\002" +
"\056\003\000\002\057\003\000\002\057\003\000\002\060" +
"\003\000\002\060\003\000\002\061\011\000\002\062\011" +
"\000\002\265\005\000\002\265\002\000\002\247\003\000" +
"\002\247\003\000\002\063\003\000\002\063\003\000\002" +
"\064\006\000\002\065\006\000\002\066\004\000\002\066" +
"\002\000\002\067\003\000\002\005\004\000\002\264\005" +
"\000\002\264\002\000\002\070\004\000\002\070\003\000" +
"\002\236\004\000\002\236\002\000\002\071\003\000\002" +
"\071\002\000\002\235\003\000\002\235\003\000\002\235" +
"\003\000\002\121\005\000\002\246\003\000\002\246\003" +
"\000\002\074\004\000\002\075\004\000\002\072\003\000" +
"\002\072\003\000\002\072\003\000\002\072\003\000\002" +
"\107\005\000\002\110\003\000\002\110\003\000\002\110" +
"\003\000\002\113\006\000\002\114\006\000\002\115\012" +
"\000\002\245\003\000\002\245\003\000\002\116\003\000" +
"\002\120\003\000\002\111\003\000\002\111\003\000\002" +
"\122\007\000\002\234\002\000\002\234\004\000\002\123" +
"\011\000\002\263\005\000\002\263\002\000\002\124\005" +
"\000\002\125\004\000\002\255\005\000\002\255\002\000" +
"\002\112\007\000\002\256\005\000\002\256\002\000\002" +
"\104\006\000\002\257\005\000\002\257\002\000\002\103" +
"\003\000\002\103\003\000\002\103\003\000\002\103\003" +
"\000\002\102\003\000\002\105\003\000\002\106\003\000" +
"\002\077\004\000\002\233\004\000\002\233\002\000\002" +
"\117\005\000\002\271\005\000\002\271\002\000\002\211" +
"\004\000\002\270\005\000\002\270\002\000\002\212\003" +
"\000\002\212\003\000\002\212\003\000\002\212\003\000" +
"\002\212\003\000\002\212\003\000\002\212\003\000\002" +
"\212\003\000\002\212\005\000\002\276\002\000\002\212" +
"\005\000\002\076\003\000\002\076\003\000\002\076\003" +
"\000\002\166\003\000\002\166\003\000\002\167\003\000" +
"\002\167\003\000\002\167\003\000\002\171\006\000\002" +
"\165\005\000\002\131\005\000\002\037\004\000\002\037" +
"\002\000\002\164\004\000\002\232\003\000\002\232\002" +
"\000\002\216\004\000\002\041\003\000\002\041\003\000" +
"\002\041\003\000\002\041\003\000\002\132\003\000\002" +
"\132\003\000\002\136\005\000\002\135\005\000\002\161" +
"\003\000\002\162\003\000\002\133\004\000\002\225\003" +
"\000\002\225\002\000\002\137\003\000\002\137\003\000" +
"\002\137\003\000\002\137\003\000\002\140\011\000\002" +
"\267\005\000\002\267\002\000\002\144\003\000\002\145" +
"\003\000\002\141\005\000\002\142\005\000\002\146\003" +
"\000\002\143\005\000\002\147\003\000\002\134\004\000" +
"\002\152\004\000\002\152\002\000\002\153\004\000\002" +
"\153\003\000\002\226\003\000\002\226\002\000\002\227" +
"\004\000\002\227\002\000\002\150\004\000\002\261\005" +
"\000\002\261\002\000\002\163\005\000\002\151\010\000" +
"\002\262\005\000\002\262\002\000\002\154\003\000\002" +
"\224\003\000\002\224\002\000\002\156\007\000\002\254" +
"\005\000\002\254\002\000\002\157\004\000\002\223\005" +
"\000\002\223\002\000\002\222\004\000\002\222\002\000" +
"\002\155\003\000\002\215\003\000\002\174\003\000\002" +
"\277\002\000\002\170\005\000\002\173\003\000\002\175" +
"\003\000\002\101\003\000\002\172\003\000\002\051\003" +
"\000\002\047\003\000\002\023\003\000\002\046\003\000" +
"\002\044\003\000\002\045\003\000\002\050\003\000\002" +
"\006\004\000\002\100\004\000\002\251\005\000\002\251" +
"\002\000\002\252\005\000\002\252\002\000\002\253\005" +
"\000\002\253\002\000\002\176\003\000\002\176\003\000" +
"\002\177\003\000\002\200\006\000\002\200\004\000\002" +
"\217\004\000\002\221\003\000\002\221\002\000\002\203" +
"\003\000\002\204\003\000\002\204\002\000\002\202\004" +
"\000\002\016\003\000\002\020\004\000\002\020\003\000" +
"\002\244\003\000\002\244\003\000\002\126\003\000\002" +
"\126\003\000\002\126\003\000\002\126\003\000\002\126" +
"\003\000\002\126\003\000\002\126\003\000\002\127\003" +
"\000\002\127\003\000\002\127\003\000\002\130\003\000" +
"\002\130\003\000\002\130\003\000\002\130\003\000\002" +
"\130\003\000\002\205\003\000\002\214\003\000\002\207" +
"\003\000\002\207\003\000\002\210\003\000\002\210\002" +
"\000\002\206\003\000\002\042\003" });
/** Access to production table. */
public short[][] production_table() {return _production_table;}
/** Parse-action table. */
protected static final short[][] _action_table =
unpackFromStrings(new String[] {
"\000\u01ce\000\004\004\006\001\002\000\004\002\u01d0\001" +
"\002\000\020\005\023\006\ufff6\007\ufff6\010\ufff6\012\ufff6" +
"\014\ufff6\015\ufff6\001\002\000\004\071\010\001\002\000" +
"\006\047\011\061\ufffd\001\002\000\110\013\ufedc\020\ufedc" +
"\024\ufedc\026\ufedc\030\ufedc\031\ufedc\033\ufedc\034\ufedc\041" +
"\ufedc\042\ufedc\043\ufedc\047\ufedc\050\ufedc\051\ufedc\052\ufedc" +
"\053\ufedc\054\ufedc\055\ufedc\056\ufedc\057\ufedc\060\ufedc\061" +
"\ufedc\062\ufedc\063\ufedc\064\ufedc\067\ufedc\070\ufedc\071\ufedc" +
"\101\ufedc\102\ufedc\103\ufedc\104\ufedc\105\ufedc\106\ufedc\107" +
"\ufedc\001\002\000\004\071\010\001\002\000\004\061\013" +
"\001\002\000\020\005\uffff\006\uffff\007\uffff\010\uffff\012" +
"\uffff\014\uffff\015\uffff\001\002\000\010\050\uff06\060\uff06" +
"\062\017\001\002\000\004\050\016\001\002\000\004\061" +
"\ufffe\001\002\000\004\071\010\001\002\000\006\050\uff0b" +
"\060\uff0b\001\002\000\010\050\uff06\060\uff06\062\017\001" +
"\002\000\006\050\uff07\060\uff07\001\002\000\010\053\070" +
"\054\051\073\ufede\001\002\000\004\012\u016e\001\002\000" +
"\016\006\ufff7\007\ufff7\010\ufff7\012\ufff7\014\ufff7\015\ufff7" +
"\001\002\000\016\006\031\007\ufff1\010\ufff1\012\ufff1\014" +
"\ufff1\015\ufff1\001\002\000\004\063\030\001\002\000\004" +
"\002\000\001\002\000\004\071\010\001\002\000\014\007" +
"\ufff2\010\ufff2\012\ufff2\014\ufff2\015\ufff2\001\002\000\014" +
"\007\036\010\uffeb\012\uffeb\014\uffeb\015\uffeb\001\002\000" +
"\012\010\uffec\012\uffec\014\uffec\015\uffec\001\002\000\012" +
"\010\373\012\uffe5\014\uffe5\015\uffe5\001\002\000\004\071" +
"\010\001\002\000\004\101\046\001\002\000\004\061\041" +
"\001\002\000\014\010\uffed\012\uffed\014\uffed\015\uffed\071" +
"\010\001\002\000\012\010\uffef\012\uffef\014\uffef\015\uffef" +
"\001\002\000\004\061\044\001\002\000\014\010\uffed\012" +
"\uffed\014\uffed\015\uffed\071\010\001\002\000\012\010\uffee" +
"\012\uffee\014\uffee\015\uffee\001\002\000\032\016\057\017" +
"\uff45\044\uff45\045\uff45\046\uff45\047\064\053\070\054\051" +
"\070\055\071\010\073\ufede\077\061\001\002\000\020\013" +
"\ufef5\050\ufef5\052\ufef5\060\ufef5\061\ufef5\062\ufef5\064\ufef5" +
"\001\002\000\004\064\370\001\002\000\024\037\ufee1\040" +
"\ufee1\047\ufee1\051\ufee1\053\ufee1\054\ufee1\071\ufee1\073\ufee1" +
"\077\ufee1\001\002\000\014\013\uff0f\020\uff0f\050\uff0f\052" +
"\uff0f\061\uff0f\001\002\000\004\064\uff49\001\002\000\004" +
"\061\uffea\001\002\000\004\071\010\001\002\000\014\013" +
"\uff4c\050\uff4c\052\uff4c\060\uff4c\061\uff4c\001\002\000\012" +
"\017\uff46\044\uff46\045\uff46\046\uff46\001\002\000\010\013" +
"\uff4e\050\uff4e\061\uff4e\001\002\000\076\013\ufedd\020\ufedd" +
"\024\ufedd\026\ufedd\030\ufedd\031\ufedd\033\ufedd\034\ufedd\041" +
"\ufedd\042\ufedd\043\ufedd\050\ufedd\052\ufedd\053\ufedd\054\ufedd" +
"\055\ufedd\056\ufedd\057\ufedd\060\ufedd\061\ufedd\062\ufedd\064" +
"\ufedd\071\ufedd\101\ufedd\102\ufedd\103\ufedd\104\ufedd\105\ufedd" +
"\106\ufedd\107\ufedd\001\002\000\076\013\ufee3\020\ufee3\024" +
"\ufee3\026\ufee3\030\ufee3\031\ufee3\033\ufee3\034\ufee3\041\ufee3" +
"\042\ufee3\043\ufee3\050\ufee3\052\ufee3\053\ufee3\054\ufee3\055" +
"\ufee3\056\ufee3\057\ufee3\060\ufee3\061\ufee3\062\ufee3\064\ufee3" +
"\071\ufee3\101\ufee3\102\ufee3\103\ufee3\104\ufee3\105\ufee3\106" +
"\ufee3\107\ufee3\001\002\000\010\013\uff51\050\uff51\061\uff51" +
"\001\002\000\004\071\010\001\002\000\010\013\uff4f\050" +
"\uff4f\061\uff4f\001\002\000\012\017\120\044\123\045\122" +
"\046\117\001\002\000\014\013\uff4d\050\uff4d\052\uff4d\060" +
"\uff4d\061\uff4d\001\002\000\024\037\ufee0\040\ufee0\047\ufee0" +
"\051\ufee0\053\ufee0\054\ufee0\071\ufee0\073\ufee0\077\ufee0\001" +
"\002\000\012\053\070\054\051\071\010\073\ufede\001\002" +
"\000\024\037\ufedf\040\ufedf\047\ufedf\051\ufedf\053\ufedf\054" +
"\ufedf\071\ufedf\073\ufedf\077\ufedf\001\002\000\010\013\uff50" +
"\050\uff50\061\uff50\001\002\000\004\073\110\001\002\000" +
"\076\013\uff03\020\uff03\024\uff03\026\uff03\030\uff03\031\uff03" +
"\033\uff03\034\uff03\041\uff03\042\uff03\043\uff03\050\uff03\052" +
"\uff03\053\uff03\054\uff03\055\uff03\056\uff03\057\uff03\060\uff03" +
"\061\uff03\062\uff03\064\uff03\071\uff03\101\uff03\102\uff03\103" +
"\uff03\104\uff03\105\uff03\106\uff03\107\uff03\001\002\000\076" +
"\013\uff02\020\uff02\024\uff02\026\uff02\030\uff02\031\uff02\033" +
"\uff02\034\uff02\041\uff02\042\uff02\043\uff02\050\uff02\052\uff02" +
"\053\uff02\054\uff02\055\uff02\056\uff02\057\uff02\060\uff02\061" +
"\uff02\062\uff02\064\uff02\071\uff02\101\uff02\102\uff02\103\uff02" +
"\104\uff02\105\uff02\106\uff02\107\uff02\001\002\000\020\013" +
"\ufef3\050\ufef3\052\ufef3\060\ufef3\061\ufef3\062\ufef3\064\ufef3" +
"\001\002\000\102\013\uff01\020\uff01\024\uff01\026\uff01\030" +
"\uff01\031\uff01\033\uff01\034\uff01\041\uff01\042\uff01\043\uff01" +
"\050\uff01\052\uff01\053\uff01\054\uff01\055\uff01\056\uff01\057" +
"\uff01\060\uff01\061\uff01\062\uff01\063\106\064\uff01\071\uff01" +
"\101\uff01\102\uff01\103\uff01\104\uff01\105\uff01\106\uff01\107" +
"\uff01\110\104\001\002\000\020\013\ufef4\050\ufef4\052\ufef4" +
"\060\ufef4\061\ufef4\062\ufef4\064\ufef4\001\002\000\020\013" +
"\uff11\050\uff11\052\uff11\060\uff11\061\uff11\062\uff11\064\uff11" +
"\001\002\000\020\013\ufef6\050\ufef6\052\ufef6\060\ufef6\061" +
"\ufef6\062\ufef6\064\ufef6\001\002\000\010\053\070\054\051" +
"\073\ufede\001\002\000\076\013\ufeff\020\ufeff\024\ufeff\026" +
"\ufeff\030\ufeff\031\ufeff\033\ufeff\034\ufeff\041\ufeff\042\ufeff" +
"\043\ufeff\050\ufeff\052\ufeff\053\ufeff\054\ufeff\055\ufeff\056" +
"\ufeff\057\ufeff\060\ufeff\061\ufeff\062\ufeff\064\ufeff\071\ufeff" +
"\101\ufeff\102\ufeff\103\ufeff\104\ufeff\105\ufeff\106\ufeff\107" +
"\ufeff\001\002\000\102\013\ufef9\020\ufef9\024\ufef9\026\ufef9" +
"\030\ufef9\031\ufef9\033\ufef9\034\ufef9\041\ufef9\042\ufef9\043" +
"\ufef9\050\ufef9\052\ufef9\053\ufef9\054\ufef9\055\ufef9\056\ufef9" +
"\057\ufef9\060\ufef9\061\ufef9\062\ufef9\064\ufef9\071\ufef9\073" +
"\110\101\ufef9\102\ufef9\103\ufef9\104\ufef9\105\ufef9\106\ufef9" +
"\107\ufef9\110\ufef9\001\002\000\100\013\ufefc\020\ufefc\024" +
"\ufefc\026\ufefc\030\ufefc\031\ufefc\033\ufefc\034\ufefc\041\ufefc" +
"\042\ufefc\043\ufefc\050\ufefc\052\ufefc\053\ufefc\054\ufefc\055" +
"\ufefc\056\ufefc\057\ufefc\060\ufefc\061\ufefc\062\ufefc\064\ufefc" +
"\071\ufefc\101\ufefc\102\ufefc\103\ufefc\104\ufefc\105\ufefc\106" +
"\ufefc\107\ufefc\110\104\001\002\000\102\013\ufefb\020\ufefb" +
"\024\ufefb\026\ufefb\030\ufefb\031\ufefb\033\ufefb\034\ufefb\041" +
"\ufefb\042\ufefb\043\ufefb\050\ufefb\052\ufefb\053\ufefb\054\ufefb" +
"\055\ufefb\056\ufefb\057\ufefb\060\ufefb\061\ufefb\062\ufefb\063" +
"\ufefb\064\ufefb\071\ufefb\101\ufefb\102\ufefb\103\ufefb\104\ufefb" +
"\105\ufefb\106\ufefb\107\ufefb\110\ufefb\001\002\000\100\013" +
"\ufefa\020\ufefa\024\ufefa\026\ufefa\030\ufefa\031\ufefa\033\ufefa" +
"\034\ufefa\041\ufefa\042\ufefa\043\ufefa\050\ufefa\052\ufefa\053" +
"\ufefa\054\ufefa\055\ufefa\056\ufefa\057\ufefa\060\ufefa\061\ufefa" +
"\062\ufefa\064\ufefa\071\ufefa\101\ufefa\102\ufefa\103\ufefa\104" +
"\ufefa\105\ufefa\106\ufefa\107\ufefa\110\ufefa\001\002\000\076" +
"\013\uff00\020\uff00\024\uff00\026\uff00\030\uff00\031\uff00\033" +
"\uff00\034\uff00\041\uff00\042\uff00\043\uff00\050\uff00\052\uff00" +
"\053\uff00\054\uff00\055\uff00\056\uff00\057\uff00\060\uff00\061" +
"\uff00\062\uff00\064\uff00\071\uff00\101\uff00\102\uff00\103\uff00" +
"\104\uff00\105\uff00\106\uff00\107\uff00\001\002\000\076\013" +
"\ufefd\020\ufefd\024\ufefd\026\ufefd\030\ufefd\031\ufefd\033\ufefd" +
"\034\ufefd\041\ufefd\042\ufefd\043\ufefd\050\ufefd\052\ufefd\053" +
"\ufefd\054\ufefd\055\ufefd\056\ufefd\057\ufefd\060\ufefd\061\ufefd" +
"\062\ufefd\064\ufefd\071\ufefd\101\ufefd\102\ufefd\103\ufefd\104" +
"\ufefd\105\ufefd\106\ufefd\107\ufefd\001\002\000\076\013\ufefe" +
"\020\ufefe\024\ufefe\026\ufefe\030\ufefe\031\ufefe\033\ufefe\034" +
"\ufefe\041\ufefe\042\ufefe\043\ufefe\050\ufefe\052\ufefe\053\ufefe" +
"\054\ufefe\055\ufefe\056\ufefe\057\ufefe\060\ufefe\061\ufefe\062" +
"\ufefe\064\ufefe\071\ufefe\101\ufefe\102\ufefe\103\ufefe\104\ufefe" +
"\105\ufefe\106\ufefe\107\ufefe\001\002\000\102\013\ufef8\020" +
"\ufef8\024\ufef8\026\ufef8\030\ufef8\031\ufef8\033\ufef8\034\ufef8" +
"\041\ufef8\042\ufef8\043\ufef8\050\ufef8\052\ufef8\053\ufef8\054" +
"\ufef8\055\ufef8\056\ufef8\057\ufef8\060\ufef8\061\ufef8\062\ufef8" +
"\063\ufef8\064\ufef8\071\ufef8\101\ufef8\102\ufef8\103\ufef8\104" +
"\ufef8\105\ufef8\106\ufef8\107\ufef8\110\ufef8\001\002\000\010" +
"\013\uff42\050\uff42\061\uff42\001\002\000\004\020\362\001" +
"\002\000\004\051\347\001\002\000\010\013\uff41\050\uff41" +
"\061\uff41\001\002\000\004\020\344\001\002\000\010\013" +
"\uff34\035\133\071\010\001\002\000\010\013\uff43\050\uff43" +
"\061\uff43\001\002\000\010\013\uff47\050\uff47\061\uff47\001" +
"\002\000\010\013\uff44\050\uff44\061\uff44\001\002\000\010" +
"\013\uff2e\050\uff2e\061\342\001\002\000\010\013\uff2b\050" +
"\uff2b\061\336\001\002\000\010\013\uff30\050\uff30\061\334" +
"\001\002\000\004\060\331\001\002\000\006\061\141\071" +
"\uff24\001\002\000\004\013\136\001\002\000\010\013\uff32" +
"\050\uff32\061\uff32\001\002\000\010\013\uff3b\050\uff3b\061" +
"\uff3b\001\002\000\004\071\uff25\001\002\000\004\071\010" +
"\001\002\000\024\037\ufede\040\ufede\047\ufede\051\ufede\053" +
"\070\054\051\071\ufede\073\ufede\077\ufede\001\002\000\004" +
"\071\uff26\001\002\000\006\060\304\071\uff1c\001\002\000" +
"\024\037\175\040\173\047\161\051\165\053\070\054\051" +
"\071\010\073\ufede\077\061\001\002\000\054\013\uff74\020" +
"\uff74\024\uff74\026\uff74\030\uff74\031\uff74\033\uff74\034\uff74" +
"\050\uff74\052\uff74\060\uff74\061\uff74\062\uff74\071\uff74\101" +
"\157\102\155\103\154\104\156\105\150\106\147\107\151" +
"\001\002\000\006\060\uff1b\071\uff1b\001\002\000\024\037" +
"\ufeed\040\ufeed\047\ufeed\051\ufeed\053\ufeed\054\ufeed\071\ufeed" +
"\073\ufeed\077\ufeed\001\002\000\024\037\ufeee\040\ufeee\047" +
"\ufeee\051\ufeee\053\ufeee\054\ufeee\071\ufeee\073\ufeee\077\ufeee" +
"\001\002\000\024\037\ufeec\040\ufeec\047\ufeec\051\ufeec\053" +
"\ufeec\054\ufeec\071\ufeec\073\ufeec\077\ufeec\001\002\000\024" +
"\037\ufede\040\ufede\047\ufede\051\ufede\053\070\054\051\071" +
"\ufede\073\ufede\077\ufede\001\002\000\036\013\uff76\020\uff76" +
"\024\uff76\026\uff76\030\uff76\031\uff76\033\uff76\034\uff76\050" +
"\uff76\052\uff76\060\uff76\061\uff76\062\uff76\071\uff76\001\002" +
"\000\024\037\ufef0\040\ufef0\047\ufef0\051\ufef0\053\ufef0\054" +
"\ufef0\071\ufef0\073\ufef0\077\ufef0\001\002\000\024\037\ufef1" +
"\040\ufef1\047\ufef1\051\ufef1\053\ufef1\054\ufef1\071\ufef1\073" +
"\ufef1\077\ufef1\001\002\000\024\037\ufeef\040\ufeef\047\ufeef" +
"\051\ufeef\053\ufeef\054\ufeef\071\ufeef\073\ufeef\077\ufeef\001" +
"\002\000\024\037\ufef2\040\ufef2\047\ufef2\051\ufef2\053\ufef2" +
"\054\ufef2\071\ufef2\073\ufef2\077\ufef2\001\002\000\036\013" +
"\uff75\020\uff75\024\uff75\026\uff75\030\uff75\031\uff75\033\uff75" +
"\034\uff75\050\uff75\052\uff75\060\uff75\061\uff75\062\uff75\071" +
"\uff75\001\002\000\024\037\ufede\040\ufede\047\ufede\051\ufede" +
"\053\070\054\051\071\ufede\073\ufede\077\ufede\001\002\000" +
"\074\013\uff68\020\uff68\024\uff68\026\uff68\030\uff68\031\uff68" +
"\033\uff68\034\uff68\041\uff68\042\uff68\043\uff68\050\uff68\052" +
"\uff68\053\uff68\054\uff68\055\uff68\056\uff68\057\uff68\060\uff68" +
"\061\uff68\062\uff68\071\uff68\101\uff68\102\uff68\103\uff68\104" +
"\uff68\105\uff68\106\uff68\107\uff68\001\002\000\104\013\uff5f" +
"\020\uff5f\024\uff5f\026\uff5f\030\uff5f\031\uff5f\033\uff5f\034" +
"\uff5f\041\uff5f\042\uff5f\043\uff5f\050\uff5f\051\uff5f\052\uff5f" +
"\053\uff5f\054\uff5f\055\uff5f\056\uff5f\057\uff5f\060\uff5f\061" +
"\uff5f\062\uff5f\063\uff5f\067\uff5f\070\uff5f\071\uff5f\101\uff5f" +
"\102\uff5f\103\uff5f\104\uff5f\105\uff5f\106\uff5f\107\uff5f\001" +
"\002\000\104\013\uff5c\020\uff5c\024\uff5c\026\uff5c\030\uff5c" +
"\031\uff5c\033\uff5c\034\uff5c\041\uff5c\042\uff5c\043\uff5c\050" +
"\uff5c\051\uff5c\052\uff5c\053\uff5c\054\uff5c\055\uff5c\056\uff5c" +
"\057\uff5c\060\uff5c\061\uff5c\062\uff5c\063\uff5c\067\uff5c\070" +
"\uff5c\071\uff5c\101\uff5c\102\uff5c\103\uff5c\104\uff5c\105\uff5c" +
"\106\uff5c\107\uff5c\001\002\000\026\037\ufede\040\ufede\047" +
"\ufede\051\ufede\052\uff56\053\070\054\051\071\ufede\073\ufede" +
"\077\ufede\001\002\000\074\013\uff66\020\uff66\024\uff66\026" +
"\uff66\030\uff66\031\uff66\033\uff66\034\uff66\041\uff66\042\uff66" +
"\043\uff66\050\uff66\052\uff66\053\uff66\054\uff66\055\uff66\056" +
"\uff66\057\uff66\060\uff66\061\uff66\062\uff66\071\uff66\101\uff66" +
"\102\uff66\103\uff66\104\uff66\105\uff66\106\uff66\107\uff66\001" +
"\002\000\074\013\uff67\020\uff67\024\uff67\026\uff67\030\uff67" +
"\031\uff67\033\uff67\034\uff67\041\uff67\042\uff67\043\uff67\050" +
"\uff67\052\uff67\053\uff67\054\uff67\055\uff67\056\uff67\057\uff67" +
"\060\uff67\061\uff67\062\uff67\071\uff67\101\uff67\102\uff67\103" +
"\uff67\104\uff67\105\uff67\106\uff67\107\uff67\001\002\000\104" +
"\013\uff5e\020\uff5e\024\uff5e\026\uff5e\030\uff5e\031\uff5e\033" +
"\uff5e\034\uff5e\041\uff5e\042\uff5e\043\uff5e\050\uff5e\051\uff5e" +
"\052\uff5e\053\uff5e\054\uff5e\055\uff5e\056\uff5e\057\uff5e\060" +
"\uff5e\061\uff5e\062\uff5e\063\uff5e\067\uff5e\070\uff5e\071\uff5e" +
"\101\uff5e\102\uff5e\103\uff5e\104\uff5e\105\uff5e\106\uff5e\107" +
"\uff5e\001\002\000\074\013\uff6b\020\uff6b\024\uff6b\026\uff6b" +
"\030\uff6b\031\uff6b\033\uff6b\034\uff6b\041\uff6b\042\uff6b\043" +
"\uff6b\050\uff6b\052\uff6b\053\uff6b\054\uff6b\055\uff6b\056\uff6b" +
"\057\uff6b\060\uff6b\061\uff6b\062\uff6b\071\uff6b\101\uff6b\102" +
"\uff6b\103\uff6b\104\uff6b\105\uff6b\106\uff6b\107\uff6b\001\002" +
"\000\104\013\uff12\020\uff12\024\uff12\026\uff12\030\uff12\031" +
"\uff12\033\uff12\034\uff12\041\uff12\042\uff12\043\uff12\047\uff0d" +
"\050\uff12\051\uff12\052\uff12\053\uff12\054\uff12\055\uff12\056" +
"\uff12\057\uff12\060\uff12\061\uff12\062\uff12\063\uff12\070\uff12" +
"\071\uff12\101\uff12\102\uff12\103\uff12\104\uff12\105\uff12\106" +
"\uff12\107\uff12\001\002\000\024\037\uff64\040\uff64\047\uff64" +
"\051\uff64\053\uff64\054\uff64\071\uff64\073\uff64\077\uff64\001" +
"\002\000\076\013\uff53\020\uff53\024\uff53\026\uff53\030\uff53" +
"\031\uff53\033\uff53\034\uff53\041\uff53\042\uff53\043\uff53\047" +
"\254\050\uff53\052\uff53\053\uff53\054\uff53\055\uff53\056\uff53" +
"\057\uff53\060\uff53\061\uff53\062\uff53\071\uff53\101\uff53\102" +
"\uff53\103\uff53\104\uff53\105\uff53\106\uff53\107\uff53\001\002" +
"\000\074\013\uff69\020\uff69\024\uff69\026\uff69\030\uff69\031" +
"\uff69\033\uff69\034\uff69\041\uff69\042\uff69\043\uff69\050\uff69" +
"\052\uff69\053\uff69\054\uff69\055\uff69\056\uff69\057\uff69\060" +
"\uff69\061\uff69\062\uff69\071\uff69\101\uff69\102\uff69\103\uff69" +
"\104\uff69\105\uff69\106\uff69\107\uff69\001\002\000\004\063" +
"\247\001\002\000\104\013\uff60\020\uff60\024\uff60\026\uff60" +
"\030\uff60\031\uff60\033\uff60\034\uff60\041\uff60\042\uff60\043" +
"\uff60\050\uff60\051\uff60\052\uff60\053\uff60\054\uff60\055\uff60" +
"\056\uff60\057\uff60\060\uff60\061\uff60\062\uff60\063\uff60\067" +
"\uff60\070\uff60\071\uff60\101\uff60\102\uff60\103\uff60\104\uff60" +
"\105\uff60\106\uff60\107\uff60\001\002\000\004\070\246\001" +
"\002\000\074\013\uff6a\020\uff6a\024\uff6a\026\uff6a\030\uff6a" +
"\031\uff6a\033\uff6a\034\uff6a\041\uff6a\042\uff6a\043\uff6a\050" +
"\uff6a\052\uff6a\053\uff6a\054\uff6a\055\uff6a\056\uff6a\057\uff6a" +
"\060\uff6a\061\uff6a\062\uff6a\071\uff6a\101\uff6a\102\uff6a\103" +
"\uff6a\104\uff6a\105\uff6a\106\uff6a\107\uff6a\001\002\000\062" +
"\013\uff71\020\uff71\024\uff71\026\uff71\030\uff71\031\uff71\033" +
"\uff71\034\uff71\042\243\050\uff71\052\uff71\053\242\054\240" +
"\060\uff71\061\uff71\062\uff71\071\uff71\101\uff71\102\uff71\103" +
"\uff71\104\uff71\105\uff71\106\uff71\107\uff71\001\002\000\104" +
"\013\uff5d\020\uff5d\024\uff5d\026\uff5d\030\uff5d\031\uff5d\033" +
"\uff5d\034\uff5d\041\uff5d\042\uff5d\043\uff5d\050\uff5d\051\uff5d" +
"\052\uff5d\053\uff5d\054\uff5d\055\uff5d\056\uff5d\057\uff5d\060" +
"\uff5d\061\uff5d\062\uff5d\063\uff5d\067\uff5d\070\uff5d\071\uff5d" +
"\101\uff5d\102\uff5d\103\uff5d\104\uff5d\105\uff5d\106\uff5d\107" +
"\uff5d\001\002\000\004\070\uff18\001\002\000\102\013\uff6d" +
"\020\uff6d\024\uff6d\026\uff6d\030\uff6d\031\uff6d\033\uff6d\034" +
"\uff6d\041\uff6d\042\uff6d\043\uff6d\050\uff6d\051\uff13\052\uff6d" +
"\053\uff6d\054\uff6d\055\uff6d\056\uff6d\057\uff6d\060\uff6d\061" +
"\uff6d\062\uff6d\063\uff16\070\uff19\071\uff6d\101\uff6d\102\uff6d" +
"\103\uff6d\104\uff6d\105\uff6d\106\uff6d\107\uff6d\001\002\000" +
"\004\051\225\001\002\000\104\013\uff62\020\uff62\024\uff62" +
"\026\uff62\030\uff62\031\uff62\033\uff62\034\uff62\041\uff62\042" +
"\uff62\043\uff62\050\uff62\051\uff62\052\uff62\053\uff62\054\uff62" +
"\055\uff62\056\uff62\057\uff62\060\uff62\061\uff62\062\uff62\063" +
"\uff62\067\uff62\070\uff62\071\uff62\101\uff62\102\uff62\103\uff62" +
"\104\uff62\105\uff62\106\uff62\107\uff62\001\002\000\074\013" +
"\uff6e\020\uff6e\024\uff6e\026\uff6e\030\uff6e\031\uff6e\033\uff6e" +
"\034\uff6e\041\220\042\uff6e\043\216\050\uff6e\052\uff6e\053" +
"\uff6e\054\uff6e\055\217\056\221\057\215\060\uff6e\061\uff6e" +
"\062\uff6e\071\uff6e\101\uff6e\102\uff6e\103\uff6e\104\uff6e\105" +
"\uff6e\106\uff6e\107\uff6e\001\002\000\104\013\uff61\020\uff61" +
"\024\uff61\026\uff61\030\uff61\031\uff61\033\uff61\034\uff61\041" +
"\uff61\042\uff61\043\uff61\050\uff61\051\uff61\052\uff61\053\uff61" +
"\054\uff61\055\uff61\056\uff61\057\uff61\060\uff61\061\uff61\062" +
"\uff61\063\uff61\067\uff61\070\uff61\071\uff61\101\uff61\102\uff61" +
"\103\uff61\104\uff61\105\uff61\106\uff61\107\uff61\001\002\000" +
"\104\013\uff5b\020\uff5b\024\uff5b\026\uff5b\030\uff5b\031\uff5b" +
"\033\uff5b\034\uff5b\041\uff5b\042\uff5b\043\uff5b\050\uff5b\051" +
"\uff5b\052\uff5b\053\uff5b\054\uff5b\055\uff5b\056\uff5b\057\uff5b" +
"\060\uff5b\061\uff5b\062\uff5b\063\uff5b\067\uff5b\070\uff5b\071" +
"\uff5b\101\uff5b\102\uff5b\103\uff5b\104\uff5b\105\uff5b\106\uff5b" +
"\107\uff5b\001\002\000\074\013\uff6c\020\uff6c\024\uff6c\026" +
"\uff6c\030\uff6c\031\uff6c\033\uff6c\034\uff6c\041\uff6c\042\uff6c" +
"\043\uff6c\050\uff6c\052\uff6c\053\uff6c\054\uff6c\055\uff6c\056" +
"\uff6c\057\uff6c\060\uff6c\061\uff6c\062\uff6c\071\uff6c\101\uff6c" +
"\102\uff6c\103\uff6c\104\uff6c\105\uff6c\106\uff6c\107\uff6c\001" +
"\002\000\062\013\uff70\020\uff70\024\uff70\026\uff70\030\uff70" +
"\031\uff70\033\uff70\034\uff70\042\uff70\050\uff70\052\uff70\053" +
"\uff70\054\uff70\060\uff70\061\uff70\062\uff70\071\uff70\101\uff70" +
"\102\uff70\103\uff70\104\uff70\105\uff70\106\uff70\107\uff70\001" +
"\002\000\024\037\ufee5\040\ufee5\047\ufee5\051\ufee5\053\ufee5" +
"\054\ufee5\071\ufee5\073\ufee5\077\ufee5\001\002\000\024\037" +
"\ufee4\040\ufee4\047\ufee4\051\ufee4\053\ufee4\054\ufee4\071\ufee4" +
"\073\ufee4\077\ufee4\001\002\000\024\037\ufee7\040\ufee7\047" +
"\ufee7\051\ufee7\053\ufee7\054\ufee7\071\ufee7\073\ufee7\077\ufee7" +
"\001\002\000\024\037\ufee6\040\ufee6\047\ufee6\051\ufee6\053" +
"\ufee6\054\ufee6\071\ufee6\073\ufee6\077\ufee6\001\002\000\024" +
"\037\ufee8\040\ufee8\047\ufee8\051\ufee8\053\ufee8\054\ufee8\071" +
"\ufee8\073\ufee8\077\ufee8\001\002\000\024\037\175\040\173" +
"\047\161\051\165\053\070\054\051\071\010\073\ufede\077" +
"\061\001\002\000\074\013\uff6e\020\uff6e\024\uff6e\026\uff6e" +
"\030\uff6e\031\uff6e\033\uff6e\034\uff6e\041\220\042\uff6e\043" +
"\216\050\uff6e\052\uff6e\053\uff6e\054\uff6e\055\217\056\221" +
"\057\215\060\uff6e\061\uff6e\062\uff6e\071\uff6e\101\uff6e\102" +
"\uff6e\103\uff6e\104\uff6e\105\uff6e\106\uff6e\107\uff6e\001\002" +
"\000\062\013\uff6f\020\uff6f\024\uff6f\026\uff6f\030\uff6f\031" +
"\uff6f\033\uff6f\034\uff6f\042\uff6f\050\uff6f\052\uff6f\053\uff6f" +
"\054\uff6f\060\uff6f\061\uff6f\062\uff6f\071\uff6f\101\uff6f\102" +
"\uff6f\103\uff6f\104\uff6f\105\uff6f\106\uff6f\107\uff6f\001\002" +
"\000\024\037\ufede\040\ufede\047\ufede\051\ufede\053\070\054" +
"\051\071\ufede\073\ufede\077\ufede\001\002\000\004\052\234" +
"\001\002\000\006\052\uff04\062\230\001\002\000\024\037" +
"\ufede\040\ufede\047\ufede\051\ufede\053\070\054\051\071\ufede" +
"\073\ufede\077\ufede\001\002\000\004\052\uff0a\001\002\000" +
"\006\052\uff04\062\230\001\002\000\004\052\uff05\001\002" +
"\000\104\013\uff5a\020\uff5a\024\uff5a\026\uff5a\030\uff5a\031" +
"\uff5a\033\uff5a\034\uff5a\041\uff5a\042\uff5a\043\uff5a\050\uff5a" +
"\051\uff5a\052\uff5a\053\uff5a\054\uff5a\055\uff5a\056\uff5a\057" +
"\uff5a\060\uff5a\061\uff5a\062\uff5a\063\uff5a\067\uff5a\070\uff5a" +
"\071\uff5a\101\uff5a\102\uff5a\103\uff5a\104\uff5a\105\uff5a\106" +
"\uff5a\107\uff5a\001\002\000\004\070\236\001\002\000\104" +
"\013\uff17\020\uff17\024\uff17\026\uff17\030\uff17\031\uff17\033" +
"\uff17\034\uff17\041\uff17\042\uff17\043\uff17\050\uff17\051\uff17" +
"\052\uff17\053\uff17\054\uff17\055\uff17\056\uff17\057\uff17\060" +
"\uff17\061\uff17\062\uff17\063\uff17\067\uff17\070\uff17\071\uff17" +
"\101\uff17\102\uff17\103\uff17\104\uff17\105\uff17\106\uff17\107" +
"\uff17\001\002\000\054\013\uff73\020\uff73\024\uff73\026\uff73" +
"\030\uff73\031\uff73\033\uff73\034\uff73\050\uff73\052\uff73\060" +
"\uff73\061\uff73\062\uff73\071\uff73\101\uff73\102\uff73\103\uff73" +
"\104\uff73\105\uff73\106\uff73\107\uff73\001\002\000\024\037" +
"\ufeeb\040\ufeeb\047\ufeeb\051\ufeeb\053\ufeeb\054\ufeeb\071\ufeeb" +
"\073\ufeeb\077\ufeeb\001\002\000\024\037\175\040\173\047" +
"\161\051\165\053\070\054\051\071\010\073\ufede\077\061" +
"\001\002\000\024\037\ufeea\040\ufeea\047\ufeea\051\ufeea\053" +
"\ufeea\054\ufeea\071\ufeea\073\ufeea\077\ufeea\001\002\000\024" +
"\037\ufee9\040\ufee9\047\ufee9\051\ufee9\053\ufee9\054\ufee9\071" +
"\ufee9\073\ufee9\077\ufee9\001\002\000\062\013\uff71\020\uff71" +
"\024\uff71\026\uff71\030\uff71\031\uff71\033\uff71\034\uff71\042" +
"\243\050\uff71\052\uff71\053\242\054\240\060\uff71\061\uff71" +
"\062\uff71\071\uff71\101\uff71\102\uff71\103\uff71\104\uff71\105" +
"\uff71\106\uff71\107\uff71\001\002\000\054\013\uff72\020\uff72" +
"\024\uff72\026\uff72\030\uff72\031\uff72\033\uff72\034\uff72\050" +
"\uff72\052\uff72\060\uff72\061\uff72\062\uff72\071\uff72\101\uff72" +
"\102\uff72\103\uff72\104\uff72\105\uff72\106\uff72\107\uff72\001" +
"\002\000\104\013\uff52\020\uff52\024\uff52\026\uff52\030\uff52" +
"\031\uff52\033\uff52\034\uff52\041\uff52\042\uff52\043\uff52\050" +
"\uff52\051\uff52\052\uff52\053\uff52\054\uff52\055\uff52\056\uff52" +
"\057\uff52\060\uff52\061\uff52\062\uff52\063\uff52\067\uff52\070" +
"\uff52\071\uff52\101\uff52\102\uff52\103\uff52\104\uff52\105\uff52" +
"\106\uff52\107\uff52\001\002\000\004\071\010\001\002\000" +
"\104\013\uff59\020\uff59\024\uff59\026\uff59\030\uff59\031\uff59" +
"\033\uff59\034\uff59\041\uff59\042\uff59\043\uff59\050\uff59\051" +
"\uff59\052\uff59\053\uff59\054\uff59\055\uff59\056\uff59\057\uff59" +
"\060\uff59\061\uff59\062\uff59\063\uff59\067\uff59\070\uff59\071" +
"\uff59\101\uff59\102\uff59\103\uff59\104\uff59\105\uff59\106\uff59" +
"\107\uff59\001\002\000\104\013\uff12\020\uff12\024\uff12\026" +
"\uff12\030\uff12\031\uff12\033\uff12\034\uff12\041\uff12\042\uff12" +
"\043\uff12\050\uff12\051\uff12\052\uff12\053\uff12\054\uff12\055" +
"\uff12\056\uff12\057\uff12\060\uff12\061\uff12\062\uff12\063\uff12" +
"\067\uff12\070\uff12\071\uff12\101\uff12\102\uff12\103\uff12\104" +
"\uff12\105\uff12\106\uff12\107\uff12\001\002\000\074\013\uff55" +
"\020\uff55\024\uff55\026\uff55\030\uff55\031\uff55\033\uff55\034" +
"\uff55\041\uff55\042\uff55\043\uff55\050\uff55\052\uff55\053\uff55" +
"\054\uff55\055\uff55\056\uff55\057\uff55\060\uff55\061\uff55\062" +
"\uff55\071\uff55\101\uff55\102\uff55\103\uff55\104\uff55\105\uff55" +
"\106\uff55\107\uff55\001\002\000\074\013\uff54\020\uff54\024" +
"\uff54\026\uff54\030\uff54\031\uff54\033\uff54\034\uff54\041\uff54" +
"\042\uff54\043\uff54\050\uff54\052\uff54\053\uff54\054\uff54\055" +
"\uff54\056\uff54\057\uff54\060\uff54\061\uff54\062\uff54\071\uff54" +
"\101\uff54\102\uff54\103\uff54\104\uff54\105\uff54\106\uff54\107" +
"\uff54\001\002\000\024\037\ufede\040\ufede\047\ufede\051\ufede" +
"\053\070\054\051\071\010\073\ufede\077\ufede\001\002\000" +
"\030\013\uff0e\026\uff0e\034\uff0e\047\uff0e\050\uff12\051\uff12" +
"\061\uff0e\062\uff12\063\uff12\067\uff12\070\uff12\001\002\000" +
"\006\050\uff7a\062\uff7a\001\002\000\006\050\uff7e\062\270" +
"\001\002\000\006\050\uff7b\062\uff7b\001\002\000\006\050" +
"\uff79\062\uff79\001\002\000\014\050\uff14\051\uff13\062\uff14" +
"\063\uff16\070\uff19\001\002\000\006\050\uff7d\062\uff7d\001" +
"\002\000\006\050\uff7c\062\uff7c\001\002\000\006\050\uff77" +
"\062\uff77\001\002\000\006\050\uff78\062\uff78\001\002\000" +
"\004\050\273\001\002\000\024\037\ufede\040\ufede\047\ufede" +
"\051\ufede\053\070\054\051\071\010\073\ufede\077\ufede\001" +
"\002\000\006\050\uff7e\062\270\001\002\000\004\050\uff7f" +
"\001\002\000\074\013\uff80\020\uff80\024\uff80\026\uff80\030" +
"\uff80\031\uff80\033\uff80\034\uff80\041\uff80\042\uff80\043\uff80" +
"\050\uff80\052\uff80\053\uff80\054\uff80\055\uff80\056\uff80\057" +
"\uff80\060\uff80\061\uff80\062\uff80\071\uff80\101\uff80\102\uff80" +
"\103\uff80\104\uff80\105\uff80\106\uff80\107\uff80\001\002\000" +
"\024\037\175\040\173\047\161\051\165\053\070\054\051" +
"\071\010\073\ufede\077\061\001\002\000\074\013\uff63\020" +
"\uff63\024\uff63\026\uff63\030\uff63\031\uff63\033\uff63\034\uff63" +
"\041\uff63\042\uff63\043\uff63\050\uff63\052\uff63\053\uff63\054" +
"\uff63\055\uff63\056\uff63\057\uff63\060\uff63\061\uff63\062\uff63" +
"\071\uff63\101\uff63\102\uff63\103\uff63\104\uff63\105\uff63\106" +
"\uff63\107\uff63\001\002\000\004\052\301\001\002\000\006" +
"\052\uff04\062\230\001\002\000\004\052\uff57\001\002\000" +
"\074\013\uff58\020\uff58\024\uff58\026\uff58\030\uff58\031\uff58" +
"\033\uff58\034\uff58\041\uff58\042\uff58\043\uff58\050\uff58\052" +
"\uff58\053\uff58\054\uff58\055\uff58\056\uff58\057\uff58\060\uff58" +
"\061\uff58\062\uff58\071\uff58\101\uff58\102\uff58\103\uff58\104" +
"\uff58\105\uff58\106\uff58\107\uff58\001\002\000\004\050\303" +
"\001\002\000\074\013\uff65\020\uff65\024\uff65\026\uff65\030" +
"\uff65\031\uff65\033\uff65\034\uff65\041\uff65\042\uff65\043\uff65" +
"\050\uff65\052\uff65\053\uff65\054\uff65\055\uff65\056\uff65\057" +
"\uff65\060\uff65\061\uff65\062\uff65\071\uff65\101\uff65\102\uff65" +
"\103\uff65\104\uff65\105\uff65\106\uff65\107\uff65\001\002\000" +
"\024\037\ufede\040\ufede\047\ufede\051\ufede\053\070\054\051" +
"\071\ufede\073\ufede\077\ufede\001\002\000\004\071\uff1f\001" +
"\002\000\004\071\uff1d\001\002\000\004\071\uff1a\001\002" +
"\000\004\020\311\001\002\000\014\053\070\054\051\071" +
"\ufede\073\ufede\077\061\001\002\000\010\013\uff27\050\uff27" +
"\061\325\001\002\000\006\060\uff84\062\321\001\002\000" +
"\004\060\315\001\002\000\004\047\316\001\002\000\010" +
"\035\133\050\uff34\071\010\001\002\000\004\050\320\001" +
"\002\000\010\013\uff23\050\uff23\061\uff23\001\002\000\014" +
"\053\070\054\051\071\ufede\073\ufede\077\061\001\002\000" +
"\004\060\uff86\001\002\000\006\060\uff84\062\321\001\002" +
"\000\004\060\uff85\001\002\000\014\053\070\054\051\071" +
"\ufede\073\ufede\077\061\001\002\000\010\013\uff29\050\uff29" +
"\061\uff29\001\002\000\010\013\uff27\050\uff27\061\325\001" +
"\002\000\010\013\uff28\050\uff28\061\uff28\001\002\000\032" +
"\016\057\017\uff45\044\uff45\045\uff45\046\uff45\047\064\053" +
"\070\054\051\070\055\071\010\073\ufede\077\061\001\002" +
"\000\010\013\uff2a\050\uff2a\061\uff2a\001\002\000\006\013" +
"\uff35\050\uff35\001\002\000\006\013\uff31\050\uff31\001\002" +
"\000\010\013\uff2d\050\uff2d\061\uff2d\001\002\000\004\071" +
"\010\001\002\000\010\013\uff2b\050\uff2b\061\336\001\002" +
"\000\010\013\uff2c\050\uff2c\061\uff2c\001\002\000\010\013" +
"\uff33\050\uff33\061\uff33\001\002\000\004\035\133\001\002" +
"\000\010\013\uff2f\050\uff2f\061\uff2f\001\002\000\032\016" +
"\057\017\uff45\044\uff45\045\uff45\046\uff45\047\064\053\070" +
"\054\051\070\055\071\010\073\ufede\077\061\001\002\000" +
"\010\013\uff39\050\uff39\061\uff39\001\002\000\010\013\uff3a" +
"\050\uff3a\061\uff3a\001\002\000\016\047\064\053\070\054" +
"\051\071\ufede\073\ufede\077\061\001\002\000\006\052\uff3d" +
"\060\uff3d\001\002\000\006\052\uff3e\060\352\001\002\000" +
"\016\047\064\053\070\054\051\071\ufede\073\ufede\077\061" +
"\001\002\000\004\052\354\001\002\000\004\020\355\001" +
"\002\000\032\016\057\017\uff45\044\uff45\045\uff45\046\uff45" +
"\047\064\053\070\054\051\070\055\071\010\073\ufede\077" +
"\061\001\002\000\010\013\uff3c\050\uff3c\061\uff3c\001\002" +
"\000\010\013\uff40\050\uff40\061\uff40\001\002\000\006\052" +
"\uff3e\060\352\001\002\000\004\052\uff3f\001\002\000\032" +
"\016\057\017\uff45\044\uff45\045\uff45\046\uff45\047\064\053" +
"\070\054\051\070\055\071\010\073\ufede\077\061\001\002" +
"\000\010\013\uff37\050\uff37\061\uff37\001\002\000\010\013" +
"\uff38\050\uff38\061\uff38\001\002\000\004\050\366\001\002" +
"\000\014\013\uff4b\050\uff4b\052\uff4b\060\uff4b\061\uff4b\001" +
"\002\000\010\013\uff36\050\uff36\061\uff36\001\002\000\014" +
"\053\070\054\051\071\ufede\073\ufede\077\061\001\002\000" +
"\014\013\uff48\050\uff48\052\uff48\060\uff48\061\uff48\001\002" +
"\000\014\013\uff4a\050\uff4a\052\uff4a\060\uff4a\061\uff4a\001" +
"\002\000\004\071\010\001\002\000\010\012\uffe1\014\u0101" +
"\015\u0105\001\002\000\010\012\uffe6\014\uffe6\015\uffe6\001" +
"\002\000\004\061\u015a\001\002\000\004\061\uffdf\001\002" +
"\000\004\061\u0156\001\002\000\004\071\010\001\002\000" +
"\004\061\u014e\001\002\000\004\061\u014b\001\002\000\004" +
"\061\uffe0\001\002\000\004\071\010\001\002\000\004\012" +
"\ufffb\001\002\000\004\012\uffe3\001\002\000\004\061\u0109" +
"\001\002\000\010\012\uffe1\014\u0101\015\u0105\001\002\000" +
"\004\012\uffe2\001\002\000\010\047\u010f\060\uffc9\061\uff0d" +
"\001\002\000\004\061\uffce\001\002\000\004\060\u0148\001" +
"\002\000\010\050\uffca\060\uffca\061\uffca\001\002\000\012" +
"\010\u0117\014\u0114\015\u0119\071\010\001\002\000\004\050" +
"\uffc8\001\002\000\004\050\uffc5\001\002\000\004\050\uffc6" +
"\001\002\000\004\050\uffc1\001\002\000\004\071\010\001" +
"\002\000\004\050\uffc7\001\002\000\004\050\uffc2\001\002" +
"\000\004\071\010\001\002\000\004\060\u011d\001\002\000" +
"\004\071\010\001\002\000\004\050\u011b\001\002\000\010" +
"\050\uffcd\060\uffcd\061\uffcd\001\002\000\006\047\u010f\060" +
"\uffc9\001\002\000\010\016\u0124\017\u0120\071\010\001\002" +
"\000\004\050\uffc4\001\002\000\004\050\uffbe\001\002\000" +
"\004\051\u0138\001\002\000\004\050\uffc0\001\002\000\004" +
"\050\uffbf\001\002\000\004\050\uffbd\001\002\000\004\017" +
"\u0125\001\002\000\004\051\u0126\001\002\000\006\071\010" +
"\073\u012a\001\002\000\006\052\uffb6\061\uffb6\001\002\000" +
"\004\052\u0135\001\002\000\004\064\u0132\001\002\000\004" +
"\064\u012c\001\002\000\006\052\uffb5\061\uffb5\001\002\000" +
"\004\073\u012d\001\002\000\010\052\uffb1\060\u012f\061\uffb1" +
"\001\002\000\006\052\uffb3\061\uffb3\001\002\000\004\071" +
"\010\001\002\000\006\052\uffb2\061\uffb2\001\002\000\006" +
"\052\uffb0\061\uffb0\001\002\000\004\071\010\001\002\000" +
"\010\052\uffb1\060\u012f\061\uffb1\001\002\000\006\052\uffb4" +
"\061\uffb4\001\002\000\004\020\u0136\001\002\000\004\071" +
"\010\001\002\000\004\050\uffbc\001\002\000\006\071\010" +
"\073\u012a\001\002\000\006\052\uffb9\061\u013a\001\002\000" +
"\006\071\010\073\u012a\001\002\000\004\052\u013c\001\002" +
"\000\004\020\u013d\001\002\000\010\016\u0124\017\u0120\071" +
"\010\001\002\000\004\050\uffb8\001\002\000\004\050\uffb7" +
"\001\002\000\004\050\uffbb\001\002\000\006\052\uffb9\061" +
"\u013a\001\002\000\004\052\uffba\001\002\000\004\060\u0144" +
"\001\002\000\010\016\u0124\017\u0120\071\010\001\002\000" +
"\004\050\uffc3\001\002\000\006\047\u010f\050\uffc9\001\002" +
"\000\006\050\uffd2\061\uffd2\001\002\000\004\071\010\001" +
"\002\000\006\050\uffd0\061\uffd0\001\002\000\006\050\uffd1" +
"\061\uffd1\001\002\000\020\005\023\006\ufff6\007\ufff6\010" +
"\ufff6\012\ufff6\014\ufff6\015\ufff6\001\002\000\004\061\uffdc" +
"\001\002\000\004\061\uffdb\001\002\000\024\005\023\006" +
"\ufff6\007\ufff6\010\ufff6\011\u014f\012\ufff6\014\ufff6\015\ufff6" +
"\021\u0151\001\002\000\004\061\uffd6\001\002\000\004\061" +
"\uffde\001\002\000\004\061\uffd3\001\002\000\004\061\uffdd" +
"\001\002\000\004\061\uffd5\001\002\000\004\061\uffcf\001" +
"\002\000\006\047\u010f\061\uffc9\001\002\000\024\005\023" +
"\006\ufff6\007\ufff6\010\ufff6\011\u014f\012\ufff6\014\ufff6\015" +
"\ufff6\021\u0151\001\002\000\004\061\uffda\001\002\000\004" +
"\061\uffd7\001\002\000\004\061\uffd9\001\002\000\020\005" +
"\023\006\ufff6\007\ufff6\010\ufff6\012\ufff6\014\ufff6\015\ufff6" +
"\001\002\000\004\061\uffd8\001\002\000\004\060\u0163\001" +
"\002\000\004\061\u015e\001\002\000\012\012\uffe7\014\uffe7" +
"\015\uffe7\071\010\001\002\000\010\012\uffe9\014\uffe9\015" +
"\uffe9\001\002\000\004\061\u0161\001\002\000\012\012\uffe7" +
"\014\uffe7\015\uffe7\071\010\001\002\000\010\012\uffe8\014" +
"\uffe8\015\uffe8\001\002\000\032\016\057\017\uff45\044\uff45" +
"\045\uff45\046\uff45\047\064\053\070\054\051\070\055\071" +
"\010\073\ufede\077\061\001\002\000\004\061\uffe4\001\002" +
"\000\004\101\u016c\001\002\000\004\061\u0167\001\002\000" +
"\016\007\ufff3\010\ufff3\012\ufff3\014\ufff3\015\ufff3\071\010" +
"\001\002\000\014\007\ufff5\010\ufff5\012\ufff5\014\ufff5\015" +
"\ufff5\001\002\000\004\061\u016a\001\002\000\016\007\ufff3" +
"\010\ufff3\012\ufff3\014\ufff3\015\ufff3\071\010\001\002\000" +
"\014\007\ufff4\010\ufff4\012\ufff4\014\ufff4\015\ufff4\001\002" +
"\000\014\053\070\054\051\071\ufede\073\ufede\077\061\001" +
"\002\000\004\061\ufff0\001\002\000\036\012\u017b\013\uffa9" +
"\022\uffa9\023\u0173\025\u0184\027\u0183\032\u0175\035\u017f\036" +
"\u0178\053\070\054\051\061\uffa9\071\uffa9\073\ufede\001\002" +
"\000\006\061\ufffc\063\ufffc\001\002\000\012\013\uffab\026" +
"\uffab\034\uffab\061\uffab\001\002\000\010\013\uffad\026\uffad" +
"\061\u01c6\001\002\000\012\013\uff8f\026\uff8f\034\uff8f\061" +
"\uff8f\001\002\000\024\037\ufede\040\ufede\047\ufede\051\ufede" +
"\053\070\054\051\071\ufede\073\ufede\077\ufede\001\002\000" +
"\012\013\uff99\026\uff99\034\uff99\061\uff99\001\002\000\024" +
"\037\ufede\040\ufede\047\ufede\051\ufede\053\070\054\051\071" +
"\ufede\073\ufede\077\ufede\001\002\000\004\060\u01bc\001\002" +
"\000\012\013\uff9e\026\uff9e\034\uff9e\061\uff9e\001\002\000" +
"\004\071\010\001\002\000\016\013\uffa7\022\u01a5\026\uffa7" +
"\034\uffa7\061\uffa7\071\010\001\002\000\012\013\uff9c\026" +
"\uff9c\034\uff9c\061\uff9c\001\002\000\036\012\u017b\013\uffa9" +
"\022\uffa9\023\u0173\025\u0184\027\u0183\032\u0175\035\u017f\036" +
"\u0178\053\070\054\051\061\uffa9\071\uffa9\073\ufede\001\002" +
"\000\012\013\uff97\026\uff97\034\uff97\061\uff97\001\002\000" +
"\012\013\uff8e\026\uff8e\034\uff8e\061\uff8e\001\002\000\016" +
"\013\ufef7\026\ufef7\034\ufef7\060\ufef7\061\ufef7\062\ufef7\001" +
"\002\000\024\037\ufede\040\ufede\047\ufede\051\ufede\053\070" +
"\054\051\071\ufede\073\ufede\077\ufede\001\002\000\012\013" +
"\uff9b\026\uff9b\034\uff9b\061\uff9b\001\002\000\016\013\uff01" +
"\026\uff01\034\uff01\060\uff01\061\uff01\062\uff01\001\002\000" +
"\012\013\uff98\026\uff98\034\uff98\061\uff98\001\002\000\004" +
"\071\010\001\002\000\036\012\u017b\022\uffa9\023\u0173\025" +
"\u0184\026\uffa9\027\u0183\032\u0175\035\u017f\036\u0178\053\070" +
"\054\051\061\uffa9\071\uffa9\073\ufede\001\002\000\004\013" +
"\u0187\001\002\000\012\013\uff9d\026\uff9d\034\uff9d\061\uff9d" +
"\001\002\000\006\061\uffd4\063\uffd4\001\002\000\004\026" +
"\u0189\001\002\000\024\037\ufede\040\ufede\047\ufede\051\ufede" +
"\053\070\054\051\071\ufede\073\ufede\077\ufede\001\002\000" +
"\012\013\uff95\026\uff95\034\uff95\061\uff95\001\002\000\004" +
"\067\uff10\001\002\000\004\067\u018d\001\002\000\024\037" +
"\ufede\040\ufede\047\ufede\051\ufede\053\070\054\051\071\ufede" +
"\073\ufede\077\ufede\001\002\000\006\030\u0190\031\u0192\001" +
"\002\000\006\030\uff91\031\uff91\001\002\000\024\037\uff93" +
"\040\uff93\047\uff93\051\uff93\053\uff93\054\uff93\071\uff93\073" +
"\uff93\077\uff93\001\002\000\024\037\ufede\040\ufede\047\ufede" +
"\051\ufede\053\070\054\051\071\ufede\073\ufede\077\ufede\001" +
"\002\000\024\037\uff92\040\uff92\047\uff92\051\uff92\053\uff92" +
"\054\uff92\071\uff92\073\uff92\077\uff92\001\002\000\004\024" +
"\u0195\001\002\000\004\024\uff90\001\002\000\042\012\u017b" +
"\013\uffa9\022\uffa9\023\u0173\025\u0184\026\uffa9\027\u0183\032" +
"\u0175\034\uffa9\035\u017f\036\u0178\053\070\054\051\061\uffa9" +
"\071\uffa9\073\ufede\001\002\000\012\013\uff94\026\uff94\034" +
"\uff94\061\uff94\001\002\000\004\020\u0198\001\002\000\014" +
"\053\070\054\051\071\ufede\073\ufede\077\061\001\002\000" +
"\006\013\uff88\061\u019d\001\002\000\004\060\u019b\001\002" +
"\000\036\012\u017b\013\uffa9\022\uffa9\023\u0173\025\u0184\027" +
"\u0183\032\u0175\035\u017f\036\u0178\053\070\054\051\061\uffa9" +
"\071\uffa9\073\ufede\001\002\000\006\013\uff87\061\uff87\001" +
"\002\000\014\053\070\054\051\071\ufede\073\ufede\077\061" +
"\001\002\000\006\013\uff30\061\334\001\002\000\004\013" +
"\u01a0\001\002\000\012\013\uff8a\026\uff8a\034\uff8a\061\uff8a" +
"\001\002\000\006\013\uff88\061\u019d\001\002\000\006\013" +
"\uff89\061\uff89\001\002\000\004\013\u01a4\001\002\000\012" +
"\013\uff9a\026\uff9a\034\uff9a\061\uff9a\001\002\000\010\053" +
"\070\054\051\073\ufede\001\002\000\012\013\uffa6\026\uffa6" +
"\034\uffa6\061\uffa6\001\002\000\012\013\uffa5\026\uffa5\034" +
"\uffa5\061\uffa5\001\002\000\012\013\uffa4\026\uffa4\034\uffa4" +
"\061\uffa4\001\002\000\012\051\uff13\063\uff16\067\uffa2\070" +
"\uff19\001\002\000\004\067\u01b0\001\002\000\012\013\uffa8" +
"\026\uffa8\034\uffa8\061\uffa8\001\002\000\004\067\uffa1\001" +
"\002\000\012\013\uffac\026\uffac\034\uffac\061\uffac\001\002" +
"\000\014\013\uff53\026\uff53\034\uff53\047\254\061\uff53\001" +
"\002\000\012\013\uffa0\026\uffa0\034\uffa0\061\uffa0\001\002" +
"\000\024\037\ufede\040\ufede\047\ufede\051\ufede\053\070\054" +
"\051\071\ufede\073\ufede\077\ufede\001\002\000\012\013\uffa3" +
"\026\uffa3\034\uffa3\061\uffa3\001\002\000\012\013\uff9f\026" +
"\uff9f\034\uff9f\061\uff9f\001\002\000\010\024\uff81\062\u01b6" +
"\063\247\001\002\000\014\024\uff16\051\uff13\062\uff16\063" +
"\uff16\070\uff19\001\002\000\014\024\uff12\051\uff12\062\uff12" +
"\063\uff12\070\uff12\001\002\000\004\071\010\001\002\000" +
"\004\024\u01b8\001\002\000\042\012\u017b\013\uffa9\022\uffa9" +
"\023\u0173\025\u0184\026\uffa9\027\u0183\032\u0175\034\uffa9\035" +
"\u017f\036\u0178\053\070\054\051\061\uffa9\071\uffa9\073\ufede" +
"\001\002\000\012\013\uff83\026\uff83\034\uff83\061\uff83\001" +
"\002\000\010\024\uff81\062\u01b6\063\247\001\002\000\004" +
"\024\uff82\001\002\000\016\013\uffaa\022\uffaa\026\uffaa\034" +
"\uffaa\061\uffaa\071\uffaa\001\002\000\004\033\u01be\001\002" +
"\000\042\012\u017b\013\uffa9\022\uffa9\023\u0173\025\u0184\026" +
"\uffa9\027\u0183\032\u0175\034\uffa9\035\u017f\036\u0178\053\070" +
"\054\051\061\uffa9\071\uffa9\073\ufede\001\002\000\012\013" +
"\uff8c\026\uff8c\034\u01c0\061\uff8c\001\002\000\042\012\u017b" +
"\013\uffa9\022\uffa9\023\u0173\025\u0184\026\uffa9\027\u0183\032" +
"\u0175\034\uffa9\035\u017f\036\u0178\053\070\054\051\061\uffa9" +
"\071\uffa9\073\ufede\001\002\000\012\013\uff8d\026\uff8d\034" +
"\uff8d\061\uff8d\001\002\000\012\013\uff8b\026\uff8b\034\uff8b" +
"\061\uff8b\001\002\000\004\024\u01c4\001\002\000\042\012" +
"\u017b\013\uffa9\022\uffa9\023\u0173\025\u0184\026\uffa9\027\u0183" +
"\032\u0175\034\uffa9\035\u017f\036\u0178\053\070\054\051\061" +
"\uffa9\071\uffa9\073\ufede\001\002\000\012\013\uff96\026\uff96" +
"\034\uff96\061\uff96\001\002\000\040\012\u017b\013\uffa9\022" +
"\uffa9\023\u0173\025\u0184\026\uffa9\027\u0183\032\u0175\035\u017f" +
"\036\u0178\053\070\054\051\061\uffa9\071\uffa9\073\ufede\001" +
"\002\000\006\013\uffaf\026\uffaf\001\002\000\010\013\uffad" +
"\026\uffad\061\u01c6\001\002\000\006\013\uffae\026\uffae\001" +
"\002\000\006\061\ufff8\062\u01cb\001\002\000\010\053\070" +
"\054\051\073\ufede\001\002\000\004\061\u01cd\001\002\000" +
"\016\006\ufffa\007\ufffa\010\ufffa\012\ufffa\014\ufffa\015\ufffa" +
"\001\002\000\006\061\ufff8\062\u01cb\001\002\000\004\061" +
"\ufff9\001\002\000\004\002\001\001\002" });
/** Access to parse-action table. */
public short[][] action_table() {return _action_table;}
/** <code>reduce_goto</code> table. */
protected static final short[][] _reduce_table =
unpackFromStrings(new String[] {
"\000\u01ce\000\006\002\003\003\004\001\001\000\002\001" +
"\001\000\012\004\026\007\023\011\024\240\025\001\001" +
"\000\004\042\006\001\001\000\004\220\011\001\001\000" +
"\002\001\001\000\006\006\014\042\013\001\001\000\002" +
"\001\001\000\002\001\001\000\004\252\017\001\001\000" +
"\002\001\001\000\002\001\001\000\004\042\020\001\001" +
"\000\002\001\001\000\004\252\021\001\001\000\002\001" +
"\001\000\014\016\u01c9\177\u017d\202\u0180\207\071\210\073" +
"\001\001\000\004\010\u016e\001\001\000\002\001\001\000" +
"\006\012\031\241\032\001\001\000\002\001\001\000\002" +
"\001\001\000\006\017\u0165\042\u0164\001\001\000\002\001" +
"\001\000\006\013\033\242\034\001\001\000\002\001\001" +
"\000\006\014\374\243\373\001\001\000\006\021\037\042" +
"\036\001\001\000\002\001\001\000\002\001\001\000\010" +
"\021\042\042\036\274\041\001\001\000\002\001\001\000" +
"\002\001\001\000\010\021\042\042\036\274\044\001\001" +
"\000\002\001\001\000\040\020\052\041\053\042\051\046" +
"\057\132\062\133\072\134\064\135\066\136\055\161\047" +
"\205\046\206\061\207\071\210\070\225\065\001\001\000" +
"\002\001\001\000\002\001\001\000\002\001\001\000\002" +
"\001\001\000\002\001\001\000\002\001\001\000\006\042" +
"\051\046\366\001\001\000\002\001\001\000\002\001\001" +
"\000\002\001\001\000\002\001\001\000\002\001\001\000" +
"\002\001\001\000\006\006\364\042\013\001\001\000\002" +
"\001\001\000\014\137\124\140\125\141\123\142\115\143" +
"\120\001\001\000\002\001\001\000\002\001\001\000\024" +
"\042\101\047\100\176\076\177\074\200\075\202\077\207" +
"\071\210\073\244\102\001\001\000\002\001\001\000\002" +
"\001\001\000\004\203\114\001\001\000\002\001\001\000" +
"\002\001\001\000\002\001\001\000\004\217\104\001\001" +
"\000\002\001\001\000\002\001\001\000\002\001\001\000" +
"\010\202\113\207\071\210\073\001\001\000\002\001\001" +
"\000\006\203\110\204\106\001\001\000\006\217\112\221" +
"\111\001\001\000\002\001\001\000\002\001\001\000\002" +
"\001\001\000\002\001\001\000\002\001\001\000\002\001" +
"\001\000\002\001\001\000\002\001\001\000\002\001\001" +
"\000\002\001\001\000\002\001\001\000\020\006\131\042" +
"\013\150\126\151\134\152\133\153\130\163\127\001\001" +
"\000\002\001\001\000\002\001\001\000\002\001\001\000" +
"\004\227\340\001\001\000\004\261\334\001\001\000\004" +
"\226\332\001\001\000\002\001\001\000\010\154\137\223" +
"\136\224\141\001\001\000\002\001\001\000\002\001\001" +
"\000\002\001\001\000\002\001\001\000\006\042\051\046" +
"\307\001\001\000\014\077\145\117\144\155\142\207\071" +
"\210\143\001\001\000\002\001\001\000\004\222\304\001" +
"\001\000\074\023\162\042\171\045\173\047\161\050\166" +
"\051\167\076\204\131\200\164\165\165\163\166\206\167" +
"\210\170\176\171\202\172\205\173\175\174\177\175\203" +
"\176\212\177\074\200\075\202\077\205\170\206\061\207" +
"\071\210\073\211\201\212\207\216\211\001\001\000\006" +
"\126\151\233\152\001\001\000\002\001\001\000\002\001" +
"\001\000\002\001\001\000\002\001\001\000\010\117\157" +
"\207\071\210\143\001\001\000\002\001\001\000\002\001" +
"\001\000\002\001\001\000\002\001\001\000\002\001\001" +
"\000\002\001\001\000\012\077\301\117\144\207\071\210" +
"\143\001\001\000\002\001\001\000\002\001\001\000\002" +
"\001\001\000\014\037\275\077\276\117\144\207\071\210" +
"\143\001\001\000\002\001\001\000\002\001\001\000\002" +
"\001\001\000\002\001\001\000\002\001\001\000\004\276" +
"\273\001\001\000\006\104\252\232\251\001\001\000\002" +
"\001\001\000\002\001\001\000\002\001\001\000\002\001" +
"\001\000\002\001\001\000\006\127\240\271\236\001\001" +
"\000\002\001\001\000\004\277\234\001\001\000\002\001" +
"\001\000\002\001\001\000\002\001\001\000\006\130\221" +
"\270\213\001\001\000\002\001\001\000\002\001\001\000" +
"\002\001\001\000\002\001\001\000\002\001\001\000\002" +
"\001\001\000\002\001\001\000\002\001\001\000\002\001" +
"\001\000\072\023\162\042\171\045\173\047\161\050\166" +
"\051\167\076\204\131\200\164\165\165\163\166\206\167" +
"\210\170\176\171\202\172\205\173\175\174\177\175\203" +
"\176\212\177\074\200\075\202\077\205\170\206\061\207" +
"\071\210\073\212\222\216\211\001\001\000\006\130\221" +
"\270\223\001\001\000\002\001\001\000\014\077\226\100" +
"\225\117\144\207\071\210\143\001\001\000\002\001\001" +
"\000\004\253\230\001\001\000\012\077\231\117\144\207" +
"\071\210\143\001\001\000\002\001\001\000\004\253\232" +
"\001\001\000\002\001\001\000\002\001\001\000\002\001" +
"\001\000\002\001\001\000\002\001\001\000\002\001\001" +
"\000\074\023\162\042\171\045\173\047\161\050\166\051" +
"\167\076\204\131\200\164\165\165\163\166\206\167\210" +
"\170\176\171\202\172\205\173\175\174\177\175\203\176" +
"\212\177\074\200\075\202\077\205\170\206\061\207\071" +
"\210\073\211\243\212\207\216\211\001\001\000\002\001" +
"\001\000\002\001\001\000\006\127\240\271\244\001\001" +
"\000\002\001\001\000\002\001\001\000\006\042\250\051" +
"\247\001\001\000\002\001\001\000\002\001\001\000\002" +
"\001\001\000\002\001\001\000\064\023\162\042\254\044" +
"\265\045\264\051\167\076\261\077\260\101\263\102\262" +
"\103\256\105\257\106\255\117\144\165\163\166\206\167" +
"\210\170\176\171\202\172\205\173\175\174\177\175\203" +
"\207\071\210\143\216\211\001\001\000\002\001\001\000" +
"\002\001\001\000\004\257\266\001\001\000\002\001\001" +
"\000\002\001\001\000\002\001\001\000\002\001\001\000" +
"\002\001\001\000\002\001\001\000\002\001\001\000\002" +
"\001\001\000\064\023\162\042\254\044\265\045\264\051" +
"\167\076\261\077\260\101\263\102\262\103\270\105\257" +
"\106\255\117\144\165\163\166\206\167\210\170\176\171" +
"\202\172\205\173\175\174\177\175\203\207\071\210\143" +
"\216\211\001\001\000\004\257\271\001\001\000\002\001" +
"\001\000\002\001\001\000\072\023\162\042\171\045\173" +
"\047\161\050\166\051\167\076\204\131\200\164\165\165" +
"\163\166\206\167\210\170\176\171\202\172\205\173\175" +
"\174\177\175\203\176\212\177\074\200\075\202\077\205" +
"\170\206\061\207\071\210\073\212\274\216\211\001\001" +
"\000\002\001\001\000\002\001\001\000\004\253\277\001" +
"\001\000\002\001\001\000\002\001\001\000\002\001\001" +
"\000\002\001\001\000\014\077\306\117\144\207\071\210" +
"\143\215\305\001\001\000\002\001\001\000\002\001\001" +
"\000\002\001\001\000\002\001\001\000\020\020\312\125" +
"\313\156\311\205\046\206\061\207\071\210\070\001\001" +
"\000\004\262\325\001\001\000\004\255\321\001\001\000" +
"\002\001\001\000\002\001\001\000\020\006\131\042\013" +
"\150\126\151\134\152\316\153\130\163\127\001\001\000" +
"\002\001\001\000\002\001\001\000\014\020\322\205\046" +
"\206\061\207\071\210\070\001\001\000\002\001\001\000" +
"\004\255\323\001\001\000\002\001\001\000\020\020\312" +
"\125\313\156\326\205\046\206\061\207\071\210\070\001" +
"\001\000\002\001\001\000\004\262\327\001\001\000\002" +
"\001\001\000\040\020\052\041\331\042\051\046\057\132" +
"\062\133\072\134\064\135\066\136\055\161\047\205\046" +
"\206\061\207\071\210\070\225\065\001\001\000\002\001" +
"\001\000\002\001\001\000\002\001\001\000\002\001\001" +
"\000\010\006\131\042\013\163\336\001\001\000\004\261" +
"\337\001\001\000\002\001\001\000\002\001\001\000\004" +
"\151\342\001\001\000\002\001\001\000\042\020\052\041" +
"\344\042\051\046\057\132\062\133\072\134\064\135\066" +
"\136\055\146\345\161\047\205\046\206\061\207\071\210" +
"\070\225\065\001\001\000\002\001\001\000\002\001\001" +
"\000\026\020\052\132\347\135\066\136\055\144\350\161" +
"\047\205\046\206\061\207\071\210\070\001\001\000\002" +
"\001\001\000\004\267\352\001\001\000\026\020\052\132" +
"\347\135\066\136\055\144\357\161\047\205\046\206\061" +
"\207\071\210\070\001\001\000\002\001\001\000\002\001" +
"\001\000\042\020\052\041\355\042\051\046\057\132\062" +
"\133\072\134\064\135\066\136\055\145\356\161\047\205" +
"\046\206\061\207\071\210\070\225\065\001\001\000\002" +
"\001\001\000\002\001\001\000\004\267\360\001\001\000" +
"\002\001\001\000\042\020\052\041\362\042\051\046\057" +
"\132\062\133\072\134\064\135\066\136\055\147\363\161" +
"\047\205\046\206\061\207\071\210\070\225\065\001\001" +
"\000\002\001\001\000\002\001\001\000\002\001\001\000" +
"\002\001\001\000\002\001\001\000\016\020\370\162\371" +
"\205\046\206\061\207\071\210\070\001\001\000\002\001" +
"\001\000\002\001\001\000\010\006\u015b\022\u015c\042\013" +
"\001\001\000\024\015\u0105\024\u0103\025\u0101\027\u0102\030" +
"\376\031\377\033\375\250\u0107\272\u0106\001\001\000\002" +
"\001\001\000\002\001\001\000\002\001\001\000\002\001" +
"\001\000\006\042\u0154\044\u0153\001\001\000\002\001\001" +
"\000\002\001\001\000\002\001\001\000\006\042\u010a\045" +
"\u010b\001\001\000\002\001\001\000\002\001\001\000\002" +
"\001\001\000\022\024\u0103\025\u0101\027\u0102\030\376\031" +
"\377\033\375\250\u0107\272\u0109\001\001\000\002\001\001" +
"\000\006\036\u010d\237\u010c\001\001\000\002\001\001\000" +
"\002\001\001\000\002\001\001\000\024\006\u0117\025\u0115" +
"\031\u0112\042\013\052\u0119\053\u010f\054\u0114\055\u0111\056" +
"\u0110\001\001\000\002\001\001\000\002\001\001\000\002" +
"\001\001\000\002\001\001\000\004\042\u0145\001\001\000" +
"\002\001\001\000\002\001\001\000\006\006\u0142\042\013" +
"\001\001\000\002\001\001\000\004\042\u011b\001\001\000" +
"\002\001\001\000\002\001\001\000\006\036\u010d\237\u010c" +
"\001\001\000\016\042\051\046\u0120\057\u011d\060\u0121\061" +
"\u011e\062\u0122\001\001\000\002\001\001\000\002\001\001" +
"\000\002\001\001\000\002\001\001\000\002\001\001\000" +
"\002\001\001\000\002\001\001\000\002\001\001\000\012" +
"\042\u0128\063\u0127\064\u0126\065\u012a\001\001\000\002\001" +
"\001\000\002\001\001\000\002\001\001\000\002\001\001" +
"\000\002\001\001\000\002\001\001\000\004\066\u012d\001" +
"\001\000\002\001\001\000\010\042\051\046\u0130\067\u012f" +
"\001\001\000\002\001\001\000\002\001\001\000\004\042" +
"\u0132\001\001\000\004\066\u0133\001\001\000\002\001\001" +
"\000\002\001\001\000\006\042\051\046\u0136\001\001\000" +
"\002\001\001\000\012\042\u0128\063\u0138\064\u0126\065\u012a" +
"\001\001\000\004\265\u013a\001\001\000\012\042\u0128\063" +
"\u0140\064\u0126\065\u012a\001\001\000\002\001\001\000\002" +
"\001\001\000\016\042\051\046\u013d\060\u013e\061\u011e\062" +
"\u0122\247\u013f\001\001\000\002\001\001\000\002\001\001" +
"\000\002\001\001\000\004\265\u0141\001\001\000\002\001" +
"\001\000\002\001\001\000\016\042\051\046\u0120\057\u0144" +
"\060\u0121\061\u011e\062\u0122\001\001\000\002\001\001\000" +
"\006\036\u010d\237\u0146\001\001\000\002\001\001\000\010" +
"\040\u0149\042\051\046\u0148\001\001\000\002\001\001\000" +
"\002\001\001\000\014\004\u014c\007\023\011\024\026\u014b" +
"\240\025\001\001\000\002\001\001\000\002\001\001\000" +
"\020\004\u014c\007\023\011\024\026\u014f\034\u0151\230\u0152" +
"\240\025\001\001\000\002\001\001\000\002\001\001\000" +
"\002\001\001\000\002\001\001\000\002\001\001\000\002" +
"\001\001\000\006\036\u010d\237\u0146\001\001\000\020\004" +
"\u0157\007\023\011\024\032\u0156\034\u0158\230\u0152\240\025" +
"\001\001\000\002\001\001\000\002\001\001\000\002\001" +
"\001\000\014\004\u0157\007\023\011\024\032\u015a\240\025" +
"\001\001\000\002\001\001\000\002\001\001\000\002\001" +
"\001\000\012\006\u015b\022\u015f\042\013\273\u015e\001\001" +
"\000\002\001\001\000\002\001\001\000\012\006\u015b\022" +
"\u015f\042\013\273\u0161\001\001\000\002\001\001\000\040" +
"\020\052\041\u0163\042\051\046\057\132\062\133\072\134" +
"\064\135\066\136\055\161\047\205\046\206\061\207\071" +
"\210\070\225\065\001\001\000\002\001\001\000\002\001" +
"\001\000\002\001\001\000\010\017\u0168\042\u0164\275\u0167" +
"\001\001\000\002\001\001\000\002\001\001\000\010\017" +
"\u0168\042\u0164\275\u016a\001\001\000\002\001\001\000\014" +
"\020\u016c\205\046\206\061\207\071\210\070\001\001\000" +
"\002\001\001\000\046\005\u0184\016\u0175\070\u0170\072\u016f" +
"\107\u0176\110\u0185\111\u0179\112\u017f\113\u0173\114\u0181\115" +
"\u017b\122\u0171\123\u017c\177\u017d\202\u0180\207\071\210\073" +
"\236\u0178\001\001\000\002\001\001\000\002\001\001\000" +
"\004\264\u01c6\001\001\000\002\001\001\000\012\077\u01c2" +
"\117\144\207\071\210\143\001\001\000\002\001\001\000" +
"\012\077\u01bc\117\144\207\071\210\143\001\001\000\002" +
"\001\001\000\002\001\001\000\036\023\162\042\u01b4\051" +
"\167\076\u01b3\165\163\166\206\167\210\170\176\171\202" +
"\172\205\173\u01b2\174\177\175\203\216\211\001\001\000" +
"\056\023\162\042\254\044\u01ad\045\u01ab\051\167\071\u01ac" +
"\074\u01a6\075\u01a7\076\u01a8\121\u01a5\165\163\166\206\167" +
"\210\170\176\171\202\172\205\173\175\174\177\175\203" +
"\216\211\235\u01aa\246\u01a9\001\001\000\002\001\001\000" +
"\046\005\u01a2\016\u0175\070\u0170\072\u016f\107\u0176\110\u0185" +
"\111\u0179\112\u017f\113\u0173\114\u0181\115\u017b\122\u0171\123" +
"\u017c\177\u017d\202\u0180\207\071\210\073\236\u0178\001\001" +
"\000\002\001\001\000\002\001\001\000\002\001\001\000" +
"\012\077\u0196\117\144\207\071\210\143\001\001\000\002" +
"\001\001\000\002\001\001\000\002\001\001\000\006\023" +
"\u018b\042\u018a\001\001\000\046\005\u0187\016\u0175\070\u0170" +
"\072\u016f\107\u0176\110\u0185\111\u0179\112\u017f\113\u0173\114" +
"\u0181\115\u017b\122\u0171\123\u017c\177\u017d\202\u0180\207\071" +
"\210\073\236\u0178\001\001\000\002\001\001\000\002\001" +
"\001\000\002\001\001\000\002\001\001\000\012\077\u0189" +
"\117\144\207\071\210\143\001\001\000\002\001\001\000" +
"\002\001\001\000\002\001\001\000\014\077\u018e\116\u018d" +
"\117\144\207\071\210\143\001\001\000\004\245\u0190\001" +
"\001\000\002\001\001\000\002\001\001\000\014\077\u0193" +
"\117\144\120\u0192\207\071\210\143\001\001\000\002\001" +
"\001\000\002\001\001\000\002\001\001\000\044\016\u0175" +
"\070\u0195\072\u016f\107\u0176\110\u0185\111\u0179\112\u017f\113" +
"\u0173\114\u0181\115\u017b\122\u0171\123\u017c\177\u017d\202\u0180" +
"\207\071\210\073\236\u0178\001\001\000\002\001\001\000" +
"\002\001\001\000\020\020\312\124\u0198\125\u0199\205\046" +
"\206\061\207\071\210\070\001\001\000\004\263\u019d\001" +
"\001\000\002\001\001\000\044\016\u0175\070\u019b\072\u016f" +
"\107\u0176\110\u0185\111\u0179\112\u017f\113\u0173\114\u0181\115" +
"\u017b\122\u0171\123\u017c\177\u017d\202\u0180\207\071\210\073" +
"\236\u0178\001\001\000\002\001\001\000\020\020\312\124" +
"\u01a0\125\u0199\205\046\206\061\207\071\210\070\001\001" +
"\000\004\226\u019e\001\001\000\002\001\001\000\002\001" +
"\001\000\004\263\u01a1\001\001\000\002\001\001\000\002" +
"\001\001\000\002\001\001\000\014\016\u01b1\177\u017d\202" +
"\u0180\207\071\210\073\001\001\000\002\001\001\000\002" +
"\001\001\000\002\001\001\000\002\001\001\000\002\001" +
"\001\000\002\001\001\000\002\001\001\000\002\001\001" +
"\000\006\104\252\232\u01ae\001\001\000\002\001\001\000" +
"\012\077\u01b0\117\144\207\071\210\143\001\001\000\002" +
"\001\001\000\002\001\001\000\004\256\u01b6\001\001\000" +
"\002\001\001\000\002\001\001\000\036\023\162\042\u01b4" +
"\051\167\076\u01b3\165\163\166\206\167\210\170\176\171" +
"\202\172\205\173\u01b9\174\177\175\203\216\211\001\001" +
"\000\002\001\001\000\044\016\u0175\070\u01b8\072\u016f\107" +
"\u0176\110\u0185\111\u0179\112\u017f\113\u0173\114\u0181\115\u017b" +
"\122\u0171\123\u017c\177\u017d\202\u0180\207\071\210\073\236" +
"\u0178\001\001\000\002\001\001\000\004\256\u01ba\001\001" +
"\000\002\001\001\000\002\001\001\000\002\001\001\000" +
"\044\016\u0175\070\u01be\072\u016f\107\u0176\110\u0185\111\u0179" +
"\112\u017f\113\u0173\114\u0181\115\u017b\122\u0171\123\u017c\177" +
"\u017d\202\u0180\207\071\210\073\236\u0178\001\001\000\004" +
"\234\u01c0\001\001\000\044\016\u0175\070\u01c1\072\u016f\107" +
"\u0176\110\u0185\111\u0179\112\u017f\113\u0173\114\u0181\115\u017b" +
"\122\u0171\123\u017c\177\u017d\202\u0180\207\071\210\073\236" +
"\u0178\001\001\000\002\001\001\000\002\001\001\000\002" +
"\001\001\000\044\016\u0175\070\u01c4\072\u016f\107\u0176\110" +
"\u0185\111\u0179\112\u017f\113\u0173\114\u0181\115\u017b\122\u0171" +
"\123\u017c\177\u017d\202\u0180\207\071\210\073\236\u0178\001" +
"\001\000\002\001\001\000\044\016\u0175\070\u01c7\072\u016f" +
"\107\u0176\110\u0185\111\u0179\112\u017f\113\u0173\114\u0181\115" +
"\u017b\122\u0171\123\u017c\177\u017d\202\u0180\207\071\210\073" +
"\236\u0178\001\001\000\002\001\001\000\004\264\u01c8\001" +
"\001\000\002\001\001\000\004\260\u01cb\001\001\000\014" +
"\016\u01cd\177\u017d\202\u0180\207\071\210\073\001\001\000" +
"\002\001\001\000\002\001\001\000\004\260\u01ce\001\001" +
"\000\002\001\001\000\002\001\001" });
/** Access to <code>reduce_goto</code> table. */
public short[][] reduce_table() {return _reduce_table;}
/** Instance of action encapsulation class. */
protected CUP$parser$actions action_obj;
/** Action encapsulation object initializer. */
protected void init_actions()
{
action_obj = new CUP$parser$actions(this);
}
/** Invoke a user supplied parse action. */
public java_cup.runtime.Symbol do_action(
int act_num,
java_cup.runtime.lr_parser parser,
java.util.Stack stack,
int top)
throws java.lang.Exception
{
/* call code in generated class */
return action_obj.CUP$parser$do_action(act_num, parser, stack, top);
}
/** Indicates start state. */
public int start_state() {return 0;}
/** Indicates start production. */
public int start_production() {return 0;}
/** <code>EOF</code> Symbol index. */
public int EOF_sym() {return 0;}
/** <code>error</code> Symbol index. */
public int error_sym() {return 1;}
public void report_error(String message, Object info) {
StringBuffer m = new StringBuffer("Error");
if (info instanceof java_cup.runtime.Symbol) {
java_cup.runtime.Symbol s = ((java_cup.runtime.Symbol) info);
if (s.left >= 0) {
/* Add to the end of the StringBuffer error message
the line number of the error in the input. */
m.append(" in line "+(s.left+1));
/* Check if the column number in the input is greater
or equal to zero. */
if (s.right >= 0)
/* Add to the end of the StringBuffer error message
the column number of the error in the input. */
m.append(", column "+(s.right+1));
}
}
m.append(" : "+message);
System.err.println(m);
}
public void report_fatal_error(String message, Object info) {
report_error(message, info);
System.exit(1);
}
}
/** Cup generated class to encapsulate user supplied action code.*/
class CUP$parser$actions {
private final parser parser;
/** Constructor */
CUP$parser$actions(parser parser) {
this.parser = parser;
}
/** Method with the actual generated action code. */
public final java_cup.runtime.Symbol CUP$parser$do_action(
int CUP$parser$act_num,
java_cup.runtime.lr_parser CUP$parser$parser,
java.util.Stack CUP$parser$stack,
int CUP$parser$top)
throws java.lang.Exception
{
/* Symbol object for return from actions */
java_cup.runtime.Symbol CUP$parser$result;
/* select the action based on the action number */
switch (CUP$parser$act_num)
{
/*. . . . . . . . . . . . . . . . . . . .*/
case 293: // identifier ::= IDENTIFIER
{
Object RESULT =null;
int idleft = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).left;
int idright = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).right;
Object id = (Object)((java_cup.runtime.Symbol) CUP$parser$stack.peek()).value;
System.out.println("IDENTIFIER: "+id);
if(id != null) {
RESULT = id.toString();
}
CUP$parser$result = parser.getSymbolFactory().newSymbol("identifier",32, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 292: // string_character ::= STRINGCHARACTER
{
Object RESULT =null;
int strterleft = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).left;
int strterright = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).right;
Object strter = (Object)((java_cup.runtime.Symbol) CUP$parser$stack.peek()).value;
if(strter != null) {RESULT = strter.toString();}
CUP$parser$result = parser.getSymbolFactory().newSymbol("string_character",132, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 291: // sign_optional ::=
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("sign_optional",134, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 290: // sign_optional ::= sign
{
Object RESULT =null;
int sleft = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).left;
int sright = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).right;
Object s = (Object)((java_cup.runtime.Symbol) CUP$parser$stack.peek()).value;
if(s!= null) {RESULT = s;}
CUP$parser$result = parser.getSymbolFactory().newSymbol("sign_optional",134, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 289: // sign ::= MINUS
{
Object RESULT =null;
int minusleft = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).left;
int minusright = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).right;
Object minus = (Object)((java_cup.runtime.Symbol) CUP$parser$stack.peek()).value;
RESULT = new Objeto("minus", "arithmetic", "-" , (int) minus);
CUP$parser$result = parser.getSymbolFactory().newSymbol("sign",133, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 288: // sign ::= PLUS
{
Object RESULT =null;
int plusleft = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).left;
int plusright = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).right;
Object plus = (Object)((java_cup.runtime.Symbol) CUP$parser$stack.peek()).value;
RESULT = new Objeto("plus", "arithmetic", "+" , (int) plus);
CUP$parser$result = parser.getSymbolFactory().newSymbol("sign",133, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 287: // letter ::= LETTER
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("letter",138, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 286: // string ::= string_character
{
Object RESULT =null;
int strchleft = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).left;
int strchright = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).right;
Object strch = (Object)((java_cup.runtime.Symbol) CUP$parser$stack.peek()).value;
if(strch != null) {RESULT = strch.toString();}
CUP$parser$result = parser.getSymbolFactory().newSymbol("string",131, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 285: // multiplication_operator ::= AND
{
Object RESULT =null;
int andleft = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).left;
int andright = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).right;
Object and = (Object)((java_cup.runtime.Symbol) CUP$parser$stack.peek()).value;
RESULT = new Objeto("and", "boolean", "and" , (int) and);
CUP$parser$result = parser.getSymbolFactory().newSymbol("multiplication_operator",86, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 284: // multiplication_operator ::= MOD
{
Object RESULT =null;
int modleft = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).left;
int modright = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).right;
Object mod = (Object)((java_cup.runtime.Symbol) CUP$parser$stack.peek()).value;
RESULT = new Objeto("mod", "arithmetic", "mod" , (int) mod);
CUP$parser$result = parser.getSymbolFactory().newSymbol("multiplication_operator",86, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 283: // multiplication_operator ::= DIVEXTENSION
{
Object RESULT =null;
int divextleft = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).left;
int divextright = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).right;
Object divext = (Object)((java_cup.runtime.Symbol) CUP$parser$stack.peek()).value;
RESULT = new Objeto("divext", "arithmetic", "div" , (int) divext);
CUP$parser$result = parser.getSymbolFactory().newSymbol("multiplication_operator",86, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 282: // multiplication_operator ::= DIV
{
Object RESULT =null;
int divleft = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).left;
int divright = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).right;
Object div = (Object)((java_cup.runtime.Symbol) CUP$parser$stack.peek()).value;
RESULT = new Objeto("div", "arithmetic", "/" , (int) div);
CUP$parser$result = parser.getSymbolFactory().newSymbol("multiplication_operator",86, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 281: // multiplication_operator ::= TIMES
{
Object RESULT =null;
int timesleft = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).left;
int timesright = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).right;
Object times = (Object)((java_cup.runtime.Symbol) CUP$parser$stack.peek()).value;
RESULT = new Objeto("times", "arithmetic", "*" , (int) times);
CUP$parser$result = parser.getSymbolFactory().newSymbol("multiplication_operator",86, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 280: // addition_operator ::= OR
{
Object RESULT =null;
int orleft = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).left;
int orright = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).right;
Object or = (Object)((java_cup.runtime.Symbol) CUP$parser$stack.peek()).value;
RESULT = new Objeto("or", "boolean", "or" , (int) or);
CUP$parser$result = parser.getSymbolFactory().newSymbol("addition_operator",85, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 279: // addition_operator ::= MINUS
{
Object RESULT =null;
int minusleft = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).left;
int minusright = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).right;
Object minus = (Object)((java_cup.runtime.Symbol) CUP$parser$stack.peek()).value;
RESULT = new Objeto("minus", "arithmetic", "-" , (int) minus);
CUP$parser$result = parser.getSymbolFactory().newSymbol("addition_operator",85, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 278: // addition_operator ::= PLUS
{
Object RESULT =null;
int plusleft = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).left;
int plusright = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).right;
Object plus = (Object)((java_cup.runtime.Symbol) CUP$parser$stack.peek()).value;
RESULT = new Objeto("plus", "arithmetic", "+" , (int) plus);
CUP$parser$result = parser.getSymbolFactory().newSymbol("addition_operator",85, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 277: // relational_operator ::= IN
{
Object RESULT =null;
int inleft = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).left;
int inright = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).right;
Object in = (Object)((java_cup.runtime.Symbol) CUP$parser$stack.peek()).value;
RESULT = new Objeto("in", "boolean", "in" , (int) in);
CUP$parser$result = parser.getSymbolFactory().newSymbol("relational_operator",84, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 276: // relational_operator ::= GREATERTHENEQUALS
{
Object RESULT =null;
int gteleft = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).left;
int gteright = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).right;
Object gte = (Object)((java_cup.runtime.Symbol) CUP$parser$stack.peek()).value;
RESULT = new Objeto("greaterthenequals", "boolean", ">=" , (int) gte);
CUP$parser$result = parser.getSymbolFactory().newSymbol("relational_operator",84, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 275: // relational_operator ::= GREATERTHEN
{
Object RESULT =null;
int gtleft = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).left;
int gtright = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).right;
Object gt = (Object)((java_cup.runtime.Symbol) CUP$parser$stack.peek()).value;
RESULT = new Objeto("greaterthen", "boolean", ">" , (int) gt);
CUP$parser$result = parser.getSymbolFactory().newSymbol("relational_operator",84, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 274: // relational_operator ::= LESSTHENEQUALS
{
Object RESULT =null;
int lteleft = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).left;
int lteright = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).right;
Object lte = (Object)((java_cup.runtime.Symbol) CUP$parser$stack.peek()).value;
RESULT = new Objeto("lessthenequals", "boolean", "<=" , (int) lte);
CUP$parser$result = parser.getSymbolFactory().newSymbol("relational_operator",84, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 273: // relational_operator ::= LESSTHEN
{
Object RESULT =null;
int ltleft = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).left;
int ltright = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).right;
Object lt = (Object)((java_cup.runtime.Symbol) CUP$parser$stack.peek()).value;
RESULT = new Objeto("lessthen", "boolean", "<" , (int) lt);
CUP$parser$result = parser.getSymbolFactory().newSymbol("relational_operator",84, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 272: // relational_operator ::= DIFF
{
Object RESULT =null;
int dleft = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).left;
int dright = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).right;
Object d = (Object)((java_cup.runtime.Symbol) CUP$parser$stack.peek()).value;
RESULT = new Objeto("diff", "boolean", "<>" , (int) d);
CUP$parser$result = parser.getSymbolFactory().newSymbol("relational_operator",84, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 271: // relational_operator ::= EQUALS
{
Object RESULT =null;
int eleft = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).left;
int eright = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).right;
Object e = (Object)((java_cup.runtime.Symbol) CUP$parser$stack.peek()).value;
RESULT = new Objeto("equals", "boolean", "=" , (int) e);
CUP$parser$result = parser.getSymbolFactory().newSymbol("relational_operator",84, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 270: // constant_identifier_or_number ::= number
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("constant_identifier_or_number",162, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 269: // constant_identifier_or_number ::= constant_identifier
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("constant_identifier_or_number",162, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 268: // constant ::= string
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("constant",14, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 267: // constant ::= sign_optional constant_identifier_or_number
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("constant",14, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 266: // label ::= integer_number
{
Object RESULT =null;
int inleft = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).left;
int inright = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).right;
Object in = (Object)((java_cup.runtime.Symbol) CUP$parser$stack.peek()).value;
if(in!= null) {RESULT = in;}
CUP$parser$result = parser.getSymbolFactory().newSymbol("label",12, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 265: // digit_sequence ::= sign_optional unsigned_digit_sequence
{
Object RESULT =null;
int soleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).left;
int soright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).right;
Object so = (Object)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-1)).value;
int undigitleft = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).left;
int undigitright = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).right;
Object undigit = (Object)((java_cup.runtime.Symbol) CUP$parser$stack.peek()).value;
if(undigit != null) {
if(so != null){
RESULT = so.toString() + undigit.toString();
} else {
RESULT = undigit.toString();
}
}
CUP$parser$result = parser.getSymbolFactory().newSymbol("digit_sequence",128, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 264: // unsigned_digit_sequence_optional ::=
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("unsigned_digit_sequence_optional",130, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 263: // unsigned_digit_sequence_optional ::= unsigned_digit_sequence
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("unsigned_digit_sequence_optional",130, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 262: // unsigned_digit_sequence ::= DIGITSEQUENCE
{
Object RESULT =null;
int digitleft = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).left;
int digitright = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).right;
Object digit = (Object)((java_cup.runtime.Symbol) CUP$parser$stack.peek()).value;
if(digit!= null) {RESULT = digit;}
CUP$parser$result = parser.getSymbolFactory().newSymbol("unsigned_digit_sequence",129, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 261: // scale_factor_optional ::=
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("scale_factor_optional",143, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 260: // scale_factor_optional ::= scale_factor
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("scale_factor_optional",143, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 259: // scale_factor ::= SCALEFACTOR digit_sequence
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("scale_factor",141, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 258: // real_number ::= digit_sequence scale_factor
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("real_number",126, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 257: // real_number ::= digit_sequence DOT unsigned_digit_sequence_optional scale_factor_optional
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("real_number",126, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-3)), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 256: // integer_number ::= digit_sequence
{
Object RESULT =null;
int dsleft = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).left;
int dsright = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).right;
Object ds = (Object)((java_cup.runtime.Symbol) CUP$parser$stack.peek()).value;
if(ds!= null) {RESULT = ds;}
CUP$parser$result = parser.getSymbolFactory().newSymbol("integer_number",125, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 255: // number ::= real_number
{
Object RESULT =null;
int rnleft = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).left;
int rnright = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).right;
Object rn = (Object)((java_cup.runtime.Symbol) CUP$parser$stack.peek()).value;
if(rn!= null) {RESULT = "real";}
CUP$parser$result = parser.getSymbolFactory().newSymbol("number",124, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 254: // number ::= integer_number
{
Object RESULT =null;
int inleft = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).left;
int inright = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).right;
Object in = (Object)((java_cup.runtime.Symbol) CUP$parser$stack.peek()).value;
if(in!= null) {RESULT = "integer";}
CUP$parser$result = parser.getSymbolFactory().newSymbol("number",124, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 253: // comma_expression ::=
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("comma_expression",169, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 252: // comma_expression ::= COMMA expression comma_expression
{
Object RESULT =null;
int exleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).left;
int exright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).right;
Object ex = (Object)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-1)).value;
if(ex != null) {System.out.println("expression: " + ex);
SemanticManager.getInstance().lineError = (int) ex;}
CUP$parser$result = parser.getSymbolFactory().newSymbol("comma_expression",169, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 251: // comma_identifier ::=
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("comma_identifier",168, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 250: // comma_identifier ::= COMMA identifier comma_identifier
{
Object RESULT =null;
int idleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).left;
int idright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).right;
Object id = (Object)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-1)).value;
if(id != null) {System.out.println("identifier: " + id);
SemanticManager.getInstance().addIdentifier(id.toString());}
CUP$parser$result = parser.getSymbolFactory().newSymbol("comma_identifier",168, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 249: // comma_variable ::=
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("comma_variable",167, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 248: // comma_variable ::= COMMA variable comma_variable
{
Object RESULT =null;
int varleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).left;
int varright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).right;
Object var = (Object)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-1)).value;
if(var != null) {System.out.println("variable: " + var);
SemanticManager.getInstance().addIdentifier(var.toString());
SemanticManager.getInstance().addVariable(var.toString(), ((Objeto) var).getTipo(), ((Objeto) var).getValor().toString());}
CUP$parser$result = parser.getSymbolFactory().newSymbol("comma_variable",167, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 247: // expression_list ::= expression comma_expression
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("expression_list",62, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 246: // identifier_list ::= identifier comma_identifier
{
Object RESULT =null;
int idleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).left;
int idright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).right;
Object id = (Object)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-1)).value;
if(id != null){
System.out.println("identifier: " + id);
SemanticManager.getInstance().addIdentifier(id.toString());
}
CUP$parser$result = parser.getSymbolFactory().newSymbol("identifier_list",4, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 245: // bound_identifier ::= identifier
{
Object RESULT =null;
int idleft = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).left;
int idright = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).right;
Object id = (Object)((java_cup.runtime.Symbol) CUP$parser$stack.peek()).value;
System.out.println("bound variable: " + id); if(id != null) {RESULT = new Objeto(id.toString(), id.toString(), id , -1);}
CUP$parser$result = parser.getSymbolFactory().newSymbol("bound_identifier",38, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 244: // function_identifier ::= identifier
{
Object RESULT =null;
int idleft = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).left;
int idright = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).right;
Object id = (Object)((java_cup.runtime.Symbol) CUP$parser$stack.peek()).value;
System.out.println("function variable: " + id); if(id != null) {RESULT = new Objeto(id.toString(), id.toString(), id , -1);}
CUP$parser$result = parser.getSymbolFactory().newSymbol("function_identifier",35, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 243: // procedure_identifier ::= identifier
{
Object RESULT =null;
int idleft = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).left;
int idright = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).right;
Object id = (Object)((java_cup.runtime.Symbol) CUP$parser$stack.peek()).value;
System.out.println("procedure variable: " + id); if(id != null) {RESULT = new Objeto(id.toString(), id.toString(), id , -1);}
CUP$parser$result = parser.getSymbolFactory().newSymbol("procedure_identifier",34, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 242: // type_identifier ::= identifier
{
Object RESULT =null;
int idleft = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).left;
int idright = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).right;
Object id = (Object)((java_cup.runtime.Symbol) CUP$parser$stack.peek()).value;
System.out.println("type variable: " + id); if(id != null) {RESULT = new Objeto(id.toString(), id.toString(), id , 0);}
CUP$parser$result = parser.getSymbolFactory().newSymbol("type_identifier",36, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 241: // variable_identifier ::= identifier
{
Object RESULT =null;
int idleft = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).left;
int idright = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).right;
Object id = (Object)((java_cup.runtime.Symbol) CUP$parser$stack.peek()).value;
System.out.println("variable identifier: " + id); if(id != null) {RESULT = new Objeto(id.toString(), id.toString(), id , -1);}
CUP$parser$result = parser.getSymbolFactory().newSymbol("variable_identifier",17, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 240: // constant_identifier ::= identifier
{
Object RESULT =null;
int idleft = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).left;
int idright = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).right;
Object id = (Object)((java_cup.runtime.Symbol) CUP$parser$stack.peek()).value;
System.out.println("constant variable: " + id); if(id != null) {RESULT = new Objeto(id.toString(), id.toString(), id , -1);}
CUP$parser$result = parser.getSymbolFactory().newSymbol("constant_identifier",37, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 239: // field_identifier ::= identifier
{
Object RESULT =null;
int idleft = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).left;
int idright = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).right;
Object id = (Object)((java_cup.runtime.Symbol) CUP$parser$stack.peek()).value;
System.out.println("field variable: " + id); if(id != null) {RESULT = new Objeto(id.toString(), id.toString(), id , -1);}
CUP$parser$result = parser.getSymbolFactory().newSymbol("field_identifier",39, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 238: // array_variable ::= variable
{
Object RESULT =null;
int varleft = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).left;
int varright = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).right;
Object var = (Object)((java_cup.runtime.Symbol) CUP$parser$stack.peek()).value;
System.out.println("array variable: " + var); if(var != null) {RESULT = new Objeto(var.toString(), var.toString(), var , -1);}
CUP$parser$result = parser.getSymbolFactory().newSymbol("array_variable",120, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 237: // actual_variable ::= variable
{
Object RESULT =null;
int varleft = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).left;
int varright = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).right;
Object var = (Object)((java_cup.runtime.Symbol) CUP$parser$stack.peek()).value;
System.out.println("actual variable: " + var); if(var != null) {RESULT = new Objeto(var.toString(), var.toString(), var , -1);}
CUP$parser$result = parser.getSymbolFactory().newSymbol("actual_variable",63, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 236: // pointer_variable ::= variable
{
Object RESULT =null;
int varleft = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).left;
int varright = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).right;
Object var = (Object)((java_cup.runtime.Symbol) CUP$parser$stack.peek()).value;
System.out.println("pointer variable: " + var); if(var != null) {RESULT = new Objeto(var.toString(), var.toString(), var , -1);}
CUP$parser$result = parser.getSymbolFactory().newSymbol("pointer_variable",123, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 235: // record_variable ::= variable
{
Object RESULT =null;
int varleft = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).left;
int varright = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).right;
Object var = (Object)((java_cup.runtime.Symbol) CUP$parser$stack.peek()).value;
System.out.println("record variable: " + var); if(var != null) {RESULT = new Objeto(var.toString(), var.toString(), var , -1);}
CUP$parser$result = parser.getSymbolFactory().newSymbol("record_variable",121, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 234: // referenced_variable ::= pointer_variable NT$1 CIRCUNFLEX
{
Object RESULT =null;
// propagate RESULT from NT$1
RESULT = (Object) ((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-1)).value;
int varleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)).left;
int varright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)).right;
Object var = (Object)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-2)).value;
CUP$parser$result = parser.getSymbolFactory().newSymbol("referenced_variable",118, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 233: // NT$1 ::=
{
Object RESULT =null;
int varleft = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).left;
int varright = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).right;
Object var = (Object)((java_cup.runtime.Symbol) CUP$parser$stack.peek()).value;
System.out.println("referenced variable: " + var); if(var != null) {RESULT = new Objeto(var.toString(), var.toString(), var , -1);}
CUP$parser$result = parser.getSymbolFactory().newSymbol("NT$1",189, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 232: // file_variable ::= variable
{
Object RESULT =null;
int varleft = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).left;
int varright = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).right;
Object var = (Object)((java_cup.runtime.Symbol) CUP$parser$stack.peek()).value;
System.out.println("file variable: " + var); if(var != null) {RESULT = new Objeto(var.toString(), var.toString(), var , -1);}
CUP$parser$result = parser.getSymbolFactory().newSymbol("file_variable",122, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 231: // fraction_length ::= expression
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("fraction_length",139, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 230: // field_width ::= expression
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("field_width",107, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 229: // colon_fraction_length ::=
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("colon_fraction_length",144, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 228: // colon_fraction_length ::= COLON fraction_length
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("colon_fraction_length",144, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 227: // semi_colon_field_width ::=
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("semi_colon_field_width",145, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 226: // semi_colon_field_width ::= SEMICOLON field_width colon_fraction_length
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("semi_colon_field_width",145, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 225: // output_value ::= expression semi_colon_field_width
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("output_value",109, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 224: // comma_output_value ::=
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("comma_output_value",170, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 223: // comma_output_value ::= COMMA output_value comma_output_value
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("comma_output_value",170, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 222: // variant ::= case_label_list COLON LPARENT field_list RPARENT
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("variant",108, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-4)), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 221: // identifier_colon ::=
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("identifier_colon",146, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 220: // identifier_colon ::= semi_colon_field_width
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("identifier_colon",146, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 219: // tag_field ::= identifier_colon
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("tag_field",106, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 218: // semi_colon_variant ::=
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("semi_colon_variant",176, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 217: // semi_colon_variant ::= SEMICOLON variant semi_colon_variant
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("semi_colon_variant",176, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 216: // variant_part ::= CASE tag_field type_identifier OF variant semi_colon_variant
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("variant_part",103, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-5)), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 215: // record_section ::= identifier_list COLON type
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("record_section",113, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 214: // semi_colon_record_section ::=
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("semi_colon_record_section",175, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 213: // semi_colon_record_section ::= SEMICOLON record_section semi_colon_record_section
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("semi_colon_record_section",175, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 212: // fixed_part ::= record_section semi_colon_record_section
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("fixed_part",102, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 211: // semi_colon_variant_part ::=
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("semi_colon_variant_part",149, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 210: // semi_colon_variant_part ::= SEMICOLON variant_part
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("semi_colon_variant_part",149, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 209: // semi_colon_optional ::=
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("semi_colon_optional",148, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 208: // semi_colon_optional ::= SEMICOLON
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("semi_colon_optional",148, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 207: // field_list_aux ::= variant_part
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("field_list_aux",105, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 206: // field_list_aux ::= fixed_part semi_colon_variant_part
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("field_list_aux",105, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 205: // field_list ::=
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("field_list",104, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 204: // field_list ::= field_list_aux semi_colon_optional
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("field_list",104, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 203: // pointer_type ::= CIRCUNFLEX type_identifier
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("pointer_type",90, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 202: // file_component_type ::= type
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("file_component_type",101, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 201: // file_type ::= FILE OF file_component_type
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("file_type",97, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 200: // base_type ::= type
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("base_type",100, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 199: // set_type ::= SET OF base_type
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("set_type",96, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 198: // record_type ::= RECORD field_list END
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("record_type",95, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 197: // element_type ::= type
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("element_type",99, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 196: // index_type ::= simple_type
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("index_type",98, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 195: // colon_index_type ::=
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("colon_index_type",181, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 194: // colon_index_type ::= COLON index_type colon_index_type
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("colon_index_type",181, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 193: // array_type ::= ARRAY LBRACKET index_type colon_index_type RBRACKET OF element_type
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("array_type",94, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-6)), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 192: // unpacked_structured_type ::= file_type
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("unpacked_structured_type",93, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 191: // unpacked_structured_type ::= set_type
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("unpacked_structured_type",93, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 190: // unpacked_structured_type ::= record_type
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("unpacked_structured_type",93, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 189: // unpacked_structured_type ::= array_type
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("unpacked_structured_type",93, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 188: // packed_optional ::=
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("packed_optional",147, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 187: // packed_optional ::= PACKED
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("packed_optional",147, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 186: // structured_type ::= packed_optional unpacked_structured_type
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("structured_type",89, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 185: // upper_bound ::= constant
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("upper_bound",112, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 184: // lower_bound ::= constant
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("lower_bound",111, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 183: // subrange_type ::= lower_bound DOUBLEDOT upper_bound
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("subrange_type",91, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 182: // enumerated_type ::= LPARENT identifier_list RPARENT
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("enumerated_type",92, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 181: // simple_type ::= enumerated_type
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("simple_type",88, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 180: // simple_type ::= subrange_type
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("simple_type",88, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 179: // type ::= type_identifier
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("type",31, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 178: // type ::= pointer_type
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("type",31, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 177: // type ::= structured_type
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("type",31, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 176: // type ::= simple_type
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("type",31, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 175: // file_buffer ::= file_variable CIRCUNFLEX
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("file_buffer",140, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 174: // actual_parameter_list_optional ::=
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("actual_parameter_list_optional",152, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 173: // actual_parameter_list_optional ::= actual_parameter_list
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("actual_parameter_list_optional",152, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 172: // function_designator ::= function_identifier actual_parameter_list_optional
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("function_designator",114, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 171: // element_list ::=
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("element_list",29, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 170: // element_list ::= expression comma_expression
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("element_list",29, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 169: // set ::= LBRACKET element_list RBRACKET
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("set",87, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 168: // field_designator ::= record_variable DOT field_identifier
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("field_designator",115, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 167: // indexed_variable ::= array_variable LBRACKET expression_list RBRACKET
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("indexed_variable",119, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-3)), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 166: // component_variable ::= file_buffer
{
Object RESULT =null;
int fbleft = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).left;
int fbright = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).right;
Object fb = (Object)((java_cup.runtime.Symbol) CUP$parser$stack.peek()).value;
if(fb != null) {RESULT = fb;}
CUP$parser$result = parser.getSymbolFactory().newSymbol("component_variable",117, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 165: // component_variable ::= field_designator
{
Object RESULT =null;
int fdleft = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).left;
int fdright = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).right;
Object fd = (Object)((java_cup.runtime.Symbol) CUP$parser$stack.peek()).value;
if(fd != null) {RESULT = fd;}
CUP$parser$result = parser.getSymbolFactory().newSymbol("component_variable",117, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 164: // component_variable ::= indexed_variable
{
Object RESULT =null;
int ivleft = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).left;
int ivright = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).right;
Object iv = (Object)((java_cup.runtime.Symbol) CUP$parser$stack.peek()).value;
if(iv != null) {RESULT = iv;}
CUP$parser$result = parser.getSymbolFactory().newSymbol("component_variable",117, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 163: // entire_variable ::= field_identifier
{
Object RESULT =null;
int fileft = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).left;
int firight = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).right;
Object fi = (Object)((java_cup.runtime.Symbol) CUP$parser$stack.peek()).value;
if(fi != null) {RESULT = fi;}
CUP$parser$result = parser.getSymbolFactory().newSymbol("entire_variable",116, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 162: // entire_variable ::= variable_identifier
{
Object RESULT =null;
int vileft = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).left;
int viright = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).right;
Object vi = (Object)((java_cup.runtime.Symbol) CUP$parser$stack.peek()).value;
if(vi != null) {RESULT = vi;}
CUP$parser$result = parser.getSymbolFactory().newSymbol("entire_variable",116, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 161: // variable ::= referenced_variable
{
Object RESULT =null;
int rvleft = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).left;
int rvright = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).right;
Object rv = (Object)((java_cup.runtime.Symbol) CUP$parser$stack.peek()).value;
if(rv != null) {System.out.println("referenced variable: " + rv); RESULT = rv;}
CUP$parser$result = parser.getSymbolFactory().newSymbol("variable",60, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 160: // variable ::= component_variable
{
Object RESULT =null;
int cvleft = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).left;
int cvright = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).right;
Object cv = (Object)((java_cup.runtime.Symbol) CUP$parser$stack.peek()).value;
if(cv != null) {System.out.println("component variable : " + cv); RESULT = cv;}
CUP$parser$result = parser.getSymbolFactory().newSymbol("variable",60, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 159: // variable ::= entire_variable
{
Object RESULT =null;
int evleft = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).left;
int evright = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).right;
Object ev = (Object)((java_cup.runtime.Symbol) CUP$parser$stack.peek()).value;
if(ev != null) {System.out.println("entire variable: " + ev); RESULT = ev;}
CUP$parser$result = parser.getSymbolFactory().newSymbol("variable",60, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 158: // factor ::= NOT NT$0 factor
{
Object RESULT =null;
// propagate RESULT from NT$0
RESULT = (Object) ((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-1)).value;
int notleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)).left;
int notright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)).right;
Object not = (Object)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-2)).value;
CUP$parser$result = parser.getSymbolFactory().newSymbol("factor",136, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 157: // NT$0 ::=
{
Object RESULT =null;
int notleft = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).left;
int notright = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).right;
Object not = (Object)((java_cup.runtime.Symbol) CUP$parser$stack.peek()).value;
RESULT = new Objeto("not", "boolean", "not" , (int) not);
CUP$parser$result = parser.getSymbolFactory().newSymbol("NT$0",188, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 156: // factor ::= LPARENT expression RPARENT
{
Object RESULT =null;
int expleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).left;
int expright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).right;
Object exp = (Object)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-1)).value;
if(exp != null) { RESULT = exp; }
CUP$parser$result = parser.getSymbolFactory().newSymbol("factor",136, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 155: // factor ::= function_designator
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("factor",136, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 154: // factor ::= bound_identifier
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("factor",136, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 153: // factor ::= constant_identifier
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("factor",136, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 152: // factor ::= NIL
{
Object RESULT =null;
RESULT = "nil";
CUP$parser$result = parser.getSymbolFactory().newSymbol("factor",136, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 151: // factor ::= set
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("factor",136, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 150: // factor ::= string
{
Object RESULT =null;
int strleft = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).left;
int strright = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).right;
Object str = (Object)((java_cup.runtime.Symbol) CUP$parser$stack.peek()).value;
if(str != null) { RESULT = "string"; }
CUP$parser$result = parser.getSymbolFactory().newSymbol("factor",136, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 149: // factor ::= number
{
Object RESULT =null;
int nleft = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).left;
int nright = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).right;
Object n = (Object)((java_cup.runtime.Symbol) CUP$parser$stack.peek()).value;
if(n != null) { RESULT = n;}
CUP$parser$result = parser.getSymbolFactory().newSymbol("factor",136, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 148: // factor ::= variable
{
Object RESULT =null;
int varileft = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).left;
int variright = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).right;
Object vari = (Object)((java_cup.runtime.Symbol) CUP$parser$stack.peek()).value;
if(vari != null) { RESULT = vari;}
CUP$parser$result = parser.getSymbolFactory().newSymbol("factor",136, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 147: // multiplication_operator_factor ::=
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("multiplication_operator_factor",182, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 146: // multiplication_operator_factor ::= multiplication_operator factor multiplication_operator_factor
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("multiplication_operator_factor",182, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 145: // term ::= factor multiplication_operator_factor
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("term",135, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 144: // addition_operator_term ::=
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("addition_operator_term",183, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 143: // addition_operator_term ::= addition_operator term addition_operator_term
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("addition_operator_term",183, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 142: // simple_expression ::= sign_optional term addition_operator_term
{
Object RESULT =null;
int terleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).left;
int terright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).right;
Object ter = (Object)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-1)).value;
CUP$parser$result = parser.getSymbolFactory().newSymbol("simple_expression",77, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 141: // relational_operator_simple_expression ::=
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("relational_operator_simple_expression",153, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 140: // relational_operator_simple_expression ::= relational_operator simple_expression
{
Object RESULT =null;
int relopleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).left;
int relopright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).right;
Object relop = (Object)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-1)).value;
int sexpleft = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).left;
int sexpright = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).right;
Object sexp = (Object)((java_cup.runtime.Symbol) CUP$parser$stack.peek()).value;
System.out.println("RELOP: " + ((Objeto) relop).getId());
if(relop != null){
SemanticManager.getInstance().lineError = ((Objeto) relop).getLineError();
} if(sexp != null){
SemanticManager.getInstance().checkBooleanExpression(sexp.toString());
}
CUP$parser$result = parser.getSymbolFactory().newSymbol("relational_operator_simple_expression",153, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 139: // expression ::= simple_expression relational_operator_simple_expression
{
Object RESULT =null;
int sexpleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).left;
int sexpright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).right;
Object sexp = (Object)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-1)).value;
int relopseleft = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).left;
int relopseright = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).right;
Object relopse = (Object)((java_cup.runtime.Symbol) CUP$parser$stack.peek()).value;
if(sexp != null){
RESULT = sexp;
}
CUP$parser$result = parser.getSymbolFactory().newSymbol("expression",61, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 138: // actual_function ::= function_identifier
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("actual_function",68, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 137: // actual_procedure ::= procedure_identifier
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("actual_procedure",67, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 136: // actual_value ::= expression
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("actual_value",64, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 135: // actual_parameter ::= actual_function
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("actual_parameter",65, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 134: // actual_parameter ::= actual_procedure
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("actual_parameter",65, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 133: // actual_parameter ::= actual_variable
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("actual_parameter",65, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 132: // actual_parameter ::= actual_value
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("actual_parameter",65, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 131: // comma_actual_parameter ::=
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("comma_actual_parameter",173, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 130: // comma_actual_parameter ::= COMMA actual_parameter comma_actual_parameter
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("comma_actual_parameter",173, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 129: // actual_parameter_list ::= LPARENT actual_parameter comma_actual_parameter RPARENT
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("actual_parameter_list",66, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-3)), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 128: // comma_record_variable ::=
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("comma_record_variable",172, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 127: // comma_record_variable ::= COMMA record_variable comma_record_variable
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("comma_record_variable",172, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 126: // with_statement ::= WITH record_variable comma_record_variable DO statement
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("with_statement",72, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-4)), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 125: // comma_constant ::=
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("comma_constant",171, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 124: // comma_constant ::= COMMA constant comma_constant
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("comma_constant",171, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 123: // case_label_list ::= constant comma_constant
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("case_label_list",83, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 122: // case_limb ::= case_label_list COLON statement
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("case_limb",82, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 121: // semi_colon_case_limb ::=
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("semi_colon_case_limb",177, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 120: // semi_colon_case_limb ::= SEMICOLON case_limb semi_colon_case_limb
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("semi_colon_case_limb",177, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 119: // case_statement ::= CASE expression OF case_limb semi_colon_case_limb semi_colon_optional END
{
Object RESULT =null;
int casestmleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-6)).left;
int casestmright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-6)).right;
Object casestm = (Object)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-6)).value;
int expleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-5)).left;
int expright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-5)).right;
Object exp = (Object)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-5)).value;
System.out.println("CASE: " + exp);
if(casestm != null){
SemanticManager.getInstance().lineError = ((int) casestm);
} if(exp != null) {
SemanticManager.getInstance().checkIfThenElseExpression(exp.toString());
RESULT = exp;
}
CUP$parser$result = parser.getSymbolFactory().newSymbol("case_statement",81, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-6)), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 118: // else_statement_optional ::= ELSE statement
{
Object RESULT =null;
int elsestmleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).left;
int elsestmright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).right;
Object elsestm = (Object)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-1)).value;
int stmleft = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).left;
int stmright = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).right;
Object stm = (Object)((java_cup.runtime.Symbol) CUP$parser$stack.peek()).value;
System.out.println("ELSE: " + stm);
if(elsestm != null){
SemanticManager.getInstance().lineError = ((int) elsestm);
} if(stm != null){
SemanticManager.getInstance().checkIfThenElseExpression(stm.toString());
RESULT = stm;
}
CUP$parser$result = parser.getSymbolFactory().newSymbol("else_statement_optional",154, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 117: // else_statement_optional ::=
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("else_statement_optional",154, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 116: // if_statement ::= IF expression THEN statement else_statement_optional
{
Object RESULT =null;
int ifstmleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-4)).left;
int ifstmright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-4)).right;
Object ifstm = (Object)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-4)).value;
int expleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-3)).left;
int expright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-3)).right;
Object exp = (Object)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-3)).value;
System.out.println("IF: " + exp);
if(ifstm != null){
SemanticManager.getInstance().lineError = ((int) ifstm);
} if(exp != null) {
SemanticManager.getInstance().checkIfThenElseExpression(exp.toString());
RESULT = exp;
}
CUP$parser$result = parser.getSymbolFactory().newSymbol("if_statement",80, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-4)), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 115: // conditional_statement ::= case_statement
{
Object RESULT =null;
int casestmleft = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).left;
int casestmright = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).right;
Object casestm = (Object)((java_cup.runtime.Symbol) CUP$parser$stack.peek()).value;
if(casestm != null) {RESULT = casestm;}
CUP$parser$result = parser.getSymbolFactory().newSymbol("conditional_statement",71, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 114: // conditional_statement ::= if_statement
{
Object RESULT =null;
int ifstmleft = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).left;
int ifstmright = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).right;
Object ifstm = (Object)((java_cup.runtime.Symbol) CUP$parser$stack.peek()).value;
if(ifstm != null) {RESULT = ifstm;}
CUP$parser$result = parser.getSymbolFactory().newSymbol("conditional_statement",71, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 113: // final_expression ::= expression
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("final_expression",78, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 112: // initial_expression ::= expression
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("initial_expression",76, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 111: // to_or_downto ::= DOWNTO
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("to_or_downto",163, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 110: // to_or_downto ::= TO
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("to_or_downto",163, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 109: // for_statement ::= FOR variable_identifier ASSIGMENT initial_expression to_or_downto final_expression DO statement
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("for_statement",75, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-7)), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 108: // repeat_statement ::= REPEAT statement_sequence UNTIL expression
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("repeat_statement",74, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-3)), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 107: // while_statement ::= WHILE expression DO statement
{
Object RESULT =null;
int wleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-3)).left;
int wright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-3)).right;
Object w = (Object)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-3)).value;
int expwleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)).left;
int expwright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)).right;
Object expw = (Object)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-2)).value;
System.out.println("WHILE: " + expw);
if(w != null){
SemanticManager.getInstance().lineError = ((int) w);
} if(expw != null){
SemanticManager.getInstance().checkWhileExpression(expw.toString());
}
CUP$parser$result = parser.getSymbolFactory().newSymbol("while_statement",73, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-3)), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 106: // repetitive_statement ::= for_statement
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("repetitive_statement",70, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 105: // repetitive_statement ::= repeat_statement
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("repetitive_statement",70, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 104: // repetitive_statement ::= while_statement
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("repetitive_statement",70, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 103: // compound_statement ::= BEGIN statement_sequence END
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("compound_statement",69, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 102: // structured_statement ::= with_statement
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("structured_statement",56, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 101: // structured_statement ::= conditional_statement
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("structured_statement",56, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 100: // structured_statement ::= repetitive_statement
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("structured_statement",56, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 99: // structured_statement ::= compound_statement
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("structured_statement",56, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 98: // goto_statement ::= GOTO label
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("goto_statement",59, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 97: // procedure_statement ::= procedure_identifier actual_parameter_list_optional
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("procedure_statement",58, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 96: // variable_or_function_identifier ::= function_identifier
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("variable_or_function_identifier",164, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 95: // variable_or_function_identifier ::= variable
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("variable_or_function_identifier",164, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 94: // assignment_statement ::= variable_or_function_identifier ASSIGMENT expression
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("assignment_statement",79, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 93: // simple_statement_optional ::= goto_statement
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("simple_statement_optional",155, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 92: // simple_statement_optional ::= procedure_statement
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("simple_statement_optional",155, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 91: // simple_statement_optional ::= assignment_statement
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("simple_statement_optional",155, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 90: // simple_statement ::=
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("simple_statement",55, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 89: // simple_statement ::= simple_statement_optional
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("simple_statement",55, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 88: // label_colon ::=
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("label_colon",156, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 87: // label_colon ::= label COLON
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("label_colon",156, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 86: // statement ::= structured_statement
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("statement",54, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 85: // statement ::= label_colon simple_statement
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("statement",54, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 84: // semi_colon_statement ::=
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("semi_colon_statement",178, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 83: // semi_colon_statement ::= SEMICOLON statement semi_colon_statement
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("semi_colon_statement",178, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 82: // statement_sequence ::= statement semi_colon_statement
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("statement_sequence",3, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 81: // ordinal_type_identifier ::= type_identifier
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("ordinal_type_identifier",53, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 80: // ordinal_type_identifier_optional ::=
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("ordinal_type_identifier_optional",52, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 79: // ordinal_type_identifier_optional ::= COLON ordinal_type_identifier
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("ordinal_type_identifier_optional",52, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 78: // bound_digit_sequence_production ::= DIGITSEQUENCE DOUBLEDOT DIGITSEQUENCE ordinal_type_identifier_optional
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("bound_digit_sequence_production",51, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-3)), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 77: // bound_identifier_production ::= identifier DOUBLEDOT identifier ordinal_type_identifier_optional
{
Object RESULT =null;
int idleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-3)).left;
int idright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-3)).right;
Object id = (Object)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-3)).value;
int id1left = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).left;
int id1right = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).right;
Object id1 = (Object)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-1)).value;
if(id != null && id1 !=null){
System.out.println("identifier:id: " + id);
System.out.println("identifier:id: " + id1);
SemanticManager.getInstance().addIdentifier(id.toString());
SemanticManager.getInstance().addIdentifier(id1.toString());
}
CUP$parser$result = parser.getSymbolFactory().newSymbol("bound_identifier_production",50, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-3)), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 76: // bound_specification ::= bound_digit_sequence_production
{
Object RESULT =null;
int bdsleft = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).left;
int bdsright = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).right;
Object bds = (Object)((java_cup.runtime.Symbol) CUP$parser$stack.peek()).value;
if(bds != null) { RESULT = bds;}
CUP$parser$result = parser.getSymbolFactory().newSymbol("bound_specification",49, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 75: // bound_specification ::= bound_identifier_production
{
Object RESULT =null;
int bipleft = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).left;
int bipright = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).right;
Object bip = (Object)((java_cup.runtime.Symbol) CUP$parser$stack.peek()).value;
if(bip != null) { RESULT = bip;}
CUP$parser$result = parser.getSymbolFactory().newSymbol("bound_specification",49, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 74: // type_identifier_or_conformant_array_schema ::= conformant_array_schema
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("type_identifier_or_conformant_array_schema",165, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 73: // type_identifier_or_conformant_array_schema ::= type_identifier
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("type_identifier_or_conformant_array_schema",165, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 72: // semi_colon_bound_specification ::=
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("semi_colon_bound_specification",179, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 71: // semi_colon_bound_specification ::= SEMICOLON bound_specification semi_colon_bound_specification
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("semi_colon_bound_specification",179, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 70: // unpacked_conformant_array_schema ::= ARRAY LBRACKET bound_specification semi_colon_bound_specification RBRACKET OF type_identifier_or_conformant_array_schema
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("unpacked_conformant_array_schema",48, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-6)), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 69: // packed_conformant_array_schema ::= PACKED ARRAY LBRACKET bound_specification RBRACKET OF type_identifier
{
Object RESULT =null;
int pcleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-6)).left;
int pcright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-6)).right;
Object pc = (Object)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-6)).value;
int bsleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-3)).left;
int bsright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-3)).right;
Object bs = (Object)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-3)).value;
int rtleft = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).left;
int rtright = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).right;
Object rt = (Object)((java_cup.runtime.Symbol) CUP$parser$stack.peek()).value;
if(pc != null){
SemanticManager.getInstance().lineError = ((int) pc);
} if(rt != null){
System.out.println("type identifier: " + rt);
RESULT = rt;
} if(bs != null){
System.out.println("bound specification: " + bs);
}
CUP$parser$result = parser.getSymbolFactory().newSymbol("packed_conformant_array_schema",47, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-6)), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 68: // conformant_array_schema ::= unpacked_conformant_array_schema
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("conformant_array_schema",46, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 67: // conformant_array_schema ::= packed_conformant_array_schema
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("conformant_array_schema",46, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 66: // parameter_type ::= conformant_array_schema
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("parameter_type",45, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 65: // parameter_type ::= type_identifier
{
Object RESULT =null;
int tileft = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).left;
int tiright = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).right;
Object ti = (Object)((java_cup.runtime.Symbol) CUP$parser$stack.peek()).value;
if(ti != null){
System.out.println("type identifier: " + ti);
RESULT = ti;
}
CUP$parser$result = parser.getSymbolFactory().newSymbol("parameter_type",45, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 64: // function_parameter_section ::= function_heading
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("function_parameter_section",44, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 63: // procedure_parameter_section ::= procedure_heading
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("procedure_parameter_section",43, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 62: // variable_parameter_section ::= VAR identifier_list COLON parameter_type
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("variable_parameter_section",42, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-3)), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 61: // value_parameter_section ::= identifier_list COLON parameter_type
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("value_parameter_section",41, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 60: // formal_parameter_section ::= function_parameter_section
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("formal_parameter_section",40, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 59: // formal_parameter_section ::= procedure_parameter_section
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("formal_parameter_section",40, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 58: // formal_parameter_section ::= variable_parameter_section
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("formal_parameter_section",40, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 57: // formal_parameter_section ::= value_parameter_section
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("formal_parameter_section",40, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 56: // formal_parameter_list_optinonal ::=
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("formal_parameter_list_optinonal",157, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 55: // formal_parameter_list_optinonal ::= formal_parameter_list
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("formal_parameter_list_optinonal",157, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 54: // semi_colon_formal_parameter_section ::=
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("semi_colon_formal_parameter_section",180, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 53: // semi_colon_formal_parameter_section ::= SEMICOLON formal_parameter_section semi_colon_formal_parameter_section
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("semi_colon_formal_parameter_section",180, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 52: // formal_parameter_list ::= LPARENT formal_parameter_section RPARENT
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("formal_parameter_list",28, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 51: // function_identification ::= FUNCTION function_identifier
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("function_identification",25, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 50: // procedure_identification ::= PROCEDURE procedure_identifier
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("procedure_identification",21, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 49: // result_type ::= type_identifier
{
Object RESULT =null;
int rtleft = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).left;
int rtright = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).right;
Object rt = (Object)((java_cup.runtime.Symbol) CUP$parser$stack.peek()).value;
if(rt != null){
System.out.println("result type : " + rt);
RESULT = rt;
}
CUP$parser$result = parser.getSymbolFactory().newSymbol("result_type",30, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 48: // function_heading ::= FUNCTION identifier formal_parameter_list_optinonal COLON result_type
{
Object RESULT =null;
int fleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-4)).left;
int fright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-4)).right;
Object f = (Object)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-4)).value;
int idleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-3)).left;
int idright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-3)).right;
Object id = (Object)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-3)).value;
int fpleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)).left;
int fpright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)).right;
Object fp = (Object)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-2)).value;
int rtleft = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).left;
int rtright = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).right;
Object rt = (Object)((java_cup.runtime.Symbol) CUP$parser$stack.peek()).value;
System.out.println("function heading returned type: " + fp);
if(f != null){
System.out.println("entrou no f !=null");
SemanticManager.getInstance().lineError = ((int) f);
} if(id != null){
System.out.println("entrou no id!=null ");
System.out.println("rt: " + rt);
SemanticManager.getInstance().addIdentifier(id.toString());
SemanticManager.getInstance().addFunction(id.toString(), rt.toString());
}
CUP$parser$result = parser.getSymbolFactory().newSymbol("function_heading",23, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-4)), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 47: // procedure_heading ::= PROCEDURE identifier formal_parameter_list_optinonal
{
Object RESULT =null;
int pleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)).left;
int pright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)).right;
Object p = (Object)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-2)).value;
int idleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).left;
int idright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).right;
Object id = (Object)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-1)).value;
System.out.println("PROCEDURE: " + p);
if(p != null){
SemanticManager.getInstance().lineError = ((int) p);
} if(id != null){
System.out.println("identifier: " + id);
SemanticManager.getInstance().addIdentifier(id.toString());
SemanticManager.getInstance().addProcedure(id.toString());
}
CUP$parser$result = parser.getSymbolFactory().newSymbol("procedure_heading",19, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 46: // compiler_defined_directives ::= EXTERNAL
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("compiler_defined_directives",150, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 45: // statement_part ::= BEGIN statement_sequence END
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("statement_part",6, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 44: // directive ::= compiler_defined_directives
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("directive",26, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 43: // directive ::= FORWARD
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("directive",26, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 42: // function_body ::= block
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("function_body",24, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 41: // function_declaration ::= function_identification SEMICOLON function_body
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("function_declaration",22, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 40: // function_declaration ::= function_heading SEMICOLON directive
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("function_declaration",22, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 39: // function_declaration ::= function_heading SEMICOLON function_body
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("function_declaration",22, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 38: // procedure_body ::= block
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("procedure_body",20, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 37: // procedure_declaration ::= procedure_identification SEMICOLON procedure_body
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("procedure_declaration",18, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 36: // procedure_declaration ::= procedure_heading SEMICOLON directive
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("procedure_declaration",18, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 35: // procedure_declaration ::= procedure_heading SEMICOLON procedure_body
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("procedure_declaration",18, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 34: // procedure_declaration_or_function_declaration ::= function_declaration
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("procedure_declaration_or_function_declaration",166, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 33: // procedure_declaration_or_function_declaration ::= procedure_declaration
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("procedure_declaration_or_function_declaration",166, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 32: // procedure_declaration_or_function_declaration_semi_colon ::=
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("procedure_declaration_or_function_declaration_semi_colon",184, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 31: // procedure_declaration_or_function_declaration_semi_colon ::= procedure_declaration_or_function_declaration SEMICOLON procedure_declaration_or_function_declaration_semi_colon
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("procedure_declaration_or_function_declaration_semi_colon",184, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 30: // procedure_and_function_declaration_part ::= procedure_declaration_or_function_declaration_semi_colon
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("procedure_and_function_declaration_part",11, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 29: // variable_declaration ::= identifier_list COLON type
{
Object RESULT =null;
int illeft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)).left;
int ilright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)).right;
Object il = (Object)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-2)).value;
int tpleft = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).left;
int tpright = ((java_cup.runtime.Symbol)CUP$parser$stack.peek()).right;
Object tp = (Object)((java_cup.runtime.Symbol) CUP$parser$stack.peek()).value;
if(il != null){
System.out.println("VARIABLE DECLARATION : " + il);
RESULT = il;}
if(tp != null){
SemanticManager.getInstance().addIdentifier(il.toString());
SemanticManager.getInstance().addVariable(il.toString(), tp.toString(), "null");
}
CUP$parser$result = parser.getSymbolFactory().newSymbol("variable_declaration",16, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 28: // variable_declaration_part_optional ::=
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("variable_declaration_part_optional",161, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 27: // variable_declaration_part_optional ::= variable_declaration_part
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("variable_declaration_part_optional",161, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 26: // variable_declaration_semi_colon ::=
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("variable_declaration_semi_colon",185, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 25: // variable_declaration_semi_colon ::= variable_declaration SEMICOLON variable_declaration_semi_colon
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("variable_declaration_semi_colon",185, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 24: // variable_declaration_part ::= VAR variable_declaration SEMICOLON variable_declaration_semi_colon
{
Object RESULT =null;
int valeft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-3)).left;
int varight = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-3)).right;
Object va = (Object)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-3)).value;
int varleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)).left;
int varright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)).right;
Object var = (Object)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-2)).value;
if(va != null){
SemanticManager.getInstance().lineError = ((int) va);
} if(var != null) {
//*************************
//*************************
//*************************
System.out.println("VARIABLE DECLARATION PART: " + var);
RESULT = var;
}
CUP$parser$result = parser.getSymbolFactory().newSymbol("variable_declaration_part",10, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-3)), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 23: // type_definition ::= identifier EQUALS type
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("type_definition",15, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 22: // type_definition_part_optional ::=
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("type_definition_part_optional",160, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 21: // type_definition_part_optional ::= type_definition_part
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("type_definition_part_optional",160, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 20: // type_definition_semi_colon ::=
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("type_definition_semi_colon",186, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 19: // type_definition_semi_colon ::= type_definition SEMICOLON type_definition_semi_colon
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("type_definition_semi_colon",186, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 18: // type_definition_part ::= TYPE type_definition SEMICOLON type_definition_semi_colon
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("type_definition_part",9, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-3)), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 17: // constant_definition ::= identifier EQUALS constant
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("constant_definition",13, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 16: // constant_definition_part_optional ::=
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("constant_definition_part_optional",159, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 15: // constant_definition_part_optional ::= constant_definition_part
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("constant_definition_part_optional",159, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 14: // constant_definition_semi_colon ::=
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("constant_definition_semi_colon",187, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 13: // constant_definition_semi_colon ::= constant_definition SEMICOLON constant_definition_semi_colon
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("constant_definition_semi_colon",187, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 12: // constant_definition_part ::= CONST constant_definition SEMICOLON constant_definition_semi_colon
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("constant_definition_part",8, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-3)), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 11: // label_declaration_part_optional ::=
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("label_declaration_part_optional",158, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 10: // label_declaration_part_optional ::= label_declaration_part
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("label_declaration_part_optional",158, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 9: // comma_label ::=
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("comma_label",174, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 8: // comma_label ::= COMMA label comma_label
{
Object RESULT =null;
int cleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)).left;
int cright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)).right;
Object c = (Object)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-2)).value;
int lid2left = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).left;
int lid2right = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).right;
Object lid2 = (Object)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-1)).value;
if(c != null){
SemanticManager.getInstance().lineError = ((int) c);
}
if(lid2 != null){
SemanticManager.getInstance().addLabel(Integer.parseInt(lid2.toString()));
}
CUP$parser$result = parser.getSymbolFactory().newSymbol("comma_label",174, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 7: // label_declaration_part ::= LABEL label comma_label SEMICOLON
{
Object RESULT =null;
int leleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-3)).left;
int leright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-3)).right;
Object le = (Object)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-3)).value;
int lidleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)).left;
int lidright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)).right;
Object lid = (Object)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-2)).value;
if(le != null){
SemanticManager.getInstance().lineError = ((int) le);
} if(lid != null){
SemanticManager.getInstance().addLabel(Integer.parseInt(lid.toString()));
}
CUP$parser$result = parser.getSymbolFactory().newSymbol("label_declaration_part",7, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-3)), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 6: // declaration_part ::= label_declaration_part_optional constant_definition_part_optional type_definition_part_optional variable_declaration_part_optional procedure_and_function_declaration_part
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("declaration_part",5, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-4)), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 5: // block ::= declaration_part statement_part
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("block",2, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 4: // arguments_optional ::=
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("arguments_optional",142, ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 3: // arguments_optional ::= LPARENT identifier_list RPARENT
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("arguments_optional",142, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 2: // program_heading ::= PROGRAM identifier arguments_optional SEMICOLON
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("program_heading",1, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-3)), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 1: // program ::= program_heading block DOT
{
Object RESULT =null;
CUP$parser$result = parser.getSymbolFactory().newSymbol("program",0, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
return CUP$parser$result;
/*. . . . . . . . . . . . . . . . . . . .*/
case 0: // $START ::= program EOF
{
Object RESULT =null;
int start_valleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).left;
int start_valright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).right;
Object start_val = (Object)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-1)).value;
RESULT = start_val;
CUP$parser$result = parser.getSymbolFactory().newSymbol("$START",0, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)), ((java_cup.runtime.Symbol)CUP$parser$stack.peek()), RESULT);
}
/* ACCEPT */
CUP$parser$parser.done_parsing();
return CUP$parser$result;
/* . . . . . .*/
default:
throw new Exception(
"Invalid action number found in internal parse table");
}
}
}
|
C++
|
UTF-8
| 2,083
| 2.734375
| 3
|
[
"MIT"
] |
permissive
|
#include <iostream>
#include <cstdio>
#include <vector>
#include <unordered_map>
#include <cassert>
#include "./bf.h"
bf::Interpreter::Interpreter(std::string code)
{
_code = code;
_instruction_count = code.length();
_tape = std::vector<char>(1024, '\0');
_jmp_tb = std::unordered_map<int, int>();
init_jmp_tb();
}
void bf::Interpreter::init_jmp_tb()
{
std::vector<int> stack;
for (unsigned int i = 0; i < _code.length(); i++)
{
if (_code[i] == '[')
stack.push_back(i);
else if (_code[i] == ']')
{
int temp = stack[stack.size() - 1];
stack.pop_back();
_jmp_tb.insert({i, temp});
_jmp_tb.insert({temp, i});
}
}
assert(stack.empty());
}
void bf::Interpreter::dec_ptr()
{
_pointer = _pointer > 0 ? (_pointer - 1) : 0;
}
void bf::Interpreter::inc_ptr()
{
_pointer++;
if (_pointer > _tape.size())
_tape.resize((int)(2 * _tape.size()));
}
void bf::Interpreter::inc_mem()
{
_tape[_pointer]++;
}
void bf::Interpreter::dec_mem()
{
_tape[_pointer]--;
}
void bf::Interpreter::out()
{
putchar(_tape[_pointer]);
}
void bf::Interpreter::in()
{
_tape[_pointer] = getchar();
}
void bf::Interpreter::jmp_fw()
{
if (!_tape[_pointer])
_pc = _jmp_tb.at(_pc);
}
void bf::Interpreter::jmp_bck()
{
if (_tape[_pointer])
_pc = _jmp_tb.at(_pc);
}
void bf::Interpreter::run()
{
while (_pc < _instruction_count)
{
switch (_code[_pc])
{
case BF_DEC_PTR:
dec_ptr();
break;
case BF_INC_PTR:
inc_ptr();
break;
case BF_INC_MEM:
inc_mem();
break;
case BF_DEC_MEM:
dec_mem();
break;
case BF_OUT:
out();
break;
case BF_IN:
in();
break;
case BF_JMP_FW:
jmp_fw();
break;
case BF_JMP_BCK:
jmp_bck();
break;
}
_pc++;
}
}
|
PHP
|
UTF-8
| 2,852
| 2.578125
| 3
|
[
"MIT"
] |
permissive
|
<?php
namespace AniketIN\Wallet\Models;
use AniketIN\Wallet\Casts\Round;
use Exception;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\DB;
class Wallet extends Model
{
use HasFactory;
protected $fillable = [
'balance',
'withdrawable_balance',
];
protected $casts = [
'balance' => Round::class,
'withdrawable_balance' => Round::class,
];
public function walletable()
{
return $this->morphTo();
}
public function transactions()
{
return $this->hasMany(WalletTransaction::class);
}
public function deposit(int $amount, string $description)
{
if ($amount < 1) {
throw new Exception("Deposit amount must not be less than 1, $amount given.");
}
return DB::transaction(function () use ($amount, $description) {
$wallet = $this->lockForUpdate()->find($this->id);
$transaction['ob'] = $wallet->balance;
$this->update([
'balance' => $wallet->balance + $amount,
]);
return $this->transactions()->create([
...$transaction,
'type' => 'credit',
'amount' => $amount,
'cb' => $this->balance,
'description' => $description,
]);
});
}
public function withdraw(int $amount, string $description, bool $force = false, $bypass_withdrawable_limit = false)
{
if ($amount < 1) {
throw new Exception("Withdrawl amount must not be less than 1, $amount given.");
}
return DB::transaction(function () use ($amount, $description, $force, $bypass_withdrawable_limit) {
$wallet = $this->lockForUpdate()->find($this->id);
$transaction['ob'] = $wallet->balance;
if ($wallet->balance < $amount && ! $force) {
throw new Exception("To withdraw more than wallet balance you need to use force mode.");
}
if ($wallet->withdrawable_balance < $amount && ! $bypass_withdrawable_limit) {
throw new Exception("Withdrawable balance exceeds! Max withdrawable limit is set to {$wallet->withdrawable_balance}.");
}
$this->update([
'balance' => $wallet->balance - $amount,
'withdrawable_balance' => $bypass_withdrawable_limit ? $wallet->withdrawable_balance : $wallet->withdrawable_balance - $amount,
]);
return $this->transactions()->create([
...$transaction,
'type' => 'debit',
'amount' => $amount,
'cb' => $this->balance,
'description' => $description,
]);
});
}
}
|
C++
|
UTF-8
| 13,416
| 2.53125
| 3
|
[] |
no_license
|
#include "SolutionCalculator.h"
#include "Mesh.h"
#include "SteadyReader.h"
#include "../Solver/HarmonicSolver.h"
#include "../Inputs.h"
#include <iostream>
#include <fstream>
#include <iomanip>
#include <cmath>
#include <valarray>
using namespace std;
SolutionCalculator::SolutionCalculator(Mesh*mp,SteadyReader*srp,HarmonicSolver*hsp) {
double g1=gamma-1;
int cellTotal=mp->GetCelltot();
double** qSteady=srp->GetPrimitiveDomain();
double** wHatReal=hsp->GetConservativeReal();
double** wHatImag=hsp->GetConservativeImag();
//solution steady
double rhoSteady[cellTotal]={0};
double uSteady[cellTotal]={0};
double vSteady[cellTotal]={0};
double pSteady[cellTotal]={0};
double sSteady[cellTotal]={0};
double aSteady[cellTotal]={0};
double mSteady[cellTotal]={0};
for(int i=0;i<cellTotal;i++){
rhoSteady[i]=qSteady[i][0];
uSteady[i]=qSteady[i][1];
vSteady[i]=qSteady[i][2];
pSteady[i]=qSteady[i][3];
sSteady[i]=sqrt(uSteady[i]*uSteady[i]+vSteady[i]*vSteady[i]);
aSteady[i]=sqrt(gamma*pSteady[i]/rhoSteady[i]);
mSteady[i]=sSteady[i]/aSteady[i];
}
//solution int frequency domain in real and imgag format
double rhoHatReal[cellTotal]={0};
double rhoHatImag[cellTotal]={0};
double uHatReal[cellTotal]={0};
double uHatImag[cellTotal]={0};
double vHatReal[cellTotal]={0};
double vHatImag[cellTotal]={0};
double pHatReal[cellTotal]={0};
double pHatImag[cellTotal]={0};
double sHatReal[cellTotal]={0};
double sHatImag[cellTotal]={0};
double aHatReal[cellTotal]={0};
double aHatImag[cellTotal]={0};
double mHatReal[cellTotal]={0};
double mHatImag[cellTotal]={0};
for(int i=0;i<cellTotal;i++){
rhoHatReal[i]=wHatReal[i][0];
rhoHatImag[i]=wHatImag[i][0];
uHatReal[i]=(wHatReal[i][1]-rhoHatReal[i]*uSteady[i])/rhoSteady[i];
uHatImag[i]=(wHatImag[i][1]-rhoHatImag[i]*uSteady[i])/rhoSteady[i];
vHatReal[i]=(wHatReal[i][2]-rhoHatReal[i]*vSteady[i])/rhoSteady[i];
vHatImag[i]=(wHatImag[i][2]-rhoHatImag[i]*vSteady[i])/rhoSteady[i];
pHatReal[i]=g1*(wHatReal[i][3]-0.5*(2*(uSteady[i]*wHatReal[i][1]+vSteady[i]*wHatReal[i][2])-wHatReal[i][0]*(uSteady[i]*uSteady[i]+vSteady[i]*vSteady[i])));
pHatImag[i]=g1*(wHatImag[i][3]-0.5*(2*(uSteady[i]*wHatImag[i][1]+vSteady[i]*wHatImag[i][2])-wHatImag[i][0]*(uSteady[i]*uSteady[i]+vSteady[i]*vSteady[i])));
sHatReal[i]=(uSteady[i]*uHatReal[i]+vSteady[i]*vHatReal[i])/sSteady[i];
sHatImag[i]=(uSteady[i]*uHatImag[i]+vSteady[i]*vHatImag[i])/sSteady[i];
aHatReal[i]=gamma/2/aSteady[i]*(pHatReal[i]/rhoSteady[i]-pSteady[i]*rhoHatReal[i]/rhoSteady[i]/rhoSteady[i]);
aHatReal[i]=gamma/2/aSteady[i]*(pHatImag[i]/rhoSteady[i]-pSteady[i]*rhoHatImag[i]/rhoSteady[i]/rhoSteady[i]);
mHatReal[i]=sHatReal[i]/aSteady[i]-sSteady[i]*aHatReal[i]/aSteady[i]/aSteady[i];
mHatImag[i]=sHatImag[i]/aSteady[i]-sSteady[i]*aHatImag[i]/aSteady[i]/aSteady[i];
}
//solution in frequeny domain in maginutude and phase angle
amplitude.w1=new double[cellTotal]; //structure to store amplitudes
amplitude.w2=new double[cellTotal];
amplitude.w3=new double[cellTotal];
amplitude.w4=new double[cellTotal];
amplitude.rho=new double[cellTotal];
amplitude.u=new double[cellTotal];
amplitude.v=new double[cellTotal];
amplitude.P=new double[cellTotal];
amplitude.M=new double[cellTotal];
for (int cn=0;cn<cellTotal;cn++){
amplitude.w1[cn]=sqrt(wHatReal[cn][0]*wHatReal[cn][0]+wHatImag[cn][0]*wHatImag[cn][0]);
amplitude.w2[cn]=sqrt(wHatReal[cn][1]*wHatReal[cn][1]+wHatImag[cn][1]*wHatImag[cn][1]);
amplitude.w3[cn]=sqrt(wHatReal[cn][2]*wHatReal[cn][2]+wHatImag[cn][2]*wHatImag[cn][2]);
amplitude.w4[cn]=sqrt(wHatReal[cn][3]*wHatReal[cn][3]+wHatImag[cn][3]*wHatImag[cn][3]);
amplitude.rho[cn]=sqrt(rhoHatReal[cn]*rhoHatReal[cn]+rhoHatImag[cn]*rhoHatImag[cn]);
amplitude.u[cn]=sqrt(uHatReal[cn]*uHatReal[cn]+uHatImag[cn]*uHatImag[cn]);
amplitude.v[cn]=sqrt(vHatReal[cn]*vHatReal[cn]+vHatImag[cn]*vHatImag[cn]);
amplitude.P[cn]=sqrt(pHatReal[cn]*pHatReal[cn]+pHatImag[cn]*pHatImag[cn]);
amplitude.M[cn]=sqrt(mHatReal[cn]*mHatReal[cn]+mHatImag[cn]*mHatImag[cn]);
}
phi.w1=new double[cellTotal]; //structure to store phase angle
phi.w2=new double[cellTotal];
phi.w3=new double[cellTotal];
phi.w4=new double[cellTotal];
phi.rho=new double[cellTotal];
phi.u=new double[cellTotal];
phi.v=new double[cellTotal];
phi.P=new double[cellTotal];
phi.M=new double[cellTotal];
for (int cn=0;cn<cellTotal;cn++){
phi.w1[cn]=PhiCalculator(wHatReal[cn][0],wHatImag[cn][0]);
phi.w2[cn]=PhiCalculator(wHatReal[cn][1],wHatImag[cn][1]);
phi.w3[cn]=PhiCalculator(wHatReal[cn][2],wHatImag[cn][2]);
phi.w4[cn]=PhiCalculator(wHatReal[cn][3],wHatImag[cn][3]);
phi.rho[cn]=PhiCalculator(rhoHatReal[cn],rhoHatImag[cn]);
phi.u[cn]=PhiCalculator(uHatReal[cn],uHatImag[cn]);
phi.v[cn]=PhiCalculator(vHatReal[cn],vHatImag[cn]);
phi.P[cn]=PhiCalculator(pHatReal[cn],pHatImag[cn]);
phi.M[cn]=PhiCalculator(mHatReal[cn],mHatImag[cn]);
}
cout<<"\n"<<endl;
cout<<"|wHat1| w1Phi |wHat2| w2Phi |wHat3| w3Phi |wHat4| w4Phi |rhoHat| rhoPhi |uHat| uPhi |vHat| vPhi |pHat| pPhi |mHat| mPhi"<<endl;
cout<<"------------------------------------------------------------------------------------------------------------------------------------------------"<<endl;
for (int cn=0;cn<cellTotal;cn++){
cout<<setw(6)<<fixed<<left<<cn<<
setw(15)<<setprecision(8)<<fixed<<left<<amplitude.w1[cn]<<setw(15)<<setprecision(8)<<fixed<<left<<phi.w1[cn]<<
setw(15)<<setprecision(8)<<fixed<<left<<amplitude.w2[cn]<<setw(15)<<setprecision(8)<<fixed<<left<<phi.w2[cn]<<
setw(15)<<setprecision(8)<<fixed<<left<<amplitude.w3[cn]<<setw(15)<<setprecision(8)<<fixed<<left<<phi.w3[cn]<<
setw(15)<<setprecision(8)<<fixed<<left<<amplitude.w4[cn]<<setw(15)<<setprecision(8)<<fixed<<left<<phi.w4[cn]<<
setw(15)<<setprecision(8)<<fixed<<left<<amplitude.rho[cn]<<setw(15)<<setprecision(8)<<fixed<<left<<phi.rho[cn]<<
setw(15)<<setprecision(8)<<fixed<<left<<amplitude.u[cn]<<setw(15)<<setprecision(8)<<fixed<<left<<phi.u[cn]<<
setw(15)<<setprecision(8)<<fixed<<left<<amplitude.v[cn]<<setw(15)<<setprecision(8)<<fixed<<left<<phi.v[cn]<<
setw(15)<<setprecision(8)<<fixed<<left<<amplitude.P[cn]<<setw(15)<<setprecision(8)<<fixed<<left<<phi.P[cn]<<
setw(15)<<setprecision(8)<<fixed<<left<<amplitude.M[cn]<<setw(15)<<setprecision(8)<<fixed<<left<<phi.M[cn]<<endl;
}
cout<<"\n"<<endl;
//convert solution into time domain
double periodTime=1/redF; //period of oscilation in seconds
instantTotal=periodDevision+1; //number of time instants to calculate solution at
double radialFreq=2*pi/periodTime; //radial frequency
dt=periodTime/periodDevision; //it includes time=0, time=inst1, time=inst2, ... and time =T
double time[instantTotal]={0}; //instants in which solution is required 0 <= time <= T
for (int i=0;i<instantTotal;i++)
time[i]=i*dt;
harmonicSinus=new TimeSolution[instantTotal]; //array structure to store sinus harmonic solution at different times
for (int t=0;t<instantTotal;t++){
harmonicSinus[t].w1=new double[cellTotal];
harmonicSinus[t].w2=new double[cellTotal];
harmonicSinus[t].w3=new double[cellTotal];
harmonicSinus[t].w4=new double[cellTotal];
harmonicSinus[t].rho=new double[cellTotal];
harmonicSinus[t].u=new double[cellTotal];
harmonicSinus[t].v=new double[cellTotal];
harmonicSinus[t].P=new double[cellTotal];
harmonicSinus[t].M=new double[cellTotal];
}
harmonicCosinus=new TimeSolution[instantTotal]; //array structure to store cosinus harmonic solution at different times
for (int t=0;t<instantTotal;t++){
harmonicCosinus[t].w1=new double[cellTotal];
harmonicCosinus[t].w2=new double[cellTotal];
harmonicCosinus[t].w3=new double[cellTotal];
harmonicCosinus[t].w4=new double[cellTotal];
harmonicCosinus[t].rho=new double[cellTotal];
harmonicCosinus[t].u=new double[cellTotal];
harmonicCosinus[t].v=new double[cellTotal];
harmonicCosinus[t].P=new double[cellTotal];
harmonicCosinus[t].M=new double[cellTotal];
}
for (int t=0;t<instantTotal;t++){
harmonicSinus[t].time=time[t];
harmonicCosinus[t].time=time[t];
for(int cn=0;cn<cellTotal;cn++){
harmonicSinus[t].w1[cn]=amplitude.w1[cn]*sin(radialFreq*time[t]+phi.w1[cn]);
harmonicSinus[t].w2[cn]=amplitude.w2[cn]*sin(radialFreq*time[t]+phi.w2[cn]);
harmonicSinus[t].w3[cn]=amplitude.w3[cn]*sin(radialFreq*time[t]+phi.w3[cn]);
harmonicSinus[t].w4[cn]=amplitude.w4[cn]*sin(radialFreq*time[t]+phi.w4[cn]);
harmonicSinus[t].rho[cn]=amplitude.rho[cn]*sin(radialFreq*time[t]+phi.rho[cn]);
harmonicSinus[t].u[cn]=amplitude.u[cn]*sin(radialFreq*time[t]+phi.u[cn]);
harmonicSinus[t].v[cn]=amplitude.v[cn]*sin(radialFreq*time[t]+phi.v[cn]);
harmonicSinus[t].P[cn]=amplitude.P[cn]*sin(radialFreq*time[t]+phi.P[cn]);
harmonicSinus[t].M[cn]=amplitude.M[cn]*sin(radialFreq*time[t]+phi.M[cn]);
harmonicCosinus[t].w1[cn]=amplitude.w1[cn]*cos(radialFreq*time[t]+phi.w1[cn]);
harmonicCosinus[t].w2[cn]=amplitude.w2[cn]*cos(radialFreq*time[t]+phi.w2[cn]);
harmonicCosinus[t].w3[cn]=amplitude.w3[cn]*cos(radialFreq*time[t]+phi.w3[cn]);
harmonicCosinus[t].w4[cn]=amplitude.w4[cn]*cos(radialFreq*time[t]+phi.w4[cn]);
harmonicCosinus[t].rho[cn]=amplitude.rho[cn]*cos(radialFreq*time[t]+phi.rho[cn]);
harmonicCosinus[t].u[cn]=amplitude.u[cn]*cos(radialFreq*time[t]+phi.u[cn]);
harmonicCosinus[t].v[cn]=amplitude.v[cn]*cos(radialFreq*time[t]+phi.v[cn]);
harmonicCosinus[t].P[cn]=amplitude.P[cn]*cos(radialFreq*time[t]+phi.P[cn]);
harmonicCosinus[t].M[cn]=amplitude.M[cn]*cos(radialFreq*time[t]+phi.M[cn]);
}
}
//combine steady and harmonic to get unsteady
unsteadySinus=new TimeSolution[instantTotal]; //array structure to store unsteady sinus solution at different times
for (int t=0;t<instantTotal;t++){
unsteadySinus[t].w1=new double[cellTotal];
unsteadySinus[t].w2=new double[cellTotal];
unsteadySinus[t].w3=new double[cellTotal];
unsteadySinus[t].w4=new double[cellTotal];
unsteadySinus[t].rho=new double[cellTotal];
unsteadySinus[t].u=new double[cellTotal];
unsteadySinus[t].v=new double[cellTotal];
unsteadySinus[t].P=new double[cellTotal];
unsteadySinus[t].M=new double[cellTotal];
}
unsteadyCosinus=new TimeSolution[instantTotal]; //array structure to store unsteady cosinus solution at different times
for (int t=0;t<instantTotal;t++){
unsteadyCosinus[t].w1=new double[cellTotal];
unsteadyCosinus[t].w2=new double[cellTotal];
unsteadyCosinus[t].w3=new double[cellTotal];
unsteadyCosinus[t].w4=new double[cellTotal];
unsteadyCosinus[t].rho=new double[cellTotal];
unsteadyCosinus[t].u=new double[cellTotal];
unsteadyCosinus[t].v=new double[cellTotal];
unsteadyCosinus[t].P=new double[cellTotal];
unsteadyCosinus[t].M=new double[cellTotal];
}
for (int t=0;t<instantTotal;t++){
unsteadySinus[t].time=time[t];
unsteadyCosinus[t].time=time[t];
for(int cn=0;cn<cellTotal;cn++){
unsteadySinus[t].w1[cn]=rhoSteady[cn] + harmonicSinus[t].w1[cn];
unsteadySinus[t].w2[cn]=rhoSteady[cn]*uSteady[cn] + harmonicSinus[t].w2[cn];
unsteadySinus[t].w3[cn]=rhoSteady[cn]*vSteady[cn] + harmonicSinus[t].w3[cn];
unsteadySinus[t].w4[cn]=(pSteady[cn]/(gamma-1) + rhoSteady[cn]*sSteady[cn]*sSteady[cn]) + harmonicSinus[t].w4[cn];
unsteadySinus[t].rho[cn]=rhoSteady[cn] + harmonicSinus[t].rho[cn];
unsteadySinus[t].u[cn]=uSteady[cn] + harmonicSinus[t].u[cn];
unsteadySinus[t].v[cn]=vSteady[cn] + harmonicSinus[t].v[cn];
unsteadySinus[t].P[cn]=pSteady[cn] + harmonicSinus[t].P[cn];
unsteadySinus[t].M[cn]=mSteady[cn] + harmonicSinus[t].M[cn];
unsteadyCosinus[t].w1[cn]=rhoSteady[cn] + harmonicCosinus[t].w1[cn];
unsteadyCosinus[t].w2[cn]=rhoSteady[cn]*uSteady[cn] + harmonicCosinus[t].w2[cn];
unsteadyCosinus[t].w3[cn]=rhoSteady[cn]*vSteady[cn] + harmonicCosinus[t].w3[cn];
unsteadyCosinus[t].w4[cn]=(pSteady[cn]/(gamma-1) + rhoSteady[cn]*sSteady[cn]*sSteady[cn]) + harmonicCosinus[t].w4[cn];
unsteadyCosinus[t].rho[cn]=rhoSteady[cn] + harmonicCosinus[t].rho[cn];
unsteadyCosinus[t].u[cn]=uSteady[cn] + harmonicCosinus[t].u[cn];
unsteadyCosinus[t].v[cn]=vSteady[cn] + harmonicCosinus[t].v[cn];
unsteadyCosinus[t].P[cn]=pSteady[cn] + harmonicCosinus[t].P[cn];
unsteadyCosinus[t].M[cn]=mSteady[cn] + harmonicCosinus[t].M[cn];
}
}
}
double SolutionCalculator::PhiCalculator(double real,double imag){
double phi;
if (real==0){
if(imag>0){
phi=pi/2;
return phi;
}
else if(imag<0){
phi=3/2*pi;
return phi;
}
else{ //imag=0
phi=0;
cout<<"Warning: both real and imag values got zero !"<<endl;
return phi;
}
}
if (imag==0){
if (real>0){
phi=0;
return phi;
}
else{ //real<0
phi=pi;
return phi;
}
}
if(real>0)
phi=atan(imag/real);
else
phi=pi+atan(imag/real);
return phi;
}
Frequency* SolutionCalculator::GetAmplitude(){
return &litude;
}
Frequency* SolutionCalculator::GetPhi(){
return φ
}
TimeSolution* SolutionCalculator::GetHarmonicSinus(){
return harmonicSinus;
}
TimeSolution* SolutionCalculator::GetHarmonicCosinus(){
return harmonicCosinus;
}
TimeSolution* SolutionCalculator::GetUnsteadySinus(){
return unsteadySinus;
}
TimeSolution* SolutionCalculator::GetUnsteadyCosinus(){
return unsteadyCosinus;
}
int SolutionCalculator::GetInstantNumber(){
return instantTotal;
}
double SolutionCalculator::GetDt(){
return dt;
}
|
C++
|
UTF-8
| 12,950
| 2.796875
| 3
|
[] |
no_license
|
//Christian Bradford
//C00223037
//Joint Assignment 2
#include "VoteCounter.h"
void VoteCounter::Start()
{
char answer = 0;
while (true)
{
std::cout << "Would you like to do a manual process or load a file? (m | l) ";
std::cin >> answer;
if (answer == 'l')
{
std::string filename = "../Data/Vote_Results.voteCounter";
StartVotingFile(filename);
break;
}
else if (answer == 'm')
{
std::list<Candidate> candidates = InitManualProcess();
StartVotingManual(candidates);
break;
}
}
}
void VoteCounter::StartVotingManual(const std::list<Candidate> candidates)
{
std::list<BallotPaper> ballotPapers;
std::list<Candidate> currentCandidates;
int numVoters = 0;
int currentPick;
bool answer = false;
std::cout << std::endl << "Lets start the voting process!" << std::endl;
while (answer == false)
{
BallotPaper *currentBallotPaper = new BallotPaper();
currentPick = 0;
++numVoters;
currentCandidates = candidates;
while (currentCandidates.size() >= 1)
{
PrintOutAllCandidates(currentCandidates);
currentPick++;
int index = 0;
while (index < 1 || index > currentCandidates.size())
{
std::cout << "Voter #: " << numVoters << " Current Pick: " << currentPick << " (Pick The Candidate Number)? ";
index = CheckForValidNumberInput();
}
std::list<Candidate>::iterator it1 = currentCandidates.begin();
std::advance(it1, --index);
currentBallotPaper->setPreference(currentPick, *it1);
currentCandidates.erase(it1);
}
ballotPapers.push_back(*currentBallotPaper);
delete currentBallotPaper;
std::cout << std::endl;
answer = AskForInput("Would you like to add another Voter?");
}
FigureOutWhoWon(ballotPapers, candidates);
}
void VoteCounter::FigureOutWhoWon(const std::list<BallotPaper> ballotPapers, const std::list<Candidate> &candidates)
{
int round = 0;
std::list<CandidateVotes> totalVotes;
//Candidates and their votes
totalVotes = CountVotes(candidates, ballotPapers);
//Print Progress
PrintOutVotersAndTheirPreferences(ballotPapers, candidates.size());
while (totalVotes.size() > 1)
{
//Sort out the list in ascending order
totalVotes = SortDesending(totalVotes);
//Print out the Candidates names and the number of votes that they have
PrintOutCandidatesAndThierVotes(totalVotes, round);
//Find The candidate(s) in last place
std::list<CandidateVotes> lowestVotes = FindAllTheLowestVotes(totalVotes);
CandidateVotes loserCandidate;
if (lowestVotes.size() > 1)
{
PrintOutTiedCandidates(lowestVotes);
loserCandidate = FindTheLoserCandidate(lowestVotes);
}
else
loserCandidate = *lowestVotes.cbegin();
//Print out the lost Candidate
std::cout << "Candidate " << loserCandidate.c.GetName() << " has lost the race... " << std::endl;
//Find out where the votes goes too
TransferVotes(loserCandidate, totalVotes);
//Get rid of the loser Candidate from the list of votes
std::list<CandidateVotes> newList;
for (auto cv : totalVotes)
{
if (cv.c != loserCandidate.c)
newList.push_back(cv);
}
totalVotes = newList;
round++;
}
PrintOutCandidatesAndThierVotes(totalVotes, round);
std::cout << "The winner is Candidate: " << (totalVotes.begin())->c.GetName() << std::endl;
}
void VoteCounter::TransferVotes(CandidateVotes loserCandidate, std::list<CandidateVotes> &totalVotes)
{
std::cout << "The vote(s) that went to Candidate " << loserCandidate.c.GetName() << " is going to:" << std::endl;
if (loserCandidate.votes.size() < 1)
std::cout << "There was no votes for Candidate " << loserCandidate.c.GetName() << std::endl;
else
{
std::list<BallotPaper> transferBallotPapers;
for (auto bp : loserCandidate.votes)
{
//You can take the round number and add one to get to the round preference since round will always be less then total starting Candidates
Candidate tmp;
int prefence = 2; //Start off with the second choice
bool exists = false;
while (exists == false)
{
tmp = bp.getPreference(prefence);
for (auto cv : totalVotes)
{
if (cv.c == tmp && cv.c != loserCandidate.c)
{
exists = true;
break;
}
}
prefence++;
}
std::cout << "Candidate: " << tmp.GetName() << std::endl;
for (std::list<CandidateVotes>::iterator it = totalVotes.begin(); it != totalVotes.end(); ++it)
{
if (it->c == tmp)
{
it->votes.push_back(bp);
break;
}
}
}
}
}
const std::list<CandidateVotes> VoteCounter::CountVotes(const std::list<Candidate> &candidates, const std::list<BallotPaper> &ballotPapers)
{
std::list<CandidateVotes> totalVotes;
//Set up the list of the CandidateVote Structure
for (std::list<Candidate>::const_iterator it = candidates.cbegin(); it != candidates.cend(); ++it)
{
CandidateVotes tmp;
Candidate c = Candidate(*it);
tmp.c = c;
totalVotes.push_back(tmp);
}
//Count the votes and add it to the correct candidate
for (auto bp : ballotPapers)
{
Candidate first = bp.getPreference(1);
for (std::list<CandidateVotes>::iterator it = totalVotes.begin(); it != totalVotes.end(); ++it)
{
if (it->c.GetName() == first.GetName())
{
it->votes.push_back(bp);
break;
}
}
}
return totalVotes;
}
std::list<CandidateVotes> VoteCounter::FindAllTheLowestVotes(const std::list<CandidateVotes> &votes)
{
//The list can have mulitple ties so add all the lowest counts to another list
std::list<CandidateVotes> lowestVotes;
int lowestVoteCount = -1;
//Find the lowestVoteCount
for (std::list<CandidateVotes>::const_iterator it = votes.cbegin(); it != votes.cend(); ++it)
{
if (it->votes.size() < lowestVoteCount)
lowestVoteCount = it->votes.size();
}
//Add to the return list if it matches the lowest vote count
for (std::list<CandidateVotes>::const_iterator it = votes.cbegin(); it != votes.cend(); ++it)
{
if (it->votes.size() == lowestVoteCount)
lowestVotes.push_back(*it);
}
return lowestVotes;
}
void VoteCounter::PrintOutTiedCandidates(const std::list<CandidateVotes> &votes)
{
std::string candidateNames;
int stopIndex = votes.size() - 1;
int currentIndex = 0;
for (auto cv : votes)
{
candidateNames += cv.c.GetName();
if (currentIndex < stopIndex)
candidateNames += ", ";
currentIndex++;
}
std::cout << "These Candidates are tied: " << candidateNames << ". Randomly selecting which one is kicked out of the race...." << std::endl;
}
CandidateVotes VoteCounter::FindTheLoserCandidate(std::list<CandidateVotes> &votes)
{
int listIndex = (rand() % votes.size()); // rand % starts at one and the indexing starts at one
std::list<CandidateVotes>::const_iterator it1 = votes.cbegin();
std::advance(it1, listIndex);
return *it1;
}
void VoteCounter::PrintOutCandidatesAndThierVotes(const std::list<CandidateVotes> &votes, int round)
{
std::cout << std::endl << "Printing out round # " << round << std::endl;
for (auto v : votes)
std::cout << "Candidate " << v.c.GetName() << " has " << v.votes.size() << " votes" << std::endl;
}
void VoteCounter::PrintOutVotersAndTheirPreferences(std::list<BallotPaper> ballotPapers, int numCandidates)
{
std::cout << "Printing the voters and their preference of highest to lowest." << std::endl;
int numVoter = 0;
for (auto bp : ballotPapers)
{
std::cout << "Voter #" << ++numVoter << ": ";
for (int i = 0; i < numCandidates; i++)
{
std::cout << bp.getPreference(i + 1).GetName();
if (i + 1 < numCandidates)
std::cout << ", ";
}
std::cout << std::endl;
}
std::cout << std::endl;
}
std::list<Candidate> VoteCounter::InitManualProcess()
{
int count = 0;
bool answer = false;
std::list<Candidate> candidates;
while (answer == false)
{
std::string name;
std::string party;
std::cout << "What is the name of Candidate #" << ++count << "? ";
std::cin >> name;
std::cout << "What is the party of Candidate #" << count << "? ";
std::cin >> party;
Candidate *tmp = new Candidate(name, party);
candidates.push_back(*tmp);
std::cout << std::endl;
answer = AskForInput("Would you like to add another Candidate?");
}
return candidates;
}
void VoteCounter::PrintOutAllCandidates(std::list<Candidate> candidates)
{
int count = 0;
for (auto c : candidates)
std::cout << "Candidate # " << ++count << " Name: " << c.GetName() << " Party: " << c.GetParty() << std::endl;
}
std::list<CandidateVotes> VoteCounter::SortDesending(const std::list<CandidateVotes> &totalVotes)
{
std::list<CandidateVotes> returnList;
bool added = false;
for (auto tv : totalVotes)
{
bool added = false;
if (returnList.size() == 0)
{
returnList.push_front(tv);
continue;
}
std::list<CandidateVotes>::const_iterator it1 = returnList.cbegin();
while (it1 != returnList.cend())
{
if (it1->votes.size() <= tv.votes.size())
{
returnList.insert(it1, tv);
added = true;
break;
}
std::advance(it1, 1);
}
if (added == false) //means thats the tv object is the largest in the list so put it at the end
returnList.push_back(tv);
}
return returnList;
}
int VoteCounter::CheckForValidNumberInput()
{
int returnValue = 0;
while (!(std::cin >> returnValue))
{
std::cin.clear();
std::cin.ignore(999, '\n');
std::cout << "Please type in a number!!" << std::endl;
std::cout << "Type in a number: ";
}
return returnValue;
}
bool VoteCounter::AskForInput(std::string message)
{
std::cout << std::endl;
std::cout << message << " (y|n): ";
char returnValue = CheckForValidQuitInput();
std::cin.clear();
std::cin.ignore(999, '\n');
std::cout << std::endl;
if (returnValue == 'y')
return false;
return true;
}
char VoteCounter::CheckForValidQuitInput()
{
char returnValue = 0;
bool validInput = false;
bool failedFlag = false;
while (!validInput)
{
std::cin.clear();
std::cin.sync();
if (failedFlag)
std::cout << "Type in a answer: ";
std::cin >> returnValue;
if (returnValue == 'y' || returnValue == 'n')
validInput = true;
else
{
returnValue = 0;
failedFlag = true;
}
}
return returnValue;
}
void VoteCounter::StartVotingFile(std::string fileName)
{
char ignoreCharacter = '#';
std::string seperateCharacter = "";
bool isCandidates = true;
std::string line;
std::list<std::string> listOfInputs = {};
std::list<std::string> candidatesString = {};
std::list<std::string> votersString = {};
std::ifstream myfile(fileName);
try
{
if (myfile.is_open())
{
while (getline(myfile, line))
{
if (line[0] != ignoreCharacter)
{
if (line == seperateCharacter)
{
if (isCandidates)
{
isCandidates = false;
candidatesString = listOfInputs;
listOfInputs = {};
}
}
else
listOfInputs.push_back(line);
}
}
myfile.close();
votersString = listOfInputs;
}
else
{
throw FileReadError;
}
std::list<Candidate> candidates = ConvertToCandidates(candidatesString);
if (candidates.size() <= 0)
throw CandidatesError;
std::list<BallotPaper> voters = ConvertToBallotPapers(votersString, candidates);
if (voters.size() <= 0)
throw VotersError;
FigureOutWhoWon(voters, candidates);
}
catch (ERROR_CODES error)
{
switch (error)
{
case CandidatesError:
std::cout << "The file is not set up properly. Please fix the Candidates and try again!" << std::endl;
break;
case VotersError:
std::cout << "The file is not set up properly. Please fix the Votes and try again!" << std::endl;
break;
case FileReadError:
std::cout << "Can not read the file. Please fix it and try again!" << std::endl;
break;
default:
break;
}
return;
}
}
std::list<Candidate> VoteCounter::ConvertToCandidates(std::list<std::string> candidatesString)
{
/*
Each line will be set as NAME,PARTY for the Candidate
*/
std::list<Candidate> returnList;
bool isCreated = false;
Candidate tmp;
for (auto line : candidatesString)
{
std::stringstream ss(line);
while (ss.good())
{
std::string substr;
getline(ss, substr, ',');
if (isCreated == false)
{
tmp = {};
tmp.SetName(substr);
isCreated = true;
}
else
{
tmp.SetParty(substr);
returnList.push_back(tmp);
isCreated = false;
}
}
}
return returnList;
}
std::list<BallotPaper> VoteCounter::ConvertToBallotPapers(std::list<std::string> votesString, const std::list<Candidate> &candidates)
{
/*
Each line will be set as firstPrefence,SecondPrefenece,ThirdPrefenece
Choosing these numbers are based on the index of the candidates listed in the file
*/
std::list<BallotPaper> returnList = {};
try
{
std::list<Candidate>::const_iterator it1;
for (auto line : votesString)
{
std::stringstream ss(line);
int i;
int preference = 0;
BallotPaper tmp;
while (ss >> i)
{
it1 = candidates.cbegin();
std::advance(it1, i - 1);
tmp.setPreference(++preference, *it1);
if (ss.peek() == ',')
ss.ignore();
}
returnList.push_back(tmp);
}
return returnList;
}
catch (const std::exception&)
{
return returnList;
}
}
|
Java
|
UTF-8
| 385
| 2.390625
| 2
|
[] |
no_license
|
package Model;
import utils.MyException;
import utils.MyIDictionary;
/**
* Created by Wyking on 10/29/2016.
*/
public class VarExp extends Exp {
String nm;
public VarExp(String name){
nm = name;
}
int eval(MyIDictionary<String, Integer> tbl) throws Exception {
return tbl.get(nm);
}
public String toString(){
return nm;
}
}
|
C#
|
UTF-8
| 1,548
| 2.765625
| 3
|
[
"MIT"
] |
permissive
|
using i5.Toolkit.Core.ServiceCore;
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace i5.Toolkit.Core.Examples.ServiceExample
{
/// <summary>
/// Demo service which demonstrates how a service can work
/// </summary>
public class DemoService : IService
{
/// <summary>
/// A message that should be returned if the service is accessed
/// </summary>
private string message;
/// <summary>
/// Initializes the service when before it is added to the service manager
/// </summary>
/// <param name="message"></param>
public DemoService(string message)
{
this.message = message;
}
/// <summary>
/// Called if the service is unregistered or the service manager is destroyed
/// </summary>
public void Cleanup()
{
}
/// <summary>
/// Called if the service is registered at the service manager
/// </summary>
/// <param name="owner">The service manager where the service is registered</param>
public void Initialize(IServiceManager owner)
{
}
/// <summary>
/// Returns a demo message to show that the correct service is accessed
/// </summary>
/// <returns></returns>
public string GetDemoMessage()
{
return message + " at time " + DateTime.Now;
}
}
}
|
Markdown
|
UTF-8
| 7,694
| 3.171875
| 3
|
[
"Unlicense",
"LicenseRef-scancode-proprietary-license"
] |
permissive
|
# Albe Timeline <sup>4.0.0</sup>
Albe Timeline is a simple yet highly customizable jQuery plugin that helps you render a responsive horizontal (or vertical) timeline from JSON data.
The data will be automatically grouped by year and the events will be sorted by date.
In addition, this plugin is able to handle almost any type of content such as images, videos, audios and more.
## Use license
The plugin is open source and released for commercial use without cost. I only ask you to [contact me](http://albertino.eti.br/#collapse5 "contact") if you implement it somewhere, so I can take a look or add it here as a demonstration.
## Demonstration
| HORIZONTAL | VERTICAL |
| ------------- | ------------- |
| [Template 1](https://albejr.github.io/jquery-albe-timeline/templates/horizontal/index.html "Template Horizontal") | [Template 1](https://albejr.github.io/jquery-albe-timeline/templates/vertical/index.html "Template Vertical") |
| | [Template 2](https://albejr.github.io/jquery-albe-timeline/templates/simple/index.html "Template Simples") |
| | [Template 3](https://albejr.github.io/jquery-albe-timeline/templates/minimalist/index.html "Template Minimalista") |
| | [Template 4](https://albejr.github.io/jquery-albe-timeline/templates/audain/index.html "Template Audain Designs") |
## Requirements
* Required
[Jquery](https://jquery.com)
* Optional
[Animate CSS](https://daneden.github.io/animate.css)
## Installation
### Bower:
```html
$ bower install jquery-albe-timeline --save
```
### Nodejs:
```html
$ npm install jquery-albe-timeline --save
```
## How to use
#### Load the plugin and dependencies
```html
<link rel="stylesheet" href="style-albe-timeline.css" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="jquery-albe-timeline.min.js"></script>
```
#### Create the data list
```js
<script type="text/javascript">
//Json object
var data = [{
time: '2015-04-30 23:59:59',
header: 'Sample of header',
body: [{
tag: 'h1',
content: 'Lorem ipsum'
},
{
tag: 'p',
content: 'Lorem ipsum dolor sit amet, nisl lorem.'
}],
footer: 'Sample of footer'
},
{
time: '2016-01-20',
body: [{
tag: 'h2',
content: 'Sample with link'
},
{
tag: 'a',
content: 'MY LINK',
attr: {
href: 'http://albertino.eti.br',
target: '_blank',
title: 'Albertino Júnior'
}
}]
}
];
</script>
```
#### Make the call
```html
<div id="myTimeline"></div>
```
```js
<script type="text/javascript">
//Json object
var data = [{...}];
$(document).ready(function () {
$('#myTimeline').albeTimeline(data);
});
</script>
```
* Instance with options:
```js
//**myTimeline**, sets the identifier of the element that will receive the entire timeline (for example, a DIV) and must be unique for each timeline on the page.
//**data**, defines the Json object containing the list of data to be displayed.
$('#myTimeline').albeTimeline(data, {
//Effect of presentation
//'fadeInUp', 'bounceIn', etc
effect: 'zoomInUp',
//Sets the visibility of the annual grouper
showGroup: true,
//Sets the anchor menu visibility for annual groupings (depends on 'showGroup')
showMenu: true,
//Specifies the display language of texts (i18n)
language: 'pt-BR',
//Sets the date display format
//'dd/MM/yyyy', 'dd de MMMM de yyyy HH:mm:ss', etc
formatDate : 'dd MMMM',
//Defines ordering of items
//true: Descendente
//false: Ascendente
sortDesc: true
});
```
* Set the culture:
```js
$(document).ready(function () {
//Overrides the CutureInfo default plugin
$.fn.albeTimeline.languages = {
"en-US": {
days: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
months: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"],
shortMonths: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
msgEmptyContent: "No information to display."
},
"es-ES": {
days: ["Domingo", "Lunes", "Martes", "Miércoles", "Jueves", "Viernes", "Sábado"],
months: ["Enero", "Febrero", "Marzo", "Abril", "Mayo", "Junio", "Julio", "Agosto", "Septiembre", "Octubre", "Noviembre", "Diciembre"],
shortMonths: ["Ene", "Feb", "Mar", "Abr", "May", "Jun", "Jul", "Ago", "Sep", "Oct", "Nov", "Dic"],
msgEmptyContent: "No hay información para mostrar."
},
"fr-FR": {
days: ["Dimanche", "Lundi", "Mardi", "Mercredi", "Jeudi", "Vendredi", "Samedi"],
months: ["Janvier", "Février", "Mars", "Avril", "Mai", "Juin", "Juillet", "Août", "Septembre", "Octobre", "Novembre", "Décembre"],
shortMonths: ["Jan", "Fév", "Mar", "Avr", "Mai", "Juin", "Juil", "Août", "Sep", "Oct", "Nov", "Déc"],
msgEmptyContent: "Aucune information à afficher."
}
};
//Internationalization
$('#myTimeline').albeTimeline(data, {
language: 'fr-FR', //default: pt-BR
formatDate: 'DD, dd MMMM aaaaa'
});
});
```
#### Html Structure
Using the plugin defaults, we'll have a similar result:
```html
<div id="myTimeline">
<section id="timeline">
<div id="year2016" class="group2016">2016</div>
<article class="animated fadeInUp">
<div class="panel">
<div class="badge">20 Jan</div>
<div class="panel-body">
<img src="../img/qrcode.png" width="150px" class="img-responsive">
<h2>Sample with image</h2>
<p>Lorem ipsum dolor sit amet, nisl lorem.</p>
</div>
</div>
</article>
<div id="year2015" class="group2015">2015</div>
<article class="animated fadeInUp inverted">
<div class="panel">
<div class="badge">29 Mar</div>
<div class="panel-heading">
<h4 class="panel-title">Sample of header</h4>
</div>
<div class="panel-body">
<h1>Lorem ipsum</h1>
<p>Lorem ipsum dolor sit amet, nisl lorem.</p>
</div>
<div class="panel-footer">Sample of footer</div>
</div>
</article>
<article class="animated fadeInUp">
<div class="panel">
<div class="badge"> </div>
</div>
</article>
<div class="clearfix" style="float: none;"></div>
</section>
</div>
```
## Notes
* The Json object is also accepted in string format. For example:
```js
$('#myTimeline').albeTimeline('[{"time": "2016-01-20", "body": [{ "tag": "h1", "content": "Lorem ipsum" }, { "tag": "p", "content": "massa, cursus quisque leo quisque dui." }]}]');
```
* The **time** element must meet the ISO 8601 standard in year-month-day format "yyyy-MM-dd" or "yyyy-MM-dd HH:mm:ss"
* If you need to pass a CSS class as an element attribute, use the property name **cssclass**. For example:
```js
body: [{
tag: 'img',
attr: {
src: '../img/qrcode.png',
width: '150px',
cssclass: 'img-responsive'
}
}
```
* For double quotes in attributes, use "escape". For example:
```js
body: [{
tag: 'p',
content: 'Lorem ipsum dolor sit amet. See <a href=\"https://github.com/Albejr/jquery-albe-timeline\" target=\"_blank\">more details</a>'
}
}
```
|
C++
|
UTF-8
| 3,095
| 3.609375
| 4
|
[] |
no_license
|
/****************************************************************************************************
34. Search for a Range
-----------------------------------------------------------------------------------------------------
Given an array of integers sorted in ascending order, find the starting and ending position of a given target value.
Your algorithm's runtime complexity must be in the order of O(log n).
If the target is not found in the array, return [-1, -1].
For example,
Given [5, 7, 7, 8, 8, 10] and target value 8,
return [3, 4].
****************************************************************************************************/
#include "problems\problems\Header.h"
namespace std
{
class Solution {
public:
vector<int> searchRange(vector<int>& nums, int target) {
vector<int> rst; rst.resize(2,-1);
int len = nums.size();
if (len==0 || target<nums[0] || target > nums[len-1]) return rst;
if (target==nums[0]) {rst[0]=0; rst[1]=0;}
if (target==nums[len-1]) rst[1] = len-1;
int left=binaryfind(nums,double(target)-0.5);
int right=binaryfind(nums,double(target)+0.5);
if ((right - left)<1 && target!=nums[len-1]) return rst;
rst[0] = left; if (target==nums[0]) rst[0] = 0;
rst[1] = right-1; if (target==nums[len-1]) rst[1] = len-1;
return rst;
}
int binaryfind(vector<int>& nums, double target)
{
int left=0,right=nums.size()-1;
while(left<right-1)
{
int mid = (left+right)/2;
if (target<nums[mid]) right=mid;
else left=mid;
}
return right;
}
};
class Solution {
public:
vector<int> searchRange(vector<int>& nums, int target) {
vector<int> rst(2,-1);
int len=nums.size();
if(len==0) return rst;
int s=0;
int t=len-1;
int mid=0;
if(target < nums[s] || target > nums[t]) return rst;
while(s<=t)
{
mid = (s+t)/2;
if(nums[mid]<target) s=mid+1;
else if (nums[mid]>target) t=mid-1;
else break;
}
if(nums[mid]==target)
{
int tmp=mid;
while(tmp>=0 && nums[tmp]==target) tmp--;
rst[0]=tmp+1;
tmp=mid;
while(tmp<len && nums[tmp]==target) tmp++;
rst[1]=tmp-1;
}
return rst;
}
};
}
/****************************************************************************************************
Note
here it return the right pointor of the target.
so there are several special cases need to be considered
****************************************************************************************************/
|
Shell
|
UTF-8
| 1,043
| 2.671875
| 3
|
[] |
no_license
|
#!/bin/bash -ve
# request memory for job (default 6G, max 72G)
#$ -l mem=6G
#$ -l rmem=6G
# run time for job in hours:mins:sec (max 168:0:0, jobs with h_rt < 8:0:0 have priority)
#$ -l h_rt=02:50:00
# -P molecol
# -q molecol.q
#$ -t 1000-16828
#$ -tc 30
#$ -cwd
#$ -V
module load apps/python/conda
module load apps/python/anaconda3-4.2.0
source activate short-variants
taskid=${SGE_TASK_ID}
for site in CZA CZB CZD; do
# make one file per location; keep only SNPs used in ANG analysis
# /home/bo1awx/programs/vcftools_0.1.13/bin/vcftools --keep individuals_$site.txt --vcf CZ.raw.vcf$taskid \
# --positions ANG13b_positions_to_keep.txt --recode --out CZCLI01_$site.filt1-$taskid
# minor allele freq filter, variant quality filter, keep biallelic SNPs only, remove SNPs where < 150 inds have data
vcftools --gzvcf filtered/CZCLI01_${site}.HF.SNP-${taskid}.vcf.gz --maf 0.01 --minQ 20 \
--min-alleles 2 --max-alleles 2 --max-missing-count 150 --recode --out filtered/CZCLI01_${site}_SNP.filt2-${taskid}
done
source deactivate
|
Java
|
UTF-8
| 805
| 3.21875
| 3
|
[] |
no_license
|
package com.orilore.housework.live;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
public class Live {
public static void main(String [] args){
long a1=0;
String birday="1991-08-26";
SimpleDateFormat s= new SimpleDateFormat("yyyy-MM-dd");
try{
Date d1 = s.parse(birday);//将字符串 转换成date对象
a1= d1.getTime();//获取当前对象 距离1970年的毫秒数
System.out.println(a1);
}catch(Exception e){
e.printStackTrace();
}
Calendar c = Calendar.getInstance();
Date d2 = c.getTime();//获取当前时间对象
long a2 = d2.getTime();//当前时间对象至历元的毫秒数
System.out.println(a2);
long age= (a2-a1)/1000/60/60/24/365;//活了多少年
System.out.println(age);
}
}
|
Python
|
UTF-8
| 6,813
| 3.015625
| 3
|
[
"MIT"
] |
permissive
|
import sys, os
import math
import os.path
from collections import OrderedDict
import argparse
import numpy as np
import tiledb
import random
ltrdict = {'a':[1,0,0,0],
'c':[0,1,0,0],
'g':[0,0,1,0],
't':[0,0,0,1],
'n':[0,0,0,0],
'A':[1,0,0,0],
'C':[0,1,0,0],
'G':[0,0,1,0],
'T':[0,0,0,1],
'N':[0,0,0,0]}
reverse_dict={}
for key in ltrdict:
cur_val=ltrdict[key]
reverse_dict[tuple(cur_val)]=key
#def one_hot_encode(seqs):
# return np.array([[ltrdict.get(x,[0,0,0,0]) for x in seq] for seq in seqs])
def one_hot_encode(seqs):
"""
Converts a list of DNA ("ACGT") sequences to one-hot encodings, where the
position of 1s is ordered alphabetically by "ACGT". `seqs` must be a list
of N strings, where every string is the same length L. Returns an N x L x 4
NumPy array of one-hot encodings, in the same order as the input sequences.
All bases will be converted to upper-case prior to performing the encoding.
Any bases that are not "ACGT" will be given an encoding of all 0s.
"""
seq_len = len(seqs[0])
assert np.all(np.array([len(s) for s in seqs]) == seq_len)
# Join all sequences together into one long string, all uppercase
seq_concat = "".join(seqs).upper()
one_hot_map = np.identity(5)[:, :-1]
# Convert string into array of ASCII character codes;
base_vals = np.frombuffer(bytearray(seq_concat, "utf8"), dtype=np.int8)
# Anything that's not an A, C, G, or T gets assigned a higher code
base_vals[~np.isin(base_vals, np.array([65, 67, 71, 84]))] = 85
# Convert the codes into indices in [0, 4], in ascending order by code
_, base_inds = np.unique(base_vals, return_inverse=True)
# Get the one-hot encoding for those indices, and reshape back to separate
return one_hot_map[base_inds].reshape((len(seqs), seq_len, 4))
def one_hot_to_dna(one_hot):
"""
Converts a one-hot encoding into a list of DNA ("ACGT") sequences, where the
position of 1s is ordered alphabetically by "ACGT". `one_hot` must be an
N x L x 4 array of one-hot encodings. Returns a lits of N "ACGT" strings,
each of length L, in the same order as the input array. The returned
sequences will only consist of letters "A", "C", "G", "T", or "N" (all
upper-case). Any encodings that are all 0s will be translated to "N".
"""
bases = np.array(["A", "C", "G", "T", "N"])
# Create N x L array of all 5s
one_hot_inds = np.tile(one_hot.shape[2], one_hot.shape[:2])
# Get indices of where the 1s are
batch_inds, seq_inds, base_inds = np.where(one_hot)
# In each of the locations in the N x L array, fill in the location of the 1
one_hot_inds[batch_inds, seq_inds] = base_inds
# Fetch the corresponding base for each position using indexing
seq_array = bases[one_hot_inds]
return ["".join(seq) for seq in seq_array]
def dinuc_shuffle(seq):
#get list of dinucleotides
nucs=[]
for i in range(0,len(seq),2):
nucs.append(seq[i:i+2])
#generate a random permutation
random.shuffle(nucs)
return ''.join(nucs)
def revcomp(seq):
seq=seq[::-1].upper()
comp_dict=dict()
comp_dict['A']='T'
comp_dict['T']='A'
comp_dict['C']='G'
comp_dict['G']='C'
rc=[]
for base in seq:
if base in comp_dict:
rc.append(comp_dict[base])
else:
rc.append(base)
return ''.join(rc)
class DefaultOrderedDictWrapper(object):
def __init__(self, factory):
self.ordered_dict = OrderedDict()
assert hasattr(factory, '__call__')
self.factory = factory
def __getitem__(self, key):
if key not in self.ordered_dict:
self.ordered_dict[key] = self.factory()
return self.ordered_dict[key]
def enum(**enums):
class Enum(object):
pass
to_return = Enum
for key,val in enums.items():
if hasattr(val, '__call__'):
setattr(to_return, key, staticmethod(val))
else:
setattr(to_return, key, val)
to_return.vals = [x for x in enums.values()]
to_return.the_dict = enums
return to_return
def combine_enums(*enums):
new_enum_dict = OrderedDict()
for an_enum in enums:
new_enum_dict.update(an_enum.the_dict)
return enum(**new_enum_dict)
def coords_to_tdb_indices(coords,tdb_instance):
'''
coords is a tuple (chrom, start, stop)
'''
num_chroms=tdb_instance.meta['num_chroms']
for i in range(num_chroms):
if tdb_instance.meta['chrom_'+str(i)]==coords[0]:
chrom_offset=tdb_instance.meta['offset_'+str(i)]
tdb_index_start=chrom_offset+coords[1]
tdb_index_end=chrom_offset+coords[2]
return (tdb_index_start,tdb_index_end)
raise Exception("chrom name:"+str(coords[0])+" not found in tdb array")
def tdb_indices_to_coords(indices,tdb_instance):
'''
indices is a list of tdb indices
'''
pass
def transform_data_type(inputs,num_inputs):
if inputs is None:
inputs=[None]*num_inputs
elif inputs is []:
inputs=[None]*num_inputs
else:
assert(len(inputs)==num_inputs)
transformed=[]
for i in range(num_inputs):
transformed.append([])
cur_inputs=inputs[i].split(',')
for j in cur_inputs:
if str(j).lower()=="none":
transformed[i].append(None)
else:
transformed[i].append(float(j))
return transformed
def transform_data_type_min(inputs,num_inputs):
if inputs is None:
transformed=[-math.inf]*num_inputs
elif inputs is []:
transformed=[-math.inf]*num_inputs
else:
assert(len(inputs)==num_inputs)
transformed=[]
for i in range(num_inputs):
transformed.append([])
cur_inputs=inputs[i].split(',')
for j in cur_inputs:
if str(j).lower()=="none":
transformed[i].append(-math.inf)
else:
transformed[i].append(float(j))
return transformed
def transform_data_type_max(inputs,num_inputs):
if inputs is None:
transformed=[math.inf]*num_inputs
elif inputs is []:
transformed=[math.inf]*num_inputs
else:
assert(len(inputs)==num_inputs)
transformed=[]
for i in range(num_inputs):
transformed.append([])
cur_inputs=inputs[i].split(',')
for j in cur_inputs:
if str(j).lower()=="none":
transformed[i].append(math.inf)
else:
transformed[i].append(float(j))
return transformed
|
C
|
UTF-8
| 2,254
| 3.078125
| 3
|
[] |
no_license
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "Funciones.h"
#define Cant_Personas 20
int menu(void);
typedef struct
{
char nombre[50];
int dni;
int edad;
int status;
}ePersonas;
int main()
{
ePersona ArrayPersona[Cant_Personas];
int dni;
int option=0;
int lugarLibre;
int resultadoDeBusqueda;
inicializarArrayPersona (ArrayPersona,Cant_Personas);
do
{
option=menu();
switch(option)
{
case 1:
lugarLibre=obtenerEspacioLibre(ArrayPersona,Cant_Personas);
if(lugarLibre==-1)
{
printf("\nNO QUEDAN LUGARES LIBRES\n");
}
else
{
printf("\nINGRESE EL NOMBRE:\n");
fflush(stdin);
scanf("%s",&ArrayPersona[lugarLibre].nombre);
ArrayPersona[lugarLibre].status=0;
printf("\nINGRESE LA EDAD:\n");
scanf("%d",&ArrayPersona[lugarLibre].edad);
printf("\nINGRESE EL DNI:\n");
scanf("%d",&ArrayPersona[lugarLibre].dni);
}
break;
case 2:
printf("\nINGRESE EL DNI A BORRAR:\n");
scanf("%d",&dni);
resultadoDeBusqueda=buscarPorDni(ArrayPersona,dni);
if(resultadoDeBusqueda==-1)
{
printf("\nEL DNI NO PUDO ENCONTRARSE\n");
break;
}
printf("\nINGRESE EL NUEVO DNI:\n");
case 3:
mostrarOrdenado(ArrayPersona, Cant_Personas);
system("pause");
break;
case 4:
mostrarGrafico(ArrayPersona,Cant_Personas);
system("pause");
break;
case 5:
printf("\nSALIR DEL PROGRAMA\n");
default:
case 6:
break;
case 7:
break;
case 8:
break;
case 9:
break;
printf("\nOPCION INCORRECTA\n");
system("pause");
break;
}
}while(option!='S');
return 0;
}
|
Python
|
UTF-8
| 374
| 3.4375
| 3
|
[
"MIT"
] |
permissive
|
L=raw_input("Please Enter the length of the layer (in m): ")
A=raw_input("Please Enter the area of the wall (in m2): ")
k=raw_input("Please Enter the condictivty of the layer (in W/(m*K)): ")
print("\n you just said "+ "L= " + L+ " m "+ "A= " + A+ " m2 "+ "k= "+ k +" W/(m*K) \n")
R=float(L)/(float(k)*float(A))
print("Well the Thermal Resistnace is "+ str(R)+ " degC/W")
|
Shell
|
UTF-8
| 163
| 3.453125
| 3
|
[] |
no_license
|
#!/bin/bash
counter=0
for ((i=1;i<=100;i++))
do
ans=$[$i%11]
if [ $ans -eq 0 ]
then
twice[((counter++))]=$i
fi
done
echo "Repeated Twice Numbers are: ${twice[@]}"
|
Python
|
UTF-8
| 1,782
| 2.75
| 3
|
[] |
no_license
|
import re
def readline(log_file):
line = log_file.readline()
if line == "":
return None
else:
return re.sub(r"[\n\t\s]*", "", line)
def is_read_type(line):
return line.startswith('FLANKING') or line.startswith('SPANNING') or line.startswith('INREPEAT')
# To define name and corresponding sequence
def log_parse(text_file):
with open(text_file) as log_file:
dic = {}
line = readline(log_file)
while line:
if line is not None and line != "" and line[0].isdigit():
repeat_id = line[:-1]
dic[repeat_id] = {}
line = readline(log_file)
while line is not None and (line == "" or not line[0].isdigit()):
if is_read_type(line):
read_type = line[:-1]
dic[repeat_id][read_type] = {}
line = readline(log_file)
while line is not None and (line == "" or not line[0].isdigit()) and not is_read_type(line):
if line.startswith('name'):
name_id = line[line.find('"')+1:-1]
line = readline(log_file)
if read_type.startswith('INREPEAT'):
dic[repeat_id][read_type][name_id] = line[4:]
else:
line = readline(log_file)
dic[repeat_id][read_type][name_id] = line
line = readline(log_file)
continue
line = readline(log_file)
continue
line = readline(log_file)
return dic
|
Swift
|
UTF-8
| 1,171
| 2.625
| 3
|
[] |
no_license
|
//
// UIColor+HSB.swift
// arkit-testing-2
//
// Created by Nikita Arutyunov on 10/10/20.
// Copyright © 2020 Nickaroot.ME. All rights reserved.
//
import UIKit
extension UIColor {
open var hue: CGFloat? {
var value = CGFloat.leastNonzeroMagnitude
getHue(&value, saturation: nil, brightness: nil, alpha: nil)
return value != CGFloat.leastNonzeroMagnitude ? value : nil
}
open var saturation: CGFloat? {
var value = CGFloat.leastNonzeroMagnitude
getHue(nil, saturation: &value, brightness: nil, alpha: nil)
return value != CGFloat.leastNonzeroMagnitude ? value : nil
}
open var brightness: CGFloat? {
var value = CGFloat.leastNonzeroMagnitude
getHue(nil, saturation: nil, brightness: &value, alpha: nil)
return value != CGFloat.leastNonzeroMagnitude ? value : nil
}
open var alpha: CGFloat? {
var value = CGFloat.leastNonzeroMagnitude
getHue(nil, saturation: nil, brightness: nil, alpha: &value)
return value != CGFloat.leastNonzeroMagnitude ? value : nil
}
}
|
PHP
|
UTF-8
| 1,067
| 2.9375
| 3
|
[
"Apache-2.0"
] |
permissive
|
<?php
/**
* This file is part of the GraphAware Reco4PHP package.
*
* (c) GraphAware Limited <http://graphaware.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace GraphAware\Reco4PHP\Result;
class SingleScore
{
/**
* @var float
*/
private $score;
/**
* @var null|string
*/
private $reason;
/**
* SingleScore constructor.
*
* @param float|$score
* @param null|string $reason
*/
public function __construct($score, $reason = null)
{
$this->score = (float) $score;
$this->addReason($reason);
}
public function addReason($reason = null)
{
if (null !== $reason) {
$this->reason = (string) $reason;
}
}
/**
* @return float
*/
public function getScore()
{
return $this->score;
}
/**
* @return null|string
*/
public function getReason()
{
return $this->reason;
}
}
|
C#
|
UTF-8
| 1,298
| 2.546875
| 3
|
[] |
no_license
|
using ProjetSessionWebServ2.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace ProjetSessionWebServ2.DAL
{
public class SpectacleRepository : GenericRepository<Spectacle>
{
public SpectacleRepository(ApplicationDbContext context) : base(context) { }
public Spectacle ObtenirSpectacleParID(int? id)
{
return GetByID(id);
}
public IEnumerable<Spectacle> ObtenirSpectacles()
{
return Get(null, null, "TypeSpectacle,Salle,Congres,PlageHoraires,Users");
}
public IEnumerable<Spectacle> ObtenirSpectacleParTypeSpectacle(TypeSpectacle type)
{
return Get().Where(s => s.TypeSpectacle.Nom.Equals(type.Nom));
}
public IEnumerable<Spectacle> ObtenirSpectacleParNom(string nom)
{
IEnumerable<Spectacle> lstFiltered = Get(t => t.Nom.Contains(nom)).ToList();
return lstFiltered.Count() == 0 ? ObtenirSpectacles() : lstFiltered;
}
public void InsertSpectacle(Spectacle Spectacle) { Insert(Spectacle); }
public void DeleteSpectacle(Spectacle Spectacle) { Delete(Spectacle); }
public void UpdateSpectacle(Spectacle Spectacle) { Update(Spectacle); }
}
}
|
Java
|
UTF-8
| 4,415
| 3.453125
| 3
|
[] |
no_license
|
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Scanner;
public class VendingMachine {
public static void main(String args[]) {
VendingMachine vm = new VendingMachine();
Scanner scanner = new Scanner(System.in);
boolean endProgramFlag = false;
// prepare items to sell
List<Item> itemList = new ArrayList<Item>();
vm.prepareItem(itemList);
// vending machine running
while (!endProgramFlag) {
// print out menu
System.out.println("*********************************************");
vm.printMenu(itemList);
// take user input
System.out.println("Enter your selection, press 0 to exit: ");
int selection = scanner.nextInt();
if (selection == 0) {
endProgramFlag = true;
break;
}
// validate input selection
if (itemList.size() < selection) {
System.out.println("No such item, transaction aborted.");
continue;
}
// validate input cash format
System.out.println("Enter your cash: ");
double cash = scanner.nextDouble();
if (!vm.validateCash(cash)){
System.out.println("Cash not accepted, transaction aborted.");
continue;
}
// calculate change return
int[] change = vm.changeReturnCalculation(selection-1, itemList, cash);
// change return
if (change[0] == 1) {
System.out.println("Transaction complelte, your change is: " +
(change[1]==0 ? "" : change[1] + " of $25, ") +
(change[2]==0 ? "" : change[2] + " of $10, ") +
(change[3]==0 ? "" : change[3] + " of $5, ") +
(change[4]==0 ? "" : change[4] + " of $1, ") +
(change[5]==0 ? "" : change[5] + " of $0.25, ") +
(change[6]==0 ? "" : change[6] + " of $0.1, ") +
(change[7]==0 ? "" : change[7] + " of $0.01.") +
(change[1]==0 && change[2]==0 && change[3]==0
&& change[4]==0 && change[5]==0 && change[6]==0 && change[7]==0 ? "0" : ""));
} else if (change[0] == 2) {
System.out.println("Not enough cash, transaction aborted.");
} else if (change[0] == 3) {
System.out.println("System error, transaction aborted.");
}
}
scanner.close();
}
private void prepareItem(List<Item> itemList) {
Item item1 = new Item(1, "soda", 5.50);
Item item2 = new Item(2, "apple", 8.31);
Item item3 = new Item(3, "book", 9.99);
Item item4 = new Item(4, "earphone", 10.49);
Item item5 = new Item(5, "pen", 15.25);
itemList.add(item1);
itemList.add(item2);
itemList.add(item3);
itemList.add(item4);
itemList.add(item5);
}
private void printMenu(List<Item> itemList) {
Iterator<Item> ite = itemList.iterator();
while (ite.hasNext()){
Item e = ite.next();
System.out.println(e.getTag()+". "+e.getName()+": $"+e.getPrice());
}
}
private int[] changeReturnCalculation(int selection, List<Item> itemList, double cash) {
int[] change = new int[8];
//0 - txn complete flag
//1 - number of 25
//2 - number of 10
//3 - number of 5
//4 - number of 1
//5 - number of 0.25
//6 - number of 0.1
//7 - number of 0.01
if (itemList.get(selection) != null) {
double formattedPrice = toTwoDigits(itemList.get(selection).getPrice());
double formattedCash = toTwoDigits(cash);
if (formattedPrice <= formattedCash) {
double changeReturn = toTwoDigits(formattedCash-formattedPrice);
while (changeReturn>=25) {
change[1]++;
changeReturn-=25;
}
while (changeReturn>=10) {
change[2]++;
changeReturn-=10;
}
while (changeReturn>=5) {
change[3]++;
changeReturn-=5;
}
while (changeReturn>=1) {
change[4]++;
changeReturn-=1;
}
while (changeReturn>=0.25) {
change[5]++;
changeReturn = toTwoDigits(changeReturn-0.25);
}
while (changeReturn>=0.1) {
change[6]++;
changeReturn = toTwoDigits(changeReturn-0.1);
}
while (changeReturn>=0.01) {
change[7]++;
changeReturn = toTwoDigits(changeReturn-0.01);
}
change[0] = 1;
} else {
change[0] = 2;
}
} else {
change[0] = 3;
}
return change;
}
private boolean validateCash(double cash) {
if (cash<=0) {
return false;
}
if (cash*100-(int)(cash*100/1) != 0) { // not two digits
return false;
}
return true;
}
private double toTwoDigits(double input) {
DecimalFormat df = new DecimalFormat("#.##");
return Double.valueOf(df.format(input));
}
}
|
Python
|
UTF-8
| 1,802
| 3.640625
| 4
|
[] |
no_license
|
import random
class MarkovEngine:
def __init__(self):
self.states = {}
#adds an occurence of a state to the engine
def append_instance(self, state, next):
found = False
if state in self.states:
follow = self.states.get(state)
follow.append(next)
else:
self.states[state] = [next]
#checks to see if a state is being stored (might be unnecessary with get-state() function)
def exists(self, state):
return state in self.states
#gets a random state from the states stored by the engine
def get_random_state(self):
index = random.randint(0, len(self.states) - 1)
all_keys = list(self.states.keys())
return all_keys[index]
#get the next state for a markov chain given a state
def next_state(self, state):
if state in self.states:
follow = self.states.get(state)
index = random.randint(0, len(follow) - 1)
return follow[index]
else:
return None
#given a current state and the next word, create a new state ((current[1:]), next)
def adjust_state(self, current, next):
adjusted = []
for x in range(1, len(current)):
adjusted.append(current[x])
adjusted.append(next)
return tuple(adjusted)
#takes a length for the result and returns a string
def generate_chain(self, length, seed = None):
if seed is None:
current = self.get_random_state()
else:
current = seed
result = ""
for x in range(0, len(current)):
result += current[x]
if x < len(current) - 1:
result += " "
total_length = len(result)
while total_length < length:
next = self.next_state(current)
if next != None:
total_length += len(next) + 1
if total_length <= length:
result += " " + next
current = self.adjust_state(current, next)
if next == None or current == None:
total_length = length
return result
|
C#
|
UTF-8
| 1,624
| 2.59375
| 3
|
[] |
no_license
|
using UnityEngine;
using System.Collections;
public class AnimalUtilityGenerator : UtilityGenerator
{
private Animal animal;
void Awake()
{
animal = GetComponent<Animal>();
}
public override bool CheckSpecific(Desire desire, Animal checker)
{
if (desire == Desire.Mate)
return animal.CanBreed();
else if (desire == Desire.RunAway || desire == Desire.RunAway)
return IsThreat(animal, checker);
else if (desire == Desire.EatMeat)
return IsThreat(checker, animal);
else
return true;
}
public override void InteractWith(Animal other)
{
if (other.species == animal.species && other.CanBreed() && animal.CanBreed())
{
animal.GiveBirth();
other.Impregnate();
}
else if (other.species != animal.species && other.species.type == AnimalSpecies.Type.Carnivore)
{
if (other.species.HasTrait(Trait.Type.Claws))
animal.currentHealth = 0f;
else
animal.currentHealth -= other.species.size * other.species.rateOfEating;
}
}
bool IsThreat(Animal attacker, Animal defender)
{
if (attacker.species == defender.species)
return false;
if (defender.species.HasTrait(Trait.Type.Vicious))
return false;
if (attacker.species.HasTrait(Trait.Type.Vicious))
return true;
return attacker.species.GetCombatThreat() > defender.species.GetCombatThreat() * AnimalSpeciesConfig.instance.defenderThreatMod;
}
}
|
Markdown
|
UTF-8
| 2,259
| 3.078125
| 3
|
[
"Apache-2.0"
] |
permissive
|
## Overview
This is a generated connector for [SupportBee API v1](https://supportbee.com/api) OpenAPI specification.
SupportBee’s support ticket system enables teams to organize, prioritize and collaborate on customer support emails.
## Prerequisites
Before using this connector in your Ballerina application, complete the following:
* Create a [SupportBee](https://supportbee.com) account
* Obtain tokens by following [this guide](https://supportbee.com/api#authentication)
## Quickstart
To use the SupportBee connector in your Ballerina application, update the .bal file as follows:
### Step 1: Import connector
First, import the `ballerinax/supportbee` module into the Ballerina project.
```ballerina
import ballerinax/supportbee;
```
### Step 2: Create a new connector instance
Create a `supportbee:ApiKeysConfig` with the API key obtained, and initialize the connector with it.
```ballerina
supportbee:ApiKeysConfig config = {
authToken: "<API_KEY>"
}
supportbee:Client baseClient = check new Client(config, serviceUrl = "https://{company}.supportbee.com");
```
### Step 3: Invoke connector operation
1. Now you can use the operations available within the connector. Note that they are in the form of remote operations.
Following is an example on how to create a ticket for the company using the connector.
Creates a ticket for the company
```ballerina
public function main() returns error? {
supportbee:CreateTicketRequest requestData = {
ticket: {
subject: "Subject",
requester_name: "John Doe",
requester_email: "john@example.com",
cc: [
"Test1 <test1@example.com>",
"Test2 <test2@example.com>"
],
bcc: [
"Test3 <test3@example.com>",
"Test4 <test4@example.com>"
],
content: {
text: "Creating a ticket",
html: "<p>Creating a ticket</p>"
}
}
};
supportbee:CreatedTicket response = check baseClient->createTicket(requestData);
log:printInfo(response.toJsonString());
}
```
2. Use `bal run` command to compile and run the Ballerina program.
|
Java
|
UTF-8
| 548
| 2.390625
| 2
|
[] |
no_license
|
package com.osreboot.ridhvl.action;
import java.util.ArrayList;
import java.util.Arrays;
public final class HvlEvent2<A, B> {
private ArrayList<HvlAction2<A, B>> actions;
public HvlEvent2(){
actions = new ArrayList<>();
}
public HvlEvent2(HvlAction2<A, B>[] actionArgs){
actions = new ArrayList<>(Arrays.asList(actionArgs));
}
public void trigger(A a, B b){
for(HvlAction2<A, B> action : actions) action.run(a, b);
}
public void addAction(HvlAction2<A, B> actionArg){
actions.add(actionArg);
}
}
|
Java
|
UTF-8
| 487
| 1.90625
| 2
|
[] |
no_license
|
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package evaluatemetrics;
/**
*
* @author daguaman
*/
class C3 extends C2{
private int num;
private float price;
public int putNum() {
return num;
}
public float putPrice() {
return price;
}
}
|
SQL
|
UTF-8
| 3,110
| 3.78125
| 4
|
[] |
no_license
|
# http://www.w3resource.com/sql-exercises/sql-retrieve-exercise-24.php
/*
Write a SQL query to find all the details of 1970 winners by the ordered to subject and winner name; but the list contain the subject Economics and Chemistry at last.
YEAR SUBJECT WINNER COUNTRY CATEGORY
---- ------------------------- --------------------------------------------- ------------------------- ------------
1970 Physics Hannes Alfven Sweden Scientist
1970 Physics Louis Neel France Scientist
1970 Chemistry Luis Federico Leloir France Scientist
1970 Physiology Ulf von Euler Sweden Scientist
1970 Physiology Bernard Katz Germany Scientist
1970 Literature Aleksandr Solzhenitsyn Russia Linguist
1970 Economics Paul Samuelson USA Economist
1970 Physiology Julius Axelrod USA Scientist
1971 Physics Dennis Gabor Hungary Scientist
1971 Chemistry Gerhard Herzberg Germany Scientist
1971 Peace Willy Brandt Germany Chancellor
1971 Literature Pablo Neruda Chile Linguist
1971 Economics Simon Kuznets Russia Economist
1978 Peace Anwar al-Sadat Egypt President
1978 Peace Menachem Begin Israel Prime Minister
1987 Chemistry Donald J. Cram USA Scientist
1987 Chemistry Jean-Marie Lehn France Scientist
1987 Physiology Susumu Tonegawa Japan Scientist
1994 Economics Reinhard Selten Germany Economist
1994 Peace Yitzhak Rabin Israel Prime Minister
1987 Physics Johannes Georg Bednorz Germany Scientist
1987 Literature Joseph Brodsky Russia Linguist
1987 Economics Robert Solow USA Economist
1994 Literature Kenzaburo Oe Japan Linguist
*/
SELECT *
FROM nobel_win
WHERE year=1970
ORDER BY
CASE
WHEN subject IN ('Economics','Chemistry') THEN 1 --1 last line
ELSE 0 --0 first line
END,
subject,
winner;
|
Java
|
UTF-8
| 4,675
| 2.609375
| 3
|
[] |
no_license
|
package com.jvirriel.demo.frontend.components.core;
import com.vaadin.server.Resource;
import com.vaadin.server.Sizeable;
import com.vaadin.ui.Component;
import com.vaadin.ui.TabSheet;
/**
* Clase <i>Builder</i> para crear un componente nativo de Vaadin del tipo TabSheet.
* Para más información acerca de los métodos, ver la
* <a href="https://vaadin.com/api/8.0.5/com/vaadin/ui/TabSheet.html">documentación de referencia</a> en la página
* de Vaadin.
*/
public class TabSheetBuilder {
private final TabSheet tabSheet;
private TabSheetBuilder(final TabSheet tabSheet) {
this.tabSheet = tabSheet;
}
public TabSheet get() {
return tabSheet;
}
public static TabSheetBuilder tabSheet() {
return new TabSheetBuilder(new TabSheet());
}
public static TabSheetBuilder tabSheet(Component... components) {
return new TabSheetBuilder(new TabSheet(components));
}
public TabSheetBuilder addComponents(Component... components) {
tabSheet.addComponents(components);
return this;
}
public TabSheetBuilder addFocusListener(com.vaadin.event.FieldEvents.FocusListener listener) {
tabSheet.addFocusListener(listener);
return this;
}
public TabSheetBuilder addSelectedTabChangeListener(TabSheet.SelectedTabChangeListener listener) {
tabSheet.addSelectedTabChangeListener(listener);
return this;
}
public TabSheetBuilder addStyleName(final String... styleNames) {
for (final String styleName : styleNames) {
tabSheet.addStyleName(styleName);
}
return this;
}
public TabSheetBuilder addTab(Component c) {
tabSheet.addTab(c);
return this;
}
public TabSheetBuilder addTab(Component c, int position) {
tabSheet.addTab(c, position);
return this;
}
public TabSheetBuilder addTab(Component c, String caption) {
tabSheet.addTab(c, caption);
return this;
}
public TabSheetBuilder addTab(Component c, String caption, Resource icon) {
tabSheet.addTab(c, caption);
return this;
}
public TabSheetBuilder addTab(Component c, String caption, Resource icon, int position) {
tabSheet.addTab(c, caption, icon, position);
return this;
}
public TabSheetBuilder setCaption(final String caption) {
tabSheet.setCaption(caption);
return this;
}
public TabSheetBuilder setCloseHandler(TabSheet.CloseHandler handler) {
tabSheet.setCloseHandler(handler);
return this;
}
public TabSheetBuilder setEnabled(final boolean enabled) {
tabSheet.setEnabled(enabled);
return this;
}
public TabSheetBuilder setHeight(final String height) {
tabSheet.setHeight(height);
return this;
}
public TabSheetBuilder setHeight(final Float height, final Sizeable.Unit unit) {
tabSheet.setHeight(height, unit);
return this;
}
public TabSheetBuilder setPrimaryStyleName(final String primaryStyleName) {
tabSheet.setPrimaryStyleName(primaryStyleName);
return this;
}
public TabSheetBuilder setResponsive(final boolean responsive) {
tabSheet.setResponsive(responsive);
return this;
}
public TabSheetBuilder setSelectedTab(int position) {
tabSheet.setSelectedTab(position);
return this;
}
public TabSheetBuilder setSelectedTab(TabSheet.Tab tab) {
tabSheet.setSelectedTab(tab);
return this;
}
public TabSheetBuilder setSizeFull() {
tabSheet.setSizeFull();
return this;
}
public TabSheetBuilder setStyleName(final String styleName) {
tabSheet.setStyleName(styleName);
return this;
}
public TabSheetBuilder setStyleName(final String styleName, final boolean add) {
tabSheet.setStyleName(styleName, add);
return this;
}
public TabSheetBuilder setTabCaptionsAsHtml(boolean tabCaptionsAsHtml) {
tabSheet.setTabCaptionsAsHtml(tabCaptionsAsHtml);
return this;
}
public TabSheetBuilder setTabsVisible(boolean tabsVisible) {
tabSheet.setTabsVisible(tabsVisible);
return this;
}
public TabSheetBuilder setVisible(final boolean visible) {
tabSheet.setVisible(visible);
return this;
}
public TabSheetBuilder setWidth(final String width) {
tabSheet.setWidth(width);
return this;
}
public TabSheetBuilder setWidth(final Float width, final Sizeable.Unit unit) {
tabSheet.setWidth(width, unit);
return this;
}
}
|
Python
|
UTF-8
| 7,435
| 2.53125
| 3
|
[] |
no_license
|
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
import cherrypy,settings,json,os,re,sqlite3,random
from cherrypy.lib import auth_basic
from cherrypy import expose,HTTPError
from utils import *
import os.path
rank_zero_append_domains = []
class Domains():
exposed = True
def __init__(self):
self._init_database()
self._debug = True
if settings.environment == 'production':
self._debug = False
def _init_database(self):
db = sqlite3.connect(settings.DB_FILE_PATH)
cursor = db.cursor()
cursor.execute('''
CREATE TABLE IF NOT EXISTS MirrorDomain (
domain TEXT PRIMARY KEY NOT NULL,
site TEXT NOT NULL,
rank INTEGER NOT NULL DEFAULT 0,
blocked BOOLEAN NOT NULL DEFAULT false,
cdate TIMESTAMP DEFAULT CURRENT_TIMESTAMP
)''')
cursor.execute('CREATE INDEX IF NOT EXISTS query_index ON MirrorDomain(site,blocked,rank)')
db.commit()
db.close()
"""
GET site domains by rank and status
GET /domains/$site/?status=up&rank=0
Params:
site: The site id, required
status: The accessible status, default is up,i.e. not blocked.
Enum(up|down|all)
rank: The domain rank, default is 0, i.e. public. use rank=all to get all domains
format: The output format, default is 'plain', means output plain text, domains seperated by line feed
Enum(plain|json|detail)
Format 'detail' will output each JSON with each domain's detail information: [DomainObject]
[{domain:"up.a.com",blocked:true,rank:1}]
Output:
Domain list seperated by line feed char
"""
@mimetype('text/plain')
def GET(self,site=None,status='up',rank='0',format='plain',*args,**kwargs):
if format not in ('plain','json','detail'):
raise HTTPError(400,"Output format must be either plain or json.")
if site is None:
return self._list_all_sites(format)
if status not in ('up','down','all'):
raise HTTPError(400,"Status must be either up or down or all.")
if rank != 'all':
try:
rank = int(rank)
except ValueError:
raise HTTPError(400,"Rank must be integer.")
if rank != 0 :
cb = lambda *args,**kwargs: self._fetch(*args,**kwargs)
return role(['admin','mandator','vip'])(cb)(site,status,rank,format)
else:
return self._fetch(site,status,rank,format)
def _fetch(self,site,status,rank,format):
db = sqlite3.connect(settings.DB_FILE_PATH)
cursor = db.cursor()
if rank == 0:
order = 'ASC'
if status == 'down':
order = 'DESC'
cursor.execute('SELECT domain,blocked,rank FROM MirrorDomain WHERE site=? AND rank=0 ORDER BY blocked ' + order + ' LIMIT 3',(site,))
else:
condSQL = ''
condValue = (site,)
if rank != 'all':
condSQL += ' AND rank=?'
condValue += (rank,)
if status != 'all':
condSQL += ' AND blocked=?'
condValue += (status=='down',)
cursor.execute('SELECT domain,blocked,rank FROM MirrorDomain WHERE site=? '+condSQL,condValue)
domains = cursor.fetchall()
db.close()
if rank==0:
random.shuffle(rank_zero_append_domains)
domains = domains + rank_zero_append_domains[0:5]
if format == 'detail':
domains = map(lambda t:{"domain":t[0],"blocked":t[1],"rank":t[2]},domains)
else:
domains = map(lambda t:t[0],domains)
if format == 'plain':
return "\n".join(domains) + "\n"
elif format == 'json' or format == 'detail':
return json.dumps(domains)
def _list_all_sites(self,format):
db = sqlite3.connect(settings.DB_FILE_PATH)
cursor = db.cursor()
cursor.execute('SELECT DISTINCT site FROM MirrorDomain')
sites = map(lambda t:t[0],cursor.fetchall())
db.close()
if format == 'plain':
return "\n".join(sites) + "\n"
elif format == 'json':
return json.dumps(dict(siteIdList=sites))
"""
POST /domains/$site/
Body:up=a.example.com,b.example.com&down=x.example.com
Params:
site: The site ID
up: up domain split by comma or space
down: down domain split by comma or space
"""
@role(['admin','mandator'])
@mimetype('text/plain')
def POST(self,site,up,down,*args,**kwargs):
db = sqlite3.connect(settings.DB_FILE_PATH)
cursor = db.cursor()
up_domains = set(filter(None,re.split('[,\s]+',up.strip())))
down_domains = set(filter(None,re.split('[,\s]+',down.strip())))
if down_domains:
cursor.execute('DELETE FROM MirrorDomain WHERE site=:site AND blocked=1',{"site":site})
updates = map(lambda (domain):(domain,site,True),down_domains)
cursor.executemany('INSERT OR REPLACE INTO MirrorDomain(domain,site,blocked) values(?,?,?)',updates)
if up_domains:
# mark old up domains to down only when new up domains are available
cursor.execute('UPDATE MirrorDomain SET blocked=1 AND rank=0 WHERE site=:site',{"site":site})
ranked_up_domains = rankDomains(up_domains) # :: [(Rank,Domain)]
blocked = False
updates = map(lambda (rank,domain):(domain,site,blocked,rank),ranked_up_domains)
cursor.executemany('INSERT OR REPLACE INTO MirrorDomain(domain,site,blocked,rank) values(?,?,?,?)',updates)
db.commit()
db.close()
return "OK\n"
@role(['admin','mandator'])
@mimetype('text/plain')
def DELETE(self):
sql = "DELETE FROM MirrorDomain WHERE cdate <= DATETIME('now','-1 day')"
db = sqlite3.connect(settings.DB_FILE_PATH)
cursor = db.cursor()
cursor.execute(sql)
db.commit()
db.close()
return "DELETED\n"
class SubmitForm():
exposed = True
@role(['admin','mandator'])
def GET(self):
return '''
<form action="/domains/" method="POST" style="width:50em;margin:4em auto;">
<p><label>Site ID: <input type="text" name="site"/></label></p>
<p><label>Up Domains split by comma or newline: </br><textarea name="up" style="width:40em;height:10em;"></textarea></label></p>
<p><label>Down Domains split by comma or newline: </br><textarea name="down" style="width:40em;height:10em;"></textarea></label></p>
<p><input type="submit" value="Submit"/></p>
</form>
'''
def validate_password(realm,username, password):
if username in settings.USERS and settings.USERS[username]['password'] == password:
return True
return False
def read_rank_zero_other_domains():
other_domains_file = settings.RANK_ZERO_APPEND_FILE
if os.path.isfile(other_domains_file):
other_domains = filter(None,re.split('[,\s]+',open(other_domains_file).read().strip()))
for domain in other_domains:
rank_zero_append_domains.append((domain,0,0))
if __name__ == '__main__':
read_rank_zero_other_domains()
conf = {
'/': {
'tools.auth_basic.on': True,
'tools.auth_basic.realm': 'localhost',
'tools.auth_basic.checkpassword': validate_password,
'request.dispatch': cherrypy.dispatch.MethodDispatcher()
}
}
cherrypy.config.update({
'server.ssl_module':'builtin',
'server.ssl_certificate':settings.ssl_certificate,
'server.ssl_private_key':settings.ssl_private_key,
'server.socket_host': settings.host,
'server.socket_port': settings.port,
'environment': settings.environment
})
cherrypy.tree.mount(Domains(), '/domains/',conf)
cherrypy.tree.mount(SubmitForm(), '/domain-submit-form/',conf)
cherrypy.engine.start()
cherrypy.engine.block()
|
Java
|
UTF-8
| 293
| 2.4375
| 2
|
[] |
no_license
|
package com.iv.icourier.adapters;
/**
* Created by Andread on 02.06.2016.
*/
public class RecyclerItem {
int id;
String text;
public RecyclerItem(int _id, String _text) {
id = _id;
text = _text;
}
public String getText() {
return text;
}
}
|
C
|
UTF-8
| 661
| 4.375
| 4
|
[] |
no_license
|
#include "stdio.h"
/**
* @brief Returns the single non-duplicated integer from an integer array
*
* @param arr: integer array, can be any lenght
* @param size: size of the integer array
* @return int: integer array of any length with all the elements with exactly 1 duplicate of itself, and a single non duplicate element.
*/
int singleNumber(int* arr, int size)
{
int res = arr[0];
for (int i = 1; i < size; i++)
{
res ^= arr[i];
}
return res;
}
void testSingleNumber()
{
int size;
int arr[] = {1, 3, 7, 5, 1, 7, 3, 2, 8, 2, 5};
size = sizeof(arr) / sizeof(arr[0]);
printf("Single Number is = %d\r\n", singleNumber(arr, size));
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.