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
|
---|---|---|---|---|---|---|---|
C
|
ISO-8859-1
| 980 | 3.296875 | 3 |
[] |
no_license
|
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include "definicoes_sistema.h"
#include "timer.h"
#define TEMPO 10
int tmr_situacao;
time_t horaInicio;
/*******************************
tmr_iniciar
Aciona ou desaciona o timer
entradas
controle: TRUE:liga FALSE:desliga
saidas
nenhuma
********************************/
void tmr_iniciar(int controle)
{
tmr_situacao = controle;
if (controle)
{
horaInicio = time(NULL);
}
}
/*******************************
tmr_timeout
Retorna se o timer esta em timeout.
entradas
nenhuma
saidas
FALSE: no houve estouro do temporizador
TRUE: houve estouro do temporizador
********************************/
int tmr_timeout()
{
time_t horaAtual;
horaAtual = time(NULL);
if (tmr_situacao == false)
{
return false;
}
if ((horaAtual - horaInicio) > TEMPO)
{
return true;
}
return false;
}
|
JavaScript
|
UTF-8
| 1,515 | 2.9375 | 3 |
[] |
no_license
|
var schedule = require('node-schedule');
function scheduleCronstyle(){
//52,53,55分钟执行
// var rule = new schedule.RecurrenceRule();
// rule.minute = [52,53,55];
// schedule.scheduleJob(rule, function(){
// console.log('scheduleCronstyle:' + new Date());
// });
//每5秒
// schedule.scheduleJob('*/5 * * * * *', function(){
// console.log('scheduleCronstyle:' + new Date());
// });
//每3分钟
// schedule.scheduleJob('*/3 * * * *', function(){ //如果 * */3 会有问题
// console.log('scheduleCronstyle:' + new Date());
// });
//每30分钟
schedule.scheduleJob('*/30 * * * *', function(){ //它会在:00 和 :30触发
console.log('scheduleCronstyle:' + new Date());
});
//18点和20点每5分钟
// schedule.scheduleJob('*/5 18,20 * * *', function(){ //如果 * */3 会有问题
// console.log('scheduleCronstyle:' + new Date());
// });
//异常抛出
// schedule.scheduleJob('*/5 * * * * *', function(){
// try{
// throw new Error('Catch me');
// }catch(e){
// console.log(e.message)
// }
// });
// 测试报错
// schedule.scheduleJob('*/5 * * * * *', function(){
// try{
// setTimeout(()=>{
// try {
// throw new Error('Catch me')
// } catch(e) {
// console.log(e.message)
// }
// })
// }catch(e){
// logger.debug("Some debug messages")
// console.log(e.message)
// }
// });
}
scheduleCronstyle();
|
Python
|
UTF-8
| 10,746 | 2.640625 | 3 |
[
"ISC",
"LicenseRef-scancode-public-domain"
] |
permissive
|
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
"""
# Copyright (c) 2018, Ammar Qaseem <ammar.qaseem@pharmazie.uni-freiburg.de>
This script To annotate the entities(in our case entities are compound and protein).
"""
import os, sys
import datetime, time
import nltk.data
import gzip
import os.path
import cPickle as pickle
import re # regular expressions
punkt_tokenizer = nltk.data.load('tokenizers/punkt/english.pickle')
myabbrevs = ['dr', 'vs', 'mr', 'Mrs', 'prof', 'inc', 'i.e', 'e.g', 'et al', 'eq', 'resp']
for abbr in myabbrevs:
punkt_tokenizer._params.abbrev_types.add(abbr)
DictUniProt = {}
# This fuction to make tokenization for text and split it into sentences
def split_to_sentences(text):
return punkt_tokenizer.tokenize(text)
# This function create a dictionary (key: GeneID, value: UniProtID).
# Save this a pickle file to use it later.
def UniProt_mapping(idmapping_file):
_file = gzip.open(idmapping_file, 'rb')
idtype="GeneID"
#print "fileName:", self.fileName
#DBUniProtMapping = ProtmineDB.GenesUniProt()
loop_counter = 0
for line in _file:
# strip() deletes leading plus ending spaces, etc.
# split(delimiter) generates a list out of a string and deletes the "delimiter" (here: tab)
temp = line.strip().split("\t")
#print temp[1]
# Check the second column - if its value equals "GeneID", the required UniProt ID and gene ID is stored in the output file
# debug:
# if test_case is True
if temp[1] == idtype:
loop_counter = loop_counter +1
geneid = int(temp[2])
uniprot = temp[0]
if geneid in DictUniProt:
DictUniProt[geneid] = DictUniProt[geneid] + ',' + uniprot
else:
DictUniProt[geneid] = uniprot
# Save the dictionary into pickle file
pickle.dump( DictUniProt, open( "protmine/uniprot.p", "wb" ) )
# This function receive a text and the list of entities to be annotate with their postions in the text, and return a text with annotated those entities.
def annotating(pmid, text, entities):
#<compound-id="80654">Cl</compound-id>
l = list(text)
l2 = list()
pos = 0
for row in entities:
#print row
rowTokens = row.split('\t')
startEnt = int(rowTokens[1])
endEnt = int(rowTokens[2])
entity = rowTokens[3]
entType = rowTokens[4]
entID = ''
if len(rowTokens) > 5 :
if (entType == "Chemical"):
cid = rowTokens[5]
entID = cid
elif (entType == "Gene"):
gid = (rowTokens[5].split('(')[0]).split(';')
gg = ''
for g in gid:
#print g
try:
if int(g) in dict:
#print g
gg += dict[int(g)] + ","
except:
continue
if gg != '':
entID = gg[:-1]
else:
entID = ''
l2 += l[pos:startEnt]
if (entType == "Chemical"):
fullCompAnnotEntity = '<compound-id="'+entID+'">' + str("".join( l[startEnt:endEnt])) + '</compound-id>'
l2 += fullCompAnnotEntity
elif (entType == "Gene"):
fullCompAnnotEntity = '<protein-id="'+entID+'">' + str("".join( l[startEnt:endEnt])) + '</protein-id>'
l2 += fullCompAnnotEntity
pos = endEnt
l2 += "".join( l[pos:])
annotedText = "".join( l2 )
return annotedText
def getSynonyms(ann_text,tag):
tag_start = [(a.start(), a.end()) for a in list(re.finditer('<'+tag+'=\".*?">', ann_text))]
tag_end = [(a.start(), a.end()) for a in list(re.finditer('</'+tag+'>', ann_text))]
#comp_tag_end = [(a.start(), a.end()) for a in list(re.finditer('</compound-id>', ann_text))]
syn_pos=[]
lstSyn=[]
for elem in tag_start:
syn_pos.append(elem[1])
for elem in tag_end:
syn_pos.append(elem[0])
syn_pos.sort()
for i in range(0,(len(syn_pos)/2)):
syn = ann_text[syn_pos[i*2]:syn_pos[(i*2)+1]]
lstSyn.append(syn)
return lstSyn
def get_related_entities(ann_text):
compound_lstSyn = getSynonyms(ann_text,'compound-id')
protein_lstSyn = getSynonyms(ann_text,'protein-id')
# Get the unique list to avoid the duplication
#sorted(set(x), key=x.index)
compound_lstSyn_unique = sorted(set(compound_lstSyn), key=compound_lstSyn.index)
protein_lstSyn_unique = sorted(set(protein_lstSyn), key=protein_lstSyn.index)
# if one of two lists is empty then there is not any relation
if not compound_lstSyn_unique or not protein_lstSyn_unique :
return
cand_relation = "" # initialize
# go through each compound and make relation to each protein(all with all). The default relation is no_interation
for comp in compound_lstSyn_unique:
for prot in protein_lstSyn_unique:
cand_relation += "\t" + comp + "__" + prot + "__" + "no_interaction"
#return (ann_text+relation)
return (cand_relation)
# This fuction to analyse the output results from Pubtator for annotate entities. This analysis, extract pmid, a text(Title and Abstract) and the entities with their postions in the text.
def analysisPubtatorRes(fileName, outputFile):
if os.path.splitext(fileName)[-1] == ".gz":
InFile = gzip.open(fileName, 'rb')
else:
InFile = open(fileName, 'rb')
out= "annotate_output/" + outputFile
#outFile = gzip.GzipFile(out, 'wb')
#outFileCand = gzip.GzipFile('annotate_output/final_sentences_with_candidate.txt.gz', 'wb')
outFileCand = open(out, 'w')
outFile = open('annotate_output/out_without_candidate.txt', 'w')
doc_counter = 0
entities=list()
rowDict = {}
i=0
s=""
for line in InFile :
if line.strip():
if line.strip()[:7] == "[Error]":
i=0
s=""
entities=list()
rowDict = {}
continue
if i in (0,1):
#print line
tokens = line.strip().split("|")
if len(tokens) > 1:
if tokens[1] == "a" and tokens[2]:
s+= " " + tokens[2]
#print s
elif tokens[1] == "t" and tokens[2]:
#print line
pmid = tokens[0]
s+= tokens[2]
i+=1
else:
tokens = line.strip().split("\t")
if len(tokens) > 1:
if tokens[4] in ("Gene","Chemical"):
#entities.append(line.strip())
offset_b = int(tokens[1])
#print offset_b
rowDict[offset_b] = line.strip()
else:
'''
print pmid , "\t", s ,"\n"
for item in entities:
print item
'''
for key in sorted(rowDict):
entities.append(rowDict[key])
annotatedText = annotating(pmid, s, entities)
annotatesSentences = split_to_sentences(annotatedText.strip())
sentID = 0
for sent in annotatesSentences:
cand_entities = get_related_entities(sent)
if cand_entities:
fullSentence = pmid + '-' + str(sentID) + '\t' + sent + cand_entities
outFileCand.write(fullSentence)
outFileCand.write('\n')
else:
fullSentence = pmid + '-' + str(sentID) + '\t' + sent
#print fullSentence
outFile.write(fullSentence)
outFile.write('\n')
sentID += 1
doc_counter+=1
print >> sys.stderr, "\rProcessing document " + str(doc_counter),
i=0
s=""
entities=list()
rowDict = {}
print
InFile.close()
outFile.close()
outFileCand.close()
if __name__ == "__main__":
from optparse import OptionParser
parser = OptionParser()
parser.add_option("-i", "--input", dest="articles",
default='abstracts/1.txt',
help="specify the path of the pubTator annotated file (default: abstracts/1.txt)")
parser.add_option("-o", "--output", dest="output",
default='annotate_output//final_sentences.txt.gz',
help="specify the path of the output (default: annotate_output//final_sentences.txt.gz)")
parser.add_option("-p", "--processes",
dest="PROCESSES", default=2,
help="How many processes should be used. (Default: 2)")
(options, args) = parser.parse_args()
#print options.articles
start = time.asctime()
print "programme started - " + start
#dir_path = os.path.dirname(os.path.realpath(__file__))
#WDir = dir_path.split('/')[-1]
#print os.getcwd()
#UniProt_mapping('protmine/idmapping.dat.gz')
print "Upload UniProt ..."
if not os.path.exists('uniprot.p'):
os.system('gunzip uniprot.p.gz')
dict = pickle.load( open( "uniprot.p", "rb" ) )
print "Done."
'''
#for key, value in dict.iteritems():
# key = key + '#'
# print key, value
x = 1117315
if x in dict:
print dict[x]
else:
print 'None'
sys.exit()
'''
if not os.path.exists(options.articles):
print "input file: ", options.articles ," does not exits"
sys.exit()
if not os.path.exists('annotate_output/'):
os.makedirs('annotate_output/')
analysisPubtatorRes(options.articles, options.output)
end = time.asctime()
print "programme started - " + start
print "programme ended - " + end
|
C++
|
UTF-8
| 1,327 | 3.09375 | 3 |
[] |
no_license
|
//directed edges
#include<bits/stdc++.h>
#define fast ios_base::sync_with_stdio(0); cin.tie(0);
#define inf 0xfffffff
using namespace std;
vector<int> bellman_ford(int src, vector<pair<int,int> > G[], int n)
{
vector<int> dist(n+1, inf);
dist[src] = 0;
int v, w;
for (int i=0; i<n-1; i++)
{
for (int u=1; u<=n; u++)
{
if (dist[u] == inf)
continue;
for (auto edge: G[u])
{
tie(v, w) = edge;
dist[v] = min(dist[v], dist[u]+w);
}
}
}
//for detecting negetive cycle in graph *optional
for (int u=1; u<=n; u++)
{
if (dist[u] == inf)
continue;
for (auto edge: G[u])
{
tie(v, w) = edge;
if (dist[v] > dist[u]+w)
{
//Negetive cycle detected !!
dist.clear();
// assert(0);
}
}
}
return dist;
}
int main()
{
fast
int n, w, x, y, e, s;
cout << "input: ";
cin >> n >> e;
vector<pair<int, int> > *g = new vector<pair<int, int> >[n+1];
for (int i=0; i<e; i++)
{
cin >> x >> y >> w;
g[x].push_back({y, w});
g[y].push_back({x, w});
}
cin >> s;
cout << "output: \n";
auto dist = bellman_ford(s, g, n);
if (dist.size()==0)
{
cout << "graph contain negetive cycle ";
delete[] g;
return 0;
}
for (int i=1; i<n; i++)
cout << dist[i] << ' ';
delete[] g;
return 0;
}
/*
7 7
1 2 1
1 3 1
2 3 2
3 4 3
4 5 2
4 6 1
5 6 1
1
*/
|
Markdown
|
UTF-8
| 14,204 | 3.03125 | 3 |
[
"BSD-3-Clause",
"Unlicense",
"OFL-1.1",
"MIT",
"GPL-1.0-or-later"
] |
permissive
|
---
title: "Beyond 'parts' documentation: Moving towards systems thinking with developer portals"
permalink: /blog/dev-portals-and-systems-thinking/
categories:
- technical-writing
- podcasts
keywords: big picture, systems view
rebrandly: https://idbwrtng.com/
series: "Trends to follow or forget"
sidebar: sidebar_fizzled_trends
description: "In this post, I continue the series on systems thinking and tech comm, describing my experience in writing a documentation project plan for a large project involving multiple APIs. I argue that we should look at how APIs interact as a network rather than just documenting each API as a standalone part."
---
* TOC
{:toc}
## Series recap
If you’re just joining this series, here’s a brief recap. After an exhaustive review of trends that I've followed and abandoned in my career, I read Kevin Kelly’s _What Technology Wants_ and became persuaded that [ever-increasing complexity, specialization, and diversity](/trends/embracing-diversity-pluralism-fragmentation.html) will lead to a loss of high-level systems views. In other words, people have their heads down building widgets but no one focuses on the whole. If tech writers hope to thrive in a hyper-specialized world, we have to focus on elucidating the big picture, on connecting the dots across multiple products, services, and more as a technology ecosystem. In short, we have to move into systems documentation, not just parts documentation.
This big-picture domain is called systems thinking, and its central tenet is that when you view the whole, the whole manifests properties not visible in the individual parts. With a systems thinking perspective, you look at how all the parts in a system interact, the controls that shape the system’s dynamics, the inflows and outflows into the system, the relationships between the components and how they influence each other. In short, you look at the complex web of interactions. As such, systems thinking often runs parallel to complex systems and analysis.
## A system-level project
To explore this topic, I try to find books relevant to the subject and use them as conversational springboards. I was recently reading one of the classics in the genre: _The Systems View of Life: A Unifying Vision,_ by Fritjof Capra and Pier Luigi Luisi. I'll use some quotes from their book in this post.
By the way, most of the books in the systems thinking genre don’t focus on tech comm scenarios (content strategy is the closest cousin). But I think tech comm, especially developer portals, with their increasing number of APIs and SDKs, might apply in interesting ways for systems view thinking. This is the hunch of my entire series, actually. Dev portals are ripe territory for systems view thinking, and when tech writers engage in systems thinking, our value skyrockets.
I recently started working on a documentation project plan for a project that involves multiple teams and crosses into several parts of the organization. There’s a whole toolkit of APIs and SDKs planned in the project, covering a variety of scenarios for developers.
I decided to start this project by drafting a documentation project plan. I laid out the publishing strategy and challenges, the various workstreams and deliverables, and more. Besides the project overview document, written by program managers, this documentation project plan is one of the few documents that tries to get a handle on the high-level. I wanted to understand not only all the various workstreams alone (and each of their documentation needs) but how they fit and flow together into a coherent river. As such, I started meeting with technical leads to find out more details about their workstream and deliverables.
The documentation project plan is where many of these individual workstreams (like subprojects) come together. It’s where complexity emerges. Capra and Luisi write:
> ...the major problems of our time—energy, the environment, climate change, food security, financial security—cannot be understood in isolation. They are systematic problems, which means that they are all interconnected and interdependent (xi).
I wanted to understand the project in the same way: how all the parts interconnect and depend on each other. This is no doubt where more of the complexity emerges and where there’s more opportunity to provide value.
Capra and Luisi start their book by explaining the context for more holistic thinking. They say rationalist/enlightenment thinkers (Descartes, Newton, Bacon, etc.) started to perceive the world as a machine, with individual parts operating according to scientific laws. These thinkers examined the parts and tried to mathematically model them.
But here’s the problem, Capra and Luisi say. When those parts are combined into a whole, new properties emerge that aren’t observable in any individual part. It’s like when all my family sits down at the dinner table. Individually, alone, each person is mellow and pleasant to talk to.
<figure><img src="https://s3.us-west-1.wasabisys.com/idbwmedia.com/images/alltogetheratdinner.png" alt="Chatting 1:1" /><figcaption>Chatting with any single family member alone is pleasant and easy.</figcaption></figure>
When you combine them into a group at the dinner table, however, the conversations are loud and chaotic. There’s an energy they all feed off of, and it’s exhausting. Most of the time, I can’t get a word in.
<figure><img src="https://s3.us-west-1.wasabisys.com/idbwmedia.com/images/loudcaucophonousdinner.png" alt="Chatting many:many" /><figcaption>Chatting as a whole at the dinner table brings a new energy and dynamic to everyone. Where was this energy previously? It's not visible in any single person.</figcaption></figure>
Capra and Luisi say that instead of reducing components to their individual parts, we should instead observe how the parts influence each other. We should also observe the properties that surface in the whole, and what patterns emerge in the network of interactions and dynamics. Capra and Luisi explain:
> The basic tension is one between the parts and the whole. The emphasis on the parts has been called mechanistic, reductionist, or atomistic; the emphasis on the whole, holistic, organismic, or ecological. In twentieth-century science, the holistic perspective has become known as "systemic" and the way of thinking it implies as "systems thinking"... (4)
In other words, instead of asking for a list of parts, we should ask about the shape of the network. How does each node in a network interact with other nodes? How do the nodes influence and interrelate with each other? Not pieces. *A system.*
While talking with one technical program manager, I asked how a specific API they were building was different from a similarly named API in another workstream. Both workstreams included a gizmo deliverable. I wanted to know how the gizmos differed.
Admittedly, engineers are faced with an enormous complexity of services, languages, and code frameworks. To expect an engineer to both understand the larger picture of how all the pieces fit and flow together, and then to articulate them in ways tech writers can understand, might be a bit much. But this is exactly the type of knowledge I sought.
I asked whether the API had any dependencies on other APIs. If each partner used each API in isolation, they wouldn’t run into any problems. But what happens when you call similar data from multiple APIs? Their responses described more of the systems interactions I was looking for. I felt like I was finally getting somewhere, moving beyond an abstract idea of systems thinking toward tangible information.
{% include ads.html %}
## A simple demonstration
To demonstrate the type of systems information I was looking for, do this simple experiment. Hold up both of your hands and stretch your fingers out. This is the reductionist view.
<figure><img src="https://s3.us-west-1.wasabisys.com/idbwmedia.com/images/fingersoutstretched.jpg" alt="Parts view (reductionist)" /><figcaption>Parts view (reductionist)</figcaption></figure>
Now interlock your fingers between your two hands. Feel the warmth and pressure of your fingers interlocking. This warmth and pressure isn't present when each finger is stretched out in isolation. This is the systems view.
<figure><img src="https://s3.us-west-1.wasabisys.com/idbwmedia.com/images/fingersinterlocked.jpg" alt="Systems view (more complex)" /><figcaption>Systems view (more complex)</figcaption></figure>
Essentially, I wanted to understand the figurative warmth and pressure of interlocked APIs. Capra and Luisi explain that with Galileo, there was a shift in worldview to a belief that the universe was a machine, consisting of discrete parts rather than a fluid organic whole. That you only study what you can measure. Descartes accelerated this "shift from the organic to the mechanistic worldview." Then later, organismic biologists in the early twentieth century started to look at the natural sciences holistically, such as understanding ecosystems rather than individual inhabitants.
> The material universe, including living organisms, was a machine for him [Descartes], which could in principle be understood completely by analyzing it in terms of its smallest parts. [The idea of] the world as a perfect machine governed by exact mathematical laws—was completed triumphantly by Isaac Newton .... (8)
>
> [In the] early twentieth century, organismic biologists ... [developed] ... a new way of thinking—"systems thinking"—in terms of connectedness, relationships, and context. According to the systems view, an organism, or living system, is an integrated whole whose essential properties cannot be reduced to those of its parts. They arise from the interactions and relationships between the parts. (10)
Properties not reducible to parts is the entire rationale for systems thinking. It’s like my dinner table analogy. Alone, each child is polite and easy to talk to. Together, they are a loud, chaotic riot. When you examine the whole, properties emerge that aren’t visible in isolation.
What, then, might be some of these emerging properties that are only visible in the network of APIs on a developer portal? If engineers work on APIs in isolation, will they understand what new properties emerge in the network effect? Who will? QA?
I learned about other project details involving schemas and conversions to other schemas. What if the schemas didn't line up? What if the terms and definitions in one schema conflicted with the terms and definitions in another? Capra and Luisi continue:
> ... the world-machine became the dominant metaphor of the modern era until the late twentieth century when it began to be replaced by the metaphor of the network. (6)
How could I document the *network* of APIs rather than each individual API? If each workstream operated semi-independently, how could I tap into the network perspective? It was clear that this perspective wasn't something I could easily gather by talking only to workstream leads. Maybe it was something we would discover only as the implementation progressed.
## Developer portals vs. individual APIs
I’ve always been intrigued by developer portals more than individual APIs. Developer portals, with their many co-located APIs and tools, provide a _system_ of information, which lead to more system-level flows and interactions than might be apparent in a standalone API. In tackling this new project, I wanted to remove myself from the nitty-gritty details of each API and focus on the larger view. What were the patterns through these APIs? Were we surfacing the same data in different APIs? If you were to draw lines between the APIs, what would those lines look like, and why?
To use another analogy: Which APIs were the main actors and which were the supporting roles? What did that play look like with all actors on stage? When did each actor enter the stage and why? During which acts of the play? Who was the villain? Did it make sense to approach developer portal documentation like writing a play, with each API as an individual actor?
<figure><a href=""><img src="https://s3.us-west-1.wasabisys.com/idbwmedia.com/images/actorsonstagesystemsthinking.jpg" alt="APIs as actors on a stage" /></a><figcaption>Thinkin of APIs as actors on a stage</figcaption></figure>
Of course, I was not yet at the playwriting stage. I was still drafting a documentation project plan. Only by understanding the larger picture, I argued, could we formulate a publishing plan that made sense. By publishing plan, I mean details like where to publish the material, what conventions to follow, how to brand the content, how to arrange the information flows, and more. Only by understanding the plot of the play could I construct a stage set for it.
And I couldn’t yet arrive at that network-level thinking, of pattern flows and interdependence, until I understood each part. So although the starting point was atomistic, the end goal was holistic.
During my brainstorming, one thought emerged. Rather than fragment the new APIs into yet another siloed site, I wanted to integrate them into an existing site to confront the interactions with other APIs head-on. Hosting them on a different site would hide away that context.
## Conclusion
Admittedly, the scale and complexity of my goals were ambitious. To achieve my ecosystem-wide aims, I realized I’d need to rely on my team members to document more of the nitty-gritty API details. For example, have them dig into each field definition.
This pivot felt a little uncomfortable to me because I’m accustomed to jumping in and getting knee-deep into everything, and because doc requests seemed to be about individual APIs only. The high-level view was my own grassroots effort. If I wanted to capture the high-level perspective, I would only be able to dip my toes in the water, having a superficial understanding of each part but with a much broader scope. Would that broader understanding be valuable? And how could I produce concrete deliverables so that people could feel tangible value in this high-level, broad documentation?
|
C++
|
UTF-8
| 399 | 2.671875 | 3 |
[] |
no_license
|
#include<stdio.h>
main() {
int t, n;
scanf("%d", &t);
while(t--) {
scanf("%d", &n);
int i, j, Ans = 0, letter, tmp;
char DNA[27];
letter = (1<<27) - 1;
for(i = 0; i < n; i++) {
scanf("%s", DNA);
for(j = 0, tmp = 0; DNA[j]; j++)
tmp |= 1<<(DNA[j]-'a');
if(tmp&letter) {
letter &= tmp;
} else {
Ans++, letter = tmp;
}
}
printf("%d\n", Ans);
}
return 0;
}
|
Markdown
|
UTF-8
| 874 | 3.453125 | 3 |
[] |
no_license
|
## 课时5 Linux文件基本操作管理
### 复制文件、目录
通过cp命令复制文件或目录
> cp 源文件(文件夹) 目标文件(文件夹)
常用参数:
<pre>
-r 递归复制整个目录树
-v 显示详细信息
</pre>
### 移动、重命名文件或目录
通过mv命令移动或者重命名文件或目录,如果指定文件名,则可以重命名文件。
> mv 文件 目标目录
### 创建、删除文件
通过touch命令可以创建一个空文件或更新文件时间,通过rm命令可以删除文件或目录。
常用参数:
<pre>
-i: 交互式
-r: 递归的删除包括目录中的所有内容
-f: 强制删除,没有警告提示(使用时需十分谨慎)
</pre>
### 创建、删除目录
<pre>
通过mkdir命令创建一个目录
通过rmdir命令删除一个空目录
通过rm -r 命令删除一个非空目录
</pre>
|
Java
|
UTF-8
| 4,255 | 2.375 | 2 |
[] |
no_license
|
package kesean.com.search.ui.match;
import android.content.Context;
import android.support.annotation.NonNull;
import android.support.v7.widget.CardView;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import com.bumptech.glide.Glide;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.security.InvalidParameterException;
import java.util.ArrayList;
import java.util.List;
import butterknife.BindView;
import butterknife.ButterKnife;
import kesean.com.search.R;
import kesean.com.search.data.model.Datum;
import kesean.com.search.ui.base.BaseRecyclerViewAdapter;
/**
* Created by Kesean on 2/7/18.
*/
class MatchAdapter extends BaseRecyclerViewAdapter<MatchAdapter.MatchViewHolder> {
public class MatchViewHolder extends RecyclerView.ViewHolder {
@BindView(R.id.username)
TextView username;
@BindView(R.id.cardViewLayout)
CardView cardView;
@BindView(R.id.age)
TextView age;
@BindView(R.id.location_city)
TextView locationCity;
@BindView(R.id.location_state)
TextView locationState;
@BindView(R.id.match)
TextView match;
@BindView(R.id.image_profile)
ImageView profileImage;
public MatchViewHolder(View view) {
super(view);
ButterKnife.bind(this, view);
}
}
Context mContext;
public MatchAdapter(@NonNull ArrayList<Datum> matchList, Context context) {
this.matchList = matchList;
this.mContext = context;
}
@Override
public MatchViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View view = LayoutInflater.from(parent.getContext())
.inflate(R.layout.item_special, parent, false);
return new MatchViewHolder(view);
}
private List<Datum> matchList;
@Override
public int getItemCount() {
return matchList.size();
}
@Override
public void onBindViewHolder(RecyclerView.ViewHolder viewHolder, int i) {
super.onBindViewHolder(viewHolder, i);
MatchAdapter.MatchViewHolder vh = (MatchAdapter.MatchViewHolder) viewHolder;
Datum special_item = matchList.get(i);
vh.username.setText(special_item.getUsername());
vh.age.setText(String.valueOf(special_item.getAge()));
String formattedCityName = special_item.getCityName() + ",";
vh.locationCity.setText(formattedCityName);
vh.locationState.setText(special_item.getStateCode());
vh.match.setText(matchConversion(special_item.getMatch()));
Glide.with(vh.profileImage).load(special_item.getPhoto().getFullPaths().getOriginal()).into(vh.profileImage);
}
/*
* Rounding and converting the match value into a percentage string
* */
private String matchConversion(long matchOriginal){
int x = 2; // 2 decimal points
BigDecimal unscaled = new BigDecimal(matchOriginal);
BigDecimal scaled = unscaled.scaleByPowerOfTen(-x);
scaled = scaled.setScale(0, RoundingMode.HALF_EVEN);
String matchPercentage = String.valueOf(scaled) + "% Match";
return matchPercentage;
}
/*
* Replaces entire recycler view list with new data
* */
public void replaceData(List<Datum> special) {
this.matchList.clear();
this.matchList.addAll(special);
notifyDataSetChanged();
}
/*
* Not in Use for Match Tab
* Updates a single element in the recycler view list when a user likes another users account
* */
public void updateList(Datum user, int position) {
this.matchList.set(position, user);
notifyItemChanged(position);
}
/*
* Not in Use
* Based on position, gets specific element from list
* */
public Datum getItem(int position) {
if (position < 0 || position >= matchList.size()) {
throw new InvalidParameterException("Invalid item index");
}
return matchList.get(position);
}
public void clearData() {
matchList.clear();
notifyDataSetChanged();
}
}
|
Shell
|
UTF-8
| 630 | 2.75 | 3 |
[] |
no_license
|
#!/bin/bash
apt-get update
echo "America/Los_Angeles" > /etc/timezone
dpkg-reconfigure --frontend noninteractive tzdata
# Install Apache
apt-get install -y apache2 apache2.2-common
apt-get -yf install
# Install PageSpeed
wget -nv https://dl-ssl.google.com/dl/linux/direct/mod-pagespeed-stable_current_amd64.deb
dpkg -i mod-pagespeed-*.deb
apt-get -yf install
rm mod-pagespeed-*.deb
# Enable proxy modules
a2enmod proxy
a2enmod proxy_http
ln -fs /vagrant/conf/*conf /etc/apache2/conf.d/
echo "Include conf.d/proxy_vhost.conf" > /etc/apache2/sites-available/default
service apache2 restart # and go!
|
JavaScript
|
UTF-8
| 8,620 | 2.640625 | 3 |
[
"MIT"
] |
permissive
|
function makeArray(d1, d2) {
var arr = new Array(d1), i, l;
for(i = 0, l = d1; i < l; i++) {
arr[i] = new Array(d2);
}
return arr;
}
var GAMEENGINE=function(){};
GAMEENGINE.prototype = {
canvas : null,
ctx : null,
renderEvent : null,
fps : 20,
width : 10,
height : 10,
boxsize : 60,
mex : 0,
mey : 0,
meImg : null,
canvasId : "gamecanvas",
coins : 0,
coinsInMap : 0,
visitedArray : [],
foundAStep : false,
ordersStack : [],
ordersStackfn : null,
isRobotOnFire : false,
coinsPos : [],
mapOneDim : null,
p : null,
s : [],
init:function(){
this.canvas = document.getElementById(this.canvasId);
this.ctx = this.canvas.getContext("2d");
this.meImg = new Image();
this.coins = 0;
this.meImg.src = "img/player.png";
this.canvas.height=this.height*this.boxsize;
this.canvas.width =this.width *this.boxsize;
var img=new Image();
img.src="img/bg.jpg";
var $this=this;
this.renderEvent=setInterval(function(){$this.render()} ,parseInt(1000/this.fps));
if(this.ordersStackfn)
window.clearInterval(this.ordersStackfn);
var $this=this;
this.ordersStackfn=setInterval(function(){
if($this.ordersStack[0])
if($this.ordersStack[0]=='r')
toright();
else if($this.ordersStack[0]=='l')
toleft();
else if($this.ordersStack[0]=='u')
toup();
else if($this.ordersStack[0]=='d')
todown();
$this.ordersStack.shift();
},200);
},
render:function(){
$('#'+this.canvasId).css("background-image", "url(img/bg.jpg)");
if(this.map)
for(var i=0;i<this.height; i++)
for(var j=0;j<this.width; j++){
if(this.map && this.map[i] && this.map[i][j])
this.ctx.drawImage(this.map[i][j].img, i*this.boxsize, j*this.boxsize, this.boxsize, this.boxsize);
if(this.mex == i && this.mey == j)
this.ctx.drawImage(this.meImg, i*this.boxsize, j*this.boxsize, this.boxsize, this.boxsize);
}
},
setMap:function(map,width,height){
this.coinsInMap=0;
coinsPos = [];
this.mapOneDim=makeArray(height*width,height*width);
this.p=makeArray(height*width,height*width);
for(var i=0;i<(height*width);i++)
for(var j=0;j<(height*width);j++)
{
this.mapOneDim[i][j]=1000000;
this.p[i][j]=i;
}
for(var adj=0;adj<(width*height);adj++){
this.mapOneDim[adj][adj]=0;
var y= Math.floor(adj/height) , x=adj%height;
if( map[x][y] != 'b'){
if( (x+1) < height){
if(map[x+1][y]!='b')
this.mapOneDim[adj][adj+1]=1;
}
if( (x-1) >=0){
if(map[x-1][y]!='b')
this.mapOneDim[adj][adj-1]=1;
}
if( (y+1) < height){
//console.log(map[x+1][y]!='b');
if(map[x][y+1]!='b')
this.mapOneDim[adj][adj+width]=1;
}
if( (y-1)>=0 ){
if(map[x][y-1]!='b')
this.mapOneDim[adj][adj-width]=1;
}
}
}
for (var k = 0; k < (height*width); k++)
for (var i = 0; i < (height*width); i++)
for (var j = 0; j < (height*width); j++)
if(this.mapOneDim[i][j] > (this.mapOneDim[i][k] + this.mapOneDim[k][j]) ){
var y1=Math.floor(i/height),x1= (i%height);
var y2=Math.floor(j/height),x2= (j%height);
var y3=Math.floor(k/height),x3= (k%height);
if( (map[x1][y1]!='b')&& (map[x2][y2]!='b') && (map[x3][y3]!='b') && i!=j){
//console.log(i+' '+j+' '+k+' '+x1+' '+y1+' '+x2+' '+y2+' '+x3+' '+y3);
this.mapOneDim[i][j] = this.mapOneDim[i][k] + this.mapOneDim[k][j];
this.p[i][j] = this.p[k][j];
}
}
var indexOne=0;
for(var j=0;j<height;j++)
for(var i=0;i<width;i++)
if(map[i][j])
{
if(map[i][j] == 'b')
map[i][j]=new block();
else if(map[i][j] == '0')
map[i][j]=new grass();
else if(map[i][j] == 'c'){
map[i][j]=new coin();
this.coinsPos[this.coinsInMap]=indexOne;
this.coinsInMap++;
}
indexOne++;
}
this.map =map;
this.width =width;
this.height =height;
this.init();
this.isRobotOnFire=false;
},
gotothe:function(a,b){
var x = this.mex + a,
y = this.mey + b;
if(this.map[x] && this.map[x][y] && !(this.map[x][y] instanceof block)){
this.mex=x;
this.mey=y;
this.palyerMove(x,y);
}
},
palyerMove:function(x,y){
if(this.map[x][y] instanceof coin){
this.map[x][y]=new grass();
this.coins++;
this.coinsInMap--;
console.log('coins++;');
}
},
myrobot:function(){
if(this.coinsInMap == 0){
console.log('Robot Says:');
console.log("Mission Accomplished.")
}
var consoleLog=[
['On my way.'],
['Sir, Yes sir.'],
['Roger that.'],
['it\'s an honor to help you Sir.'],
['On my next mission.'],
['That would be very easy Sir.'],
];
console.log('Robot Says:');
console.log('> ' + consoleLog[Math.floor(Math.random()*consoleLog.length)][0]);
this.isRobotOnFire=true;
this.findTheClosestFrom('', (this.mey*this.width) + this.mex);
},executeOrder:function(steps){
for(var i=0;i<steps.length;i++)
this.ordersStack.push(steps[i]);
},
findTheClosestFrom:function(steps , MyPos){
console.log(MyPos);
if(MyPos <0 || MyPos>=(this.width*this.height))return;
if(this.coinsInMap <= 0) return;
var min=100000,indexMin=-1;
for(var i=0;i<this.coinsPos.length;i++){
if(this.coinsPos[i] != -1){
if(this.mapOneDim[MyPos][this.coinsPos[i]] < min){
min=this.mapOneDim[MyPos][this.coinsPos[i]];
indexMin=i;
}
}
}
var to =this.coinsPos[indexMin];
this.coinsPos[indexMin]=-1;
var y=Math.floor(to/this.width),x = to%this.width;
this.s=null;
this.s=[];
this.printPath(MyPos,to);
for(var i=0;i<this.s.length-1;i++) {
if(this.s[i+1] == (this.s[i]+this.width)) {steps+='d';console.log('down');}
else if(this.s[i+1] == (this.s[i]-this.width)) {console.log('up');steps+='u'}
else if(this.s[i+1] == (this.s[i]+1) ) {console.log('right');steps+='r'}
else if(this.s[i+1] == (this.s[i]-1)) {console.log('left');steps+='l'}
console.log(this.s[i]+' '+this.s[i+1]);
}
this.executeOrder(steps);
this.findTheClosestFrom('',to);
},
printPath:function(i , j){
if (i != j)
this.printPath(i, this.p[i][j]);
this.s.push(j);
}
}
var x=new GAMEENGINE;
//block
var block=function(){
this.img=new Image();
this.img.src=this.src;
};
block.prototype={
src :"img/block.jpg",
img :null
};
//grass
var grass=function(){
this.img=new Image();
this.img.src=this.src;
};
grass.prototype={
src :"img/grass.jpg",
img :null
};
//coin
var coin=function(){
this.img=new Image();
this.img.src=this.src;
};
coin.prototype={
src :"img/coin.jpg",
img :null
};
var map1=[
['0','0','0','0','0','0','b','0','0','c','0','0','0','0','0','0','0','0','0','0'],
['0','0','c','0','b','0','c','0','b','0','b','b','b','0','b','b','b','0','b','0'],
['b','b','b','0','b','0','b','0','b','0','b','0','0','0','b','0','c','c','b','0'],
['c','0','b','0','b','0','b','0','b','0','b','0','b','0','b','0','0','0','b','c'],
['0','0','b','c','0','0','b','0','0','0','b','0','c','0','0','b','0','b','b','0'],
['0','0','b','0','b','0','b','0','b','0','b','0','b','0','0','0','0','0','b','0'],
['0','0','0','0','b','0','b','c','b','0','c','0','b','b','b','b','0','0','0','c'],
['b','b','b','0','b','0','0','0','b','0','b','0','b','c','0','0','0','0','b','0'],
['0','0','0','0','b','b','b','b','0','0','b','0','b','b','b','c','b','b','b','0'],
['0','b','b','0','b','0','c','0','b','0','b','0','b','0','0','0','0','0','b','c'],
['0','0','0','0','b','0','b','b','0','0','b','0','0','0','0','b','c','0','b','b'],
['b','0','b','0','0','0','0','0','0','c','b','0','b','0','b','b','b','b','b','0'],
['c','0','b','b','0','b','b','0','b','0','b','0','b','0','0','0','0','0','b','c'],
['0','b','b','0','0','0','b','0','b','b','b','0','b','0','0','b','0','c','0','0'],
['0','c','b','0','b','0','b','0','0','0','c','b','0','c','b','b','b','0','b','0'],
['b','0','0','0','b','0','c','b','0','0','b','c','0','b','b','b','b','b','b','c'],
['c','0','b','0','0','0','b','0','0','0','c','b','0','0','0','b','0','0','b','0'],
['0','b','b','b','b','b','0','0','b','0','b','c','0','0','0','0','0','0','b','0'],
['0','0','b','0','b','0','b','b','b','0','c','b','b','0','b','b','b','0','0','0'],
['b','0','0','c','0','0','0','0','0','0','0','0','0','0','0','0','b','b','b','c']
];
function toright() {x.gotothe(1,0);}
function toleft() {x.gotothe(-1,0);}
function toup() {x.gotothe(0,-1);}
function todown() {x.gotothe(0,1);}
|
Java
|
UTF-8
| 3,044 | 3.5625 | 4 |
[] |
no_license
|
/**
* This class is a Country class. It holds the data of a country in an object such as its name, country code, capitol city, population, gdp per capita
* and happiness rank.
*
* @author Zackery Crews
* @version 09-15-2019
*/
public class Country {
private String name;
private String code;
private String capitol;
private long population;
private long gdp;
private int happinessRank;
Country()
{
}
Country(String name, String code, String capitol, int population, long gdp, int happinessRank)
{
this.name = name;
this.code = code;
this.capitol = capitol;
this.population = population;
this.gdp = gdp;
this.happinessRank = happinessRank;
}
public void setName(String name)
{
this.name = name;
}
public String getName()
{
return this.name;
}
public void setCode(String code)
{
this.code = code;
}
public String getCode()
{
return this.code;
}
public void setCapitol(String capitol)
{
this.capitol = capitol;
}
public String getCapitol()
{
return this.capitol;
}
public void setPopulation(long population)
{
this.population = population;
}
public long getPopulation()
{
return this.population;
}
public void setGDP(long gdp)
{
this.gdp = gdp;
}
public long getGDP()
{
return this.gdp;
}
public void setHappinessRank(int happinessRank)
{
this.happinessRank = happinessRank;
}
public int getHappinessRank()
{
return this.happinessRank;
}
public boolean compareName(Country input)
{
if(this.name == input.getName())
{
return true;
}
return false;
}
public boolean compareCode(Country input)
{
if(this.code == input.getCode())
{
return true;
}
return false;
}
public boolean compareCapitol(Country input)
{
if(this.capitol == input.getCapitol())
{
return true;
}
return false;
}
public boolean comparePopulation(Country input)
{
if(this.population == input.getPopulation())
{
return true;
}
return false;
}
public boolean compareGDP(Country input)
{
if(this.gdp == input.getGDP())
{
return true;
}
return false;
}
public void printCountryReport()
{
System.out.printf("%-40s%-17s%-17s%-15d%-20d%-16d\n", this.name, this.code, this.capitol, this.population, this.gdp, this.happinessRank);
}
public void printCountry()
{
System.out.printf("%-20s%s\n%-20s%s\n%-20s%s\n%-20s%d\n%-20s%d\n%-20s%d\n\n", "Name:", this.name, "Code:", this.code, "Capitol:", this.capitol, "Population:", this.population, "GDP:", this.gdp, "Happiness Rank:", this.happinessRank);
}
}
|
C++
|
UTF-8
| 844 | 2.71875 | 3 |
[
"MIT"
] |
permissive
|
#include <iostream>
#include "battlefield.h"
#include "enemyBattlefield.h"
int posX;
int posY;
bool hit(int x, int y) {
if(enemyBoardArr[x][y] == 1) {
enemyBoardArr[x][y] = 2;
return true;
}
return false;
}
int main() {
srand(time(NULL));
initializeArr();
shipSpawn();
enemyShipSpawn();
showEnemyArr();
while (1) {
std::cout << "Input X and Y location: " << std::endl;
std::cin >> posX >> posY;
if(hit(posX, posY)) {
std::cout << "Hit!" << std::endl;
} else
std::cout << "Miss!" << std::endl;
std::cout << "Amount of enemy ships left: " << displayEnemyShipAmount << std::endl;
std::cout << "Amount of your ships left: " << displayamntShips << std::endl;
showArr();
enemyAI();
}
return 0;
}
|
Java
|
UTF-8
| 4,811 | 2.1875 | 2 |
[] |
no_license
|
package com.systemcfg.service.imp;
import java.util.List;
import java.util.Map;
import javax.annotation.Resource;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
import com.alibaba.fastjson.JSONObject;
import com.systemcfg.dao.SnmodelDao;
import com.systemcfg.service.SnmodelService;
import com.znyw.pojo.Pagepojo;
import com.znyw.tool.Objects;
import com.znyw.tool.ResultUtil;
@Service
public class SnmodelServiceImp implements SnmodelService {
private static final Logger LOGGER = LoggerFactory.getLogger(SnmodelServiceImp.class);
@Resource
private SnmodelDao snmodelDao;
@Override
public JSONObject addDevModel(Map<String, Object> namesAndValues) {
try {
boolean hasRecord = snmodelDao.hasRecord(namesAndValues.get("snModelId"));
if (hasRecord) {
return ResultUtil.simpleResponse(500, "snModelId 重复");
}
boolean inserted = snmodelDao.addDevModel(namesAndValues);
return inserted ? ResultUtil.simpleResponse(200, "添加成功")
: ResultUtil.simpleResponse(500, "添加失败", "受影响行数 0");
} catch (Exception e) {
LOGGER.error(e.getMessage(), e);
return ResultUtil.simpleResponse(500, "添加失败", e.getMessage());
}
}
@Override
public JSONObject updateDevmodel(Map<String, Object> namesAndValues) {
Object oldSnModelId = namesAndValues.remove("oldSnModelId");
Object newSnModelId = namesAndValues.remove("newSnModelId");
if (Objects.isNullString(oldSnModelId) || Objects.isNullString(newSnModelId)) {
return ResultUtil.simpleResponse(500, "参数错误");
}
try {
if (!oldSnModelId.equals(newSnModelId)) {
boolean hasRecord = snmodelDao.hasRecord(newSnModelId);
if (hasRecord) {
return ResultUtil.simpleResponse(500, "snModelId 重复");
}
}
namesAndValues.put("snModelId", newSnModelId);
boolean updated = snmodelDao.updateDevmodel(oldSnModelId, namesAndValues);
return updated ? ResultUtil.simpleResponse(200, "更新成功") : ResultUtil.simpleResponse(500, "更新失败", "受影响行数 0");
} catch (Exception e) {
LOGGER.error(e.getMessage(), e);
return ResultUtil.simpleResponse(500, "更新失败", e.getMessage());
}
}
@Override
public JSONObject deleteDevModel(Object snModelId) {
try {
boolean deleteed = snmodelDao.deleteDevModel(snModelId);
return deleteed ? ResultUtil.simpleResponse(200, "删除成功")
: ResultUtil.simpleResponse(500, "删除失败", "受影响行数 0");
} catch (Exception e) {
LOGGER.error(e.getMessage(), e);
return ResultUtil.simpleResponse(500, "删除失败", e.getMessage());
}
}
@Override
public JSONObject findSnmodel(JSONObject fuzzy, Pagepojo pagepojo) {
String fuzzyKey = fuzzy.getString("key");
String fuzzyValue = fuzzy.getString("value");
JSONObject jsonObject = new JSONObject();
if (Objects.isNullString(fuzzyValue)) {
jsonObject = null;
} else {
for (String key : fuzzyKey.split(",")) {
jsonObject.put(key, fuzzyValue);
}
}
try {
int total = snmodelDao.count(jsonObject);
//总页数pages
int pages = total>0&&pagepojo.getPageSize()>0?(int) Math.ceil(total * 1.0 / pagepojo.getPageSize()):0;
int currentPage=pagepojo.getCurrentPage();//取得前段传过来的当前页数
if(pages<currentPage&¤tPage!=1){//总页数小于当前页,并且当前页不是第一页
pagepojo.setCurrentPage(currentPage-1);//当前页减一页
}
List<Map<String, Object>> list = snmodelDao.find(jsonObject, pagepojo);
if (list == null) {
return ResultUtil.simpleResponse(500, "数据库操作错误");
}
pagepojo.setTotalNum(total);
pagepojo.setTotalPage(pages);
JSONObject result = new JSONObject();
result.put("code", 200);
result.put("message", "查询成功");
JSONObject response = new JSONObject();// 结果
response.put("devModel", list);
response.put("pageInfoPojo", pagepojo);
response.put("result", result);
return response;
} catch (Exception e) {
LOGGER.error(e.getMessage(), e);
return ResultUtil.simpleResponse(500, "查询失败", e.getMessage());
}
}
@Override
public JSONObject findByKey(JSONObject jsonObejct) {
try {
List<Map<String, Object>> list = snmodelDao.findByKey(jsonObejct);
if (list == null) {
return ResultUtil.simpleResponse(500, "数据库操作错误", "查询结果为空");
}
JSONObject result = new JSONObject();
result.put("code", 200);
result.put("message", "查询成功");
JSONObject response = new JSONObject();// 结果
response.put("devModel", list);
response.put("result", result);
return response;
} catch (Exception e) {
LOGGER.error(e.getMessage(), e);
return ResultUtil.simpleResponse(500, "查询失败", e.getMessage());
}
}
}
|
PHP
|
UTF-8
| 9,185 | 2.765625 | 3 |
[] |
no_license
|
<?php
include 'include/config.php';
include 'include/function.php';
try {
$trainings = mysqli_query($conn, /** @lang text */ 'SELECT * FROM attendance');
} catch (Exception $ex) {
die('Error ' . $ex->getMessage());
}
function displayTable($conn){
$sql_dep = "SELECT * FROM department";
$res_dep = mysqli_query($conn,$sql_dep);
$num = mysqli_num_rows($res_dep);
$departments = array();
while($row = mysqli_fetch_array($res_dep)) {
$departments[] = $row['depID'];
}
//select the
foreach ($departments as $department ) {
# code...
//display depname
$sql = "SELECT depname FROM department WHERE depID = $department";
$dep = mysqli_query($conn,$sql);
//count the number of employees per department
$sql_numEmp = "SELECT * FROM employee WHERE depID = $department";
$result = mysqli_query($conn,$sql_numEmp);
//count number of employee that took part in heath talk for each department
$sql_health = "SELECT DISTINCT e.matricule,e.empname FROM attendance AS a, employee AS e, department AS d, training AS t WHERE a.creation_date >= CURDATE() - INTERVAL DAY(CURDATE())-1 DAY AND t.trainingID = a.trainingID AND t.trainingType like '%Health Talk Awareness%' AND a.status LIKE '%present%' AND e.empID = a.empID AND e.depID = ".$department." ";
$res_health = mysqli_query($conn, $sql_health);
//count number of employee that took part in heath talk for each department
$sql_toolbox = "SELECT DISTINCT e.matricule,e.empname FROM attendance AS a, employee AS e, department AS d, training AS t WHERE a.creation_date >= CURDATE() - INTERVAL DAY(CURDATE())-1 DAY AND t.trainingID = a.trainingID AND t.trainingType like '%Toolbox%' AND a.status LIKE '%present%' AND e.empID = a.empID AND e.depID = ".$department."";
$res_toolbox = mysqli_query($conn, $sql_toolbox);
//count number of employee that took part in heath talk for each department
$sql_safety = "SELECT DISTINCT e.matricule,e.empname FROM attendance AS a, employee AS e, department AS d, training AS t WHERE a.creation_date >= CURDATE() - INTERVAL DAY(CURDATE())-1 DAY AND t.trainingID = a.trainingID AND t.trainingType like '%Safety Training%' AND a.status LIKE '%present%' AND e.empID = a.empID AND e.depID = ".$department."";
$res_safety = mysqli_query($conn, $sql_safety);
?>
<tr>
<td><?php
while($row = mysqli_fetch_array($dep)) {
echo $row['depname'];
} ?></td>
<td><?php if($result){
$empnum = mysqli_num_rows($result);
echo $empnum;
}?></td>
<td><?php if ($res_health) {
# code...
$hnum = mysqli_num_rows($res_health);
echo $hnum;
}?></td><td><?php
$hhnum = (($hnum *100/$empnum));
echo "".round($hhnum)."%";?> </td>
<td><?php if ($res_safety) {
# code...
$snum = mysqli_num_rows($res_safety);
echo $snum;
} ?></td><td><?php
$ssnum = (($snum *100/$empnum));
echo "".round($ssnum)."%";?></td>
<td><?php if ($res_toolbox) {
# code...
$tnum = mysqli_num_rows($res_toolbox);
echo $tnum;
}?></td><td><?php
$ttnum = (($tnum *100/$empnum));
echo "".round($ttnum)."%";?></td>
</tr>
<?php
}
}
?>
<?php include 'header1.php'; ?>
<section>
<!-- Line chart -->
<div class="box box-primary">
<div class="box-body">
<div id="months">
<form action="index.php" method="POST">
<div class="row">
<div class="col-md-6">
<select class="select2" name="months" id="months" style=" width:100%;">
<option value="">SELECT A MONTH</option>
<?php
$months = ['January','Febuary','March','April','May','June','July','August','September','November','December'];
$i = 0;
foreach ($months as $month) {
# code...
?>
<option value="<?php echo ++$i; ?>"><?php echo $month; ?></option>
<?php
}
?>
</select>
</div>
<div class="col-md-6">
<select class="select2" name="year" style=" width:100%;">
<?php
// set start and end year range
$yearArray = range(2016, intval(date('Y',$_SERVER['REQUEST_TIME']))+2);
?>
<!-- displaying the dropdown list -->
<option value="">Select Year</option>
<?php
foreach ($yearArray as $year) {
// if you want to select a particular year
$selected = ($year == intval(date('Y',$_SERVER['REQUEST_TIME']))) ? 'selected' : '';
echo '<option '.$selected.' value="'.$year.'">'.$year.'</option>';
}
?>
</select>
</div>
</div>
<button type="submit" name="submit" class="btn btn-sm bg-green btn-raised pull-right">validate</button>
</div>
</form>
</div>
<!-- /.box-body-->
</div>
<!-- /.box -->
</section>
<!-- /.content -->
<button onclick="printDiv('depchart')" class="btn btn-alert bg-green btn-sm btn-raised pull-right "><i class="fa fa-print"></i> Print All</button>
<div id="depchart">
<section>
<!-- Line chart -->
<div class="box box-primary">
<div class="box-header with-border">
<i class="fa fa-bar-chart-o"></i>
<h3 class="box-title">Health Talk Chart</h3>
<div class="box-tools pull-right">
<button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i>
</button>
<button type="button" class="btn btn-box-tool" data-widget="remove"><i class="fa fa-times"></i></button>
</div>
</div>
<div class="box-body">
<button onclick="printDiv('depchart1')" class="btn btn-alert bg-orange btn-sm btn-raised"><i class="fa fa-print"></i> Print</button>
<div id="depchart1">
<?php include 'charts/data1.php';?>
</div>
</div>
<!-- /.box-body-->
</div>
<!-- /.box -->
</section>
<!-- /.content -->
<section>
<!-- Line chart -->
<div class="box box-primary">
<div class="box-header with-border">
<i class="fa fa-bar-chart-o"></i>
<h3 class="box-title">Safety Training Chart</h3>
<div class="box-tools pull-right">
<button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i>
</button>
<button type="button" class="btn btn-box-tool" data-widget="remove"><i class="fa fa-times"></i></button>
</div>
</div>
<div class="box-body">
<button onclick="printDiv('depchart2')" class="btn btn-alert bg-blue btn-sm btn-raised"><i class="fa fa-print"></i> Print</button>
<div id="depchart2">
<?php include 'charts/data2.php';?>
</div>
<div>
<!-- /.box-body-->
</div>
<!-- /.box -->
</section>
<!-- /.content -->
<section>
<!-- Line chart -->
<div class="box box-primary">
<div class="box-header with-border">
<i class="fa fa-bar-chart-o"></i>
<h3 class="box-title">Toolbox Chart</h3>
<div class="box-tools pull-right">
<button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i>
</button>
<button type="button" class="btn btn-box-tool" data-widget="remove"><i class="fa fa-times"></i></button>
</div>
</div>
<div class="box-body">
<button onclick="printDiv('depchart3')" class="btn btn-alert bg-red btn-sm btn-raised"><i class="fa fa-print"></i> Print</button>
<div id="depchart3">
<?php include 'charts/data3.php';?>
</div>
</div>
<!-- /.box-body-->
</div>
<!-- /.box -->
</section>
<!-- /.content -->
</div>
<?php include 'footer1.php'; ?>
|
PHP
|
UTF-8
| 3,140 | 2.671875 | 3 |
[
"LGPL-3.0-only",
"MIT"
] |
permissive
|
<?php
/**
* @license LGPLv3, http://opensource.org/licenses/LGPL-3.0
* @copyright Aimeos (aimeos.org), 2017-2018
* @package Controller
* @subpackage Frontend
*/
namespace Aimeos\Controller\Frontend\Stock;
/**
* Default implementation of the stock frontend controller
*
* @package Controller
* @subpackage Frontend
*/
class Standard
extends \Aimeos\Controller\Frontend\Base
implements Iface, \Aimeos\Controller\Frontend\Common\Iface
{
/**
* Returns the given search filter with the conditions attached for filtering by product code
*
* @param \Aimeos\MW\Criteria\Iface $filter Criteria object used for stock search
* @param array $codes List of product codes
* @return \Aimeos\MW\Criteria\Iface Criteria object containing the conditions for searching
* @since 2017.03
*/
public function addFilterCodes( \Aimeos\MW\Criteria\Iface $filter, array $codes )
{
$expr = [
$filter->compare( '==', 'stock.productcode', $codes ),
$filter->getConditions(),
];
$filter->setConditions( $filter->combine( '&&', $expr ) );
return $filter;
}
/**
* Returns the given search filter with the conditions attached for filtering by type code
*
* @param \Aimeos\MW\Criteria\Iface $filter Criteria object used for stock search
* @param array $codes List of stock type codes
* @return \Aimeos\MW\Criteria\Iface Criteria object containing the conditions for searching
* @since 2017.03
*/
public function addFilterTypes( \Aimeos\MW\Criteria\Iface $filter, array $codes )
{
if( !empty( $codes ) )
{
$expr = [
$filter->compare( '==', 'stock.type.code', $codes ),
$filter->getConditions(),
];
$filter->setConditions( $filter->combine( '&&', $expr ) );
}
return $filter;
}
/**
* Returns the default stock filter
*
* @param boolean True to add default criteria
* @return \Aimeos\MW\Criteria\Iface Criteria object containing the conditions for searching
* @since 2017.03
*/
public function createFilter()
{
$manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'stock' );
$search = $manager->createSearch( true );
return $search->setSortations( [$search->sort( '+', 'stock.type.position' )] );
}
/**
* Returns the stock item for the given stock ID
*
* @param string $id Unique stock ID
* @return \Aimeos\MShop\Stock\Item\Iface Stock item including the referenced domains items
* @since 2017.03
*/
public function getItem( $id )
{
return \Aimeos\MShop\Factory::createManager( $this->getContext(), 'stock' )->getItem( $id, [], true );
}
/**
* Returns the stocks filtered by the given criteria object
*
* @param \Aimeos\MW\Criteria\Iface $filter Critera object which contains the filter conditions
* @param integer &$total Parameter where the total number of found stocks will be stored in
* @return array Ordered list of stock items implementing \Aimeos\MShop\Stock\Item\Iface
* @since 2017.03
*/
public function searchItems( \Aimeos\MW\Criteria\Iface $filter, &$total = null )
{
return \Aimeos\MShop\Factory::createManager( $this->getContext(), 'stock' )->searchItems( $filter, [], $total );
}
}
|
Python
|
UTF-8
| 7,305 | 2.765625 | 3 |
[] |
no_license
|
from __future__ import print_function
import os
import sys
from time import time
from math import *
import numpy as np
from scipy.optimize import curve_fit
try:
# Python 2.x only
import cPickle as pickle
except ImportError:
import pickle
from . import fast_template_periodogram as ftp
def LMfit(x, y, err, cn, sn, omega, sgn=1):
""" fits a, b, c with Levenberg-Marquardt """
ffunc = lambda X, *pars : ftp.fitfunc(X, sgn, omega, cn, sn, *pars)
p0 = [ np.std(y), 0.0, np.mean(y) ]
bounds = ([0, -1, -np.inf], [ np.inf, 1, np.inf])
popt, pcov = curve_fit(ffunc, x, y, sigma=err, p0=p0,
absolute_sigma=True, bounds=bounds,
method='trf')
a, b, c = popt
return a, b, c
class FastTemplateModeler(object):
"""
Base class for template modelers
Parameters
----------
loud: boolean (default: True), optional
print status
ofac: float, optional (default: 10)
oversampling factor -- higher values of ofac decrease
the frequency spacing (by increasing the size of the FFT)
hfac: float, optional (default: 3)
high-frequency factor -- higher values of hfac increase
the maximum frequency of the periodogram at the
expense of larger frequency spacing.
errfunc: callable, optional (default: rms_resid_over_rms)
A function returning some measure of error resulting
from approximating the template with a given number
of harmonics
stop: float, optional (default: 0.01)
A stopping criterion. Once `errfunc` returns a number
that is smaller than `stop`, the harmonics up to that point
are kept. If not, another harmonic is added.
nharmonics: None or int, optional (default: None)
Number of harmonics to keep if a constant number of harmonics
is desired
"""
def __init__(self, **kwargs):
self.params = { key : value for key, value in kwargs.items() }
self.templates = {}
self.omegas = None
self.summations = None
self.YY = None
self.max_harm = 0
self.w = None
self.ybar = None
defaults = dict(ofac=10, hfac=3)
# set defaults
for key, value in defaults.items():
if not key in self.params:
self.params[key] = value
if 'templates' in self.params:
self.add_templates(self.params['templates'])
del self.params['templates']
def _get_template_by_id(self, template_id):
assert(template_id in self.templates)
return self.templates[template_id]
def _template_ids(self):
return self.templates.keys()
def get_new_template_id(self):
i = 0
while i in self.templates:
i += 1
return i
def add_template(self, template, template_id=None):
if template_id is None:
if template.template_id is None:
ID = self.get_new_template_id()
self.templates[ID] = template
else:
self.templates[template.template_id] = template
else:
self.templates[template_id] = template
return self
def add_templates(self, templates, template_ids=None):
if isinstance(templates, dict):
for ID, template in templates.items():
self.add_template(template, template_id=ID)
elif isinstance(templates, list):
if template_ids is None:
for template in templates:
self.add_template(template)
else:
for ID, template in zip(template_ids, templates):
self.add_template(template, template_id=ID)
elif not hasattr(templates, '__iter__'):
self.add_template(templates, template_id=template_ids)
else:
raise Exception("did not recognize type of 'templates' passed to add_templates")
return self
def remove_templates(self, template_ids):
for ID in template_ids:
assert ID in self.templates
del self.templates[ID]
return self
def set_params(self, **new_params):
self.params.update(new_params)
return self
def fit(self, x, y, err):
"""
Parameters
----------
x: np.ndarray, list
independent variable (time)
y: np.ndarray, list
array of observations
err: np.ndarray
array of observation uncertainties
"""
self.x = x
self.y = y
self.err = err
# Set all old values to none
self.summations = None
self.freqs_ = None
self.best_template_id = None
self.best_template = None
self.best_model_params = None
self.periodogram_ = None
self.model_params_ = None
self.periodogram_all_templates_ = None
return self
def compute_sums(self):
self.omegas, self.summations, \
self.YY, self.w, self.ybar = \
ftp.compute_summations(self.x, self.y, self.err, self.max_harm,
ofac=self.params['ofac'], hfac=self.params['hfac'])
return self
def periodogram(self, **kwargs):
self.params.update(kwargs)
#if self.summations is None:
# self.compute_sums()
loud = False if not 'loud' in self.params else self.params['loud']
all_ftps = []
for template_id, template in self.templates.items():
args = (self.x, self.y, self.err, template.cn, template.sn)
kwargs = dict(ofac = self.params['ofac'],
hfac = self.params['hfac'],
ptensors = template.ptensors,
pvectors = template.pvectors,
omegas = self.omegas,
summations = self.summations,
YY = self.YY,
ybar = self.ybar,
w = self.w,
loud = loud,
return_best_fit_pars=True)
all_ftps.append((template_id, ftp.fast_template_periodogram(*args, **kwargs)))
template_ids, all_ftps_ = zip(*all_ftps)
freqs, ftps, modelpars = zip(*all_ftps_)
freqs = freqs[0]
self.periodogram_ = np.array([ max([ f[i] for f in ftps ]) for i in range(len(freqs)) ])
self.freqs_ = freqs
self.periodogram_all_templates_ = zip(template_ids, ftps)
self.model_params_ = zip(template_ids, modelpars)
# Periodogram is the maximum periodogram value at each frequency
return self.freqs_, self.periodogram_
def get_best_model(self, **kwargs):
ibest = np.argmax(self.periodogram_)
tbest = np.argmax([ f[ibest] for t, f in self.periodogram_all_templates_ ])
self.best_freq = self.freqs_[ibest]
self.best_template_id, self.best_model_params = self.model_params_[tbest]
self.best_model_params = self.best_model_params[ibest]
self.best_template = self.templates[self.best_template_id]
return self.best_template, self.best_model_params
|
C++
|
UTF-8
| 2,557 | 2.515625 | 3 |
[] |
no_license
|
#include "Body.h"
#include <math.h>
void Body::preUpdate() {
steady_clock::time_point thisMoment = steady_clock::now();
int time;
float diagonalForce;
time = duration_cast<microseconds>(thisMoment - moment).count(); // first get the timelapse
moment = steady_clock::now(); // get the time each loop
diagonalForce = force.magnitude();
diagonalForce -= friction();
if (diagonalForce < 0) diagonalForce = 0;
acceleration = diagonalForce / mass();
velocity = acceleration * (static_cast<float>(time) / 1000000);
if (velocity != velocity) velocity = 0;
}
void Body::update() {
Vector temp = position;
Vector newPos = temp;
if (gravity) {
force.y += 1 * mass();
}
newPos.x += force.x * velocity;
newPos.y += force.y * velocity;
unsigned char tag = layer->checkPrintable(map, position, newPos, dimension);
if (tag == 0) {
isColliding = false;
position = newPos;
} else {
isColliding = true;
GGame::callOnCollision(this->tag, tag);
}
force -= newPos - temp;
}
void Body::lateUpdate() {
if (gravity && !isColliding) {
addForce(Vector::down);
}
}
void Body::moveRight() {
Vector temp = position;
Vector newPos = temp;
newPos.moveRight();
unsigned char tag = layer->checkPrintable(map, position, newPos, dimension);
if (tag == 0) {
isColliding = false;
position = newPos;
} else {
isColliding = true;
GGame::callOnCollision(this->tag, tag);
}
}
void Body::moveLeft() {
Vector temp = position;
Vector newPos = temp;
newPos.moveLeft();
unsigned char tag = layer->checkPrintable(map, position, newPos, dimension);
if (tag == 0) {
isColliding = false;
position = newPos;
} else {
isColliding = true;
GGame::callOnCollision(this->tag, tag);
}
}
void Body::moveUp() {
Vector temp = position;
Vector newPos = temp;
newPos.moveUp();
unsigned char tag = layer->checkPrintable(map, position, newPos, dimension);
if (tag == 0) {
isColliding = false;
position = newPos;
} else {
isColliding = true;
GGame::callOnCollision(this->tag, tag);
}
}
void Body::moveDown() {
Vector temp = position;
Vector newPos = temp;
newPos.moveDown();
unsigned char tag = layer->checkPrintable(map, position, newPos, dimension);
if (tag == 0) {
isColliding = false;
position = newPos;
} else {
isColliding = true;
GGame::callOnCollision(this->tag, tag);
}
}
Body::Body() {
gravity = false;
isColliding = false;
moment = steady_clock::now();
}
Body::~Body() {
}
void Body::addForce(Vector force) {
this->force += force;
}
void Body::useGravity() {
gravity = true;
}
|
C++
|
UTF-8
| 2,115 | 2.515625 | 3 |
[] |
no_license
|
#include "PickByColor.h"
#include "..\ApplicationManager.h"
#include "..\GUI\input.h"
#include "..\GUI\Output.h"
#include"SelectAction.h"
#include"CopyAction.h"
#include"DeleteAction.h"
#include"LoadAction.h"
void PickByColor::ReadActionParameters()
{
}
void PickByColor::Execute()
{
Action* pAct;
pAct = new LoadAction(pManager, "Original Figurelist");
pAct->Execute();
pManager->UpdateInterface();
delete pAct;
Input *pIn = pManager->GetInput();
Output *pOut = pManager->GetOutput();
CFigure *F = pManager->RandomFig();
pManager->SetSelected(F);
pAct = new CopyAction(pManager);
pAct->Execute();
delete pAct;
F = pManager->GetClipboard();
int c = pManager->CountByColor(F);
if (c == 0)
return;
pManager->SetSelected(NULL);
int CorrectPicks = 0;
int IncorrectPicks = 0;
string s;
s = "Pick All ";
s += F->ColorToString(F->GetFillColor());
s += " Figures";
pOut->PrintMessage(s);
Point CheckPoint;
CheckPoint.x = 252;
CheckPoint.y = 51;
while (c != 0 && (CheckPoint.y>50 || CheckPoint.x>251))
{
pAct = new SelectAction(pManager, true);
pAct->Execute();
SelectAction* p = (SelectAction*)pAct;
CheckPoint = p->P;
delete pAct;
if ((pManager->GetSelected() != NULL))
{
if (pManager->GetSelected()->SameFillColor(F))
{
c--;
CorrectPicks++;
}
else
IncorrectPicks++;
pAct = new DeleteAction(pManager);
pAct->Execute();
delete pAct;
}
pManager->SetSelected(NULL);
pManager->UpdateInterface();
s = "Number of Corrcect Picks= ";
s += to_string(CorrectPicks);
s += "| Number Of Incorrect Picks =";
s += to_string(IncorrectPicks);
pOut->PrintMessage(s);
}
if (c == 0)
{
pAct = new LoadAction(pManager, "YouWon");
pAct->Execute();
delete pAct;
string n = "You Won! ";
n += s;
pOut->PrintMessage(n);
}
else if (CheckPoint.y>50 && CheckPoint.x>251)
{
pOut->ClearStatusBar();
pManager->GetUserAction();
}
}
PickByColor::PickByColor(ApplicationManager*pApp):Action(pApp)
{
}
PickByColor::~PickByColor()
{
}
|
JavaScript
|
UTF-8
| 7,527 | 3.03125 | 3 |
[] |
no_license
|
var namespace = "http://www.w3.org/2000/svg"
var turn = "player1"
var buttonClicked = 0
function topLeft(){
if(buttonClicked == 0){
if(turn == "player1"){
var myCircle = document.createElementNS(namespace, "circle")
var canvas = document.getElementById("game-board")
myCircle.setAttribute("cx", 45)
myCircle.setAttribute("cy", 45)
myCircle.setAttribute("r", 30)
myCircle.setAttribute("fill", "red" )
canvas.appendChild(myCircle)
buttonClicked = 1
turn = "player2"
}else{
var myCircle = document.createElementNS(namespace, "circle")
var canvas = document.getElementById("game-board")
myCircle.setAttribute("cx", 45)
myCircle.setAttribute("cy", 45)
myCircle.setAttribute("r", 30)
myCircle.setAttribute("fill", "black" )
canvas.appendChild(myCircle)
turn = "player1"
}
buttonClicked = 1
}
}
var turn = "player1"
var buttonShape = 0
function topMiddle(){
if(buttonShape == 0){
if(turn == "player1"){
var myCircle = document.createElementNS(namespace, "circle")
var canvas = document.getElementById("game-board")
myCircle.setAttribute("cx", 145)
myCircle.setAttribute("cy", 45)
myCircle.setAttribute("r", 30)
myCircle.setAttribute("fill", "red" )
canvas.appendChild(myCircle)
buttonShape = 1
turn = "player2"
}else{
var myCircle = document.createElementNS(namespace, "circle")
var canvas = document.getElementById("game-board")
myCircle.setAttribute("cx", 145)
myCircle.setAttribute("cy", 45)
myCircle.setAttribute("r", 30)
myCircle.setAttribute("fill", "black" )
canvas.appendChild(myCircle)
turn = "player1"
}
buttonShape = 1
}
}
var turn = "player1"
var buttonClicked2 = 0
function topRight(){
if(buttonClicked2 == 0){
if(turn == "player1"){
var myCircle = document.createElementNS(namespace, "circle")
var canvas = document.getElementById("game-board")
myCircle.setAttribute("cx", 245)
myCircle.setAttribute("cy", 45)
myCircle.setAttribute("r", 30)
myCircle.setAttribute("fill", "red" )
canvas.appendChild(myCircle)
buttonClicked2 = 1
turn = "player2"
}else{
var myCircle = document.createElementNS(namespace, "circle")
var canvas = document.getElementById("game-board")
myCircle.setAttribute("cx", 245)
myCircle.setAttribute("cy", 45)
myCircle.setAttribute("r", 30)
myCircle.setAttribute("fill", "black" )
canvas.appendChild(myCircle)
turn = "player1"
buttonClicked2 = 1
}
}
}
var turn = "player1"
var buttonClicked3 = 0
function middleLeft(){
if(buttonClicked3 == 0){
if(turn == "player1"){
var myCircle = document.createElementNS(namespace, "circle")
var canvas = document.getElementById("game-board")
myCircle.setAttribute("cx", 45)
myCircle.setAttribute("cy", 145)
myCircle.setAttribute("r", 30)
myCircle.setAttribute("fill", "red" )
canvas.appendChild(myCircle)
buttonClicked3 = 1
turn = "player2"
}else{
var myCircle = document.createElementNS(namespace, "circle")
var canvas = document.getElementById("game-board")
myCircle.setAttribute("cx", 45)
myCircle.setAttribute("cy", 145)
myCircle.setAttribute("r", 30)
myCircle.setAttribute("fill", "black" )
canvas.appendChild(myCircle)
turn = "player1"
}
buttonClicked3 = 1
}
}
var turn = "player1"
var buttonClicked5 = 0
function middleMiddle(){
if(buttonClicked5 == 0){
if(turn == "player1"){
var myCircle = document.createElementNS(namespace, "circle")
var canvas = document.getElementById("game-board")
myCircle.setAttribute("cx", 145)
myCircle.setAttribute("cy", 145)
myCircle.setAttribute("r", 30)
myCircle.setAttribute("fill", "red" )
canvas.appendChild(myCircle)
buttonClicked5 = 1
turn = "player2"
}else{
var myCircle = document.createElementNS(namespace, "circle")
var canvas = document.getElementById("game-board")
myCircle.setAttribute("cx", 145)
myCircle.setAttribute("cy", 145)
myCircle.setAttribute("r", 30)
myCircle.setAttribute("fill", "black" )
canvas.appendChild(myCircle)
turn = "player1"
}
buttonClicked5 = 1
}
}
var turn = "player1"
var buttonClicked6 = 0
function middleRight(){
if(buttonClicked6 == 0){
if(turn == "player1"){
var myCircle = document.createElementNS(namespace, "circle")
var canvas = document.getElementById("game-board")
myCircle.setAttribute("cx", 245)
myCircle.setAttribute("cy", 145)
myCircle.setAttribute("r", 30)
myCircle.setAttribute("fill", "red" )
canvas.appendChild(myCircle)
buttonClicked6 = 1
turn = "player2"
}else{
var myCircle = document.createElementNS(namespace, "circle")
var canvas = document.getElementById("game-board")
myCircle.setAttribute("cx", 245)
myCircle.setAttribute("cy", 145)
myCircle.setAttribute("r", 30)
myCircle.setAttribute("fill", "black" )
canvas.appendChild(myCircle)
turn = "player1"
}
buttonClicked6 = 1
}
}
var turn = "player1"
var buttonClicked7 = 0
function bottomLeft(){
if(buttonClicked7 == 0){
if(turn == "player1"){
var myCircle = document.createElementNS(namespace, "circle")
var canvas = document.getElementById("game-board")
myCircle.setAttribute("cx", 45)
myCircle.setAttribute("cy", 245)
myCircle.setAttribute("r", 30)
myCircle.setAttribute("fill", "red" )
canvas.appendChild(myCircle)
buttonClicked7 = 1
turn = "player2"
}else{
var myCircle = document.createElementNS(namespace, "circle")
var canvas = document.getElementById("game-board")
myCircle.setAttribute("cx", 45)
myCircle.setAttribute("cy", 245)
myCircle.setAttribute("r", 30)
myCircle.setAttribute("fill", "black" )
canvas.appendChild(myCircle)
turn = "player1"
}
buttonClicked7 = 1
}
}
var turn = "player1"
var buttonClicked8 = 0
function bottomMiddle(){
if(buttonClicked8 == 0){
if(turn == "player1"){
var myCircle = document.createElementNS(namespace, "circle")
var canvas = document.getElementById("game-board")
myCircle.setAttribute("cx", 145)
myCircle.setAttribute("cy", 245)
myCircle.setAttribute("r", 30)
myCircle.setAttribute("fill", "red" )
canvas.appendChild(myCircle)
buttonClicked8 = 1
turn = "player2"
}else{
var myCircle = document.createElementNS(namespace, "circle")
var canvas = document.getElementById("game-board")
myCircle.setAttribute("cx", 145)
myCircle.setAttribute("cy", 245)
myCircle.setAttribute("r", 30)
myCircle.setAttribute("fill", "black" )
canvas.appendChild(myCircle)
turn = "player1"
}
buttonClicked8 = 1
}
}
var turn = "player1"
var buttonClicked9 = 0
function bottomRight(){
if(buttonClicked9 == 0){
if(turn == "player1"){
var myCircle = document.createElementNS(namespace, "circle")
var canvas = document.getElementById("game-board")
myCircle.setAttribute("cx", 245)
myCircle.setAttribute("cy", 245)
myCircle.setAttribute("r", 30)
myCircle.setAttribute("fill", "red" )
canvas.appendChild(myCircle)
buttonClicked9 = 1
turn = "player2"
}else{
var myCircle = document.createElementNS(namespace, "circle")
var canvas = document.getElementById("game-board")
myCircle.setAttribute("cx", 245)
myCircle.setAttribute("cy", 245)
myCircle.setAttribute("r", 30)
myCircle.setAttribute("fill", "black" )
canvas.appendChild(myCircle)
turn = "player1"
}
buttonClicked9 = 1
}
}
|
Java
|
UTF-8
| 3,742 | 2.234375 | 2 |
[] |
no_license
|
package com.zilin.springtest.ws;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.zilin.springtest.entity.PrintDto;
import com.zilin.springtest.service.IPrintService;
import com.zilin.springtest.service.PrintS2;
import io.netty.buffer.Unpooled;
import io.netty.channel.ChannelFutureListener;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelInboundHandlerAdapter;
import io.netty.channel.SimpleChannelInboundHandler;
import io.netty.util.CharsetUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.PostConstruct;
import java.net.InetSocketAddress;
import java.util.Map;
@Component
public class EchoServerHandler extends SimpleChannelInboundHandler<String> {
private Logger log = LoggerFactory.getLogger(getClass());
@Autowired
private IPrintService printService;
/*@Override
public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception{
System.out.println("server channelRead...; received" + msg);
ctx.write(Unpooled.copiedBuffer("Netty rocks1", CharsetUtil.UTF_8));
}*/
@Override
protected void channelRead0(ChannelHandlerContext ctx, String msg) {
StringBuilder sb = null;
Map<String, Object> result = null;
PrintDto printDto = new PrintDto();
try {
// 报文解析处理
sb = new StringBuilder();
JSONObject jsonObject=JSON.parseObject(msg);
System.out.println(jsonObject.getString("6"));
printDto.setItemIs(jsonObject.getString("ItemIs"));
printDto.setIsSmall(jsonObject.getString("IsSmall"));
printDto.setItemSet(jsonObject.getString("ItemSet"));
printDto.setItemGet(jsonObject.getString("ItemGet"));
printDto.setNn(jsonObject.getString("N"));
printDto.setS1(jsonObject.getString("1"));
printDto.setS2(jsonObject.getString("2"));
printDto.setS3(jsonObject.getString("3"));
printDto.setS4(jsonObject.getString("4"));
printDto.setS5(jsonObject.getString("5"));
printDto.setS6(jsonObject.getString("6"));
PrintS2 printS2=new PrintS2();
int rrr = printS2.ServerSocketDemo(printDto);
sb.append(""+rrr);
sb.append("\n");
ctx.writeAndFlush(sb);
} catch (Exception e) {
String errorCode = "-1\n";
ctx.writeAndFlush(errorCode);
log.error("报文解析失败: " + e.getMessage());
}
//printService.ServerSocketDemo(printDto);
}
@Override
public void channelReadComplete(ChannelHandlerContext ctx) throws Exception{
System.out.println("server channelReadComplete..");
ctx.writeAndFlush(Unpooled.EMPTY_BUFFER).addListener(ChannelFutureListener.CLOSE);
}
@Override
public void channelActive(ChannelHandlerContext ctx) throws Exception {
InetSocketAddress insocket = (InetSocketAddress) ctx.channel().remoteAddress();
String clientIp = insocket.getAddress().getHostAddress();
log.info("收到客户端[ip:" + clientIp + "]连接");
}
@Override
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception{
System.out.println("server occur exception:" + cause.getMessage());
cause.printStackTrace();
ctx.close();
}
}
|
JavaScript
|
UTF-8
| 1,897 | 2.8125 | 3 |
[] |
no_license
|
import request from "superagent";
import Promise from "bluebird";
import * as _parse from "csv-parse";
import fs from "fs";
// TODO: Work out how to make csv-parse work with promisifyAll
const parse = Promise.promisify(_parse.default);
Promise.promisifyAll(fs);
function fetchLeagueResults(season) {
return new Promise((resolve, reject) => {
const url = `http://www.football-data.co.uk/mmz4281/${season}/E0.csv`;
request
.get(url)
.end((err, res) => {
if (err) {
reject(err);
} else {
cleanResults(res.text)
.then(resolve)
.catch(reject);
}
});
});
}
function cleanResults(rawResults) {
return new Promise((resolve, reject) => {
parse(rawResults)
.then((rows) => {
const matches = rows.slice(1).map((row) => {
return {
homeTeam: row[2],
awayTeam: row[3],
homeGoals: parseInt(row[4]),
awayGoals: parseInt(row[5])
};
})
resolve(matches);
})
.catch(reject);
});
}
const seasons = ["0809", "0910", "1011", "1112", "1213", "1314", "1415", "1516"];
for (const season of seasons) {
fetchLeagueResults(season)
.then((data) => {
fs.writeFileAsync(`data/pl_results_${season}.json`, JSON.stringify(data))
.then(() => {
console.log(`Fetched results for ${season} season`);
})
.catch((err) => {
throw err;
});
})
.catch((err) => {
console.error(`Failed to fetch results for season ${season}: ${err}`);
})
}
|
JavaScript
|
UTF-8
| 5,283 | 2.625 | 3 |
[
"MIT"
] |
permissive
|
// mkGuaguaka
module.exports = function(params, cb) {
let dft = {
id: '',
title: '',
itemClass: 'guaguayes',
eraser: 15, //橡皮擦大小
open: 25, // 开奖百分比
masker: '#ccc',
maskerTitle: '刮开此涂层',
}
let opts = Object.assign({}, dft, params)
if (!opts.title) opts.title = '好好学习'
return {
itemClass: opts.itemClass,
title: '',
dot: [
{
title: '',
itemClass: 'guagua-touchpad',
catchtouchstart(e, param, inst){
let touchs = e.changedTouches[0]
let cTarget = e.currentTarget
let dataset = cTarget.dataset
let x = touchs.pageX
let y = touchs.pageY
let r = opts.eraser
if (this.cavs) {
this.eraser(x, y, r)
}
},
catchtouchmove(e, param, inst){
let touchs = e.changedTouches[0]
let cTarget = e.currentTarget
let dataset = cTarget.dataset
let x = touchs.pageX
let y = touchs.pageY
let r = opts.eraser
this.eraser(x, y, r)
},
catchtouchend(e, param, inst){
setTimeout(() => {
let persent = this.getFilledPercentage()
if (persent>opts.open) { // 刮开面积大于32%,开奖
this.clean()
if (typeof cb === 'function') {
cb.call(this)
}
}
}, 100);
}
}
],
methods: {
// canvas的绘图都是以左上角0,0为基点
// 但我们需要定位canvas容器的位置,这里需要减去位移的位置,重置基点
flatGap(x, y) {
x = x - this.diffLeft
y = y - this.diffTop
return [x, y]
},
getFilledPercentage() {
let width = this.canvas.width
let height = this.canvas.height
let imgData = this.cavs.getImageData(0, 0, width, height);
// imgData.data是个数组,存储着指定区域每个像素点的信息,数组中4个元素表示一个像素点的rgba值
let pixels = imgData.data;
let transPixels = [];
for (let i = 0; i < pixels.length; i += 4) {
// 严格上来说,判断像素点是否透明需要判断该像素点的a值是否等于0,
// 为了提高计算效率,这儿设置当a值小于128,也就是半透明状态时就可以了
if (pixels[i + 3] < 128) {
transPixels.push(pixels[i + 3]);
}
}
// return (transPixels.length / (pixels.length / 4) * 100).toFixed(2) + '%'
return (transPixels.length / (pixels.length / 4) * 100)
},
eraser(_x, _y, r){
this.cavs.globalCompositeOperation = 'destination-out'
let [x, y] = this.flatGap(_x, _y)
this.cavs.beginPath()
this.cavs.moveTo(x, y)
this.cavs.arc(x, y, r, 0, Math.PI * 2, false)
this.cavs.fill()
this.cavs.closePath()
},
clean(){
let canvas = this.canvas
this.cavs.clearRect(0, 0, canvas.width, canvas.height)
},
reMasker(param){
opts = Object.assign({}, opts, param)
this.update({title: opts.title})
this.masker()
},
masker(){
let canvas = this.canvas
if (opts.masker.charAt(0) === '#' || opts.masker.indexOf('rgb')===0) {
this.cavs.fillStyle = opts.masker
this.cavs.fillRect(0, 0, canvas.width, canvas.height)
let top = this.container.height/2
let left = this.container.width/2
this.cavs.fillStyle = '#aaa'
this.cavs.font = 'bold 30px "Gill Sans Extrabold"'
this.cavs.textAlign = 'center'
this.cavs.textBaseline = 'middle'
this.cavs.fillText(opts.maskerTitle, left, top)
} else {
let that = this
var img = canvas.createImage();
// img.src = "/images/banner.jpg";
img.src = opts.masker;
img.onload = function(){
that.cavs.drawImage(img, 0, 0, that.container.width, that.container.height)
}
}
},
__ready(){
if (opts.id) {
this.activePage[opts.id] = this
}
let query = wx.createSelectorQuery().in(this)
query.selectAll(`.guaguayes`).boundingClientRect(ret => {
this.container = ret && ret[0]
}).exec(()=>{
if (this.container) {
this.diffTop = this.container.top
this.diffLeft = this.container.left
const canvasQuery = wx.createSelectorQuery()
canvasQuery.select('#guagua-canvas')
.fields({ node: true, size: true })
.exec((res) => {
const canvas = res[0].node
const ctx = canvas.getContext('2d')
this.canvas = canvas
this.cavs = ctx
const dpr = wx.getSystemInfoSync().pixelRatio
canvas.width = res[0].width * dpr
canvas.height = res[0].height * dpr
ctx.scale(dpr, dpr)
setTimeout(() => {
this.update({title: opts.title})
}, 200);
this.masker()
})
}
})
}
}
}
}
|
Shell
|
UTF-8
| 142 | 3.125 | 3 |
[] |
no_license
|
#!/bin/bash
# do sort on each file separately
prefix=rat;
for i in `seq -f %02g 49 95`
do
sort -k1n -k2n $prefix$i > $prefix$i.sort
done
|
Java
|
UTF-8
| 707 | 2.140625 | 2 |
[] |
no_license
|
package server.step_1_decode_request;
import server.libraries.CommandListener;
public class OurCommandListener extends CommandListener {
public OurCommandListener() {
setSerializeListener(new SerializeListener() {
@Override
public String serialize(Object toSerialize) {
return null;
}
});
setSendOutputListener(new SendOutputListener() {
@Override
public void sendOutput(String toSend) {
}
});
setSendErrorListener(new SendErrorListener() {
@Override
public void sendError(int statusCode, String statusText) {
}
});
}
}
|
C++
|
UTF-8
| 9,411 | 2.5625 | 3 |
[
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] |
permissive
|
// Copyright 2018 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_OPTIONAL_H
#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_OPTIONAL_H
#include "google/cloud/internal/throw_delegate.h"
#include <type_traits>
#include <utility>
namespace google {
namespace cloud {
inline namespace GOOGLE_CLOUD_CPP_NS {
/**
* A poor's man version of std::optional<T>.
*
* This project needs to support C++11 and C++14, so std::optional<> is not
* available. We cannot use Abseil either, see #232 for the reasons.
* So we implement a very minimal "optional" class that documents the intent
* and we will remove it when possible.
*
* @tparam T the type of the optional value.
*
* @warning this is not a drop-in replacement for std::optional<>, it has at
* least the following defects:
* - it raises std::logic_error instead of std::bad_optional_access.
* - emplace() is a very simple version.
* - It does not have the full complement of assignment operators and
* constructors required by the standard.
* - It lacks comparison operators.
* - No nullopt_t.
* - No std::swap(), std::make_optional(), or std::hash().
*
* @warning Some of the member functions have a (commented-out) `constexpr`
* qualifier. The spec requires them to be `constexpr` functions, but the spec
* assumes C++14 (or newer) semantics for non-const constexpr member functions,
* and we often compile with C++11 semantics.
*
* TODO(#687) - replace with absl::optional<> or std::optional<> when possible.
*/
template <typename T>
class optional { // NOLINT(readability-identifier-naming)
private:
template <typename T1, typename U1>
using AllowImplicit = typename std::is_convertible<U1&&, T1>;
public:
optional() : buffer_{} {}
optional(optional const& rhs) : has_value_(rhs.has_value_) {
if (has_value_) {
new (reinterpret_cast<T*>(&buffer_)) T(*rhs);
}
}
optional(optional&& rhs) noexcept : has_value_(rhs.has_value_) {
if (has_value_) {
new (reinterpret_cast<T*>(&buffer_)) T(std::move(*rhs));
}
}
template <typename U = T,
typename std::enable_if<
!std::is_same<typename std::decay<U>::type, optional>::value &&
std::is_constructible<T, U&&>::value &&
AllowImplicit<T, U>::value,
int>::type = 0>
// NOLINTNEXTLINE(bugprone-forwarding-reference-overload)
optional(U&& x) : has_value_(true) { // NOLINT(google-explicit-constructor)
new (reinterpret_cast<T*>(&buffer_)) T(std::forward<U>(x));
}
template <typename U = T,
typename std::enable_if<
!std::is_same<typename std::decay<U>::type, optional>::value &&
std::is_constructible<T, U&&>::value &&
!AllowImplicit<T, U>::value,
int>::type = 0>
// NOLINTNEXTLINE(bugprone-forwarding-reference-overload)
explicit optional(U&& x) : has_value_(true) {
new (reinterpret_cast<T*>(&buffer_)) T(std::forward<U>(x));
}
~optional() { reset(); }
optional& operator=(optional const& rhs) {
// There may be shorter ways to express this, but this is fairly readable,
// and should be reasonably efficient. Note that we must avoid destructing
// the destination and/or default initializing it unless really needed.
if (!has_value_) {
if (!rhs.has_value_) {
return *this;
}
new (reinterpret_cast<T*>(&buffer_)) T(*rhs);
has_value_ = true;
return *this;
}
if (!rhs.has_value_) {
reset();
return *this;
}
**this = *rhs;
has_value_ = true;
return *this;
}
optional& operator=(optional&& rhs) noexcept {
// There may be shorter ways to express this, but this is fairly readable,
// and should be reasonably efficient. Note that we must avoid destructing
// the destination and/or default initializing it unless really needed.
if (!has_value_) {
if (!rhs.has_value_) {
return *this;
}
new (reinterpret_cast<T*>(&buffer_)) T(std::move(*rhs));
has_value_ = true;
return *this;
}
if (!rhs.has_value_) {
reset();
return *this;
}
**this = std::move(*rhs);
has_value_ = true;
return *this;
}
// Disable this assignment if U==optional<T>. Well, really if U is a
// cv-qualified version of optional<T>, so we need to apply std::decay<> to
// it first.
template <typename U = T>
typename std::enable_if< // NOLINT(misc-unconventional-assign-operator)
!std::is_same<optional, typename std::decay<U>::type>::value,
optional>::type&
operator=(U&& rhs) {
// There may be shorter ways to express this, but this is fairly readable,
// and should be reasonably efficient. Note that we must avoid destructing
// the destination and/or default initializing it unless really needed.
if (!has_value_) {
new (reinterpret_cast<T*>(&buffer_)) T(std::forward<U>(rhs));
has_value_ = true;
return *this;
}
**this = std::forward<U>(rhs);
has_value_ = true;
return *this;
}
constexpr T const* operator->() const {
return reinterpret_cast<T const*>(&buffer_);
}
/*constexpr*/ T* operator->() { return reinterpret_cast<T*>(&buffer_); }
constexpr T const& operator*() const& {
return *reinterpret_cast<T const*>(&buffer_);
}
/*constexpr*/ T& operator*() & { return *reinterpret_cast<T*>(&buffer_); }
// Kind of useless, but the spec requires it.
#if GOOGLE_CLOUD_CPP_HAVE_CONST_REF_REF
/*constexpr*/ T const&& operator*() const&& {
return std::move(*reinterpret_cast<T const*>(&buffer_));
}
#endif // GOOGLE_CLOUD_CPP_HAVE_CONST_REF_REF
/*constexpr*/ T&& operator*() && {
return std::move(*reinterpret_cast<T*>(&buffer_));
}
/*constexpr*/ T& value() & {
check_access();
return **this;
}
/*constexpr*/ T const& value() const& {
check_access();
return **this;
}
/*constexpr*/ T&& value() && {
check_access();
return std::move(**this);
}
// Kind of useless, but the spec requires it.
/*constexpr*/ T const&& value() const&& {
check_access();
return **this;
}
template <typename U>
constexpr T value_or(U&& default_value) const& {
return bool(*this) ? **this
: static_cast<T>(std::forward<U>(default_value));
}
template <typename U>
/*constexpr*/ T value_or(U&& default_value) && {
return bool(*this) ? std::move(**this)
: static_cast<T>(std::forward<U>(default_value));
}
explicit operator bool() const { return has_value_; }
bool has_value() const { return has_value_; }
void reset() {
if (has_value_) {
reinterpret_cast<T*>(&buffer_)->~T();
has_value_ = false;
}
}
T& emplace(T&& value) {
reset();
new (reinterpret_cast<T*>(&buffer_)) T(std::move(value));
has_value_ = true;
return **this;
}
private:
void check_access() const {
if (has_value_) {
return;
}
google::cloud::internal::ThrowLogicError("access unset optional");
}
// We use std::aligned_storage<T> because T may not have a default
// constructor, if we used 'T' here we could not default initialize this class
// either.
using aligned_storage_t = std::aligned_storage<sizeof(T), alignof(T)>;
typename aligned_storage_t::type buffer_;
bool has_value_{false};
};
template <typename T>
optional<T> make_optional(T&& t) {
return optional<T>(std::forward<T>(t));
}
template <typename T>
inline bool operator==(optional<T> const& lhs, optional<T> const& rhs) {
if (lhs.has_value() != rhs.has_value()) {
return false;
}
if (!lhs.has_value()) {
return true;
}
return *lhs == *rhs;
}
template <typename T>
inline bool operator<(optional<T> const& lhs, optional<T> const& rhs) {
if (lhs.has_value()) {
if (!rhs.has_value()) {
return false;
}
// Both have a value, compare them
return *lhs < *rhs;
}
// If both do not have a value, then they are equal, so this returns false.
// If rhs has a value then it compares larger than lhs because lhs does
// not have a value.
return rhs.has_value();
}
template <typename T>
inline bool operator!=(optional<T> const& lhs, optional<T> const& rhs) {
return std::rel_ops::operator!=(lhs, rhs);
}
template <typename T>
inline bool operator>(optional<T> const& lhs, optional<T> const& rhs) {
return std::rel_ops::operator>(lhs, rhs);
}
template <typename T>
inline bool operator>=(optional<T> const& lhs, optional<T> const& rhs) {
return std::rel_ops::operator>=(lhs, rhs);
}
template <typename T>
inline bool operator<=(optional<T> const& lhs, optional<T> const& rhs) {
return std::rel_ops::operator<=(lhs, rhs);
}
} // namespace GOOGLE_CLOUD_CPP_NS
} // namespace cloud
} // namespace google
#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_OPTIONAL_H
|
Python
|
UTF-8
| 144 | 2.984375 | 3 |
[] |
no_license
|
S = input()
l = len(S)
ans = 0
for i in range(l):
ans += sum([int(S[i]) * (10**k) * 2**(max(0,l-i-k-2)+i) for k in range(l-i)])
print(ans)
|
Shell
|
UTF-8
| 1,189 | 3.59375 | 4 |
[] |
no_license
|
#!/bin/bash
###################################################################################
## ##
## This script update user profile to run $BLJ/script/blj_config. ##
## If using bash, $blj_profile=~/.bash_profile (set on 11 as the default val). ##
## If using another env, like zsh, update blj_profile value on line 11 below. ##
## If profile exists: backup as $blj_profile~, else create a new $blj_profile. ##
## ##
###################################################################################
export blj_profile=~/.bash_profile
bljDir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
if [ ! -f "$blj_profile" ]; then
printf '%s\n' '#BioLockJ generated bash profile' > $blj_profile
echo " Created profile: $blj_profile"
else
cp $blj_profile $blj_profile~
echo " Saved backup: $blj_profile~"
fi
echo '[ -x "$bljDir/script/blj_config" ] && . $bljDir/script/blj_config' >> $blj_profile
source $blj_profile
echo " Saved profile: $blj_profile"
echo "BioLockJ installation complete!"
|
PHP
|
UTF-8
| 685 | 3.0625 | 3 |
[
"MIT"
] |
permissive
|
<?php
declare(strict_types=1);
namespace Common\Stream;
use stdClass;
use function Safe\json_encode;
final class Producer
{
private string $streamFilePath;
public function __construct(string $streamFilePath)
{
$this->streamFilePath = $streamFilePath;
}
/**
* @param string $messageType
* @param mixed $data
*/
public function produce(string $messageType, $data): void
{
$message = new stdClass();
$message->messageType = $messageType;
$message->data = $data;
$encodedMessage = json_encode($message);
file_put_contents($this->streamFilePath, $encodedMessage . "\n", FILE_APPEND);
}
}
|
Java
|
UTF-8
| 996 | 2.203125 | 2 |
[] |
no_license
|
package com.sg.surveyshrike.listener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.mongodb.core.mapping.event.AbstractMongoEventListener;
import org.springframework.data.mongodb.core.mapping.event.BeforeConvertEvent;
import org.springframework.stereotype.Component;
import com.sg.surveyshrike.model.User;
import com.sg.surveyshrike.model.User.CompositeKey;
import com.sg.surveyshrike.service.SequenceGenerator;
@Component
public class UserListener extends AbstractMongoEventListener<User> {
@Autowired
private SequenceGenerator sequenceService;
@Override
public void onBeforeConvert(BeforeConvertEvent<User> event) {
User attrs = event.getSource();
CompositeKey sequenceNumber = attrs.getId();
if (null == sequenceNumber) {
int sequence = sequenceService.getNextSequence(User.SEQUENCETYPE).intValue();
CompositeKey comp = new CompositeKey(attrs.getEmailId());
attrs.setUserId(sequence);
attrs.setId(comp);
}
}
}
|
Python
|
UTF-8
| 3,131 | 2.8125 | 3 |
[] |
no_license
|
# ##################################################################################################
# Disclaimer #
# This file is a python3 translation of AutoDockTools (v.1.5.7) #
# Modifications made by Valdes-Tresanco MS (https://github.com/Valdes-Tresanco-MS) #
# Tested by Valdes-Tresanco-MS and Valdes-Tresanco ME #
# There is no guarantee that it works like the original distribution, #
# but feel free to tell us if you get any difference to correct the code. #
# #
# Please use this cite the original reference. #
# If you think my work helps you, just keep this note intact on your program. #
# #
# Modification date: 4/7/20 5:48 #
# #
# ##################################################################################################
#############################################################################
#
# Authors: Michel F. SANNER, Ruth Huey
#
# Copyright: M. Sanner TSRI 2005
#
#############################################################################
from .tree import TreeNodeSet
class Sets(dict):
"""
Object used to manage a collection of explicit sets of TreeNodes
"""
def add(self, name, set, overwrite=True):
assert isinstance(set, TreeNodeSet)
assert type(name) in (str,)
if not overwrite:
assert name not in list(self.keys())
self[name] = set
def remove(self, name):
# remove a set by name. Silently ignore non existing sets but returns
# true when a set gets deleted, else returns False
if name in list(self.keys()):
del self[name]
return True
return False
def removeByInstance(self, set):
# remove a set that is specified by a TreeNodeSet.
# Silently ignore non existing sets but returns
# true when a set gets deleted, else returns False
for n, s in list(self.items()):
if s == set:
del self[n]
return True
return False
def get(self, stype=None):
# return a dict of sets optionally restricted to a user specified type
# if stype is specified it has to be a subclass of TreeNodeSet
if stype is None:
return self
else: # select the sets of a given type
assert issubclass(stype, TreeNodeSet)
result = {}
for name, set in list(self.items()):
if isinstance(set, stype):
result[name] = set
return result
|
Python
|
UTF-8
| 3,483 | 3.796875 | 4 |
[] |
no_license
|
#!/usr/bin/env python
"""
Author: Henry Ehlers
WUR_Number: 921013218060
A script designed to find all clusters that contain any gene of interest.
Inputs: [1] Path leading to file containing clusters and genes within.
[2] Path leading to a new-line delimited file containing the genes of interest.
[3] Path leading to output file, which mirrors the structure of the cluster file.
In order to provide readable and understandable code, the right indentation margin has been
increased from 79 to 99 characters, which remains in line with Python-Style-Recommendation (
https://www.python.org/dev/peps/pep-0008/) .This allows for longer, more descriptive variable
and function names, as well as more extensive doc-strings.
"""
from CommandLineParser import *
import os
def find_co_expression_clusters(cluster_file, genes, output_file):
"""
Method to find all clusters and their genes that contain certain genes of interest contained
within a list. Found clusters are written to a tab and new-line delimited output file.
:param cluster_file: A string specifying the file name containing the clusters and their genes.
:param genes: A list of strings containing the names of the genes of interest.
:param output_file: A string specifying the name of the output file to be written.
"""
with open(output_file, 'w') as output_file:
with open(cluster_file, 'r') as input_file:
for line in input_file:
line = line.strip().split('\t')
cluster, gene_list = line[0], line[1]
if check_gene_presence(gene_list, genes):
output_file.write('%s\t%s\n' % (cluster, gene_list))
def check_gene_presence(gene_list, genes):
"""
Function to check whether any gene of interest is contained within a given list of genes.
:param gene_list: A list of strings containing the genes of interest.
:param genes: A list of strings containing the genes of a cluster.
:return: [True/False] depending on whether a gene was found or not.
"""
for gene in gene_list.split(','):
if gene[0] == ' ':
gene = gene[1:]
if gene in genes:
return True
return False
def get_genes_from_file(gene_file, column):
"""
Function to create a list of strings containing the contents of a new-line delimited file
containing the genes of interest.
:param gene_file: A string specifying the name of the new-line delimited file containing the
genes of interest
:param column: The column containing the gene codes/names of interest.
:return: A list of strings containing the genes of the input file.
"""
genes = []
with open(gene_file, 'r') as input_file:
for line in input_file:
genes.append(line.strip().split('\t')[column])
return genes
def main():
"""
Method to find all co-expressed clusters and their genes.
"""
cluster_file, gene_file, column, output_file = get_command_line_arguments(
['testing_cluster.txt', 'testing_genes.txt', '0', 'testing_output.txt'])
assert os.path.exists(cluster_file), 'Cluster file %s does not exist.' % cluster_file
assert os.path.exists(gene_file), 'Gene file %s does not exist.' % gene_file
column = int(column)
genes = get_genes_from_file(gene_file, column)
find_co_expression_clusters(cluster_file, genes, output_file)
if __name__ == '__main__':
main()
|
C++
|
UTF-8
| 7,997 | 2.53125 | 3 |
[] |
no_license
|
#include <string>
#include <vector>
#include <iostream>
using namespace std;
struct Entry {
bool available = false;
uint8_t next_track = 0x00;
uint8_t next_sector = 0x00;
string file_type = "";
uint8_t start_track = 0x00;
uint8_t start_sector = 0x00;
string pet_name = "";
uint32_t adress_start = 0x00;
uint32_t adress_end = 0x00;
uint8_t sector_size = 0x00;
uint8_t sectors = 0x00;
};
/*
Track Sectors/track # Sectors Storage in Bytes
----- ------------- --------- ----------------
1-17 21 357 7820
18-24 19 133 7170
25-30 18 108 6300
31-40(*) 17 85 6020
---
683 (for a 35 track image)
Track #Sect #SectorsIn D64 Offset Track #Sect #SectorsIn D64 Offset
----- ----- ---------- ---------- ----- ----- ---------- ----------
1 21 0 $00000 21 19 414 $19E00
2 21 21 $01500 22 19 433 $1B100
3 21 42 $02A00 23 19 452 $1C400
4 21 63 $03F00 24 19 471 $1D700
5 21 84 $05400 25 18 490 $1EA00
6 21 105 $06900 26 18 508 $1FC00
7 21 126 $07E00 27 18 526 $20E00
8 21 147 $09300 28 18 544 $22000
9 21 168 $0A800 29 18 562 $23200
10 21 189 $0BD00 30 18 580 $24400
11 21 210 $0D200 31 17 598 $25600
12 21 231 $0E700 32 17 615 $26700
13 21 252 $0FC00 33 17 632 $27800
14 21 273 $11100 34 17 649 $28900
15 21 294 $12600 35 17 666 $29A00
16 21 315 $13B00 36(*) 17 683 $2AB00
17 21 336 $15000 37(*) 17 700 $2BC00
18 19 357 $16500 38(*) 17 717 $2CD00
19 19 376 $17800 39(*) 17 734 $2DE00
20 19 395 $18B00 40(*) 17 751 $2EF00
*/
struct D64Parser {
std::vector<string> FILE_TYPE;
unsigned char data[0xf0000];
string filename;
string diskname;
std::vector<Entry> entries;
const uint32_t STARTS[41] = {
0,
0x00000, 0x01500, 0x02a00, 0x03f00, 0x05400, 0x06900, 0x07e00, 0x09300,
0x0a800, 0x0bd00, 0x0d200, 0x0e700, 0x0fc00, 0x11100, 0x12600, 0x13b00,
0x15000, 0x16500, 0x17800, 0x18b00, 0x19e00, 0x1b100, 0x1c400, 0x1d700,
0x1ea00, 0x1fc00, 0x20e00, 0x22000, 0x23200, 0x24400, 0x25600, 0x26700,
0x27800, 0x28900, 0x29a00, 0x2ab00, 0x2bc00, 0x2cd00, 0x2de00, 0x2ef00
};
void init(string f) {
FILE_TYPE.push_back("DEL");
FILE_TYPE.push_back("SEQ");
FILE_TYPE.push_back("PRG");
FILE_TYPE.push_back("USR");
FILE_TYPE.push_back("REL");
entries.clear();
filename = f;
FILE* file = fopen(filename.c_str(), "rb");
uint32_t pos = 0;
while (fread(&data[pos], 1, 1, file)) {
pos++;
}
fclose(file);
// init all available lines
uint32_t base_dir = 0x16600;
for (uint16_t i = 0; i < 0x1200; i += 0x20) {
Entry entry;
entry.next_track = data[base_dir + i];
entry.next_sector = data[base_dir + i + 1];
entry.file_type = (data[base_dir + i + 2] > 0x80 && data[base_dir + i + 2] < 0x84) ? FILE_TYPE.at(data[base_dir + i + 2] - 0x80) : "";
entry.start_track = data[base_dir + i + 3];
entry.start_sector = data[base_dir + i + 4];
entry.pet_name;
for (uint16_t j = 5; j < 0x15; j++) {
entry.pet_name += data[base_dir + i + j];
}
entry.sector_size = (uint8_t)(data[base_dir + i + 0x1e] + (data[base_dir + i + 0x1f] * 256));
entry.available = (entry.file_type != "");
entry.sectors = 21;
if (entry.start_track > 17 && entry.start_track < 25)
entry.sectors = 19;
else if (entry.start_track > 24 && entry.start_track < 31)
entry.sectors = 18;
else if (entry.start_track > 30)
entry.sectors = 17;
entry.adress_start = STARTS[entry.start_track] + entry.start_sector * 256;
entry.adress_end = entry.adress_start + entry.sector_size * 256;
entries.push_back(entry);
}
diskname = "";
for (uint8_t i = 0x90; i < 0xa0; i++) {
diskname += data[STARTS[18] + i];
}
}
std::vector<uint8_t> dirList() {
uint8_t lc = 0x1f;
uint8_t lh = 0x08;
std::vector<uint8_t> r{
0x1f, 0x08, 0x00
};
r.push_back(0x00); // HEADLINE 0
r.push_back(0x12); // HEADLINE BOLD ?
r.push_back(0x22); // "
for (uint16_t i = 0; i < diskname.size(); i++) {
r.push_back(diskname.at(i));
}
r.push_back(0x22); // "
for (uint16_t i = 0; i < 24 - diskname.size() - 2; i++) {
r.push_back(0x20); // FILLING SPACES
}
r.push_back(0x00);
for (uint16_t i = 0; i < entries.size(); i++) {
if (entries[i].available) {
if ((lc + 0x20) > 0xff)
lh++;
lc += 0x20;
r.push_back(lc); // Line separation
r.push_back(lh); // Line separation
r.push_back(entries[i].sector_size); // SIZE
r.push_back(0x00);
string f = std::to_string(entries[i].sector_size);
for (uint16_t j = 0; j < 4 - f.size(); j++) {
r.push_back(0x20); // SPACE
}
r.push_back(0x22); // "
for (uint16_t j = 0; j < entries[i].pet_name.size(); j++) {
r.push_back(entries[i].pet_name.at(j)); // NAME
}
r.push_back(0x22); // "
r.push_back(0x20); // SPACE
for (uint16_t j = 0; j < entries[i].file_type.size(); j++) {
r.push_back(entries[i].file_type.at(j)); // FILE_EXT
}
for (uint16_t j = 0; j < 26 - entries[i].pet_name.size() - 5 - (4 - f.size()); j++) {
r.push_back(0x20); // FILLING SPACES
}
r.push_back(0x00);
}
}
r.push_back(0x1d);
return r;
}
std::vector<uint8_t> getData(uint8_t row_id) {
std::vector<uint8_t> ret(entries.at(row_id).sector_size * 0x100);
uint16_t c = 0;
uint32_t next_track = entries.at(row_id).start_track;
uint32_t next_sector = entries.at(row_id).start_sector;
while(c < entries.at(row_id).sector_size) {
uint32_t a_adr = STARTS[next_track] + next_sector * 256;
for (uint16_t i = 0; i < 254; i++) {
ret[c * 254 + i] = data[a_adr + i + 2];
}
next_track = data[a_adr];
next_sector = data[a_adr + 1];
c++;
}
return ret;
}
bool filenameExists(string f) {
for (uint16_t i = 0; i < entries.size(); i++) {
cout << entries.at(i).pet_name << " - " << f << "\n";
if (entries.at(i).pet_name == f)
return true;
}
return false;
}
std::vector<uint8_t> getDataByFilename(string f) {
Entry selected;
for (uint16_t i = 0; i < entries.size(); i++) {
if (entries.at(i).pet_name == f)
selected = entries.at(i);
}
uint16_t c = 0;
std::vector<uint8_t> ret(selected.sector_size * 0x100);
uint32_t next_track = selected.start_track;
uint32_t next_sector = selected.start_sector;
while (c < selected.sector_size) {
uint32_t a_adr = STARTS[next_track] + next_sector * 256;
for (uint16_t i = 0; i < 254; i++) {
ret[c * 254 + i] = data[a_adr + i + 2];
}
next_track = data[a_adr];
next_sector = data[a_adr + 1];
c++;
}
return ret;
}
void printAll() {
cout << "\t\t" << diskname << "\n";
for (uint16_t i = 0; i < entries.size(); i ++) {
if (entries.at(i).available) {
cout << entries.at(i).file_type << "\t";
cout << hex << +entries.at(i).start_track;
cout << "/";
cout << hex << +entries.at(i).start_sector << "\t";
cout << entries.at(i).pet_name << "\t" << dec << entries.at(i).sector_size;
cout << "\t" << hex << entries.at(i).adress_start << " -> " << hex << entries.at(i).adress_end << "\n";
}
}
}
};
|
JavaScript
|
UTF-8
| 367 | 3.109375 | 3 |
[] |
no_license
|
var testArr = [6,3,5,1,2,4]
for(var x = 0; x < testArr.length; x++) {
if (x > 0) {
sum = testArr[x] ;
var z = y + sum;
console.log("Num:",sum,',','Sum: ',z);
var y = z
}
else {
sum = testArr[x];
var y = testArr[x];
console.log("Num:", sum, ',', 'Sum: ',y);
}
}
|
C++
|
UTF-8
| 580 | 2.796875 | 3 |
[] |
no_license
|
#include <stdio.h>
int main(void)
{
int a,b,c;
scanf("%d\n%d\n%d",&a,&b,&c);
if(a==1)
{
printf("I love fruit\n");
}
else if(a==2)
{
printf("I love vegetable\n");
}
else if(a==3)
{
printf("No comment\n");
}
if(b==1)
{
printf("I love fruit\n");
}
else if(b==2)
{
printf("I love vegetable\n");
}
else if(b==3)
{
printf("No comment\n");
}
if(c==1)
{
printf("I love fruit\n");
}
else if(c==2)
{
printf("I love vegetable\n");
}
else if(c==3)
{
printf("No comment\n");
}
getchar();
return 0;
}
|
JavaScript
|
UTF-8
| 3,370 | 2.65625 | 3 |
[] |
no_license
|
$(document).ready(function () {
var settingsRev = {
async: true,
crossDomain: true,
url: "https://cors-anywhere.herokuapp.com/api.yelp.com/v3/businesses/RQZCOKGctMfuf-MRVUdVnw/reviews",
method: "GET",
headers: {
"Content-Type": "application/json",
Authorization: "Bearer dXtk362BkuUPkzjgPaXmJi6q1_9rtXRWQzn8dDuzA810snDSoTrTURu_JLdNcEV4Pnz7AeCai-MeCi56hLdgpC5ozLSCjjvSwdrvhc9kPzzNMA2yV_fVyJ0rWLyXXXYx"
},
processData: false,
data: "",
};
var settingsGen = {
async: true,
crossDomain: true,
url: "https://cors-anywhere.herokuapp.com/api.yelp.com/v3/businesses/RQZCOKGctMfuf-MRVUdVnw",
method: "GET",
headers: {
"Content-Type": "application/json",
Authorization: "Bearer dXtk362BkuUPkzjgPaXmJi6q1_9rtXRWQzn8dDuzA810snDSoTrTURu_JLdNcEV4Pnz7AeCai-MeCi56hLdgpC5ozLSCjjvSwdrvhc9kPzzNMA2yV_fVyJ0rWLyXXXYx"
},
processData: false,
data: ""
};
$.ajax(settingsRev).done(function (responseReviews) {
var reviewOne = {
name: responseReviews.reviews[0].user.name,
text: responseReviews.reviews[0].text,
rating: responseReviews.reviews[0].rating
};
document.getElementById("textTitle1").innerHTML = reviewOne.name;
document.getElementById("review1Text").innerHTML = reviewOne.text;
document.getElementById("RatingOne").src = `./img/${reviewOne.rating}.png`;
var reviewTwo = {
name: responseReviews.reviews[1].user.name,
text: responseReviews.reviews[1].text,
rating: responseReviews.reviews[1].rating
};
document.getElementById("textTitle2").innerHTML = reviewTwo.name;
document.getElementById("review2Text").innerHTML = reviewTwo.text;
document.getElementById("RatingTwo").src = `./img/${reviewTwo.rating}.png`;
var reviewThree = {
name: responseReviews.reviews[2].user.name,
text: responseReviews.reviews[2].text,
rating: responseReviews.reviews[2].rating
};
document.getElementById("textTitle3").innerHTML = reviewThree.name;
document.getElementById("review3Text").innerHTML = reviewThree.text;
document.getElementById(
"RatingThree"
).src = `./img/${reviewThree.rating}.png`;
});
$.ajax(settingsGen).done(function (responseGen) {
var count = responseGen.review_count;
var ratingAve = responseGen.rating;
document.getElementById(
"reviewCount"
).innerHTML = `Currently there are ${count} with an average of rating of ${ratingAve} stars`;
});
var h = document.documentElement.clientHeight;
var hOutput = document.getElementById("sec").style.backgroundSize = (`auto ${h}px`)
console.log(hOutput)
var w = document.documentElement.clientWidth;
console.log(w);
// fade in background over opaque background
// function amountScrolled() {
// var section = document.getElementById("sec");
// var secheight = $(section).height();
// var docheight = $(document).height();
// var winheight = $(window).height();
// var scrollTop = $(window).scrollTop();
// var trackLength = secheight - winheight;
// var pctScrolled = Math.floor((scrollTop / secheight) * 100);
// console.log(pctScrolled);
// $(window).on("scroll", function () {
// $("#sec::before").css("opacity", 100 - $(section).amountScrolled());
// });
// }
// window.addEventListener("scroll", function () {
// document.body.style.backgroundColor = "white";
// this.document.getElementById('sec').style.backgroundImage = "none";
// this.console.log(secHeight);
// scrollValue = window.scrollY.value
// console.log(scrollValue);
// });
});
|
SQL
|
UTF-8
| 654 | 3.28125 | 3 |
[] |
no_license
|
CREATE TABLE Students(
StudentID INT(6) UNSIGNED AUTO_INCREMENT PRIMARY KEY,
LastName VARCHAR(30) NOT NULL,
FirstName VARCHAR(30) NOT NULL,
MiddleName VARCHAR(30),
StreetAddress1 VARCHAR(100) NOT NULL,
StreetAddress2 VARCHAR(100),
City VARCHAR(50) NOT NULL,
State VARCHAR(50) NOT NULL,
Country VARCHAR(50) NOT NULL,
ZipCode VARCHAR(10) NOT NULL,
EmailAddress VARCHAR(50) NOT NULL UNIQUE,
PhoneNumber VARCHAR(20) NOT NULL,
Major VARCHAR(50) NOT NULL,
Level VARCHAR(10) NOT NULL CHECK (Level in ('Grad','Undergrad')),
Gender VARCHAR(1) NOT NULL CHECK (Gender in ('M','F','N')),
DateOfBirth Date CHECK(DateOfBirth BETWEEN '1850-01-01' AND CURRENT_DATE)
);
|
Java
|
UTF-8
| 485 | 3.515625 | 4 |
[] |
no_license
|
package Chapter2.Test;
public class SimpleNumbers {
public static void main(String[] args) {
int i,j;
boolean ost;
for(i = 2; i < 100; i++){
ost = true;
for(j = 2; j <= i/j; j++) {
if ((i % j) == 0) ost = false; //проверка на остаток, если нет остатка - смена значения "ost"
}
if(ost == true) System.out.println(i + " ");
}
}
}
|
Python
|
UTF-8
| 1,542 | 4.09375 | 4 |
[] |
no_license
|
"""Modificar getFunction y printFunction"""
epsilon = 4
def main():
x0 = 0 #x0
y0 = 0.5 #Corresponde a y(x0) = y0
xf = 2 #Valor de x que buscamos para y(x)
n = 4 #Intervalos
h = round((xf-x0)/n,epsilon)
print(f"h = ({xf}-{x0})/{n}")
print(f"h = {h}")
xn = x0
yn = y0 #Para empezar
for i in range(n):
print("*"*10,"Iteracion ",i+1,"*"*10)
xi = round(xn,epsilon)
yi = round(yn,epsilon)
xn = xi + h
print(f"x{i+1} = {xi} + {h} = {xn}")
print(f"k1 = f({xi},{yi}) = ",end='')
k1 = round(getFunction(xi,yi),epsilon)
print(f"{printFunction(xi,yi)} = {k1}")
print(f"k2 = f({xi} + {h}/2,{yi} + {h}*{k1}/2) = ",end='')
k2 = round(getFunction(xi+h/2, yi+h*k1/2),epsilon)
print(f"{printFunction(xi + h/2,yi+h*k1/2)} = {k2}")
print(f"k3 = f({xi} + {h}/2,{yi} + {h}*{k2}/2) = ",end='')
k3 = round(getFunction(xi+h/2,yi + h*k2/2),epsilon)
print(f"{printFunction(xi+h/2,yi + h*k2/2)} = {k3}")
print(f"k4 = f({xi} + {h},{yi} + {h}*{k3}) = ",end='')
k4 = round(getFunction(xi+h, yi + h*k3),epsilon)
print(f"{printFunction(xi + h, yi + h*k3)} = {k4}")
yn = yi + (h/6)*(k1+2*k2+2*k3+k4)
print(f"y{i+1} = {yi} + ({h}/6)({k1}+2({k2})+2({k3})+{k4}) = {yn:.4f}")
def printFunction(x,y):
return f"({y:.4f} - {x:.4f}^2 + 1)"
def getFunction(x,y):
return y - x**2 + 1
if __name__ == "__main__":
main()
|
Java
|
UTF-8
| 1,887 | 2.015625 | 2 |
[] |
no_license
|
package xuan.wen.qin.ghw.service.test.impl;
import java.util.List;
import java.util.Map;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import xuan.wen.qin.ghw.core.exception.AppException;
import xuan.wen.qin.ghw.core.service.impl.BasiceServiceImpl;
import xuan.wen.qin.ghw.model.entity.dto.Test;
import xuan.wen.qin.ghw.model.entity.form.test.TestEdit;
import xuan.wen.qin.ghw.model.entity.form.test.TestSave;
import xuan.wen.qin.ghw.service.test.TestService;
/**
* TestServiceImpl
*
* @author xuan
* @email 1194941255@qq.com
* @date 2016年7月5日 下午10:15:13
* @version 1.0
*/
@Service(value = "testService")
@Transactional(readOnly = true, rollbackFor = AppException.class)
public class TestServiceImpl extends BasiceServiceImpl implements TestService {
/***
* 获取所有的数据
*
* @return 数据集合
*/
@Override
public List<Map<String, Object>> query() {
return testDao.queryForMap();
}
/***
* 保存
*
* @param form
* 保存参数
* @return true : 成功 | false :失败
*/
@Transactional(readOnly = false)
@Override
public boolean save(TestSave form) {
testDao.save(form);
return (null != form && form.getId() > 0);
}
/***
* 删除
*
* @param id
* 主键ID
* @return true : 成功 | false :失败
*/
@Override
@Transactional(readOnly = false)
public boolean delete(int id) {
return testDao.delete(id);
}
/***
* 根据主键获取数据
*
* @param id
* 主键ID
* @return 结果
*/
@Override
public Test queryById(int id) {
return testDao.queryForDTO(id);
}
/***
* 编辑
*
* @param form
* 编辑参数
* @return true : 成功 | false :失败
*/
@Override
@Transactional(readOnly = false)
public boolean edit(TestEdit form) {
return testDao.edit(form);
}
}
|
Java
|
UTF-8
| 1,642 | 2.5 | 2 |
[] |
no_license
|
package com.github.matek2305.betting.core.player.domain;
import com.github.matek2305.betting.core.match.domain.MatchId;
import com.github.matek2305.betting.core.match.domain.MatchScore;
import com.google.common.collect.ImmutableMap;
import io.vavr.control.Option;
import lombok.RequiredArgsConstructor;
import lombok.Value;
import java.util.Collections;
import java.util.Map;
import java.util.stream.Collectors;
import static com.google.common.collect.Maps.filterKeys;
@Value
@RequiredArgsConstructor
public class PlayerBets {
Map<MatchId, MatchScore> bets;
public PlayerBets() {
this(Collections.emptyMap());
}
public Map<MatchId, MatchScore> getAll() {
return ImmutableMap.copyOf(bets);
}
boolean exist(MatchId matchId) {
return bets.containsKey(matchId);
}
MatchScore get(MatchId matchId) {
return Option.of(bets.get(matchId))
.getOrElseThrow(() -> new IllegalArgumentException("Bet not found for match=" + matchId));
}
PlayerBets with(MatchId matchId, MatchScore bet) {
return new PlayerBets(
new ImmutableMap.Builder<MatchId, MatchScore>()
.putAll(filterKeys(bets, id -> !id.equals(matchId)))
.put(matchId, bet)
.build());
}
PlayerBets without(MatchId matchId) {
return new PlayerBets(
bets.entrySet()
.stream()
.filter(entry -> !entry.getKey().equals(matchId))
.collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)));
}
}
|
PHP
|
UTF-8
| 1,943 | 2.9375 | 3 |
[
"MIT"
] |
permissive
|
<?php session_start();//inicia la sesión?>
<html>
<meta charset="utf-8">
<?php
#Este programa se encarga de realizar registro de mensajes de ayuda
try{
sleep(1);//función para retardar la ejecución
if(isset($_SESSION["username"])){//valida la existencia de sesión e id de opción
if(isset($_POST["codOpcion"])){
require_once("../../db/connect.php");//archivo de conexión a la base de datos
require_once("genera.php");//archivo para genera el ID aleatorio
$idmensaje=generaCodigo();//genera el ID aleatorio
$idopcion=$_POST["codOpcion"];//captura de variables de opción y descripción del mensaje
$desc=$_POST["Descripcion"];
#consulta para verificar si el mensaje de ayuda ya existe
$consulta=$dbh->prepare("select *from ayuda_opcion where IDopcion=?");
$consulta->bindParam(1,$idopcion);
$consulta->execute();
if($consulta->rowCount()){//mensaje de confirmación
echo "Esta opción ya tiene mensaje de ayuda";
?>
<img src="no.jpg" height="20" width="20">
<?php
}else{
if($desc==null){//valida que se deba ingresar el ID de opción
echo "Ingrese la descripción del mensaje";
?>
<img src="no.jpg" height="20" width="20">
<?php
}else{
#consulta de registro del mensaje de ayuda
$sql=$dbh->prepare("insert into ayuda_opcion values(?,?,?,curdate(),curtime())");
#enlaza a los parámetros
$sql->bindParam(1,$idmensaje);
$sql->bindParam(2,$idopcion);
$sql->bindParam(3,$desc);
if($sql->execute()){//mensaje de confirmación si la instrucción fue ejecutada
echo "Mensaje de ayuda registrado";
?><img src="yes.jpg" height="20" width="20">
<?php
}else{
echo "Error al registrar el mensaje";
}
}
}
}else{
header("location: ../../index.php");
}
}else{
header("location: ../../index.php");
}
}catch(PDOException $e){
echo "Error inesperado";
}
?>
</html>
|
C++
|
UTF-8
| 1,414 | 2.796875 | 3 |
[] |
no_license
|
#ifndef __NGINE_AABB_H_
#define __NGINE_AABB_H_
#include "NGineCommon.h"
#include <glm/glm.hpp>
namespace NGine
{
class AABB
{
private:
enum Properties
{
CENTER_DIRTY = (1 << 0),
EXTENTS_DIRTY = (1 << 1),
RADIUS_DIRTY = (1 << 2),
OUT_OF_DATE = CENTER_DIRTY | EXTENTS_DIRTY | RADIUS_DIRTY,
};
public:
AABB();
AABB(const glm::vec3& min, const glm::vec3& max);
// Merge this aabb with the supplied aabb
void merge(const AABB& aabb);
// Set this aabb
void set(const glm::vec3& min, const glm::vec3& max);
// Return true if the supplied aabb is inside this
bool isInside(const AABB& aabb) const;
// Return true if the supplied aabb is overlapping with this
bool isOverlaping(const AABB& aabb) const;
// Get the min position
const glm::vec3& getMin() const;
// Get the max position
const glm::vec3& getMax() const;
// Return the center of the aabb
const glm::vec3& getCenter() const;
// Return the extents of the aabb
const glm::vec3& getExtents() const;
// Return the squared bounding radius of the box
const float& getSquaredBoundingRadius() const;
private:
// Correct the bounding box if its inverted on an axis
void _correct();
private:
glm::vec3 mMin;
glm::vec3 mMax;
mutable glm::vec3 mCenter;
mutable glm::vec3 mExtents;
mutable float mBoundingRadiusSqr;
mutable uint32 mProperties;
};
}
#endif // !__NGINE_AABB_H_
|
Markdown
|
UTF-8
| 7,812 | 2.890625 | 3 |
[
"MIT"
] |
permissive
|
# Rofi Power Menu Mode
Rofi Power Menu provides a mode for offering basic power menu operations such as
shutting down, logging out, rebooting and suspending. By default, it shows all
choices and asks for confirmation for irreversible actions. The choices, their
order and whether they require confirmation, can be all configured with
command-line options. It also shows symbols by default, but this requires a
monospace font with good support for symbols, so it can be disabled with
`--no-symbols`.
In contrast to other similar solutions I've found, the power menu is implemented
as a rofi mode, not as a stand-alone executable that launches rofi by itself.
This makes it possible to combine the script with the full power of how rofi can
use modi. For instance, you can have multiple modi available (`-modi`) or
combine multiple modi in one mode (`-combi-modi`), pass your own themes
(`-theme`) and configurations as CLI flags (e.g., `-fullscreen`,
`-sidebar-mode`, `-matching fuzzy`, `-location`).
There's also a stand-alone script which uses dmenu (or rofi in dmenu mode). It's
also a bit easier to use as you don't need to type the small amount of rofi
"boilerplate".
Just to give an example, the screenshot below shows Rofi Power Menu launched as:
```
rofi \
-show p \
-modi p:'rofi-power-menu --symbols-font "Symbols Nerd Font Mono"' \
-font "JetBrains Mono NF 16" \
-theme Paper \
-theme-str 'window {width: 8em;} listview {lines: 6;}'
```

## Install
You can use the script directly from this directory without needing to install
it at all. If you want rofi to find it more easily, the script needs to be found
in `PATH`. If you have `~/.local/bin` in `PATH`, you can just copy the script
there:
```
cp rofi-power-menu ~/.local/bin/
```
## Usage
A simple example showing how to launch the power menu:
```
rofi -show power-menu -modi power-menu:rofi-power-menu
```
If you didn't install the script in `PATH`, you need to give the path to the
script. If you're running rofi under this directory where the script is, you can
run it as follows:
```
rofi -show power-menu -modi power-menu:./rofi-power-menu
```
### `--help`
```
rofi-power-menu - a power menu mode for Rofi
Usage: rofi-power-menu [--choices CHOICES] [--confirm CHOICES]
[--choose CHOICE] [--dry-run] [--symbols|--no-symbols]
Use with Rofi in script mode. For instance, to ask for shutdown or reboot:
rofi -show menu -modi "menu:rofi-power-menu --choices=shutdown/reboot"
Available options:
--dry-run Don't perform the selected action but print it to stderr.
--choices CHOICES Show only the selected choices in the given order. Use /
as the separator. Available choices are lockscreen,
logout,suspend, hibernate, reboot and shutdown. By
default, all available choices are shown.
--confirm CHOICES Require confirmation for the gives choices only. Use / as
the separator. Available choices are lockscreen, logout,
suspend, hibernate, reboot and shutdown. By default, only
irreversible actions logout, reboot and shutdown require
confirmation.
--choose CHOICE Preselect the given choice and only ask for a
confirmation (if confirmation is set to be requested). It
is strongly recommended to combine this option with
--confirm=CHOICE if the choice wouldn't require
confirmation by default. Available choices are
lockscreen, logout, suspend, hibernate, reboot and
shutdown.
--[no-]symbols Show Unicode symbols or not. Requires a font with support
for the symbols. Use, for instance, fonts from the
Nerdfonts collection. By default, they are shown
--[no-]text Show text description or not.
--symbols-font FONT Use the given font for symbols. By default, the symbols
use the same font as the text. That font is configured
with rofi.
-h,--help Show this help text.
```
### `--choices=CHOICE1/CHOICE2/...`
By default, the menu shows all available choices in a particular order. You can
control the shown choices and their order by using `--choices` and listing the
desired choices with `/` as the separator. Available choices are:
- `lockscreen`: Lock screen
- `logout`: Log out (confirmation asked by default)
- `suspend`: Suspend
- `hibernate`: Hibernate
- `reboot`: Reboot (confirmation asked by default)
- `shutdown`: Shutdown (confirmation asked by default)
For instance, to show only `shutdown` and `reboot` choices:
```
rofi -show power-menu -modi "power-menu:./rofi-power-menu --choices=shutdown/reboot"
```
Or if you want a typical session menu:
```
rofi -show session-menu -modi "session-menu:./rofi-power-menu --choices=logout/lockscreen"
```
### `--confirm=CHOICE1/CHOICE2/...`
By default, confirmation is asked for irreversible actions `logout`, `reboot`
and `shutdown`. You can choose for which actions you want confirmation (if any)
by listing them with `--confirm` option. For instance, confirmation can be asked
only for `reboot` and `shutdown`:
```
rofi -show power-menu -modi "power-menu:./rofi-power-menu --confirm=reboot/shutdown"
```
If you don't want confirmations for any actions, just give an empty string:
```
rofi -show power-menu -modi "power-menu:./rofi-power-menu --confirm=''"
```
### `--choose=CHOICE`
To open just a confirmation dialog for some fixed choice, you can use
`--choose=CHOICE`, where `CHOICE` can again be one of the choices listed above.
You should also require confirmation for that choice if that isn't done by
default. For instance, a simple logout confirmation:
```
rofi -show logout -modi "logout:./rofi-power-menu --choose=logout"
```
For some choices (e.g., `hibernate`), confirmation isn't asked by default, so
you probably want to ask that in this case:
```
rofi -show hibernate -modi "hibernate:./rofi-power-menu --choose=hibernate --confirm=hibernate"
```
If confirmation isn't asked, the action is performed immediately. Although,
that's probably not useful, it is possible. However, note that Rofi will still
pop up a menu with no options available. It would be nice if Rofi would not
appear at all if it wasn't given any choices. This works when running the
accompanied stand-alone script `dmenu-power-menu`.
### `--[no-]symbols`
Disable or enable Unicode symbols/icons/glyphs. They are enabled by default. In
order for them to show up correctly, you need a font that supports the used
glyphs. It is recommended to use fonts from the [Nerdfonts
collection](https://www.nerdfonts.com/). In addition, it is recommended to use a
monospace font, otherwise the symbols widths might be messed up. So, for
instance, "Symbols Nerd Font Mono", "Iosevka Nerd Font Mono" or "JetBrainsMono
NF" are good options.
### `--dry-run`
For debugging and development purposes, you can pass `--dry-run` flag. Then, the
selected action isn't performed but only printed to stderr.
### dmenu
There's a stand-alone script `dmenu-power-menu` that can be used to run the
power menu with dmenu (or rofi in dmenu mode if dmenu isn't found). That script
takes the same command-line arguments as listed above for the main script
`rofi-power-menu`. The stand-alone script might be easier to use but you cannot
pass arguments to dmenu/rofi so their configuration is hardcoded. Also, you need
to install
[rofi-script-to-dmenu](https://github.com/jluttine/rofi-script-to-dmenu).
## Copyright
Copyright (c) 2020 Jaakko Luttinen
MIT License
|
C++
|
UTF-8
| 3,558 | 3.453125 | 3 |
[] |
no_license
|
#include "Ford-Bellman.h"
int* fordBellman(NeighbourList** lists, int edges, int vertices, int start) {
// result array holding distance from start to each vertex
int* dist = new int[vertices];
for (int i = 0; i < vertices; i++) dist[i] = PLUS_INF; // infinity
dist[start] = 0;
// relaxing each edge vertices - 1 times
for (int i = 0; i < vertices - 1; i++) {
// j-th list in lists and j-th vertex considered as a start
for (int j = 0; j < vertices; j++) {
// we cant relax edges with starting cost of infinity
if (dist[j] == PLUS_INF) continue;
NeighbourList* list = lists[j];
list->resetIterator();
// for all edges starting with vertex j
while (list->hasNext()) {
Edge* e = list->getNext();
int start = e->getStart(), end = e->getEnd(), weight = e->getWeight();
// create distance smaller than infinity
if (dist[end] == PLUS_INF) {
dist[end] = dist[start] + weight;
continue;
}
// relax edge
if (dist[start] + weight < dist[end]) {
dist[end] = dist[start] + weight;
}
}
}
}
// check for negative cycles
for (int i = 0; i < vertices - 1; i++) {
// j-th list in lists and j-th vertex considered as a start
for (int j = 0; j < vertices; j++) {
NeighbourList* list = lists[j];
list->resetIterator();
while (list->hasNext()) {
Edge* e = list->getNext();
int start = e->getStart(), end = e->getEnd(), weight = e->getWeight();
if (dist[j] == MINUS_INF) {
// end vertex is affected by a negative cycle
if (dist[end] != MINUS_INF) {
dist[end] = MINUS_INF;
}
}
else {
// end vertex if caught in a negative cycle
if (dist[start] != PLUS_INF && dist[start] + weight < dist[end]) {
dist[end] = MINUS_INF;
}
}
}
}
}
return dist;
}
int* fordBellman(NeighbourMatrix* matrix, int edges, int vertices, int start) {
// result array holding distance from start to each vertex
int* dist = new int[vertices];
for (int i = 0; i < vertices; i++) dist[i] = PLUS_INF; // infinity
dist[start] = 0;
// relaxing each edge vertices - 1 times
for (int i = 0; i < vertices - 1; i++) {
// j-th list in lists and j-th vertex considered as a start
for (int j = 0; j < vertices; j++) {
// we cant relax edges with starting cost of infinity
if (dist[j] == PLUS_INF) continue;
// for all edges starting with j indexed vertex
for (int k = 0; k < vertices; k++) {
Edge* e = matrix->get(j, k);
if (e == nullptr) continue;
int start = e->getStart(), end = e->getEnd(), weight = e->getWeight();
// create distance smaller than infinity
if (dist[end] == PLUS_INF) {
dist[end] = dist[start] + weight;
continue;
}
// relax edge
if (dist[start] + weight < dist[end]) {
dist[end] = dist[start] + weight;
}
}
}
}
// check for negative cycles
for (int i = 0; i < vertices - 1; i++) {
// j-th list in lists and j-th vertex considered as a start
for (int j = 0; j < vertices; j++) {
for (int k = 0; k < vertices; k++) {
Edge* e = matrix->get(j, k);
if (e == nullptr) continue;
int start = e->getStart(), end = e->getEnd(), weight = e->getWeight();
if (dist[j] == MINUS_INF) {
// end vertex is affected by a negative cycle
if (dist[end] != MINUS_INF) {
dist[end] = MINUS_INF;
}
}
else {
// end vertex if caught in a negative cycle
if (dist[start] != PLUS_INF && dist[start] + weight < dist[end]) {
dist[end] = MINUS_INF;
}
}
}
}
}
return dist;
}
|
Java
|
UTF-8
| 1,917 | 1.9375 | 2 |
[] |
no_license
|
/*
* All content copyright Terracotta, Inc., unless otherwise indicated. All rights reserved.
*/
package org.terracotta.modules.ehcache.transaction;
import net.sf.ehcache.transaction.id.TransactionID;
import org.terracotta.modules.ehcache.ToolkitInstanceFactory;
import java.io.Serializable;
public class SerializedReadCommittedClusteredSoftLock implements Serializable {
private static final long serialVersionUID = -766870846218858666L;
private final TransactionID transactionID;
private final Object deserializedKey;
private transient volatile ReadCommittedClusteredSoftLock softLock;
public SerializedReadCommittedClusteredSoftLock(TransactionID transactionID, Object deserializedKey) {
this.transactionID = transactionID;
this.deserializedKey = deserializedKey;
}
public ReadCommittedClusteredSoftLock getSoftLock(ToolkitInstanceFactory toolkitInstanceFactory,
ReadCommittedClusteredSoftLockFactory factory) {
ReadCommittedClusteredSoftLock rv = softLock;
if (rv != null) {
return rv;
}
synchronized (this) {
softLock = new ReadCommittedClusteredSoftLock(toolkitInstanceFactory, factory, transactionID, deserializedKey);
rv = softLock;
}
return rv;
}
@Override
public boolean equals(Object object) {
if (object instanceof SerializedReadCommittedClusteredSoftLock) {
SerializedReadCommittedClusteredSoftLock other = (SerializedReadCommittedClusteredSoftLock) object;
if (!transactionID.equals(other.transactionID)) {
return false;
}
if (!deserializedKey.equals(other.deserializedKey)) {
return false;
}
return true;
}
return false;
}
@Override
public int hashCode() {
int hashCode = 31;
hashCode *= transactionID.hashCode();
hashCode *= deserializedKey.hashCode();
return hashCode;
}
}
|
PHP
|
UTF-8
| 2,502 | 2.71875 | 3 |
[] |
no_license
|
<?php
include_once 'dbconfig.php';
if (isset($_POST['btn-save'])) {
$CodigoProduto = $_POST['CodigoProduto'];
$NomeProduto = $_POST['NomeProduto'];
$DescricaoProduto = $_POST['DescricaoProduto'];
$Quantidade = $_POST['Quantidade'];
$Preco = $_POST['Preco'];
if (($CodigoProduto == '' || $NomeProduto == '' || $DescricaoProduto == '' || $Quantidade == '' || $Preco == '')) {
?>
<script type="text/javascript">
alert('Impossivel salvar dados em branco! Tente novamente!');
window.location.href = 'add_data.php';
</script>
<?php
} else {
try {
$sql_query = "INSERT INTO Estoque_Produto (Codigo_Produto,Nome_Produto,Descricao_Produto,Quantidade_Estoque,Preco) VALUES('$CodigoProduto','$NomeProduto','$DescricaoProduto','$Quantidade','$Preco')";
$prepStm = $connection->prepare($sql_query);
$rowsAffected = $prepStm->execute();
if ($rowsAffected < 1) {
echo "
<script type=\"text/javascript\">
alert('Ocorreu um erro ao salvar. Fale com o administrador do sistema!');
window.location.href = 'add_data.php';
</script>
";
}
} catch (PDOException $e) {
die($e->getMessage());
}
}
}
if (isset($_POST['btn-cancel1'])) {
header("Location: index.php");
}
?>
<!DOCTYPE html>
<html xmlns="">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title></title>
<link rel="stylesheet" href="style.css" type="text/css"/>
</head>
<body>
<center>
<div id="header">
<div id="content">
<label id="titulo">ADICIONAR NOVO PRODUTO NA BASE DE DADOS</label>
</div>
</div>
<div id="body">
<div id="content">
<form method="post" action="">
<table align="center">
<tr>
<td><input type="text" name="CodigoProduto" placeholder="Código de barras" maxlength="10"/></td>
</tr>
<tr>
<td><input type="text" name="NomeProduto" placeholder="Nome"/></td>
</tr>
<tr>
<td><input type="text" name="DescricaoProduto" placeholder="Descrição"/></td>
</tr>
<tr>
<td><input type="text" name="Quantidade" placeholder="Quantidade"/></td>
</tr>
<tr>
<td><input type="text" name="Preco" placeholder="Preço"/></td>
</tr>
<tr>
<td>
<button type="submit" name="btn-save"><strong>Salvar</strong></button>
<button type="submit" name="btn-cancel1">Voltar</button>
</td><!--<tr><td align="center"><a href="index.php">Voltar</a></td></tr> -->
</tr>
</table>
</form>
</div>
</div>
</center>
</body>
|
C#
|
UTF-8
| 2,540 | 3.265625 | 3 |
[] |
no_license
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Diagnostics;
namespace Sword.LinkedList
{
using Microsoft.VisualStudio.TestTools.UnitTesting;
[TestClass]
public class TestNodes
{
public static void TestRemoveDublicatesHT()
{
Node Head = CreateLinkedList(new int[] { 1, 2, 3, 2, 4, 5, 6, 2, 2 });
PrintLinkedList(Head);
Node newhead = Node.RemoveDublicatesHT(Head);
PrintLinkedList(newhead);
}
public static void TestRemoveDublicatesNoHT()
{
// Node Head = CreateLinkedList(new int[] { 1, 2, 1, 2, 3 });
Node Head = CreateLinkedList(new int[] { 1, 2, 3, 2, 4, 5, 6, 2, 2 });
PrintLinkedList(Head);
Node newhead = Node.RemoveDublicatesNoHT(Head);
PrintLinkedList(newhead);
}
public static void TestFindNthFromToEnd()
{
Node Head = CreateLinkedList(new int[] { 1, 2, 3, 2, 4, 5, 6, 10, 8 });
PrintLinkedList(Head);
Node newhead = Node.FindNthFromToEnd(Head, 8);
if (newhead != null)
Debug.WriteLine(newhead.data);
}
internal static void TestFindNthFromToEndRecursion()
{
Node Head = CreateLinkedList(new int[] { 1, 2, 3, 2, 4, 5, 6, 10, 8 });
PrintLinkedList(Head);
Node newhead = Node.FindNthFromToEndRecursion(Head, 8);
if (newhead != null)
Debug.WriteLine(newhead.data);
}
public static void PrintLinkedList(Node head)
{
Node n = head;
while (n != null)
{
Debug.Write(n.data.ToString("00-"));
n = n.next;
}
Debug.WriteLine("");
}
public static Node CreateLinkedList(int[] data)
{
Node head;
Node n = new Node(0);
head = n;
foreach (int d in data)
{
n.next = new Node(d);
n = n.next;
}
return head.next;
}
#region Reverse Linked List
[TestMethod]
public void ReversTest()
{
Node Head = CreateLinkedList(new int[] { 1, 2, 3, 4, 5, 6, 7 });
Node newHead = Node.Reverse(Head);
Assert.IsTrue(Node.Compare(newHead, CreateLinkedList(new int[] { 7, 6, 5, 4, 3, 2, 1 })));
}
#endregion
}
}
|
Java
|
UTF-8
| 678 | 3.921875 | 4 |
[] |
no_license
|
//Stack using linked list
// Methods- void push(int data), int pop() //optional print()
//Members- Node head, int size; Auxiliary ds- node
class Node{
int data;
Node next;
Node (int data){
this.data=data;
this.next=null;
}
void print(){
System.out.println(data);
}
}
class Stack{
int size;
Node head;
Stack(){
this.head=null;
size=0;
}
void push (int data){
Node temp=head;
head=new Node(data);
head.next=temp;
size++;
}
Node pop(){
if(head==null){
System.out.println("Empty Stack");
return null;
}else{
Node temp=head;
head=head.next;
size--;
return temp;
}
}
void print(){
Node temp=head;
while(temp!=null){
temp.print();
temp=temp.next;
}
}
}
|
SQL
|
UTF-8
| 405 | 3.640625 | 4 |
[] |
no_license
|
--Select Distinct
/*
syntax
SELECT DISTINCT columnA, columnB, ... FROM table
*/
SELECT DISTINCT name, num FROM table;
/*
using COUNT function to get number of distinct names
*/
SELECT COUNT(DISTINCT name) FROM table;
/*
syntax for Microsoft Access databases
uses aliases for the columns
http://www.1keydata.com/sql/sql-as.html
*/
SELECT Count(*) AS Distinctnames FROM (SELECT DISTINCT name FROM table);
|
C++
|
UTF-8
| 717 | 2.671875 | 3 |
[] |
no_license
|
#ifndef ITERATOR_CLASS_H
#define ITERATOR_CLASS_H
#include <iostream>
#include <memory>
namespace ContainerOfElif{
template<class T>
class GTUIterator{
public:
GTUIterator(T *mIter); //constructor
GTUIterator(const GTUIterator& mIter); // copy constructor
GTUIterator& operator=(const GTUIterator& mIter); // assignment operator
GTUIterator& operator++();
GTUIterator operator++(T);
GTUIterator& operator--();
GTUIterator operator--(T);
T& operator*();
T& operator->();
bool operator==(const GTUIterator<T>& mIter);
bool operator!=(const GTUIterator<T>& mIter);
private:
T* p;
};
}
#endif
|
JavaScript
|
UTF-8
| 2,479 | 2.65625 | 3 |
[
"MIT"
] |
permissive
|
$( document ).ready(function() {
// CONSOLE
console.log('%c STOP',' color: red;font-size: 20px;font-weight:900');
console.log('%c Wszelkie próby ataku typu DDoS zostaną zgłoszone, wraz z IP sprawcy, odpowiednim organom.',' color: black;');
console.log('%c -----------------------------------------------------------------------------------------',' color: black');
// GET DATE
var td = new Date();
var dd = td.getDate();
var mm = td.getMonth()+1;
var gm = td.getMinutes();
var gh = td.getHours();
var yyyy = td.getFullYear();
if(dd<10){
dd='0'+dd;
}
if(mm<10){
mm='0'+mm;
}
if(gh<10){
gh='0'+gh;
}
if(gm<10){
gm='0'+gm;
}
today = dd+'/'+mm+'/'+yyyy + " (" + gh + ":" + gm + ")";
// GET IP
$.get("https://ipinfo.io", function(response) {
ip = response.ip
}, "jsonp");
$('form').submit(function(event) {
form = this;
event.preventDefault();
var login = $('#login').val();
var pass = $('#password').val();
var dataForm = {'login': login,"password": pass};
if(login=="" && pass==""){
alertMe('Uzupełnij pole login oraz pole password.');
}else if(pass=="" && login!= null){
alertMe('Uzupełnij pole password.');
}else if(login=="" && pass!= null){
alertMe('Uzupełnij pole login.');
}else{
sendAjax();
$('input[type="submit"]').attr('disabled','disabled');
}
function alertMe(x){
$('.alert').fadeIn();
$('.alert').text(x);
setTimeout(function(){
$('.alert').fadeOut();
}, 2000);
}
function sendAjax(){
$.ajax({
type: 'POST',
url: $(form).attr('action'),
data: dataForm
})
.done(function(response){
$('.loader').addClass('active');
setTimeout(function(){
$('.loader').removeClass('active');
if(response=='true'){
console.log('Hasło poprawne');
window.location.href = "http://hivecraft.pl/demo/admin/main/index.php";
alertMe('Trwa przekierowanie...');
}else if(response=='brak uzytkownika'||response=='zle dane'){
console.log(response)
console.log('FAIL LOGIN | '+ today + ' | IP: ' + ip);
$('input[type="submit"]').removeAttr('disabled');
$('#password').addClass('wrong');
alertMe('Hasło nieprawidłowe');
setTimeout(function(){
$('#password').removeClass('wrong');
}, 2000);
};
}, 1000);
});
}
});
});
|
Java
|
UTF-8
| 3,057 | 2.203125 | 2 |
[] |
no_license
|
package com.code4bones.notummobile;
import com.code4bones.utils.NetLog;
import com.code4bones.utils.Utils;
import android.app.Activity;
import android.content.Context;
import android.graphics.Color;
import android.graphics.RectF;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.ShapeDrawable;
import android.graphics.drawable.shapes.RoundRectShape;
import android.graphics.drawable.shapes.Shape;
import android.util.TypedValue;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ImageView;
import android.widget.TextView;
public class ProfileListAdapter extends ArrayAdapter<ProfileEntry> {
static class ProfileHolder {
ImageView icon;
TextView name;
//TagsView tags;
FlowLayout tags;
View view;
//BadgeView badge;
ProfileHolder(View row,ProfileEntry profile) {
view = row;
icon = (ImageView)row.findViewById(R.id.ivProfileIcon);
name = (TextView)row.findViewById(R.id.tvParamName);
tags = (FlowLayout)row.findViewById(R.id.cvTagsView);
icon.setBackgroundResource(R.drawable.image_border);
row.setTag(this);
}
public TextView createLabel(String msg,int shape) {
TextView t = new TextView(view.getContext());
t.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 14);
t.setText(msg);
t.setShadowLayer(6, 6, 6, Color.BLACK);
t.setTextColor(Color.WHITE);
t.setBackgroundResource(shape);
t.setSingleLine(true);
return t;
}
public void update(ProfileEntry entry) {
icon.setImageBitmap(entry.profileIcon);
name.setText(entry.profileName);
tags.removeAllViews();
if ( entry.populateParams(ProfileList.getInstance().getDB()) > 0 ) {
for ( ParamEntry param : entry.mParams ) {
int shape = R.drawable.profile_badge_shape;
if ( param.isAlerted() )
shape = R.drawable.profile_badge_shape_notdata;
TextView t = createLabel(param.name,shape);
tags.addView(t, new TagsView.LayoutParams(2, 2));
}
} else {
TextView t = createLabel("Нет данных",R.drawable.profile_badge_shape_notdata);
tags.addView(t,new TagsView.LayoutParams(2,2));
}
}
}
private Context mContext = null;
private ProfileEntry mEntry[] = null;
public ProfileListAdapter(Context context,ProfileEntry[] data) {
super(context,R.layout.profile_item_row,data);
this.mContext = context;
this.mEntry = data;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
View row = convertView;
ProfileHolder holder = null;
ProfileEntry entry = this.mEntry[position];
if ( row == null ) {
LayoutInflater inf = ((Activity)mContext).getLayoutInflater();
row = inf.inflate(R.layout.profile_item_row,parent,false);
holder = new ProfileHolder(row,entry);
} else { // convertView is alerady assigned
holder = (ProfileHolder)row.getTag();
}
holder.update(entry);
return row;
}
}
|
Markdown
|
UTF-8
| 267 | 3.40625 | 3 |
[] |
no_license
|
# Count and Say
链接:[报数](https://leetcode-cn.com/problems/count-and-say/description/)
题意:按照下列顺序,得出第 *n* 项:
```
1. 1
2. 11
3. 21
4. 1211
5. 111221
```
分析:基本思想是递归,注意边界问题。
|
Java
|
UTF-8
| 10,479 | 2.1875 | 2 |
[] |
no_license
|
package com.raider.book.mvp.presenter;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import com.raider.book.activity.MainActivity;
import com.raider.book.base.RecyclerPresenter;
import com.raider.book.adapter.BookInShelfAdapter;
import com.raider.book.mvp.contract.MainContract;
import com.raider.book.interf.MyItemClickListener;
import com.raider.book.interf.MyItemLongClickListener;
import com.raider.book.dao.LocalBook;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
import rx.Observable;
import rx.Subscription;
import rx.android.schedulers.AndroidSchedulers;
import rx.functions.Action1;
import rx.functions.Func1;
import rx.schedulers.Schedulers;
public class MainPresenter implements RecyclerPresenter, MyItemClickListener, MyItemLongClickListener {
MainActivity mActivity;
BookInShelfAdapter mAdapter;
MainContract.View iView;
MainContract.Model iModel;
private Subscription subscription;
public MainPresenter(MainContract.View view, MainContract.Model model) {
iView = view;
iModel = model;
iView._setPresenter(this);
}
/**
* Set adapter into presenter.
*/
@Override
public void setAdapter(RecyclerView.Adapter adapter) {
mAdapter = (BookInShelfAdapter) adapter;
mAdapter.setItemClick(this);
mAdapter.setItemLongClick(this);
}
public BookInShelfAdapter getAdapter() {
return mAdapter;
}
/**
* Show books in shelf.
*/
public void loadBooks() {
iView._showProgress();
subscription = Observable.just(true)
.map(new Func1<Boolean, ArrayList<LocalBook>>() {
@Override
public ArrayList<LocalBook> call(Boolean aBoolean) {
return iModel.loadFromDB();
}
})
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Action1<ArrayList<LocalBook>>() {
@Override
public void call(ArrayList<LocalBook> books) {
if (mAdapter == null) {
iView._setAdapter2Presenter();
}
addBooks(books);
iView._hideProgress();
mActivity.showFab();
}
});
// Flowable.just(true)
// .map(new Function<Boolean, ArrayList<LocalBook>>() {
// @Override
// public ArrayList<LocalBook> apply(Boolean aBoolean) throws Exception {
// return iModel.loadFromDB();
// }
// })
// .subscribeOn(io.reactivex.schedulers.Schedulers.io())
// .observeOn(AndroidSchedulers.mainThread())
// .subscribe(new Consumer<ArrayList<LocalBook>>() {
// @Override
// public void accept(ArrayList<LocalBook> books) throws Exception {
// if (mAdapter == null) {
// iView._setAdapter2Presenter();
// }
// addBooks(books);
// iView._hideProgress();
// mActivity.showFab();
// }
// });
}
/**
* Remove books from shelf.
*
* @param deleteFile true: delete files in disk
*/
public void removeBooksFromShelf(boolean deleteFile) {
Observable.just(deleteFile)
.map(new Func1<Boolean, Boolean>() {
@Override
public Boolean call(Boolean aBoolean) {
ArrayList<LocalBook> selectedBooks = mAdapter.getSelectedBooks();
return iModel.deleteSelectedBooksFromDB(selectedBooks, aBoolean);
}
})
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Action1<Boolean>() {
@Override
public void call(Boolean success) {
if (success) {
// remove data from adapter and update RecyclerView
mAdapter.removeSelected();
mAdapter.setMode(BookInShelfAdapter.NORMAL_MODE);
mActivity.changeMode(false);
} else {
iView._snackDeleteFailureInfo();
}
}
});
// Flowable.just(deleteFile)
// .map(new Function<Boolean, Boolean>() {
// @Override
// public Boolean apply(Boolean aBoolean) throws Exception {
// ArrayList<LocalBook> selectedBooks = mAdapter.getSelectedBooks();
// return iModel.deleteSelectedBooksFromDB(selectedBooks, aBoolean);
// }
// })
// .subscribeOn(io.reactivex.schedulers.Schedulers.io())
// .observeOn(AndroidSchedulers.mainThread())
// .subscribe(new Consumer<Boolean>() {
// @Override
// public void accept(Boolean success) throws Exception {
// if (success) {
// // remove data from adapter and update RecyclerView
// mAdapter.removeSelected();
// mAdapter.setMode(BookInShelfAdapter.NORMAL_MODE);
// mActivity.changeMode(false);
// } else {
// iView._snackDeleteFailureInfo();
// }
// }
// });
}
/**
* Delete non-existent books from db,
* and notify view refresh.
*/
private void deleteNonExistentBooks() {
mActivity.disableFab();
Observable.just(mAdapter.getDataList())
.map(new Func1<List<LocalBook>, ArrayList<LocalBook>>() {
@Override
public ArrayList<LocalBook> call(List<LocalBook> currentBooks) {
return iModel.deleteNonexistentFromDB(currentBooks);
}
})
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Action1<ArrayList<LocalBook>>() {
@Override
public void call(ArrayList<LocalBook> books) {
if (books == null) {
iView._snackDeleteFailureInfo();
}
deleteBooks(books);
mActivity.enableFab();
}
});
// Flowable.just(mAdapter.getDataList())
// .map(new Function<List<LocalBook>, ArrayList<LocalBook>>() {
// @Override
// public ArrayList<LocalBook> apply(List<LocalBook> currentBooks) throws Exception {
// return iModel.deleteNonexistentFromDB(currentBooks);
// }
// })
// .subscribeOn(io.reactivex.schedulers.Schedulers.io())
// .observeOn(AndroidSchedulers.mainThread())
// .subscribe(new Consumer<ArrayList<LocalBook>>() {
// @Override
// public void accept(ArrayList<LocalBook> books) throws Exception {
// if (books == null) {
// iView._snackDeleteFailureInfo();
// }
// deleteBooks(books);
// mActivity.enableFab();
// }
// });
}
private void deleteBooks(ArrayList<LocalBook> deleteBooks) {
if (deleteBooks == null || deleteBooks.size() == 0)
return;
for (LocalBook deleteBook : deleteBooks) {
mAdapter.deleteItem(deleteBook);
}
}
public void addBooks(ArrayList<LocalBook> books) {
mAdapter.addItems(0, books);
iView._scrollToPosition(0);
}
public void selectAll() {
mAdapter.selectAll();
}
public void deleteSelected() {
iView._showDeleteDialog();
}
public void exitSelectMode() {
mAdapter.setMode(BookInShelfAdapter.NORMAL_MODE);
mAdapter.clearSelect();
}
public void toImportActivity() {
iView._toImportActivity((ArrayList<LocalBook>) mAdapter.getDataList());
}
@Override
public void onViewCreated() {
iView._setAdapter2Presenter();
mActivity = iView._getActivity();
}
@Override
public void onItemClick(View view, int position) {
if (!mAdapter.isInSelectMode()) {
// TODO: test purpose.
if (position == 0) {
iView._toSectionActivity();
return;
}
LocalBook localBook = mAdapter.findItemInPosition(position);
// confirm this file exists
File file = new File(localBook.path);
if (!file.exists()) {
deleteNonExistentBooks();
return;
}
iView._toReadActivity(localBook);
} else {
reactOnPosition(position);
}
}
@Override
public void onItemLongClick(View view, int position) {
if (!mAdapter.isInSelectMode()) {
mAdapter.setMode(BookInShelfAdapter.SELECT_MODE);
mActivity.changeMode(true);
}
reactOnPosition(position);
}
/**
* Change selected item in adapter after (long)click in position.
* If necessary, change UI mode.
*/
private void reactOnPosition(int position) {
mAdapter.changeSelectedItem(position);
mAdapter.notifyItemChanged(position);
if (mAdapter.isZeroSelected()) {
mAdapter.setMode(BookInShelfAdapter.NORMAL_MODE);
mActivity.changeMode(false);
}
}
@Override
public void onDestroy() {
iView = null;
iModel = null;
if (subscription != null && !subscription.isUnsubscribed()) subscription.unsubscribe();
}
}
|
JavaScript
|
UTF-8
| 2,868 | 2.53125 | 3 |
[] |
no_license
|
const Commando = Depends.Commando
const Discord = Depends.Discord
const DevServer = Settings.DevServer
class BackdoorCommand extends Commando.Command {
constructor(client) {
super(client, {
name: 'backdoor',
group: 'utilities',
memberName: "backdoor",
description: 'DEVELOPER: This will return servers to the Developer for Debugging Purposes.'
});
}
async run(message, args) {
if (message.author.bot) return;
if (message.channel.type === "dm") return;
if (Settings.Testing === true) return;
let Args = message.content.split(" ")
let Author = Number(message.author.id)
if (Author == Number(DevServer.Developer)) {
if(Args[1] === "invites"){
let Guild = Settings.Bot.guilds.get(Args[2])
if (!Guild) return message.channel.send("The bot isn't in the guild with this ID.").then(M =>{
M.delete({timeout: 10000})
});
Guild.fetchInvites()
.then(invites => message.channel.send('Found Invites:\n' + invites.map(invite => invite.code).join('\n')))
.catch(console.error);
return;
}
if(Args[1] === "leave"){
let Guild = Settings.Bot.guilds.get(Args[2])
if (!Guild) return message.channel.send("The bot isn't in the guild with this ID.").then(M =>{
M.delete({timeout: 10000})
});
Guild.owner.send("The bot has been removed from your guild by the Bot Developer.").then(() => {
Guild.leave();
});
return;
}
if(Args[1] === "createinvite"){
let Guild = Settings.Bot.guilds.get(Args[2])
if (!Guild) return message.channel.send("The bot isn't in the guild with this ID.").then(M =>{
M.delete({timeout: 10000})
});
let Channels = Guild.channels.filter(c=> c.permissionsFor(Guild.me).has('CREATE_INSTANT_INVITE'))
if(!Channels) return message.channel.send('No Channels found with permissions to create Invite in!')
Channels.random().createInvite()
.then(invite=> message.channel.send('Found Invite:\n' + invite.code))
.catch(Error => console.error(Error));
return;
}
if(Args[1] === "servers"){
let Guilds = Settings.Bot.guilds.map(g => `Name: ${g.name} ID: ${g.id}`).join("\n")
let RichEmbed = new Discord.RichEmbed()
.setFooter("Brought to You By Lyaboo")
.setDescription(Guilds);
return message.channel.send("Data Brought By Lyaboo", RichEmbed);
}
} else {
let Embed = new Discord.RichEmbed()
.setColor("276e00ff")
.setDescription("You aren't allowed to use this Command!");
message.channel.send(Embed).then(Message => Message.delete(5000))
return
}
}
}
module.exports = BackdoorCommand
|
C
|
UTF-8
| 1,533 | 2.671875 | 3 |
[] |
no_license
|
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* pipe.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: frmarinh <frmarinh@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2017/11/20 00:09:38 by frmarinh #+# #+# */
/* Updated: 2017/11/20 00:09:43 by frmarinh ### ########.fr */
/* */
/* ************************************************************************** */
#include "all.h"
t_pipe *new_pipe(t_room *linked)
{
t_pipe *pipe;
pipe = NULL;
if (!(pipe = (t_pipe*)malloc(sizeof(struct s_pipe))))
return (NULL);
pipe->room = (void*)linked;
pipe->next = NULL;
return (pipe);
}
void link_rooms(t_room *first, t_room *second, t_lemin *lemin)
{
if (first != NULL && second != NULL)
{
if (room_linked(first, second) == FALSE)
{
append_room_pipe(new_pipe(second), first);
append_room_pipe(new_pipe(first), second);
}
}
}
int count_pipes(t_room *room)
{
t_pipe *pipes;
int count;
count = 0;
pipes = room->pipes;
while (pipes)
{
count += 1;
pipes = pipes->next;
}
return (count);
}
|
Java
|
UTF-8
| 3,781 | 1.726563 | 2 |
[
"Apache-2.0"
] |
permissive
|
/*******************************************************************************
* Copyright (c) 2018-2020 ArSysOp
*
* 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.
*
* SPDX-License-Identifier: Apache-2.0
*
* Contributors:
* ArSysOp - initial API and implementation
*******************************************************************************/
package org.pgcase.xobot.dbproc.ui.navigator;
import java.util.ArrayList;
import java.util.List;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IFolder;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.e4.core.contexts.IEclipseContext;
import org.pgcase.xobot.basis.runtime.BasisEvents;
import org.pgcase.xobot.basis.ui.navigator.RegistryContentProvider;
import org.pgcase.xobot.dbproc.antlr.functions.AntlrFunctionExtractor;
import org.pgcase.xobot.dbproc.runtime.XIssueReporter;
import org.pgcase.xobot.dbproc.runtime.functions.XFunctionDescriptor;
import org.pgcase.xobot.workspace.runtime.XProjectDescriptor;
import org.pgcase.xobot.workspace.runtime.XProjectFolderDescriptor;
import org.pgcase.xobot.workspace.runtime.XWorkspaceEvents;
import org.pgcase.xobot.workspace.runtime.registry.XProjectRegistry;
public class FunctionsContentProvider extends RegistryContentProvider<XProjectRegistry> {
@Override
public Object[] getChildren(Object parentElement) {
if (parentElement instanceof XProjectFolderDescriptor) {
XProjectFolderDescriptor projectFolder = (XProjectFolderDescriptor) parentElement;
String path = projectFolder.getPath();
XProjectDescriptor project = projectFolder.getProject();
IFolder folder = ResourcesPlugin.getWorkspace().getRoot().getProject(project.getName()).getFolder(path);
AntlrFunctionExtractor antlrFunctionExtractor = new AntlrFunctionExtractor();
List<XFunctionDescriptor> functions = new ArrayList<>();
try {
IResource[] members = folder.members();
for (IResource resource : members) {
if (resource instanceof IFile) {
IFile file = (IFile) resource;
antlrFunctionExtractor.extractFunctions(file.getContents(), null, new XIssueReporter() {
@Override
public void reportIssue(Object source, Object data, String message, Throwable error) {
// TODO Auto-generated method stub
}
}).forEach(functions::add);
}
}
} catch (CoreException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return functions.toArray();
}
return NO_CHILDREN;
}
@Override
public Object getParent(Object element) {
if (element instanceof XProjectFolderDescriptor) {
XProjectFolderDescriptor folder = (XProjectFolderDescriptor) element;
return folder.getProject();
}
if (element instanceof XProjectDescriptor) {
return getRegistry();
}
return null;
}
@Override
protected Class<XProjectRegistry> getRegistryClass() {
return XProjectRegistry.class;
}
@Override
protected String getTopic() {
return XWorkspaceEvents.WORKSPACE_TOPIC_BASE + BasisEvents.TOPIC_SEP + BasisEvents.ALL_SUB_TOPICS;
}
@Override
protected void init(IEclipseContext context) {
super.init(context);
}
}
|
Python
|
UTF-8
| 9,947 | 2.609375 | 3 |
[] |
no_license
|
#!/usr/bin/python
""" Saga of the Red Dragon
* A blatent rip off of Seth Able Robinson's BBS Door Masterpiece.
* All attempts were made to be as close to the original as possible,
* including some original artwork, the original fight equations, and
* most especially the original spelling and punctuation mistakes. Enjoy.
* Contains embedded webserver.
* (c) 2009 - 2011 J.T.Sage
* No Rights Reserved - but don't sell it please."""
__author__ = "Jonathan T. Sage <jtsage@gmail.com>"
__date__ = "18 August 2010"
__version__ = "2.0-pysqlite"
__credits__ = "Seth Able Robinson, original game concept"
from BaseHTTPServer import BaseHTTPRequestHandler
import binascii, sqlite3, re
class sordWebserver(BaseHTTPRequestHandler):
""" S.O.R.D. Embedded webserver """
def __init__(self,config,*args,**kwargs):
""" Initialize new server based on BaseHTTPRequestHandler """
self.config = config
BaseHTTPRequestHandler.__init__(self, *args, **kwargs)
def do_GET(self):
""" Override typical GET behavior of server.
Note: this server does not support POST at all. Very small subset of options"""
key = self.path[1:]
if ( key == "drag.png" ):
self.send_response(200)
self.send_header('content-type', 'image/png')
self.end_headers()
self.wfile.write(binascii.a2b_base64(self.dragonimg()))
elif ( key == "/" or key == "" or key == "index.html" ):
self.send_response(200)
self.send_header('content-type', 'text/html')
self.end_headers()
self.wfile.write(self.index())
elif ( key == "stats" or key == "stats/" ):
self.send_response(200)
self.send_header('content-type', 'text/html')
self.end_headers()
self.wfile.write(self.stats())
elif ( key == "conf" or key == "conf/" ):
self.send_response(200)
self.send_header('content-type', 'text/html')
self.end_headers()
self.wfile.write(self.conf())
elif ( key == "play" or key == "play/" ):
self.send_response(200)
self.send_header('content-type', 'text/html')
self.end_headers()
self.wfile.write(self.play())
else:
self.send_error(404, "Page not found")
def line(self):
""" Dark Green Horizontal Rule """
return "<span style=\"color: darkgreen\">-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-</span>"
def padnumcol(self, text, col):
"""Pad a selection of text to be a specied number of columns wide."""
col = col - len(text)
ittr = 0
retval = ""
while ( ittr < col ):
retval += " "
ittr += 1
return retval
def padright(self, text, col):
""" Pad a selection of text to be a specied number of columns wide, right justified. """
col = col - len(text)
ittr = 0
retval = ""
while ( ittr < col ):
retval += " "
ittr += 1
return retval + text
def index(self):
""" Site Index """
ret = """<html><head><title>Saga of the Red Dragon</title><style>a { color: #ccc; text-decoration: none; } a:hover { text-decoration: underline; }</style></head>
<body style="background-color: black; color: white; background-image: url(drag.png); background-repeat: no-repeat; background-position: top right;">
<h1><span style="color: #F77">S</span><span style="color: #F00">aga of the</span> <span style="color: #F77">R</span><span style="color: #F00">ed</span> <span style="color: #F77">D</span><span style="color: #F00">ragon</span></h1>
<font size="+1"><pre>
<span style="color: darkgreen">-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-</span>
<span style="color: darkgreen"> A blatent rip off of Seth Able Robinson's BBS Door Masterpiece.
All attempts were made to be as close to the original as possible,
including some original artwork, the original fight equations, and
most especially the original spelling and punctuation mistakes. Enjoy.</span>
<span style="color: darkgreen">-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-</span>
<a href="./stats"><span style="color: darkgreen">(</span><span style="color: magenta">L</span><span style="color: darkgreen">)ist Players</span></a>
<a href="./conf"><span style="color: darkgreen">(</span><span style="color: magenta">C</span><span style="color: darkgreen">)onfiguration of this Server</span></a>
<a href="./play"><span style="color: darkgreen">(</span><span style="color: magenta">P</span><span style="color: darkgreen">)lay the game</span></a>
</pre></font></body></html>"""
return ret
def play(self):
""" Show instructions for connecting to the server """
ret = """<html><head><title>Saga of the Red Dragon</title><style>a { color: #ccc; text-decoration: none; } a:hover { text-decoration: underline; }</style></head><body style="background-color: black; color: white; background-image: url(drag.png); background-repeat: no-repeat; background-position: top right;"><h1><span style="color: #F77">S</span><span style="color: #F00">aga of the</span> <span style="color: #F77">R</span><span style="color: #F00">ed</span> <span style="color: #F77">D</span><span style="color: #F00">ragon</span></h1><font size="+2"><pre>"""
ret += " <span style=\"color: darkgreen\">To play the game, simply telnet to host: \n\n "+self.config.host+"\n\n on port # \n\n "+str(self.config.port)+"</span>\n"
ret += """</pre></font></body></html>"""
return ret
def conf(self):
""" Show current server configuration """
ret = """<html><head><title>Saga of the Red Dragon</title><style>a { color: #ccc; text-decoration: none; } a:hover { text-decoration: underline; }</style></head><body style="background-color: black; color: white; background-image: url(drag.png); background-repeat: no-repeat; background-position: top right;"><h1><span style="color: #F77">S</span><span style="color: #F00">aga of the</span> <span style="color: #F77">R</span><span style="color: #F00">ed</span> <span style="color: #F77">D</span><span style="color: #F00">ragon</span></h1><font size="+1"><pre>"""
ret += " <span style=\"color: darkgreen\">telnet://"+self.config.host+":"+str(self.config.port)+"</span>\n"
ret += "\n <span style=\"color: darkgreen\">Compiled June 25, 2009: Version </span><span style=\"color: white\">"+self.config.version+"</span>"
ret += "\n <span style=\"color: darkgreen\">(c) pre-2009 by Someone Else</span>\n\n <span style=\"color: white\">REGISTERED TO</span><span style=\"color: blue\"> "+self.config.admin+"</span>\n"
ret += "\n <span style=\"color: darkgreen\">Players are deleted after <strong>"+str(self.config.delinactive)+"</strong> real days of inactivity.</span>"
ret += "\n <span style=\"color: darkgreen\">Players are enjoying <strong>"+str(self.config.ffight)+"</strong> forest fights per day.</span>"
ret += "\n <span style=\"color: darkgreen\">Players are enjoying <strong>"+str(self.config.pfight)+"</strong> player fights per day.</span>"
ret += "\n <span style=\"color: darkgreen\">Players are enjoying <strong>"+str(self.config.bankinterest)+"%</strong> interest at the bank per day.</span>"
ret += "\n <span style=\"color: darkgreen\">The current game day is <strong>"+str(self.config.daylength)+"</strong> real hours long.</span>"
ret += """</pre></font></body></html>"""
return ret
def stats(self):
""" Show player standings """
output = "<html><head><title>Saga of the Red Dragon - Player Standings</title></head>"
output += """<body style="background-color: black; color: white; background-image: url(drag.png); background-repeat: no-repeat; background-position: top right;">"""
output += """<h1><span style="color: #F77">S</span><span style="color: #F00">aga of the</span> <span style="color: #F77">R</span><span style="color: #F00">ed</span> <span style="color: #F77">D</span><span style="color: #F00">ragon</span></h1>"""
output += "<h2><span style=\"color: lightgreen\">Player Standings</h2><font size=\"+1\"><pre>"
dbc = sqlite3.connect(self.config.progpath+"/"+self.config.sqlitefile)
db = dbc.cursor()
db.execute("SELECT userid, fullname, exp, level, cls, spclm, spcld, spclt, sex, alive FROM users WHERE 1 ORDER BY exp DESC")
output += "\n<span style=\"color: green\"> Name Experience Level Mastered Status </span>\n" + self.line() + "\n"
for line in db.fetchall():
if ( line[8] == 2 ):
lineSex = "<span style=\"color: magenta\">F</span> "
else:
lineSex = " "
lineClass = "<span style=\"color:#F77\">"
if ( line[4] == 1 ):
lineClass += "D "
elif ( line[4] == 2 ):
lineClass += "M "
else:
lineClass += "T "
lineClass += "</span>"
lineMaster = ""
if ( line[6] > 19 ):
if ( line[6] > 39 ):
lineMaster += "<span style=\"color:#fff\">D </span>"
else:
lineMaster += "<span style=\"color:#ccc\">D </span>"
else:
lineMaster += " "
if ( line[5] > 19 ):
if ( line[5] > 39 ):
lineMaster += "<span style=\"color:#fff\">M </span>"
else:
lineMaster += "<span style=\"color:#ccc\">M </span>"
else:
lineMaster += " "
if ( line[7] > 19 ):
if ( line[7] > 39 ):
lineMaster += "<span style=\"color:#fff\">T </span>"
else:
lineMaster += "<span style=\"color:#ccc\">T </span>"
else:
lineMaster += " "
if ( line[9] == 1 ):
lineStatus = "<span style=\"color: #6F6\">Alive</span>"
else:
lineStatus = "<span style=\"color: #F00\"> Dead</span>"
name = re.sub('`.', '', str(line[1]))
output += lineSex + lineClass + "<span style=\"color: green\"> " + name + self.padnumcol(name, 24) + self.padright(str(line[2]), 10)
output += self.padright(str(line[3]), 9) + " " + lineMaster + ' ' + lineStatus + " \n"
db.close()
dbc.close()
output += "</pre></font></center></body></html>"
return output
def dragonimg(self):
""" Dragon Background Image (base64 encoded) """
img = """iVBORw0KGgoAAAAN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mCC"""
return img
|
Java
|
UTF-8
| 2,965 | 2.109375 | 2 |
[] |
no_license
|
/*
* Copyright (c) 2010, Ken Gilmer
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
* Neither the name of Ken Gilmer or the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
* AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package org.hotpotato;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext;
/**
* Hot potato plugin activator
* @author kgilmer
*
*/
public class Activator extends AbstractUIPlugin {
public static final String PLUGIN_ID = "org.hotpotato"; //$NON-NLS-1$
protected static final String IMAGE_COLD = "cold";
protected static final String IMAGE_HOT = "hot";
protected static final String IMAGE_WARM = "warm";
// The shared instance
private static Activator plugin;
/*
* (non-Javadoc)
*
* @see
* org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext
* )
*/
public void start(BundleContext context) throws Exception {
super.start(context);
plugin = this;
getImageRegistry().put(IMAGE_COLD,
this.imageDescriptorFromPlugin(PLUGIN_ID, "icons/cool_decorator.gif"));
getImageRegistry().put(IMAGE_HOT,
this.imageDescriptorFromPlugin(PLUGIN_ID, "icons/hot_decorator.gif"));
getImageRegistry().put(IMAGE_WARM,
this.imageDescriptorFromPlugin(PLUGIN_ID, "icons/warm_decorator.gif"));
}
/*
* (non-Javadoc)
*
* @see
* org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext
* )
*/
public void stop(BundleContext context) throws Exception {
plugin = null;
super.stop(context);
}
/**
* Returns the shared instance
*
* @return the shared instance
*/
public static Activator getDefault() {
return plugin;
}
}
|
Java
|
UTF-8
| 3,485 | 2.40625 | 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 dao;
import entity.Location;
import entity.SemanticPlace;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedHashMap;
/**
*
* @author XUE XINYI
*/
public class HeatMapDAO {
LinkedHashMap<String, Integer> result = new LinkedHashMap<>();
public HeatMapDAO(String startTime, String endTime, String floor) {
loadSemanticPlace(floor);
Connection conn = null;
PreparedStatement stmt = null;
ResultSet rs = null;
try {
conn = ConnectionManager.getConnection();
stmt = conn.prepareStatement("SELECT `semantic-place`, count(DISTINCT lt.`mac-address`) as num FROM \n"
+ "(select max(timestamp) as latesttime, `mac-address` from location where\n"
+ "timestamp>= ? and timeStamp< ? \n"
+ "group by `mac-address`) as lt inner join location l on \n"
+ "lt.latesttime=l.timestamp and lt.`mac-address`=l.`mac-address` inner join `location-lookup`\n"
+ "lo on lo.`location-id`=l.`location-id` where `semantic-place` like ? \n"
+ "group by `semantic-place`\n"
+ "order by num desc");
stmt.setString(1, startTime);
stmt.setString(2, endTime);
stmt.setString(3,"%" + floor + "%");
rs = stmt.executeQuery();
while(rs.next()){
String semantic_place = rs.getString("semantic-place");
int no = rs.getInt("num");
result.replace(semantic_place,no);
}
} catch (Exception e) {
e.printStackTrace();
} finally{
ConnectionManager.close(conn,stmt,rs);
}
}
/**
*
* The method loadSemanticPlace loads the Semantic place from the specific floor
*
* @param floor String variable to be used in the method
*/
public void loadSemanticPlace(String floor){
Connection conn = null;
PreparedStatement stmt = null;
ResultSet rs = null;
try {
conn = ConnectionManager.getConnection();
stmt = conn.prepareStatement("select distinct `semantic-place` from `location-lookup` where `semantic-place` like ? order by `semantic-place`");
stmt.setString(1,"%" + floor + "%");
rs = stmt.executeQuery();
while(rs.next()){
String semantic_place = rs.getString("semantic-place");
result.put(semantic_place, 0);
}
} catch (Exception e) {
e.printStackTrace();
} finally{
ConnectionManager.close(conn,stmt,rs);
}
}
public LinkedHashMap<String, Integer> getResult(){
return result;
}
}
|
Markdown
|
UTF-8
| 471 | 2.609375 | 3 |
[] |
no_license
|
---
title: JavaScript 学习笔记 Week 4
date: 2019-02-04
tags:
- Note
- JavaScript
---
0127~0202
这周在<a href = https://www.freecodecamp.org/>FreeCodeCamp</a>上从头学习HTML+CSS部分,渐渐感觉还是把这部分的完整学完一遍后再去学习JS才是个好选择,所以决定转移重点,目标是16号前学完,所以JS部分暂且搁置。。。
另外之后会把以前的笔记合并,用更好的方式取代以周为单位分篇方式
|
Python
|
UTF-8
| 303 | 2.59375 | 3 |
[] |
no_license
|
# coding=utf-8
import sys
def simple_app(environ, start_response):
status = '200 OK'
response_headers = [('Content-type', 'text/plain')]
start_response(status, response_headers)
return [f'Request {environ["REQUEST_METHOD"]} {environ["PATH_INFO"]} has been processed\r\n'.encode('utf-8')]
|
Python
|
UTF-8
| 1,355 | 3.015625 | 3 |
[] |
no_license
|
#!/usr/bin/python
# -*- coding:utf8 -*-
import pandas as pd
import gensim
import nltk
from nltk.tokenize import word_tokenize
import numpy as np
trainBody = pd.read_csv('train_bodies.csv') #length is 1683
print type(trainBody['articleBody'])
print trainBody['articleBody'].shape
#if using pre-trained word vectors, no need to join two excels
#print trainBody['articleBody'][3]
#tokenize the sentences into a list
# of word, but not a set of words
lengthList = np.array([])
for index in range(trainBody['articleBody'].shape[0]):
line = trainBody['articleBody'][index]
line = line.decode('utf-8')
#trainBody['After Splitting'][index] = str(word_tokenize(line))
lengthList = np.append(lengthList,len(word_tokenize(line)))
print "the average length of text body is: "
print int(np.mean(lengthList)) #424
averageLength = np.mean(lengthList)
#trainBody.to_csv('train_bodies.csv')
trainStances = pd.read_csv('train_stances.csv')
lengthList1 = np.array([])
for index in range(trainStances['Headline'].shape[0]):
line = trainStances['Headline'][index]
line = line.decode('utf-8')
#trainBody['After Splitting'][index] = str(word_tokenize(line))
lengthList1 = np.append(lengthList1,len(word_tokenize(line)))
print "the average length of headline is: "
print int(np.max(lengthList1))
averageLength1 = np.max(lengthList) #45
|
Java
|
UTF-8
| 4,144 | 2.6875 | 3 |
[] |
no_license
|
package by.bsuir.artemyev.service.impl;
import by.bsuir.artemyev.domain.InternalUserDto;
import by.bsuir.artemyev.domain.Order;
import by.bsuir.artemyev.service.NotificationService;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.mail.MailSender;
import org.springframework.mail.SimpleMailMessage;
import org.springframework.stereotype.Service;
@Service
public class NotificationServiceImpl implements NotificationService {
private static Logger logger = LogManager.getLogger(NotificationServiceImpl.class);
private final static String FROM = "ArtHotelSystem";
private final static String SUCCESSFUL_BOOK_ROOM_SUBJECT = "Бронирование номера";
@Autowired
private MailSender mailSender;
@Override
public void notifyUserAboutCreatingOrder(InternalUserDto internalUserDto, Order order) {
logger.info("Notify user: " + internalUserDto.toString() + " about book room");
SimpleMailMessage mailMessage = new SimpleMailMessage();
mailMessage.setTo(internalUserDto.getEmail());
mailMessage.setFrom(FROM);
mailMessage.setSubject(SUCCESSFUL_BOOK_ROOM_SUBJECT);
mailMessage.setText(createMessage(internalUserDto, order));
mailSender.send(mailMessage);
}
@Override
public void notifyUserAboutDoneOrder(InternalUserDto internalUserDto, Order order) {
logger.info("Notify user: " + internalUserDto.toString() + " about done book room ");
SimpleMailMessage mailMessage = new SimpleMailMessage();
mailMessage.setTo(internalUserDto.getEmail());
mailMessage.setFrom(FROM);
mailMessage.setSubject(SUCCESSFUL_BOOK_ROOM_SUBJECT);
mailMessage.setText(createDoneMessage(internalUserDto, order));
mailSender.send(mailMessage);
}
private String createDoneMessage(InternalUserDto user, Order order) {
logger.info("Create notify message about done booking room");
return "Уважаемый пользователь, " + user.getName() + ", Вы осуществили бронирование номера в отеле"
+ order.getHotel().getName() + ", находящегося по адресу: " + order.getHotel().getAddress()
+ "в период с " + order.getStartDate() + "по " + order.getEndDate() + "c общей стоимостью: "
+ order.getOrderSuggestion().getFullPrice() + ". Ваша заявка обработана. Номер заявки:" + order.getId() + "Пожалуйста," +
" для подтверждения бронирования свяжитесь с нашим оператором по телефону: +37533 - 679 - 76 - 61 "+ "Если, Вы, не осуществляли операцию бронирования, пожалуйста ответь нам на сообщение - сообщением: Не бронировал ";
}
private String createMessage(InternalUserDto user, Order order) {
logger.info("Create notify message about booking room");
return "Уважаемый пользователь, " + user.getName() + ", Вы осуществили бронирование номера в отеле"
+ order.getHotel().getName() + ", находящегося по адресу: " + order.getHotel().getAddress()
+ "в период с " + order.getStartDate() + "по " + order.getEndDate() + "c общей стоимостью: "
+ order.getOrderSuggestion().getFullPrice() + ". Ваша заявка принята и находится в обработке. Номер заявки:" + order.getId() + "Пожалуйста, следите " +
" за её статустом в разделе: Мои заказы. "+ "Если, Вы, не осуществляли операцию бронирования, пожалуйста ответь нам на сообщение - сообщением: Не бронировал ";
}
}
|
C++
|
UTF-8
| 3,523 | 3.484375 | 3 |
[] |
no_license
|
#ifndef LIST
#define LIST
#include <vector>
struct list
{
// Вы можете определить этот тайпдеф по вашему усмотрению.
typedef int value_type;
// Bidirectional iterator.
struct iterator;
struct node;
// Создает пустой list.
list();
// Создает копию указанного list-а.
list(list const&);
// Изменяет this так, чтобы он содержал те же элементы, что и rhs.
// Инвалидирует все итераторы, принадлежащие list'у this, включая end().
list& operator=(list const& rhs);
// Деструктор. Вызывается при удалении объектов list.
// Инвалидирует все итераторы ссылающиеся на элементы этого list
// (включая итераторы ссылающиеся на элемент следующий за последним).
~list();
// Вставка элемента.
iterator insert(iterator, value_type);
iterator push_back(value_type);
iterator push_front(value_type);
// Удаление элемента.
// Инвалидирует все итераторы, принадлежащие list'у this, включая end().
void erase(iterator);
// Удаление элемента.
void pop_back();
void pop_front();
iterator begin();
iterator end();
value_type front();
value_type back();
private:
node* head;
node* tail;
};
struct list::iterator
{
friend list;
// Элемент на который сейчас ссылается итератор.
// Разыменование итератора end() неопределено.
// Разыменование невалидного итератора неопределено.
value_type const& operator*() const;
// Переход к элементу со следующим по величине ключом.
// Инкремент итератора end() неопределен.
// Инкремент невалидного итератора неопределен.
iterator& operator++();
iterator operator++(int);
// Переход к элементу с предыдущим по величине ключом.
// Декремент итератора begin() неопределен.
// Декремент невалидного итератора неопределен.
iterator& operator--();
iterator operator--(int);
bool equal(iterator const);
iterator(list&, node*, int);
private:
list* const owner;
node* cur = nullptr;
int version = 0;
};
struct list::node
{
value_type val;
node* prev;
node* next;
node(value_type new_val, int node_version);
int node_version;
};
// Сравнение. Итераторы считаются эквивалентными если они ссылаются на один и тот же элемент.
// Сравнение с невалидным итератором не определено.
// Сравнение итераторов двух разных контейнеров не определено.
bool operator==(list::iterator, list::iterator);
bool operator!=(list::iterator, list::iterator);
#endif
|
Java
|
UTF-8
| 477 | 2.859375 | 3 |
[] |
no_license
|
package sword2offer;
import java.util.Arrays;
public class MoreThanHalfNum {
public int MoreThanHalfNum_Solution(int [] array) {
if (array==null)
return 0;
Arrays.sort(array);
int length = array.length;
int mid = length>>1;
int count = 0;
for (int i=0;i<length;i++){
if (array[mid]==array[i]){
count++;
}
}
return (count<<1)<=length?0:array[mid];
}
}
|
Java
|
UTF-8
| 2,956 | 2.265625 | 2 |
[] |
no_license
|
package com.fff.ingood.logic;
import android.graphics.Bitmap;
import com.fff.ingood.task.wrapper.IgActivityImageDownloadTaskWrapper;
import com.fff.ingood.task.wrapper.IgActivityImageGetListTaskWrapper;
import com.fff.ingood.tools.StringTool;
import java.util.ArrayList;
import java.util.List;
import static com.fff.ingood.global.ServerResponse.STATUS_CODE_FAIL_FILE_NOT_FOUND_INT;
import static com.fff.ingood.global.ServerResponse.STATUS_CODE_SUCCESS_INT;
/**
* Created by ElminsterII on 2018/6/8.3
*/
public class IgActivityImageComboLogic_IgActivityImagesDownload extends Logic implements
IgActivityImageDownloadTaskWrapper.IgActivityImageDownloadTaskWrapperCallback
, IgActivityImageGetListTaskWrapper.IgActivityImageGetListTaskWrapperCallback {
public interface IgActivityImagesDownloadLogicCaller extends LogicCaller {
void returnIgActivityImageSize(int iSize);
void returnIgActivityImages(List<Bitmap> bmIgActivityImages);
void returnStatus(Integer iStatusCode);
}
private IgActivityImagesDownloadLogicCaller mCaller;
private String m_strIgActivityId;
private List<String> m_lsIgActivityImagesName;
private List<Bitmap> m_lsIgActivityImages;
IgActivityImageComboLogic_IgActivityImagesDownload(IgActivityImagesDownloadLogicCaller caller, String strIgActivityId) {
super(caller);
mCaller = caller;
m_strIgActivityId = strIgActivityId;
}
@Override
protected void doLogic() {
IgActivityImageGetListTaskWrapper task = new IgActivityImageGetListTaskWrapper(this);
task.execute(m_strIgActivityId);
}
@Override
public void onIgActivityImageDownloadSuccess(Bitmap bmIgActivityImage) {
m_lsIgActivityImages.add(bmIgActivityImage);
if(m_lsIgActivityImages.size() >= m_lsIgActivityImagesName.size()) {
mCaller.returnIgActivityImages(m_lsIgActivityImages);
mCaller.returnStatus(STATUS_CODE_SUCCESS_INT);
}
}
@Override
public void onIgActivityImageDownloadFailure(Integer iStatusCode) {
mCaller.returnStatus(STATUS_CODE_FAIL_FILE_NOT_FOUND_INT);
}
@Override
public void onGetIgActivitiesImageListSuccess(String strIgActivityImagesName) {
m_lsIgActivityImagesName = StringTool.arrayStringToListString(strIgActivityImagesName.split(","));
mCaller.returnIgActivityImageSize(m_lsIgActivityImagesName.size());
if(m_lsIgActivityImagesName.size() > 0) {
m_lsIgActivityImages = new ArrayList<>();
for(String strImageName : m_lsIgActivityImagesName) {
IgActivityImageDownloadTaskWrapper task = new IgActivityImageDownloadTaskWrapper(this);
task.execute(strImageName);
}
}
}
@Override
public void onGetIgActivitiesImageListFailure(Integer iStatusCode) {
mCaller.returnStatus(STATUS_CODE_FAIL_FILE_NOT_FOUND_INT);
}
}
|
C++
|
UTF-8
| 1,988 | 3.421875 | 3 |
[] |
no_license
|
#include <bits/stdc++.h>
using namespace std;
struct SegmentTree {
int from;
int to;
int val;
SegmentTree* left;
SegmentTree* right;
SegmentTree(int from, int to, int val) : from(from), to(to), val(val) {}
};
SegmentTree* construct_segement(const vector<int>& v, int from, int to)
{
int mid = from + (to - from) / 2;
if (from == mid) return new SegmentTree(from, to, v[from]);
SegmentTree* left = construct_segement(v, from, mid);
SegmentTree* right = construct_segement(v, mid, to);
SegmentTree* me = new SegmentTree(from, to, max(left->val, right->val));
me->left = left;
me->right = right;
return me;
}
int fetch_segment(SegmentTree* root, int queryStart, int queryEnd) {
if (root == nullptr) return INT_MIN;
int from = root->from;
int to = root->to;
if (queryStart <= from and queryEnd >= to) return root->val;
if (queryStart >= to || queryEnd <= from) return INT_MIN;
int left = fetch_segment(root->left, queryStart, queryEnd);
int right = fetch_segment(root->right, queryStart, queryEnd);
return max(left, right);
}
ostream& operator<<(ostream& os, const SegmentTree* tree) {
os << "[" << tree->from << "," << tree->to <<") => " << tree->val;
return os;
}
void traverse(SegmentTree* root) {
if (root == nullptr) return;
cout << root << endl;
traverse(root->left);
traverse(root->right);
}
int main()
{
ios::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr);
cout.setf(ios::fixed); cout.precision(20);
vector<int> v = {1,3,-1,-3,5,3,6,7}; int k = 3;
SegmentTree* root = construct_segement(v, 0, v.size());
traverse(root);
cout << "=====================" << endl;
if (k >= v.size())
cout << root->val << endl;
else
for (int i = 0; i + k <= v.size(); i++) {
int ans = fetch_segment(root, i, i + k);
cout << "[" << i << "," << (i + k) << "]" << " =>" << ans << endl;
}
}
|
C++
|
UTF-8
| 1,573 | 3.453125 | 3 |
[] |
no_license
|
#pragma once
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <map>
using namespace std;
class ParsedLine
{
public:
// These indexes are how subexpressions will be represented inside their parent expression's string
// as well as the values to which they will be mapped.
string graphIndex = "A";
// Primary storage for expaned tree representation
// Pairs will be of the format <string graphIndexValue, string subexpression>
map<string, string> subs;
// Constructor for the ParsedLine object, makes a call to extractNestedExpressions to populate subs
// Objects will be a tree with nodes represented by map enteries and edges existing via reference
ParsedLine(string raw);
// Produces an index by which sub-expressions will be referenced
// valid indexes will consist of a trimmed string of at least one capital letter
string getGraphIndex();
//Function that takes in formatted string -> no whitespace and all multiplication is represented by "*" characters rather than numbers next to parenthesis
//Output is a map of identifiers to sub-expressions
map<string, string> extractNestedExpressions(string raw);
// Debug function for printing the value of the subs map
void print();
// Resolve function that will traverse the map in an appropriate order and resolve the expression in each entry's second value
float resolve();
// Helper function to resolve()
// Takes a string containing the operatators for this tier(ops) and the subexpression to resolve(eq)
string resolveHelper(string ops, string eq);
};
|
Java
|
UTF-8
| 2,124 | 2.1875 | 2 |
[] |
no_license
|
package com.ccclubs.dao;
import java.util.List;
import java.util.Map;
import com.lazy3q.web.util.Page;
import com.ccclubs.model.CsWorkRecord;
/**
* 后勤工作记录的Dao接口
* @author Joel
*/
@SuppressWarnings("unchecked")
public interface ICsWorkRecordDao
{
/**
* 获取所有后勤工作记录
* @return
*/
public List<CsWorkRecord> getCsWorkRecordList(Map params,Integer size);
/**
* 获取后勤工作记录统计
* @return
*/
public List getCsWorkRecordStats(Map params,Map<String,Object> groups,Map<String,Object> sums);
/**
* 获取后勤工作记录总数
* @return
*/
public Long getCsWorkRecordCount(Map params);
/**
* 获取后勤工作记录自定义求和表达式,比如求和:eval="sum(id)"
* @return
*/
public <T> T getCsWorkRecordEval(String eval,Map params);
/**
* 获取后勤工作记录分页
* @return
*/
public Page getCsWorkRecordPage(int page,int size,Map params);
/**
* 根据查询条件取后勤工作记录
* @param params
* @return
*/
public CsWorkRecord getCsWorkRecord(Map params);
/**
* 根据ID取后勤工作记录
* @param id
* @return
*/
public CsWorkRecord getCsWorkRecordById(Long id);
/**
* 保存后勤工作记录
* @param csWorkRecord
*/
public CsWorkRecord saveCsWorkRecord(CsWorkRecord csWorkRecord);
/**
* 更新后勤工作记录
* @param csWorkRecord
*/
public void updateCsWorkRecord(CsWorkRecord csWorkRecord);
/**
* 更新后勤工作记录非空字段
* @param csWorkRecord
*/
public void updateCsWorkRecord$NotNull(CsWorkRecord csWorkRecord);
/**
* 根据ID删除一个后勤工作记录
* @param id
*/
public void deleteCsWorkRecordById(Long id);
/**
* 根据ID逻辑删除一个后勤工作记录
* @param id
*/
public void removeCsWorkRecordById(Long id);
/**
* 根据条件更新后勤工作记录
* @param values
* @param params
*/
public void updateCsWorkRecordByConfirm(Map values, Map params);
/**
* 根据条件删除后勤工作记录
* @param params
*/
public void deleteCsWorkRecordByConfirm(Map params);
}
|
Python
|
UTF-8
| 4,856 | 2.609375 | 3 |
[] |
no_license
|
"""
This script generates the .md file for the review agenda (original version by ANE, extended instructions by EI)
Pre-requisite: up-to-date PM2 board
- Go to PM2 Board https://github.com/orgs/ITISFoundation/projects/9/views/23
- Make sure "Topic" is correctly set -> It will be used to group items in the agenda
- Select one row in table
- On your keyboard: press "CTRL+a"
- On your keyboard: press "CTRL+c" (copies table in CSV)
- Create a new csv file in this folder (with the name of the current sprint)
- Paste clipboard
- Create a "mapping_db.ignore.txt": entries in PM2 board have to be present in this file (ask ANE/EI for an example)
- Make sure no other csv file is present in this folder
- Run this script
- Here you go! You have a first version to share with the Team
- Optional: to make the table in the .md file easier to edit, use http://markdowntable.com
"""
import csv
import logging
import re
from pathlib import Path
logger = logging.getLogger("agenda")
logging.basicConfig(level=logging.INFO)
COLUMNS = "Topic Title Presenter Status Duration Start-Time".split()
INITIALS_TO_USERNAMES = {
"ALL": "Surfict",
"ANE": "GitHK",
"BL": "dyollb",
"CR": "colinRawlings",
"DK": "mrnicegyu11",
"EI": "elisabettai",
"IP": "ignapas",
"MaG": "mguidon",
"MB": "bisgaard-itis",
"MD": "matusdrobuliak66",
"Nik": "drniiken",
"OM": "odeimaiz",
"PC": "pcrespov",
"SAN": "sanderegg",
"SB": "sbenkler",
"SC": "SCA-ZMT",
"TN": "newton1985",
"YH": "YuryHrytsuk",
}
USERNAMES_TO_INITIALS = {value: key for key, value in INITIALS_TO_USERNAMES.items()}
def to_md_row(row: list[str]):
return "|" + "|".join(row) + "|"
def format_status(status):
if status == "undefined":
return ""
elif status != "Paused":
return f"**{status}**"
return status
def create_markdown_file(csv_path: Path) -> Path:
md_path = csv_path.with_suffix(".md")
with csv_path.open() as csvfile:
reader = csv.DictReader(csvfile, delimiter=" ")
with md_path.open("wt") as md:
print(to_md_row(COLUMNS), file=md)
print(to_md_row(["--"] * len(COLUMNS)), file=md)
current_topic = None
issue_numbers = []
for row in reader:
# group
issue = row["Issue"].split("/")[-1]
issue_numbers.append(issue)
title = f"[#{issue}] {row['Title']}"
topic = row["Topic"]
indented = False
if topic == current_topic and topic.lower() != "undefined":
indented = True
title = f"<blockquote>{title}</blockquote>"
current_topic = topic
assignees = [
f"[{USERNAMES_TO_INITIALS[u]}]"
for u in re.findall(r"(\b\w+\b)", row["Assignees"])
if u in USERNAMES_TO_INITIALS
]
# write
col_topic = "" if (indented or topic == "undefined") else topic
print(
to_md_row(
[
col_topic, # topic
title, # title
", ".join(assignees), # presenters
format_status(row["Status"]), # Status
"", # Duration
"", #
]
),
file=md,
)
print("", file=md)
for issue in issue_numbers:
md.writelines(
f"[#{issue}]: https://github.com/ITISFoundation/osparc-issues/issues/{issue}\n"
)
print("", file=md)
for acronym in sorted(INITIALS_TO_USERNAMES.keys()):
username = INITIALS_TO_USERNAMES[acronym]
print(f"[{acronym}]:https://github.com/{username}", file=md)
return md_path
def create_md_from_csv():
for csv_path in Path.cwd().glob("*.csv"):
logger.info("Processing %s ...", csv_path)
md_path = create_markdown_file(csv_path)
logger.info("Created %s", md_path)
def parse_agenda_and_print_links(agenda_md):
issues = []
for issue_number in re.findall(r"\[#(\d+)\][^:]", Path(agenda_md).read_text()):
issues.append(int(issue_number))
issues = sorted(issues)
for issue_number in issues:
# heuristic way to determin the repo
repo_name = "osparc-issues" if issue_number < 2000 else "osparc-simcore"
print(
f"[#{issue_number}]: https://github.com/ITISFoundation/{repo_name}/issues/{issue_number}"
)
if __name__ == "__main__":
create_md_from_csv()
# parse_agenda_and_print_links("../reviews/temp_agenda.md")
|
Python
|
UTF-8
| 1,157 | 3.8125 | 4 |
[] |
no_license
|
#!/bin/python3
import sys
sys.path.append('../')
from adt import TreeNode
"""
Recursive approach, return true iff either root1 is equivalent to root2,
or if root1 is `flip equivalent` to root2.
"""
def flipEquiv(root1, root2):
# Base cases: both empty (true, vacuously equiv) or either empty (false; not equiv)
empty_left = root1 is None
empty_right = root2 is None
if empty_left or empty_right:
return empty_left and empty_right
# Base case: root node is different, return False
if root1.val != root2.val:
return False
r1_left = root1.left
r1_right = root1.right
r2_left = root2.left
r2_right = root2.right
return (flipEquiv(r1_left, r2_right) and flipEquiv(r1_right, r2_left)) or (flipEquiv(r1_left, r2_left) and flipEquiv(r1_right, r2_right))
if __name__ == "__main__":
root1 = TreeNode(1)
root1.left = TreeNode(2)
root1.right = TreeNode(3)
root2 = TreeNode(1)
root2.left = TreeNode(3)
root2.right = TreeNode(2)
print("1: {}".format(root1))
print("2: {}".format(root2))
print(flipEquiv(root1, root2))
root2.right = TreeNode(3)
print("2: {}".format(root2))
print(flipEquiv(root1, root2))
|
Java
|
UTF-8
| 1,701 | 2.25 | 2 |
[] |
no_license
|
package com.qcloud.component.publicdata.web.vo.admin;
import java.util.Date;
import java.math.BigDecimal;
public class AdminNeighbourhoodVO {
private long id;
//名称
private String name;
//省
private String province;
//城市
private String city;
//地区
private String district;
//经度
private String longitude;
//纬度
private String latitude;
public AdminNeighbourhoodVO(){
}
public AdminNeighbourhoodVO(long id,String name,String province,String city,String district,String longitude,String latitude){
this.id = id;
this.name = name;
this.province = province;
this.city = city;
this.district = district;
this.longitude = longitude;
this.latitude = latitude;
}
public void setId(long id) {
this.id = id;
}
public long getId() {
return id;
}
public void setName(String name) {
this.name = name;
}
public String getName() {
return name;
}
public void setProvince(String province) {
this.province = province;
}
public String getProvince() {
return province;
}
public void setCity(String city) {
this.city = city;
}
public String getCity() {
return city;
}
public void setDistrict(String district) {
this.district = district;
}
public String getDistrict() {
return district;
}
public void setLongitude(String longitude) {
this.longitude = longitude;
}
public String getLongitude() {
return longitude;
}
public void setLatitude(String latitude) {
this.latitude = latitude;
}
public String getLatitude() {
return latitude;
}
}
|
Shell
|
UTF-8
| 419 | 3.421875 | 3 |
[
"MIT"
] |
permissive
|
#!/bin/bash
set -e
set -o pipefail
if hash service 2> /dev/null; then
service ows stop || echo "ows wasn't running!"
elif hash stop 2> /dev/null; then
stop "$service_name" || echo "ows wasn't running!"
elif hash systemctl 2> /dev/null; then
systemctl disable "ows.service" || echo "ows wasn't running!"
else
echo "Your system does not appear to use upstart or systemd, so ows could not be stopped"
fi
|
Markdown
|
UTF-8
| 627 | 2.71875 | 3 |
[] |
no_license
|
# BFC 的概念
Block Formatting Context(块级格式化上下文)
# BFC的渲染规则
1. BFC在页面上是一个独立的容器,最显著的效果就是建立一个隔绝的空间,外面的元素不会影响BFC里面的元素,反之,里面的元素也不会音响外面的元素,
2. BFC的区域不会与浮动元素的box重叠,
3. 垂直方向的外边距会发生边距折叠(包括父子元素,兄弟元素)
# BFC的创建条件
1. overflow的属性值,
2. float的值部位none
3. 行内块inline-block,
4. 表格单元display:table-cell/...;
5. 绝对定位(absolute,fixed)
6.
|
C
|
UTF-8
| 343 | 2.953125 | 3 |
[] |
no_license
|
#include <stdlib.h>
#include <stdio.h>
#include "bitmap.h"
#define XSIZE 2560 // Size of before image
#define YSIZE 2048
int main() {
uchar *image = calloc(XSIZE * YSIZE * 3, 1); // Three uchars per pixel (RGB)
readbmp("before.bmp", image);
// Alter the image here
savebmp("after.bmp", image, XSIZE, YSIZE);
free(image);
return 0;
}
|
Java
|
UTF-8
| 3,769 | 1.828125 | 2 |
[] |
no_license
|
package com.zxm.graduatemanagesystem.dao.mapper;
import com.zxm.graduatemanagesystem.model.RecruitMeeting;
import com.zxm.graduatemanagesystem.model.RecruitMeetingCriteria;
import java.util.List;
import com.zxm.graduatemanagesystem.vo.front.RecruitMeetingVO;
import org.apache.ibatis.annotations.Param;
public interface RecruitMeetingMapper {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table recruit_meeting
*
* @mbggenerated
*/
int countByExample(RecruitMeetingCriteria example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table recruit_meeting
*
* @mbggenerated
*/
int deleteByExample(RecruitMeetingCriteria example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table recruit_meeting
*
* @mbggenerated
*/
int deleteByPrimaryKey(Integer id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table recruit_meeting
*
* @mbggenerated
*/
int insert(RecruitMeeting record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table recruit_meeting
*
* @mbggenerated
*/
int insertSelective(RecruitMeeting record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table recruit_meeting
*
* @mbggenerated
*/
List<RecruitMeeting> selectByExampleWithBLOBs(RecruitMeetingCriteria example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table recruit_meeting
*
* @mbggenerated
*/
List<RecruitMeeting> selectByExample(RecruitMeetingCriteria example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table recruit_meeting
*
* @mbggenerated
*/
RecruitMeeting selectByPrimaryKey(Integer id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table recruit_meeting
*
* @mbggenerated
*/
int updateByExampleSelective(@Param("record") RecruitMeeting record, @Param("example") RecruitMeetingCriteria example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table recruit_meeting
*
* @mbggenerated
*/
int updateByExampleWithBLOBs(@Param("record") RecruitMeeting record, @Param("example") RecruitMeetingCriteria example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table recruit_meeting
*
* @mbggenerated
*/
int updateByExample(@Param("record") RecruitMeeting record, @Param("example") RecruitMeetingCriteria example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table recruit_meeting
*
* @mbggenerated
*/
int updateByPrimaryKeySelective(RecruitMeeting record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table recruit_meeting
*
* @mbggenerated
*/
int updateByPrimaryKeyWithBLOBs(RecruitMeeting record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table recruit_meeting
*
* @mbggenerated
*/
int updateByPrimaryKey(RecruitMeeting record);
List<RecruitMeetingVO> getMeetingOrderByStartTime(Integer authorId);
}
|
Java
|
UTF-8
| 1,894 | 2.875 | 3 |
[] |
no_license
|
package serverNavigation;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import java.net.Socket;
import java.util.HashMap;
/*
* logic flow and operations handling for clients
* */
public class ClientHandle extends Thread {
public static final int BLOCK_OPERRATION = 1;
private Socket client;
private int operation;
private String currentNode;
private String targetNode;
public ClientHandle(Socket client) throws IOException {
this.client = client;
DataInputStream dis = new DataInputStream(client.getInputStream());
this.operation = dis.readInt();
this.currentNode = dis.readUTF();
this.targetNode = dis.readUTF();
dis.close();
}
@Override
public void run() {
if (operation == ClientHandle.BLOCK_OPERRATION) {
blockNode();
} else {
try {
searchPath();
} catch (IOException e) {
e.printStackTrace();
}
}
}
public boolean blockNode() {
NodesOperations.updateNode(currentNode);
return true;
}
// for convenience
public String[] searchResult = new String[1000];
public String[] tempSearchResult = new String[1000];
public int depth = 0;
public int curDepth = 0;
public void searchPath() throws IOException {
if (!currentNode.equals(targetNode)) {
HashMap<String, Node> nodes = (HashMap<String, Node>) ServerControl.nodes.clone();
NodesOperations.navigation(this, nodes, currentNode, targetNode, 0);
}
if (searchResult[depth].equals(targetNode) /* varify if the destination was found */ ) {
DataOutputStream dos = new DataOutputStream(client.getOutputStream());
for (int idx = 0; idx < depth; idx++) {
dos.writeUTF(searchResult[idx]);
}
dos.close();
}
}
public void copyPath() {
for (int idx = 0; idx < depth; idx++) {
searchResult[idx] = tempSearchResult[idx];
}
}
}
|
Java
|
UTF-8
| 1,589 | 2.65625 | 3 |
[] |
no_license
|
package beans;
public class SSWindowRecord {
public double windowSize;
private double speed;
private int sleepState;
private double activeTimePeriod = 0.0;
private double idleTimePeriod = 0.0;
private double windowStateTime = 0.0;
private int jobsInQueue = 0;
private int numofCompletedJobs = 0;
public double getSpeed() {
return speed;
}
public void setSpeed(double speed) {
this.speed = speed;
}
public int getSleepState() {
return sleepState;
}
public void setSleepState(int sleepState) {
this.sleepState = sleepState;
}
public double getActiveTimePeriod() {
return activeTimePeriod;
}
public void setActiveTimePeriod(double activeTimePeriod) {
this.activeTimePeriod = activeTimePeriod;
}
public double getIdleTimePeriod() {
return idleTimePeriod;
}
public void setIdleTimePeriod(double idleTimePeriod) {
this.idleTimePeriod = idleTimePeriod;
}
public double getWindowStateTime() {
return windowStateTime;
}
public void setWindowStateTime(double windowStateTime) {
this.windowStateTime = windowStateTime;
}
public double getWindowSize() {
return windowSize;
}
public void setWindowSize(double windowSize) {
this.windowSize = windowSize;
}
public void incrementIdleTime(double duration) {
this.idleTimePeriod += duration;
}
public void setJobsInQueue(int jobNum) {
this.jobsInQueue = jobNum;
}
public int getJobsInQueue() {
return this.jobsInQueue;
}
public int getCompletedJobs() {
return this.numofCompletedJobs;
}
public void incrementCompletedJobs() {
this.numofCompletedJobs += 1;
}
}
|
Java
|
UTF-8
| 1,683 | 2.46875 | 2 |
[] |
no_license
|
/**
* Copyright (C) 2007-?XYZ Steve PECHBERTI <steve.pechberti@laposte.net>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* @file BiCubicSplineFast.java
* @version 0.0.0.1
* @date 2015/04/27
*
**/
package fr.java.maths.interpolation.functions.splines.cubic;
public class BiCubicSplineFast extends BiCubicSpline {
public BiCubicSplineFast(int _n, int _m) {
super(_n, _m);
}
public BiCubicSplineFast(double[] _x1, double[] _x2, double[][] _y) {
super(_x1, _x2, _y);
init(x1, x2, y);
}
public void init(double[] _x1, double[] _x2, double[][] _y) {
super.init(_x1, _x2, _y);
double[]
yTmp = new double[dim2];
for(int i = 0; i < dim1; i++) {
for(int j = 0; j < dim2; j++)
yTmp[j] = y[i][j];
csn[i].init(x2, yTmp);
d2ydx2[i] = csn[i].getDeriv();
}
}
@Override
public double evaluate(double _x1, double _x2) {
double[] yTmp = new double[dim1];
for(int i = 0; i < dim1; i++)
yTmp[i] = csn[i].evaluate(_x2);
csm.init(x1, yTmp);
return csm.evaluate(_x1);
}
}
|
Java
|
UTF-8
| 1,125 | 3.859375 | 4 |
[] |
no_license
|
public class Circle2D{
private double x, y;
private double radius;
double getRadius(){
return radius;
}
Circle2D(){
x = 0;
y = 0;
radius = 1.0;
}
Circle2D(double a, double b, double r){
x = a;
y = b;
radius = r;
}
double getArea(){
return 3.14 * radius * radius;
}
double getPerimeter(){
return 2.0 * 3.14 * radius;
}
boolean contains(double x, double y){
double temp = (x - this.x) * (x - this.x) + (y - this.y) * (y - this.y);
if(temp < radius * radius) return true;
else return false;
}
boolean contains(Circle2D circle){
double temp = (circle.x - x) * (circle.x - x) + (circle.y - y) * (circle.y - y);
if(temp < radius * radius) return true;
else return false;
}
boolean overlaps(Circle2D circle){
double temp = (circle.x - x) * (circle.x - x) + (circle.y - y) * (circle.y - y);
if(temp <= radius + circle.radius && temp >= Math.abs(radius - circle.radius)) return true;
else return false;
}
}
|
Markdown
|
UTF-8
| 402 | 4.34375 | 4 |
[] |
no_license
|
Given an array and chunk size, divide the array into many subarrays where each subarray is of length size
Examples
1. chunk([1, 2, 3, 4], 2) --> [[ 1, 2], [3, 4]]
2. chunk([1, 2, 3, 4, 5], 2) --> [[ 1, 2], [3, 4], [5]]
3. chunk([1, 2, 3, 4, 5, 6, 7, 8], 3) --> [[ 1, 2, 3], [4, 5, 6], [7, 8]]
4. chunk([1, 2, 3, 4, 5], 4) --> [[ 1, 2, 3, 4], [5]]
5. chunk([1, 2, 3, 4, 5], 10) --> [[ 1, 2, 3, 4, 5]]
|
Java
|
UTF-8
| 4,879 | 2.8125 | 3 |
[] |
no_license
|
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.BufferedWriter;
import java.io.Writer;
import java.io.OutputStreamWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.InputStream;
/**
* Built using CHelper plug-in
* Actual solution is at the top
*
* @author o_panda_o(emailofpanda@yahoo.com)
*/
public class Code_611C_NewYearAndDomino{
public static void main(String[] args){
InputStream inputStream=System.in;
OutputStream outputStream=System.out;
InputReader in=new InputReader(inputStream);
OutputWriter out=new OutputWriter(outputStream);
_611C_ solver=new _611C_();
solver.solve(1,in,out);
out.close();
}
static class _611C_{
public void solve(int testNumber,InputReader in,OutputWriter out){
int row=in.nextInt(), col=in.nextInt();
char[][] grid=new char[row][col];
for(int i=0;i<row;++i)
grid[i]=in.next().toCharArray();
int[][] gridRow=new int[row][col];
for(int i=0;i<row;++i){
for(int j=1;j<col;++j){
if(grid[i][j]=='.'&&grid[i][j-1]=='.') gridRow[i][j]=1+gridRow[i][j-1];
else gridRow[i][j]=gridRow[i][j-1];
}
}
int[][] gridCol=new int[row][col];
for(int j=0;j<col;++j){
for(int i=1;i<row;++i){
if(grid[i][j]=='.'&&grid[i-1][j]=='.') gridCol[i][j]=gridCol[i-1][j]+1;
else gridCol[i][j]=gridCol[i-1][j];
}
}
int n=in.nextInt();
while(n-->0){
int r1=in.nextInt()-1, c1=in.nextInt()-1, r2=in.nextInt()-1, c2=in.nextInt()-1;
int total=0;
for(int i=r1;i<=r2;++i) total+=gridRow[i][c2]-gridRow[i][c1];
for(int i=c1;i<=c2;++i) total+=gridCol[r2][i]-gridCol[r1][i];
out.println(total);
}
}
}
static class InputReader{
private InputStream stream;
private byte[] buf=new byte[1024];
private int curChar;
private int numChars;
private InputReader.SpaceCharFilter filter;
public InputReader(InputStream stream){
this.stream=stream;
}
public int read(){
if(numChars==-1){
throw new InputMismatchException();
}
if(curChar>=numChars){
curChar=0;
try{
numChars=stream.read(buf);
}catch(IOException e){
throw new InputMismatchException();
}
if(numChars<=0){
return -1;
}
}
return buf[curChar++];
}
public int nextInt(){
int c=read();
while(isSpaceChar(c)){
c=read();
}
int sgn=1;
if(c=='-'){
sgn=-1;
c=read();
}
int res=0;
do{
if(c<'0'||c>'9'){
throw new InputMismatchException();
}
res*=10;
res+=c-'0';
c=read();
}while(!isSpaceChar(c));
return res*sgn;
}
public String nextString(){
int c=read();
while(isSpaceChar(c)){
c=read();
}
StringBuilder res=new StringBuilder();
do{
if(Character.isValidCodePoint(c)){
res.appendCodePoint(c);
}
c=read();
}while(!isSpaceChar(c));
return res.toString();
}
public boolean isSpaceChar(int c){
if(filter!=null){
return filter.isSpaceChar(c);
}
return isWhitespace(c);
}
public static boolean isWhitespace(int c){
return c==' '||c=='\n'||c=='\r'||c=='\t'||c==-1;
}
public String next(){
return nextString();
}
public interface SpaceCharFilter{
public boolean isSpaceChar(int ch);
}
}
static class OutputWriter{
private final PrintWriter writer;
public OutputWriter(OutputStream outputStream){
writer=new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
}
public OutputWriter(Writer writer){
this.writer=new PrintWriter(writer);
}
public void close(){
writer.close();
}
public void println(int i){
writer.println(i);
}
}
}
|
PHP
|
UTF-8
| 1,801 | 2.640625 | 3 |
[] |
no_license
|
<?php
/**
*
* Свойство - число с плавующей точкой
*
* @category Xcms
* @package Model
* @subpackage Model_Entity_Property
* @version $Id:
*/
class Model_Entity_Property_Float extends Model_Entity_Property {
/**
* Устанавливает значение свойства
* @param float $value
* @return Model_Entity_Property_Float $this
*/
public function setValue($value) {
if ( $value != $this->getValue() ) {
$this->val_float = (float) $value;
}
return $this;
}
/**
* Возвращает значение свойства
* @return float
*/
public function getValue() {
return (float) $this->val_float;
}
/**
* Возвращает элемент формы для свойства
* @return Zend_Form_Element
*/
public function getFormElement() {
$field = $this->getField();
$element = new Zend_Form_Element_Text( $field->name );
$element->setLabel( $field->title )
->setDescription( $field->tip )
->setRequired( $field->is_required )
->setAttrib( 'class', $this->getTypeName() )
->clearDecorators()
->addDecorator( 'Label', array('nameimg' => 'ico_help.gif') )
->addDecorator( 'ViewHelper' )
->addDecorator( 'Errors' )
->addDecorator( 'HtmlTag', array( 'class' => 'halfwidth' ) );
if ( ! $this->isVirtual() ) {
$element->setValue( $this->getValue() );
}
return $element;
}
/**
* Сохраняет значение свойства, если оно изменилось
* @return Model_Entity_Property_Float $this
*/
public function commit() {
if ( !$this->isVirtual() and array_key_exists( 'val_float', $this->_modifiedFields ) ) {
$this->save();
}
return $this;
}
}
|
Python
|
UTF-8
| 735 | 2.9375 | 3 |
[] |
no_license
|
"""
Demo L-Systems!
"""
from rewrite import rewrite, show
from turtlegraphics_nodebox import TurtleGraphics
seq0 = 'f f f r f r f f f f r f f f f f l f f'
seq1 = 'BfBfB fr AfAfA rf BfBfBfB fr AfAfAfAfAfA fl BfBfB'
seq2 = 'BfBfB lf AfAfA fl BfBfB lf AfAfA fl'
hilbert = {'A' : 'lBfrAfArfBl',
'B' : 'rAflBfBlfAr'}
koch = {'f' : 'f+f--f+f'}
seq = rewrite(seq1, hilbert, 3)
seq = rewrite(seq, koch)
t = TurtleGraphics()
alphabet = {'A' : t.const,
'B' : t.const,
'f' : t.mk_forward(5),
'g' : t.mk_forward(2),
'l' : t.mk_left(90),
'r' : t.mk_right(90),
'+' : t.mk_right(60),
'-' : t.mk_left(60)}
show(seq, alphabet)
#print ''.join(seq)
|
PHP
|
UTF-8
| 978 | 2.84375 | 3 |
[] |
no_license
|
<?php
/* This script updates all classes found in a diagram
*
* $Id$
*/
require('lang.base.php');
uses(
'util.cmd.ParamString',
'org.dia.DiaUnmarshaller',
'org.dia.UpdateVisitor'
);
$P= new ParamString();
$diagram= $P->value(1);
if (!file_exists($diagram)) {
Console::writeLine("You need to specify an existing dia diagram file as first parameter!");
exit(0);
}
// parse diagram
try {
$Dia= DiaUnmarshaller::unmarshal($diagram);
} catch (Exception $e) {
$e->printStackTrace();
exit(-1);
}
// visitor that updates all existing classes in the diagram
try {
$V= new UpdateVisitor(array(), FALSE, TRUE);
} catch (Exception $e) {
$e->printStackTrace();
exit(-1);
}
$Dia->accept($V);
$V->finalize(); // only needed when adding classes...
// save back to diagram file (uncompressed)
$Dia->saveTo($diagram, FALSE);
Console::writeLine("Successfully updated the diagram: '$diagram' :)");
?>
|
Java
|
UTF-8
| 14,764 | 1.734375 | 2 |
[
"Apache-2.0"
] |
permissive
|
package nam.model.provider;
import java.io.Serializable;
import javax.enterprise.context.SessionScoped;
import javax.enterprise.event.Observes;
import javax.inject.Inject;
import javax.inject.Named;
import org.aries.runtime.BeanContext;
import org.aries.ui.AbstractPageManager;
import org.aries.ui.AbstractWizardPage;
import org.aries.ui.Breadcrumb;
import org.aries.ui.event.Selected;
import org.aries.ui.event.Unselected;
import nam.model.Provider;
import nam.model.cacheProvider.CacheProviderPageManager;
import nam.model.messagingProvider.MessagingProviderPageManager;
import nam.model.persistenceProvider.PersistenceProviderPageManager;
import nam.model.util.ProviderUtil;
import nam.ui.design.SelectionContext;
@SessionScoped
@Named("providerPageManager")
public class ProviderPageManager extends AbstractPageManager<Provider> implements Serializable {
@Inject
private ProviderWizard providerWizard;
@Inject
private ProviderDataManager providerDataManager;
@Inject
private ProviderInfoManager providerInfoManager;
@Inject
private ProviderListManager providerListManager;
@Inject
private CacheProviderPageManager cacheProviderPageManager;
@Inject
private MessagingProviderPageManager messagingProviderPageManager;
@Inject
private PersistenceProviderPageManager persistenceProviderPageManager;
@Inject
private ProviderRecord_OverviewSection providerOverviewSection;
@Inject
private ProviderRecord_IdentificationSection providerIdentificationSection;
@Inject
private ProviderRecord_ConfigurationSection providerConfigurationSection;
@Inject
private ProviderRecord_DocumentationSection providerDocumentationSection;
@Inject
private ProviderRecord_CacheProvidersSection providerCacheProvidersSection;
@Inject
private ProviderRecord_MessagingProvidersSection providerMessagingProvidersSection;
@Inject
private ProviderRecord_PersistenceProvidersSection providerPersistenceProvidersSection;
@Inject
private SelectionContext selectionContext;
public ProviderPageManager() {
initializeSections();
}
public void refresh() {
refresh("provider");
}
public void refreshLocal() {
refreshLocal("provider");
}
public void refreshMembers() {
refreshMembers("provider");
}
public void refresh(String scope) {
refreshLocal(scope);
//refreshMembers(scope);
}
public void refreshLocal(String scope) {
providerDataManager.setScope(scope);
providerListManager.refresh();
}
public void refreshMembers(String scope) {
cacheProviderPageManager.refreshLocal(scope);
messagingProviderPageManager.refreshLocal(scope);
persistenceProviderPageManager.refreshLocal(scope);
}
public String getProviderListPage() {
return "/nam/model/provider/providerListPage.xhtml";
}
public String getProviderTreePage() {
return "/nam/model/provider/providerTreePage.xhtml";
}
public String getProviderSummaryPage() {
return "/nam/model/provider/providerSummaryPage.xhtml";
}
public String getProviderRecordPage() {
return "/nam/model/provider/providerRecordPage.xhtml";
}
public String getProviderWizardPage() {
return "/nam/model/provider/providerWizardPage.xhtml";
}
public String getProviderManagementPage() {
return "/nam/model/provider/providerManagementPage.xhtml";
}
public void handleProviderSelected(@Observes @Selected Provider provider) {
selectionContext.setSelection("provider", provider);
providerInfoManager.setRecord(provider);
}
public void handleProviderUnselected(@Observes @Unselected Provider provider) {
selectionContext.unsetSelection("provider", provider);
providerInfoManager.unsetRecord(provider);
}
public void handleProviderChecked() {
String scope = "providerSelection";
ProviderListObject listObject = providerListManager.getSelection();
Provider provider = selectionContext.getSelection("provider");
boolean checked = providerListManager.getCheckedState();
listObject.setChecked(checked);
if (checked) {
providerInfoManager.setRecord(provider);
selectionContext.setSelection(scope, provider);
} else {
providerInfoManager.unsetRecord(provider);
selectionContext.unsetSelection(scope, provider);
}
String target = selectionContext.getCurrentTarget();
if (target.equals("cacheProvider"))
cacheProviderPageManager.refreshLocal(scope);
if (target.equals("messagingProvider"))
messagingProviderPageManager.refreshLocal(scope);
if (target.equals("persistenceProvider"))
persistenceProviderPageManager.refreshLocal(scope);
refreshLocal(scope);
}
public String initializeProviderListPage() {
String pageLevelKey = "providerList";
clearBreadcrumbs(pageLevelKey);
addBreadcrumb(pageLevelKey, "Top", "showMainPage()");
addBreadcrumb(pageLevelKey, "Providers", "showProviderManagementPage()");
String url = getProviderListPage();
selectionContext.setCurrentArea("provider");
selectionContext.setSelectedArea(pageLevelKey);
selectionContext.setMessageDomain(pageLevelKey);
selectionContext.resetOrigin();
selectionContext.setUrl(url);
sections.clear();
return url;
}
public String initializeProviderTreePage() {
String pageLevelKey = "providerTree";
clearBreadcrumbs(pageLevelKey);
addBreadcrumb(pageLevelKey, "Top", "showMainPage()");
addBreadcrumb(pageLevelKey, "Providers", "showProviderTreePage()");
String url = getProviderTreePage();
selectionContext.setCurrentArea("provider");
selectionContext.setSelectedArea(pageLevelKey);
selectionContext.setMessageDomain(pageLevelKey);
selectionContext.resetOrigin();
selectionContext.setUrl(url);
sections.clear();
return url;
}
public String initializeProviderSummaryPage(Provider provider) {
String pageLevelKey = "providerSummary";
clearBreadcrumbs(pageLevelKey);
addBreadcrumb(pageLevelKey, "Top", "showMainPage()");
addBreadcrumb(pageLevelKey, "Providers", "showProviderSummaryPage()");
String url = getProviderSummaryPage();
selectionContext.setCurrentArea("provider");
selectionContext.setSelectedArea(pageLevelKey);
selectionContext.setMessageDomain(pageLevelKey);
selectionContext.resetOrigin();
selectionContext.setUrl(url);
sections.clear();
return url;
}
public String initializeProviderRecordPage() {
Provider provider = selectionContext.getSelection("provider");
String providerName = ProviderUtil.getLabel(provider);
String pageLevelKey = "providerRecord";
clearBreadcrumbs(pageLevelKey);
addBreadcrumb(pageLevelKey, "Top", "showMainPage()");
addBreadcrumb(pageLevelKey, "Providers", "showProviderManagementPage()");
addBreadcrumb(pageLevelKey, providerName, "showProviderRecordPage()");
String url = getProviderRecordPage();
selectionContext.setCurrentArea("provider");
selectionContext.setSelectedArea(pageLevelKey);
selectionContext.setMessageDomain(pageLevelKey);
selectionContext.resetOrigin();
selectionContext.setUrl(url);
initializeDefaultView();
sections.clear();
return url;
}
public String initializeProviderCreationPage(Provider provider) {
setPageTitle("New "+getProviderLabel(provider));
setPageIcon("/icons/nam/NewProvider16.gif");
setSectionTitle("Provider Identification");
providerWizard.setNewMode(true);
String pageLevelKey = "provider";
String wizardLevelKey = "providerWizard";
clearBreadcrumbs(pageLevelKey);
clearBreadcrumbs(wizardLevelKey);
addBreadcrumb(pageLevelKey, "Top", "showMainPage()");
addBreadcrumb(pageLevelKey, "Providers", "showProviderManagementPage()");
addBreadcrumb(pageLevelKey, new Breadcrumb("New Provider", "showProviderWizardPage()"));
addBreadcrumb(wizardLevelKey, "CacheProviders", "showProviderWizardPage('CacheProviders')");
addBreadcrumb(wizardLevelKey, "MessagingProviders", "showProviderWizardPage('MessagingProviders')");
addBreadcrumb(wizardLevelKey, "PersistenceProviders", "showProviderWizardPage('PersistenceProviders')");
providerIdentificationSection.setOwner("providerWizard");
providerConfigurationSection.setOwner("providerWizard");
providerDocumentationSection.setOwner("providerWizard");
providerCacheProvidersSection.setOwner("providerWizard");
providerMessagingProvidersSection.setOwner("providerWizard");
providerPersistenceProvidersSection.setOwner("providerWizard");
sections.clear();
sections.add(providerIdentificationSection);
sections.add(providerConfigurationSection);
sections.add(providerDocumentationSection);
sections.add(providerCacheProvidersSection);
sections.add(providerMessagingProvidersSection);
sections.add(providerPersistenceProvidersSection);
String url = getProviderWizardPage() + "?section=Identification";
selectionContext.setCurrentArea("provider");
selectionContext.setSelectedArea(pageLevelKey);
selectionContext.setMessageDomain(pageLevelKey);
//selectionContext.resetOrigin();
selectionContext.setUrl(url);
refreshLocal();
return url;
}
public String initializeProviderUpdatePage(Provider provider) {
setPageTitle(getProviderLabel(provider));
setPageIcon("/icons/nam/Provider16.gif");
setSectionTitle("Provider Overview");
String providerName = ProviderUtil.getLabel(provider);
providerWizard.setNewMode(false);
String pageLevelKey = "provider";
String wizardLevelKey = "providerWizard";
clearBreadcrumbs(pageLevelKey);
clearBreadcrumbs(wizardLevelKey);
addBreadcrumb(pageLevelKey, "Top", "showMainPage()");
addBreadcrumb(pageLevelKey, "Providers", "showProviderManagementPage()");
addBreadcrumb(pageLevelKey, new Breadcrumb(providerName, "showProviderWizardPage()"));
addBreadcrumb(wizardLevelKey, "CacheProviders", "showProviderWizardPage('CacheProviders')");
addBreadcrumb(wizardLevelKey, "MessagingProviders", "showProviderWizardPage('MessagingProviders')");
addBreadcrumb(wizardLevelKey, "PersistenceProviders", "showProviderWizardPage('PersistenceProviders')");
providerOverviewSection.setOwner("providerWizard");
providerIdentificationSection.setOwner("providerWizard");
providerConfigurationSection.setOwner("providerWizard");
providerDocumentationSection.setOwner("providerWizard");
providerCacheProvidersSection.setOwner("providerWizard");
providerMessagingProvidersSection.setOwner("providerWizard");
providerPersistenceProvidersSection.setOwner("providerWizard");
sections.clear();
sections.add(providerOverviewSection);
sections.add(providerIdentificationSection);
sections.add(providerConfigurationSection);
sections.add(providerDocumentationSection);
sections.add(providerCacheProvidersSection);
sections.add(providerMessagingProvidersSection);
sections.add(providerPersistenceProvidersSection);
String url = getProviderWizardPage() + "?section=Overview";
selectionContext.setCurrentArea("provider");
selectionContext.setSelectedArea(pageLevelKey);
selectionContext.setMessageDomain(pageLevelKey);
//selectionContext.resetOrigin();
selectionContext.setUrl(url);
refreshLocal();
return url;
}
public String initializeProviderManagementPage() {
setPageTitle("Providers");
setPageIcon("/icons/nam/Provider16.gif");
String pageLevelKey = "providerManagement";
clearBreadcrumbs(pageLevelKey);
addBreadcrumb(pageLevelKey, "Top", "showMainPage()");
addBreadcrumb(pageLevelKey, "Providers", "showProviderManagementPage()");
String url = getProviderManagementPage();
selectionContext.setCurrentArea("provider");
selectionContext.setSelectedArea(pageLevelKey);
selectionContext.setMessageDomain(pageLevelKey);
selectionContext.resetOrigin();
selectionContext.setUrl(url);
initializeDefaultView();
sections.clear();
return url;
}
public void initializeDefaultView() {
setPageTitle("Providers");
setPageIcon("/icons/nam/Provider16.gif");
setSectionType("provider");
setSectionName("Overview");
setSectionTitle("Overview of Providers");
setSectionIcon("/icons/nam/Overview16.gif");
String viewLevelKey = "providerOverview";
clearBreadcrumbs(viewLevelKey);
addBreadcrumb(viewLevelKey, "Top", "showMainPage()");
addBreadcrumb(viewLevelKey, "Providers", "showProviderManagementPage()");
String scope = "projectList";
refreshLocal(scope);
sections.clear();
}
public String initializeProviderCacheProvidersView() {
setSectionType("provider");
setSectionName("CacheProviders");
setSectionTitle("CacheProviders");
setSectionIcon("/icons/nam/CacheProvider16.gif");
selectionContext.setMessageDomain("providerCacheProviders");
cacheProviderPageManager.refreshLocal("providerSelection");
refreshLocal("projectList");
sections.clear();
return null;
}
public String initializeProviderMessagingProvidersView() {
setSectionType("provider");
setSectionName("MessagingProviders");
setSectionTitle("MessagingProviders");
setSectionIcon("/icons/nam/MessagingProvider16.gif");
selectionContext.setMessageDomain("providerMessagingProviders");
messagingProviderPageManager.refreshLocal("providerSelection");
refreshLocal("projectList");
sections.clear();
return null;
}
public String initializeProviderPersistenceProvidersView() {
setSectionType("provider");
setSectionName("PersistenceProviders");
setSectionTitle("PersistenceProviders");
setSectionIcon("/icons/nam/PersistenceProvider16.gif");
selectionContext.setMessageDomain("providerPersistenceProviders");
persistenceProviderPageManager.refreshLocal("providerSelection");
refreshLocal("projectList");
sections.clear();
return null;
}
public String initializeProviderSummaryView(Provider provider) {
//String viewTitle = getProviderLabel(provider);
//String currentArea = selectionContext.getCurrentArea();
setSectionType("provider");
setSectionName("Summary");
setSectionTitle("Summary of Provider Records");
setSectionIcon("/icons/nam/Provider16.gif");
String viewLevelKey = "providerSummary";
clearBreadcrumbs(viewLevelKey);
addBreadcrumb(viewLevelKey, "Top", "showMainPage()");
addBreadcrumb(viewLevelKey, "Providers", "showProviderManagementPage()");
selectionContext.setMessageDomain(viewLevelKey);
sections.clear();
return null;
}
protected String getProviderLabel(Provider provider) {
String label = "Provider";
String name = ProviderUtil.getLabel(provider);
if (name == null && provider.getName() != null)
name = ProviderUtil.getLabel(provider);
if (name != null && !name.isEmpty())
label = name + " " + label;
return label;
}
protected void updateState() {
AbstractWizardPage<Provider> page = providerWizard.getPage();
if (page != null)
setSectionTitle("Provider " + page.getName());
}
protected void updateState(Provider provider) {
String providerName = ProviderUtil.getLabel(provider);
setSectionTitle(providerName + " Provider");
}
}
|
PHP
|
UTF-8
| 670 | 2.875 | 3 |
[
"MIT"
] |
permissive
|
<?php
/**
* Description of IMDBBiriani
* @author shiplu
*/
class IMDBBiriani extends HTMLBiriani {
public function extract(){
$data = parent::extract();
// now collect the release date
$xpath = new DOMXPath($this->dom);
$times = $xpath->query('//time[@itemprop= "datePublished"]');
$time = strtotime($times->item(0)->nodeValue);
$data->set_date($time);
return $data;
}
public static function can_extract(Biriani_Response $response) {
// imdb does not have https url
preg_match("#^http://www.imdb.com/(title|name|list)/([^/]+)#", $response->get_url(), $m);
return (is_array($m) && isset($m[1]) && isset($m[2]));
}
}
|
SQL
|
UTF-8
| 2,136 | 2.984375 | 3 |
[] |
no_license
|
-- phpMyAdmin SQL Dump
-- version 4.8.5
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Feb 03, 2020 at 09:52 PM
-- Server version: 10.1.38-MariaDB
-- PHP Version: 7.3.3
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Database: `aertrip`
--
-- --------------------------------------------------------
--
-- Table structure for table `users`
--
CREATE TABLE `users` (
`id` int(11) NOT NULL,
`firstname` varchar(255) NOT NULL,
`lastname` varchar(255) NOT NULL,
`email` varchar(255) NOT NULL,
`mobile` varchar(255) NOT NULL,
`type` enum('admin','FE','app','consumers') NOT NULL,
`password` varchar(255) NOT NULL,
`created` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`modified` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `users`
--
INSERT INTO `users` (`id`, `firstname`, `lastname`, `email`, `mobile`, `type`, `password`, `created`, `modified`) VALUES
(13, 'Sandesh', 'Bhalekar', 'sandesh1@yopmail.com', '9867273605', 'FE', '$2y$10$uW7GoC5y6ucLLyDyA1MH8OKP/z91Rxq2n4f8MqSLPaW7Be7LwFT8e', '2020-02-04 00:58:21', '2020-02-03 19:43:43'),
(14, 'Sandesh', 'Bhalekar', 'sandesh2@yopmail.com', '9867273605', 'consumers', '$2y$10$ifZCXCRp2ulx3NHyBIJ47.EZ4Suj4br0HcbRSxwdZEQ7dJa8fySyG', '2020-02-04 01:26:49', '2020-02-03 19:56:49');
--
-- Indexes for dumped tables
--
--
-- Indexes for table `users`
--
ALTER TABLE `users`
ADD PRIMARY KEY (`id`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `users`
--
ALTER TABLE `users`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=15;
COMMIT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
Markdown
|
UTF-8
| 18,121 | 2.734375 | 3 |
[] |
no_license
|
---
title: 'Is Algorithmic Specified Complexity Useless for Analyzing Evolution?'
date: '2019-12-05 12:00:00 -07:00'
author: Joe Felsenstein
---
<figure>
              <img src="{{ site.baseurl }}/uploads/2019/HouseAtPoohCorner.jpg" width="254px">              <br>
<figcaption>
</figcaption>
</figure>
<p>
Eric Holloway has been asserting that William Dembski's arguments
about conservation of Complex Specified Information are valid, that they have
never been validly refuted. These include Dembski's original (2002)
argument about CSI in his book
<em>No Free Lunch: Why Specified Complexity Cannot Be Purchased without
Intelligence</em>,
Dembski's (2005) <a href="https://billdembski.com/documents/2005.06.Specification.pdf"><strong>revision of his original
argument</strong></a>
as well as Dembski and Marks's
(2009) <a href="https://evoinfo.org/publications/cost-of-success-in-search.html"><strong>argument involving "active information"</strong></a>.
Holloway has also made this sweeping claim at the blog
The Skeptical Zone, where he has debated his critics (<a href="http://theskepticalzone.com/wp/breaking-the-law-of-information-non-growth/"><strong>here</strong></a>, <a href="http://theskepticalzone.com/wp/evo-info-4-non-conservation-of-algorithmic-specified-complexity/comment-page-1/#comment-237769"><strong>here</strong></a>,
<a href="http://theskepticalzone.com/wp/correspondences-between-id-theory-and-mainstream-theories/"><strong>here</strong></a>,
and <a href="http://theskepticalzone.com/wp/rejected-for-ideology-only/comment-page-2/#comment-263458"><strong>here</strong></a>).
In addition he has made this
broad claim about lack of any sensible criticism of CSI arguments
<a href="https://mindmatters.ai/2018/10/does-information-theory-support-design-in-nature/"><strong>at the site Mind Matters</strong></a>, sponsored by the Discovery Institute's
Walter Bradley Center. His arguments have been commented on favorably
in posts at the antievolution site Uncommon Descent (<a href="https://uncommondescent.com/intelligent-design/does-information-theory-support-design-in-nature/"><strong>here</strong></a> and <a href="https://uncommondescent.com/evolution/eric-holloway-atheists-agnostics-more-skeptical-of-evolution-now/"><strong>here</strong></a>)
where Holloway has agreed with their characterization of what he has accomplished.
</p><p>
When questioned on his logic, Holloway does not actually defend Dembski's original version of CSI, or Dembski's modified version of CSI.
Instead he
points to the concept of Algorithmic Specified
Complexity, arguing that this is the essential part of the
proof that Complex Specified Information is conserved, and hence that
observation of this version of CSI implies Design.
</p><p>
But no one has asked
whether it makes sense to use ASC in arguments about a law preventing gain of information
in evolution. Holloway's argument that theorems about ASC apply also to CSI
leaves one with the impression that those theorems somehow prove that, as
Dembski (2002) said, "complex specified information cannot be purchased without
intelligence".
</p><p>
Let me say flatly: I don't think that it does make sense. And if I am right about that, we can
ignore most of the debate about conservation of ASC as irrelevant to arguments about
whether normal evolutionary processes can accumulate information in the genome.
</p><p>
Why do I think that ASC is irrelevant to establishing conservation of CSI in all these arguments? Let me explain.
</p>
<!--more-->
<p>
<strong>Algorithmic Specified Complexity </strong>
</p><p>
Algorithmic Specified Complexity (ASC) is a use of Kolmogorov/Chaitin/Solomonoff (KCS)
Complexity, a measure of how short a computer program can compute a binary
string (a binary number). By a
simple counting argument, those authors were able to show that binary strings that could
be computed by short computer programs were rare, and that binary strings that had no
such simple description were common. They argued that that it was those, the
binary strings
that could not be described by short computer programs, that could be regarded as "random".
</p><p>
It is possible to prove theorems, in effect about conservation of the shortness of the
program. A very rough handwavy version of those conservation arguments is just to note that if a
binary string can be computed by a short computer program, and if we then make a transformation
of the binary string, the new string can be computed by the original short
program followed by another short one that carries out the transformation.
</p><p>
ASC reflects shortness of the computer program.
In simple cases, the ASC of a binary string is its "randomness deficiency", its
length, <em>n</em>, less the length of
the shortest program that gives it as its output.
That means that to get a genome (or binary string) that has a large amount of ASC,
it needs long string that is computed by a short program. To get a moderate
amount of ASC, one could have a long string computed by medium-length program,
or a medium-length string computed by a short program. Randomness deficiency
was invented by information theory researcher Leonid Levin and is discussed by him in a 1984 paper
(<a href="https://core.ac.uk/download/pdf/82092683.pdf"><strong>here</strong></a>). Definitions and explanations of
ASC will be found in the papers by
<a href="https://robertmarks.org/REPRINTS/2013_OnTheImprobabilityOfAlgorithmicSpecifiedComplexity.pdf"><strong>Ewert, Marks, and Dembski (2013)</strong></a>,
and <a href="https://www.robertmarks.org/REPRINTS/2014_AlgorithmicSpecifiedComplexity.pdf"><strong>Ewert, Dembski and Marks (2014)</strong></a>.
Nemati and Holloway have recently published <a href="https://www.bio-complexity.org/ojs/index.php/main/article/view/BIO-C.2019.2/BIO-C.2019.2"><strong>a scientific paper</strong></a> at the Discovery Institute's house journal BIO-Complexity, presenting a proof of conservation of ASC. There has been discussion at The Skeptical Zone of the technical issues with ASC -- is it conserved or is it not? In particular,
Tom English (<a href="http://theskepticalzone.com/wp/evo-info-4-non-conservation-of-algorithmic-specified-complexity"><strong>here</strong></a> and <a href="http://theskepticalzone.com/wp/non-conservation-of-algorithmic-specified-complexity"><strong>here</strong></a>) has presented
detailed mathematical argument at The Skeptical Zone showing simple cases which are
counterexamples to the claims by Nemati and Holloway, and has identified errors in their proof. See also the comments by English in the discussion on those posts.
</p><p>
But the real question is not whether the randomness deficiency is conserved,
or whether the shortness of the program is conserved, but
whether that implies that an evolutionary process in a population of genomes
is thereby somehow constrained. Do the theorems about ASC somehow show us that
ordinary evolutionary processes cannot achieve high levels of adaptation?
</p><p>
<strong>Pooish Puzzlements</strong>
</p><p>
At this stage in the argument, I confess myself puzzled. I hope that the
readers here will help me out with this. I confess myself very fallible on these
subjects. As Pooh said:
</p><blockquote>
When you are a Bear of Very Little Brain, and you Think of Things, you find sometimes that a Thing which seemed very Thingish
inside you is quite different when it gets out into the open and has other
people looking at it.<br>
A. J. Milne, <em>The House at Pooh Corner</em>, 1928
</blockquote>
Bumbling around in Pooish fashion, I have trouble seeing how ASC
has any connection to limits on evolution. Why use ASC as something that indicates design? There is a puzzle here. Is simply-described
structure somehow difficult for an evolving system to achieve? Is it somehow
desirable? Is evolution succeeding in achieving adaptations, in increasing fitness,
only to the extent that it brings about organisms that are simply describable?
Or to the extent that it brings about organisms that are <em>not</em> simply
describable? I don't think that Holloway has at all made this clear.
<p>
For that matter, there is another Pooish muddle in my brain. What is it that the computation is computing? A binary string representing the genotype?
Or a binary string representing the phenotype? All
of this is left distressingly unclear in the ASC arguments,
however meticulously the
conservation of the ASC quantity may (or may not) be proven.
</p><p>
<strong>A Pooish Brainwave</strong>
</p><p>
Well perhaps, I thought, there really is a rationale for the ASC criterion.
Perhaps we are talking about the complexity of living organisms, and the
conservation of ASC shows that it is very difficult for ordinary evolutionary
processes to achieve genotypes or phenotypes that are complex. This seemed
like a promising direction for exploration, until I realized that it is
backwards. Backwards because <em>ASC does not increase with complexity, it
increases with greater simplicity of description.</em>
Far from arguing
that complexity cannot be achieved by natural evolutionary processes, the
arguments that high ASC is difficult to achieve seem instead to be trying to
show that biological systems cannot achieve simplicity.
</p><p>
<strong>Another Issue</strong>
</p><p>
Specified-complexity arguments about evolution have another problem.
Whether they are for ASC or for the
earlier criterion CSI, the change of the genotype under normal evolutionary
processes is modeled by a function applied to the genotype. This might be
a description of what mutation does to a genome, if we allow random functions.
But it is not a good description
of natural selection. In natural selection, a population of individuals of different genotypes
survives and reproduces, and those individuals with higher fitness are proportionately more likely to
survive and reproduce. It is not a matter of applying some arbitrary function to a single
genotype, but of using
the fitnesses of more than one genotype to choose among the results of changes of genotype. Thus
modeling biological evolution by functions applied to individual genotypes is
a totally inadequate way of describing evolution. And it is fitness, not
simplicity of description or complexity of description, that is critical.
Natural selection cannot work in a population that always contains
only one individual. To model the effect of natural selection,
one must have genetic variation in a population of more than one individual.
</p><p>
<strong>CSI and conservation arguments</strong>
</p><p>
In the case where we do not use ASC, but use Complex Specified Information, the
Specified Information (SI) quantity is intrinsically meaningful. Whether or not it is conserved,
at least the relevance of the quantity
is easy to establish. In William Dembski's original argument that the
presence of CSI indicates Design (2002) the specification is defined on a scale
that is basically fitness. Dembski (2002, p. 148) notes that
</p><blockquote>
The specification of organisms can be cashed out in any number of ways.
Arno Wouters cashes it out globally in terms of the <em>viability</em> of whole
organisms. Michael Behe cashes it out in terms of the <em>minimal function</em>
of biochemical systems. Darwinist Richard Dawkins cashes out biological
specification in terms of the <em>reproduction</em> of genes. Thus in <em>The
Blind Watchmaker</em> Dawkins writes "Complicated things have some
quality, specifiable in advance, that is highly unlikely to have been acquired
by random chance alone. In the case of living things, the quality that is
specified in advance is ... the ability to propagate genes in
reproduction."
</blockquote>
The scale on which SI is defined is basically either a scale of fitnesses of
genotypes, or a closely-related one that is a component of fitness such
as viability. It is a quantity that may or may not be difficult to
increase, but there is little doubt that increasing it is desirable,
and that genotypes that have higher values on those specification
scales will make a larger contribution to the gene pool of the next
generation.
<p>
If a conservation law can be established that
shows that a population cannot end up in a state of high fitness
without already having started with fitness at least that high,
it will have shown that there is a barrier to achieving that
state by normal evolutionary processes such as natural selection.
But, alas for William Dembski and company, the
conservation of CSI is basically unprovable in the form that would be needed to show that (for an accessible argument, see
<a href="https://ncse.ngo/has-natural-selection-been-refuted-arguments-william-dembski"><strong>
see my article on that</strong></a>). I have also shown in a straightforward
population genetics calculation <a href="http://theskepticalzone.com/wp/natural-selection-can-put-functional-information-into-the-genome/"><strong>at The Skeptical Zone</strong></a>
that natural selection can increase Specified Information, with no
barrier in that simple case to making the SI high enough to be Complex Specified Information.
</p><p>
<strong>"Complexity"</strong>
</p><p>
The use of the word "Complex" in both concepts is confusing. It was actually
first associated with Specified Information by Leslie Orgel, who invented
Specified Information. In his case, and in subsequent uses, high complexity
means that the organism is not a simple crystal with repeating structure, but
is more complicated. He uses the length of a description of the organism
to make this distinction. But his approach is not like the KCS complexity
measure -- he does not discuss how long a description would be needed for
a random bit string.
In the CSI measure, a genotype has "complex" specified information when
its fitness is sufficiently high, whether or not that is associated with complicated
phenotypes or with a long genome.
The name
Algorithmic Specified Complexity is even more confusing. ASC is a number that
is high when the bit string that describes the organism is long, but
can be computed by a relatively short program. I think. Or perhaps when the
bit string which encodes the genome of the organism is long, but can be computed
by a relatively short program. If anything
is needed, it is a careful discussion of how ASC relates to the length of
the genome, the length of a description of the phenotype, to fitness, and to
achieving a complicated structure.
</p><p>
I suggest that no connection of ASC to fitness is possible. Whether or not I am
right about that, the matter needs to be addressed before anyone
can say that there is conservation of ASC, and that this shows that
there some limit to the ability of evolutionary processes to
achieve adaptation or to increase the fitness of organisms.
</p><p>
<strong>Conclusions</strong>
</p><p>
1. There is no known correlation between fitness, or any other measure
of degree of adaptation, and the simplicity with which we can describe
an organism's genotype or phenotype.
</p><p>
2. A proof that the high levels of fitness that we see in living
organisms cannot be achieved by evolutionary processes such as
natural selection would be a major refutation of modern evolutionary
biology. William Dembski's Law of Conservation of Complex Specified
Information attempted such a proof, but this proof fails, and Dembski's
LCCSI is no longer discussed by proponents of Intelligent Design,
except in occasional mistaken assertions that such a law has been proven
in a form that shows that high levels of fitness cannot be achieved from lower ones.
</p><p>
3. By contrast, the ASC algorithmic complexity measure is
argued to have proofs that can
be made that, in effect, constrain how large a "randomness
deficiency" can be achieved; in effect, how simple an algorithm can be achieved.
Those purported proofs are disputed, with counterexamples
provided by Tom English.
</p><p>
4. Nevertheless, it has
become common to argue that the alleged conservation of
ASC shows that there are limits on what
evolution can do. Holloway, <em>Uncommon Descent</em>, and the
Discovery Institute's website <em>Mind Matters</em> have all bought into this.
</p><p>
5. However, the connection to evolution is lacking.
There is actually no explanation as what the short computer program is computing.
Is the issue how simple an algorithm is needed to compute a
binary string which represents the genome?
It is not hard to imagine
a binary string which has
one pair of bits for each base in the genome.
Is it that binary string
that is being computed? Or is the issue
how simple an algorithm is needed to compute a detailed
description of the individual's phenotype?
This uncertainty
has <em>not been addressed at all</em> in the ASC
arguments about evolving systems, rendering those arguments
even more meaningless.
</p><p>
6. If, as I argue, there is no correlation between high ASC and high fitness,
then natural selection will not tend to bring about high values of
ASC (hence simpler descriptions of whatever-it-is that is being described),
because there will be no
fitness reward for doing so. Observing organisms that are
well-adapted, we can be reasonably sure that they have high
Specified Information, where the specification is fitness. But
<em>we have no reason to believe that they have high ASC</em>.
In finding
that they have high fitness, that they are in some sense well-adapted, we have
not observed anything that is relevant to how simple
or how non-simple are any descriptions of their genotypes or phenotypes.
</p><p>
7. We may conclude that
even if ASC of organisms could somehow be defined, and even if
some limit on its change could somehow be proven,
the non-increase of ASC would not establish any
limits on what natural selection can do to improve fitness.
</p>
<em>Thanks to Tom English for helpful comments on an earlier draft of this post.</em>
|
PHP
|
UTF-8
| 37,467 | 2.5625 | 3 |
[
"MIT",
"AGPL-3.0-only",
"GPL-1.0-or-later",
"LicenseRef-scancode-other-copyleft",
"AGPL-3.0-or-later"
] |
permissive
|
<?php
/***********************************************************************************
* X2Engine Open Source Edition is a customer relationship management program developed by
* X2 Engine, Inc. Copyright (C) 2011-2019 X2 Engine Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY X2ENGINE, X2ENGINE DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact X2Engine, Inc. P.O. Box 610121, Redwood City,
* California 94061, USA. or at email address contact@x2engine.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* X2 Engine" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by X2 Engine".
**********************************************************************************/
/**
* Consolidated class for common string formatting and parsing functions.
*
* @package application.components
*/
class Formatter {
/**
* Removes invalid/corrupt multibyte sequences from text.
*/
public static function mbSanitize($text) {
$newText = $text;
if (!mb_detect_encoding($text, Yii::app()->charset, true)) {
$newText = mb_convert_encoding($text, Yii::app()->charset, 'ISO-8859-1');
}
return $newText;
}
/**
* Return a value cast after a named PHP type
* @param type $value
* @param type $type
* @return type
*/
public static function typeCast($value,$type) {
switch($type) {
case 'bool':
case 'boolean':
return (boolean) $value;
case 'double':
return (double) $value;
case 'int':
case 'integer':
return (integer) $value;
default:
return (string) $value;
}
}
/**
* Converts a record's Description or Background Info to deal with the discrepancy
* between MySQL/PHP line breaks and HTML line breaks.
*/
public static function convertLineBreaks($text, $allowDouble = true, $allowUnlimited = false){
if(preg_match("/<br \/>/", $text)){
$text = preg_replace("/<\/b>/", "</b><br />", $text, 1);
$text = preg_replace("/\s<b>/", "<br /><b>", $text, 1);
return $text;
}
$text = mb_ereg_replace("\r\n", "\n", $text); //convert microsoft's stupid CRLF to just LF
if(!$allowUnlimited) {
// replaces 2 or more CR/LF chars with just 2
$text = mb_ereg_replace("[\r\n]{3,}", "\n\n", $text);
}
if($allowDouble) {
// replaces all remaining CR/LF chars with <br />
$text = mb_ereg_replace("[\r\n]", '<br />', $text);
} else {
$text = mb_ereg_replace("[\r\n]+", '<br />', $text);
}
return $text;
}
/**
* Parses a "formula" for the flow.
*
* If the first character in a string value in X2Flow is the "=" character, it
* will be treated as valid PHP code to be executed. This function uses {@link getSafeWords}
* to determine a list of functions which the user can execute in the code,
* and strip any which are not allowed. This should generally be used for
* mathematical operations, like calculating dynamic date offsets.
*
* @param string $input The code to be executed
* @param array $params Optional extra parameters, notably the Model triggering the flow
* @return array An array with the first element true or false corresponding to
* whether execution succeeded, the second, the value returned by the formula.
*/
public static function parseFormula($input, array $params = array()){
if(strpos($input,'=') !== 0) {
return array(false,Yii::t('admin','Formula does not begin with "="'));
}
$formula = substr($input, 1); // Remove the "=" character from in front
$replacementTokens = static::getReplacementTokens ($formula, $params, false, false);
// Run through all short codes and ensure they're proper PHP expressions
// that correspond to their value, i.e. strings will become string
// expressions, integers will become integers, etc.
//
// This step is VITALLY IMPORTANT to the security and stability of
// X2Flow's formula parsing.
foreach(array_keys($replacementTokens) as $token) {
$type = gettype($replacementTokens[$token]);
if(!in_array($type,array("boolean","integer","double","string","NULL"))) {
// Safeguard against "array to string conversion" and "warning,
// object of class X could not be converted to string" errors.
// This case shouldn't happen and is not valid, so nothing
// smarter need be done here than to simply set the replacement
// value to its corresponding token.
$replacementTokens[$token] = var_export($token,true);
} else if ($type === 'string') {
// Escape/convert values into valid PHP expressions
$replacementTokens[$token] = var_export($replacementTokens[$token],true);
}
}
// Prepare formula for eval:
if(strpos($formula, ';') !== strlen($formula) - 1){
// Eval requires a ";" at the end to execute properly
$formula .= ';';
}
if(strpos($formula, 'return ') !== 0){
// Eval requires a "return" at the front.
$formula = 'return '.$formula;
}
// Validity check: ensure the formula only consists of "safe" functions,
// the existing variable tokens, spaces, and PHP operators:
foreach(array_keys($replacementTokens) as $token) {
$shortCodePatterns[] = preg_quote($token,'#');
}
// PHP operators
$charOp = '[\[\]()<>=!^|?:*+%/\-\.]';
$charOpOrWhitespace = '(?:'.$charOp.'|\s)';
$phpOper = implode ('|', array (
$charOpOrWhitespace,
$charOpOrWhitespace.'and',
$charOpOrWhitespace.'or',
$charOpOrWhitespace.'xor',
$charOpOrWhitespace.'false',
$charOpOrWhitespace.'true',
));
// allow empty string '' and prevent final single quote from being escaped
$singleQuotedString = '\'\'|\'[^\']*[^\\\\\']\''; // Only simple strings currently supported
$number = $charOpOrWhitespace.'[0-9]+(?:\.[0-9]+)?';
$validPattern = '#^return(?:'
.self::getSafeWords($charOpOrWhitespace)
.(empty($shortCodePatterns)?'':('|'.implode('|',$shortCodePatterns)))
.'|'.$phpOper
.'|'.$number
.'|'.$singleQuotedString.')*;$#i';
if(!preg_match($validPattern,$formula)) {
return array(
false,
Yii::t('admin','Input evaluates to an invalid formula: ').
strtr($formula,$replacementTokens));
}
try{
$retVal = @eval(strtr($formula,$replacementTokens));
}catch(Exception $e){
return array(
false,
Yii::t('admin','Evaluated statement encountered an exception: '.$e->getMessage()));
}
return array(true,$retVal);
}
/**
* Returns a list of safe functions for formula parsing
*
* This function will generate a string to be inserted into the regex defined
* in the {@link parseFormula} function, where each function not listed in the
* $safeWords array here will be stripped from code execution.
* @return String A string with each function listed as to be inserted into
* a regular expression.
*/
private static function getSafeWords($prefix){
$safeWords = array(
$prefix.'echo[ (]',
$prefix.'time[ (]',
);
return implode('|',$safeWords);
}
/**
* Parses text for short codes and returns an associative array of them.
*
* @param string $value The value to parse
* @param X2Model $model The model on which to operate with attribute replacement
* @param bool $renderFlag The render flag to pass to {@link X2Model::getAttribute()}
* @param bool $makeLinks If the render flag is set, determines whether to render attributes
* as links
*/
protected static function getReplacementTokens(
$value, array $params, $renderFlag, $makeLinks) {
if (!isset ($params['model'])) throw new CException ('Missing model param');
$model = $params['model'];
// Pattern will match {attr}, {attr1.attr2}, {attr1.attr2.attr3}, etc.
$codes = array();
// Types of each value for the short codes:
$codeTypes = array();
$fieldTypes = array_map(function($f){return $f['phpType'];},Fields::getFieldTypes());
$fields = $model->getFields(true);
// check for variables
preg_match_all('/{([a-z]\w*)(\.[a-z]\w*)*?}/i', trim($value), $matches);
if(!empty($matches[0])){
foreach($matches[0] as $match){
$match = substr($match, 1, -1); // Remove the "{" and "}" characters
$attr = $match;
if(strpos($match, '.') !== false){
// We found a link attribute (i.e. {company.name})
$newModel = $model;
$pieces = explode('.',$match);
$first = array_shift($pieces);
$codes['{'.$match.'}'] = $newModel->getAttribute(
$attr, $renderFlag, $makeLinks);
$codeTypes[$match] = isset($fields[$attr])
&& isset($fieldTypes[$fields[$attr]->type])
? $fieldTypes[$fields[$attr]->type]
: 'string';
}else{ // Standard attribute
// Check if the attribute exists on the model
if($model->hasAttribute($match)){
$codes['{'.$match.'}'] = $model->getAttribute(
$match, $renderFlag, $makeLinks);
$codeTypes[$match] = isset($fields[$match])
&& isset($fieldTypes[$fields[$match]->type])
? $fieldTypes[$fields[$match]->type]
: 'string';
}
}
}
}
$codes = self::castReplacementTokenTypes ($codes, $codeTypes);
return $codes;
}
protected static function castReplacementTokenTypes (array $codes, array $codeTypes) {
// ensure that value of replacement token is of an acceptable type
foreach ($codes as $name => $val) {
if(!in_array(gettype ($val),array("boolean","integer","double","string","NULL"))) {
// remove invalid value
unset ($codes[$name]);
} elseif(isset($codeTypes[$name])) {
$codes[$name] = self::typeCast($val, $codeTypes[$name]);
}
}
return $codes;
}
/**
* Restore any special characters necessary for insertableAttributes that
* may be mangled by HTMLPurifier
* @param string $text
*/
public static function restoreInsertableAttributes($text) {
$characters = array(
'%7B' => '{',
'%7D' => '}',
);
return strtr ($text, $characters);
}
/* * * Date Format Functions ** */
/**
* A function to convert a timestamp into a string stated how long ago an object
* was created.
*
* @param $timestamp The time that the object was posted.
* @return String How long ago the object was posted.
*/
public static function timestampAge($timestamp){
$age = time() - strtotime($timestamp);
//return $age;
if($age < 60) {
// less than 1 min ago
return Yii::t('app', 'Just now');
}
if($age < 3600) {
// minutes (less than an hour ago)
return Yii::t('app', '{n} minutes ago', array('{n}' => floor($age / 60)));
}
if($age < 86400) {
// hours (less than a day ago)
return Yii::t('app', '{n} hours ago', array('{n}' => floor($age / 3600)));
}
// days (more than a day ago)
return Yii::t('app', '{n} days ago', array('{n}' => floor($age / 86400)));
}
/**
* Format a date to be long (September 25, 2011)
* @param integer $timestamp Unix time stamp
*/
public static function formatLongDate($timestamp){
if(empty($timestamp)) {
return '';
} else {
return Yii::app()->dateFormatter->format(
Yii::app()->locale->getDateFormat('long'), $timestamp);
}
}
/**
* Converts a yii date format string to a jquery ui date format string
* For each of the format string specifications, see:
* http://www.yiiframework.com/doc/api/1.1/CDateTimeParser
* http://api.jqueryui.com/datepicker/
*/
public static function yiiDateFormatToJQueryDateFormat ($format) {
$tokens = CDateTimeParser::tokenize ($format);
$jQueryFormat = '';
foreach($tokens as $token) {
switch($token) {
case 'yyyy':
case 'y':
$jQueryFormat .= 'yy';
break;
case 'yy':
$jQueryFormat .= 'y';
break;
case 'MMMM':
$jQueryFormat .= $token;
break;
case 'MMM':
$jQueryFormat .= 'M';
break;
case 'MM':
$jQueryFormat .= 'mm';
break;
case 'M':
$jQueryFormat .= 'm';
break;
case 'dd':
$jQueryFormat .= $token;
break;
case 'd':
$jQueryFormat .= $token;
break;
case 'h':
case 'H':
$jQueryFormat .= $token;
break;
case 'hh':
case 'HH':
$jQueryFormat .= $token;
break;
case 'm':
$jQueryFormat .= $token;
break;
case 'mm':
$jQueryFormat .= $token;
break;
case 's':
$jQueryFormat .= $token;
break;
case 'ss':
$jQueryFormat .= $token;
break;
case 'a':
$jQueryFormat .= $token;
break;
default:
$jQueryFormat .= $token;
break;
}
}
return $jQueryFormat;
}
/**
* Format dates for the date picker.
* @param string $width A length keyword, i.e. "medium"
* @return string
*/
public static function formatDatePicker($width = ''){
if(Yii::app()->locale->getId() == 'en'){
if($width == 'medium')
return "M d, yy";
else
return "MM d, yy";
} else{
$format = self::yiiDateFormatToJQueryDateFormat (
Yii::app()->locale->getDateFormat('medium'));
return $format;
}
}
public static function secondsToHours ($seconds) {
$decHours = $seconds / 3600;
return Yii::t(
'app', '{decHours} hours',
array ('{decHours}' => sprintf('%0.2f', $decHours)));
}
/**
* Formats a time interval.
*
* @param integer $start Beginning of the interval
* @param integer $duration Length of the interval
*/
public static function formatTimeInterval(
$start,$end,$style=null, $dateFormat='long', $timeFormat='medium') {
$duration = $end-$start;
$decHours = $duration/3600;
$intHours = (int) $decHours;
$intMinutes = (int) (($duration % 3600) / 60);
if(empty($style)){
// Default format
$style = Yii::t('app', '{decHours} hours, starting {start}');
}
// Custom format
return strtr($style, array(
'{decHours}' => sprintf('%0.2f', $decHours),
'{hoursColMinutes}' => sprintf('%d:%d',$intHours,$intMinutes),
'{hours}' => $intHours,
'{minutes}' => $intMinutes,
'{hoursMinutes}' => $intHours ?
sprintf('%d %s %d %s', $intHours, Yii::t('app', 'hours'),
$intMinutes, Yii::t('app', 'minutes')) :
sprintf('%d %s', $intMinutes, Yii::t('app', 'minutes')),
'{quarterDecHours}' => sprintf(
'%0.2f '.Yii::t('app', 'hours'),
round($duration / 900.0) * 0.25),
'{start}' => Yii::app()->dateFormatter->formatDateTime(
$start, $dateFormat, $timeFormat),
'{end}' => Yii::app()->dateFormatter->formatDateTime(
$end, $dateFormat, $timeFormat),
));
}
/**
* Formats time for the time picker.
*
* @param string $width
* @return string
*/
public static function formatTimePicker($width = '',$seconds = false){
/*if(Yii::app()->locale->getLanguageId(Yii::app()->locale->getId()) == 'zh'){
return "HH:mm".($seconds?':ss':'');
}*/
$format = Yii::app()->locale->getTimeFormat($seconds?'medium':'short');
// jquery specifies hours/minutes as hh/mm instead of HH//MM
//$format = strtolower($format);
// yii and jquery have different format to specify am/pm
$format = str_replace('a', 'TT', $format);
return $format;
}
/**
* Formats a full name according to the name format settigns
* @param type $firstName
* @param type $lastName
*/
public static function fullName($firstName,$lastName) {
return !empty(Yii::app()->settings->contactNameFormat) ?
strtr(Yii::app()->settings->contactNameFormat, compact('lastName', 'firstName')) :
"$firstName $lastName";
}
/**
* Generates a column clause using CONCAT based on the full name format as
* defined in the general settings
*
* @param type $firstNameCol
* @param type $lastNameCol
* @param type $as
* @return array An array with the first element being the SQL, the second any parameters to
* bind.
*/
public static function fullNameSelect($firstNameCol,$lastNameCol,$as=false) {
$pre = ':fullName_'.uniqid().'_';
$columns = array(
'firstName' => $firstNameCol,
'lastName' => $lastNameCol,
);
$format = empty(Yii::app()->settings->contactNameFormat)
? 'firstName lastName'
: Yii::app()->settings->contactNameFormat;
$placeholderPositions = array();
foreach($columns as $placeholder => $columnName) {
if(($pos = mb_strpos($format,$placeholder)) !== false) {
$placeholderPositions[$placeholder] = $pos;
}
}
asort($placeholderPositions);
$concatItems = array();
$params = array();
$lenTot = mb_strlen($format);
$n_p = 0;
$pos = 0;
foreach($placeholderPositions as $placeholder => $position){
// Get extraneous text into a parameter:
if($position > $pos){
$leadIn = mb_substr($format,$pos,$position-$pos);
if(!empty($leadIn)) {
$concatItems[] = $param = "{$pre}_inter_$n_p";
$params[$param] = $leadIn;
$n_p++;
}
$pos += mb_strlen($leadIn);
}
$concatItems[] = "`{$columns[$placeholder]}`";
$pos += mb_strlen($placeholder);
}
if($pos < $lenTot-1) {
$trailing = mb_substr($format,$pos);
$concatItems[] = $param = "{$pre}_trailing";
$params[$param] = $trailing;
}
return array(
"CONCAT(".implode(',', $concatItems).")".($as ? " AS `$as`" : ''),
$params
);
}
/**
* Check if am/pm is being used in this locale.
*/
public static function formatAMPM(){
if(strstr(Yii::app()->locale->getTimeFormat(), "a") === false) {
return false;
} /*else if(Yii::app()->locale->getLanguageId(Yii::app()->locale->getId()) == 'zh') {
// 24 hour format for china
return false;
} */else {
return true;
}
}
/* * * Date Time Format Functions ** */
public static function formatFeedTimestamp($timestamp){
if (Yii::app()->dateFormatter->format(
Yii::app()->locale->getDateFormat('medium'), $timestamp) ==
Yii::app()->dateFormatter->format(
Yii::app()->locale->getDateFormat('medium'), time())){
$str = Yii::t('app', 'Today').' '.
Yii::app()->dateFormatter->format(
Yii::app()->locale->getTimeFormat('short'), $timestamp);
}else{
$str =
Yii::app()->dateFormatter->format(
Yii::app()->locale->getDateFormat('medium'), $timestamp).
" ".
Yii::app()->dateFormatter->format(
Yii::app()->locale->getTimeFormat('short'), $timestamp);
}
return $str;
}
/**
* Returns a formatted string for the end of the day.
* @param integer $timestamp
* @return string
*/
public static function formatDateEndOfDay($timestamp){
if(empty($timestamp)) {
return '';
} else if(Yii::app()->locale->getId() == 'en') {
return Yii::app()->dateFormatter->format(
Yii::app()->locale->getDateFormat('medium').' '.
Yii::app()->locale->getTimeFormat('short'),
strtotime("tomorrow", $timestamp) - 60);
} /*else if(Yii::app()->locale->getLanguageId(Yii::app()->locale->getId()) == 'zh') {
return Yii::app()->dateFormatter->format(Yii::app()->locale->getDateFormat('short').
' '.'HH:mm', strtotime("tomorrow", $timestamp) - 60);
} */else {
return Yii::app()->dateFormatter->format(
Yii::app()->locale->getDateFormat('medium').' '.
Yii::app()->locale->getTimeFormat('short'),
strtotime("tomorrow", $timestamp) - 60);
}
}
/**
* Cuts string short.
* @param string $str String to be truncated.
* @param integer $length Maximum length of the string
* @param bool $encode Encode HTML special characters if true
* @return string
*/
public static function truncateText($str, $length = 30, $encode=false){
if(mb_strlen($str, 'UTF-8') > $length - 3){
if($length < 3)
$str = '';
else
$str = trim(mb_substr($str, 0, $length - 3, 'UTF-8'));
$str .= '...';
}
return $encode?CHtml::encode($str):$str;
}
/**
* Converts CamelCased words into first-letter-capitalized, spaced words.
* @param type $str
* @return type
*/
public static function deCamelCase($str){
$str = preg_replace("/(([a-z])([A-Z])|([A-Z])([A-Z][a-z]))/", "\\2\\4 \\3\\5", $str);
return ucfirst($str);
}
/**
* Locale-dependent date string formatting.
* @param integer $date Timestamp
* @param string $width A length keyword, i.e. "medium"
* @return string
*/
public static function formatDate($date, $width = 'long', $informal = true){
if(empty($date)){
return '';
}
if(!is_numeric($date))
$date = strtotime($date); // make sure $date is a proper timestamp
$now = getDate(); // generate date arrays
$due = getDate($date); // for calculations
//$date = mktime(23,59,59,$due['mon'],$due['mday'],$due['year']); // give them until 11:59 PM to finish the action
//$due = getDate($date);
$ret = '';
if($informal && $due['year'] == $now['year']){ // is the due date this year?
if($due['yday'] == $now['yday'] && $width == 'long') { // is the due date today?
$ret = Yii::t('app', 'Today');
} else if($due['yday'] == $now['yday'] + 1 && $width == 'long') { // is it tomorrow?
$ret = Yii::t('app', 'Tomorrow');
} else {
$ret = Yii::app()->dateFormatter->format(
Yii::app()->locale->getDateFormat($width), $date); // any other day this year
}
} else{
$ret = Yii::app()->dateFormatter->format(
Yii::app()->locale->getDateFormat($width), $date); // due date is after this year
}
return $ret;
}
public static function formatTime($date, $width = 'medium'){
return Yii::app()->dateFormatter->formatDateTime($date, null, $width);
}
public static function formatDueDate($date, $dateWidth='long', $timeWidth='short'){
if(!is_numeric($date))
$date = strtotime($date); // make sure $date is a proper timestamp
return date('l', $date)." ".
Yii::app()->dateFormatter->formatDateTime($date, $dateWidth, null).
" - ".Yii::app()->dateFormatter->formatDateTime($date, null, $timeWidth);
}
public static function formatCompleteDate($date){
return Yii::app()->dateFormatter->formatDateTime($date, 'long');
}
/**
* @param mixed $date timestamp
* @return bool
*/
public static function isToday ($date) {
return date ('Ymd') === date ('Ymd', $date);
}
public static function isThisYear ($date) {
return date ('Y') === date ('Y', $date);
}
// public static function isThisWeek ($date) {
// return date ('w') === date ('w', $date);
// }
public static function formatDateDynamic ($date) {
if (self::isToday ($date)) {
return Yii::app()->dateFormatter->format ('h:mm a', $date);
} else if (self::isThisYear ($date)) {
return Yii::app()->dateFormatter->format ('MMM d', $date);
} else {
return Yii::app()->dateFormatter->formatDateTime ($date, 'short', null);
}
}
/**
* Returns a formatted string for the date.
*
* @param integer $timestamp
* @return string
*/
public static function formatLongDateTime($timestamp){
if(empty($timestamp))
return '';
else
return Yii::app()->dateFormatter->formatDateTime($timestamp, 'long', 'medium');
}
/**
* Formats the date and time for a given timestamp.
* @param type $timestamp
* @return string
*/
public static function formatDateTime($timestamp){
if(empty($timestamp)){
return '';
}else if(Yii::app()->locale->getId() == 'en'){
return Yii::app()->dateFormatter->format(
Yii::app()->locale->getDateFormat('medium').' '.
Yii::app()->locale->getTimeFormat('short'),
$timestamp);
}/*else if(Yii::app()->locale->getLanguageId(Yii::app()->locale->getId()) == 'zh') {
return Yii::app()->dateFormatter->format(
Yii::app()->locale->getDateFormat('medium').' '.'HH:mm', $timestamp);
} */else {
return Yii::app()->dateFormatter->format(
Yii::app()->locale->getDateFormat('medium').' '.
Yii::app()->locale->getTimeFormat('short'),
$timestamp);
}
}
/**
* Adjust abbreviated months for French locale: The trailing . is removed
* from the month names in CDateTimeParser.parseMonth(), resulting in French
* DateTimes failing to parse.
*/
public static function getPlainAbbrMonthNames() {
$months = array_map (
function($e) { return rtrim($e,'.'); },
Yii::app()->getLocale()->getMonthNames ('abbreviated')
);
return array_values ($months);
}
/**
* Obtain a Unix-style integer timestamp for a date format.
*
* @param string $date
* @return mixed integer or false if parsing fails
*/
public static function parseDate($date){
if(Yii::app()->locale->getId() == 'en')
return strtotime($date);
else
return CDateTimeParser::parse($date, Yii::app()->locale->getDateFormat('medium'));
}
/**
* Parses both date and time into a Unix-style integer timestamp.
* @param string $date
* @return integer
*/
public static function parseDateTime($date,$dateLength = 'medium', $timeLength = 'short'){
if($date === null){
return null;
}elseif(is_numeric($date)){
return $date;
}elseif(Yii::app()->locale->getId() == 'en'){
return strtotime($date);
} else {
return CDateTimeParser::parse(
$date,
Yii::app()->locale->getDateFormat($dateLength).' '.
Yii::app()->locale->getTimeFormat($timeLength));
}
}
/**
* Convert currency to the proper format
*
* @param String $str The currency string
* @param Boolean $keepCents Whether or not to keep the cents
* @return String $str The modified currency string.
*/
public static function parseCurrency($str, $keepCents){
$cents = '';
if($keepCents){
$str = mb_ereg_match('[\.,]([0-9]{2})$', $str, $matches); // get cents
$cents = $matches[1];
}
$str = mb_ereg_replace('[\.,][0-9]{2}$', '', $str); // remove cents
$str = mb_ereg_replace('[^0-9]', '', $str); //remove all non-numbers
if(!empty($cents))
$str .= ".$cents";
return $str;
}
/**
* Returns the body of an email without any HTML markup.
*
* This function will strip out email header tags, opened email tags, and all
* HTML markup present in an Email type action so that the Action link can be
* properly displayed without looking terrible
* @param String $str Input string to be formatted
* @return String The formatted string
*/
public static function parseEmail($str){
$str = preg_replace('/<\!--BeginOpenedEmail-->(.*?)<\!--EndOpenedEmail-->/s', '', $str);
$str = preg_replace('/<\!--BeginActionHeader-->(.*?)<\!--EndActionHeader-->/s', '', $str);
$str = strip_tags($str);
return $str;
}
/**
* Replace variables in dynamic text blocks.
*
* This function takes text with dynamic attributes such as {firstName} or
* {company.symbol} or {time} and replaces them with appropriate values in
* the text. It is possible to directly access attributes of the model,
* attributes of related models to the model, or "short codes" which are
* fixed variables, so to speak. That is the variable {time} corresponds
* to a defined piece of code which returns the current time.
*
* @param String $value The text which should be searched for dynamic attributes.
* @param X2Model $model The model which attributes should be taken from
* @param String $type Optional, the type of content we're expecting to get. This
* can determine if we should render what comes back via the {@link X2Model::renderAttribute}
* function or just display what we get as is.
* @param Array $params Optional extra parameters which may include default values
* for the attributes in question.
* @param bool $renderFlag (optional) If true, overrides use of $type parameter to determine
* if attribute should be rendered
* @param bool $makeLinks If the render flag is set, determines whether to render attributes
* as links
* @return String A modified version of $value with attributes replaced.
*/
public static function replaceVariables(
$value, $params, $type = '', $renderFlag=true, $makeLinks=true){
if (!is_array ($params)) {
$params = array ('model' => $params);
}
$matches = array();
if($renderFlag && ($type === '' || $type === 'text' || $type === 'richtext')){
$renderFlag = true;
}else{
$renderFlag = false;
}
$shortCodeValues = static::getReplacementTokens($value, $params, $renderFlag, $makeLinks);
return strtr($value,$shortCodeValues);
}
/**
* Check for empty variables in dynamic text blocks.
*
* @param String $value The text which should be searched for dynamic attributes.
* @param X2Model $model The model which attributes should be taken from.
* @return Array $nullList A list of attributes paired with empty values.
*/
public static function findNullVariables ($value, $params){
if (!is_array ($params)) {
$params = array ('model' => $params);
}
$attrTable = static::getReplacementTokens($value, $params, true, false);
$nullList = array();
foreach ($attrTable as $attr => $val) {
if ($val === ''){
array_push($nullList, $attr);
}
}
return $nullList;
}
/**
* If text is greater than limit, it gets truncated and suffixed with an ellipsis
* @param string $text
* @param int $limit
* @return string
*/
public static function trimText ($text, $limit = 150) {
if(mb_strlen($text,'UTF-8') > $limit) {
return mb_substr($text, 0,$limit - 3, 'UTF-8').'...';
} else {
return $text;
}
}
/**
* @param float|int $value
* @return string value formatted as currency using app-wide currency setting
*/
public static function formatCurrency ($value) {
return Yii::app()->locale->numberFormatter->formatCurrency (
$value, Yii::app()->params->currency);
}
public static function ucwordsSpecific($string, $delimiters = '', $encoding = NULL) {
if ($encoding === NULL) {
$encoding = mb_internal_encoding();
}
if (is_string($delimiters)) {
$delimiters = str_split(str_replace(' ', '', $delimiters));
}
$delimiters_pattern1 = array();
$delimiters_replace1 = array();
$delimiters_pattern2 = array();
$delimiters_replace2 = array();
foreach ($delimiters as $delimiter) {
$ucDelimiter = $delimiter;
$delimiter = strtolower($delimiter);
$uniqid = uniqid();
$delimiters_pattern1[] = '/' . preg_quote($delimiter) . '/';
$delimiters_replace1[] = $delimiter . $uniqid . ' ';
$delimiters_pattern2[] = '/' . preg_quote($ucDelimiter . $uniqid . ' ') . '/';
$delimiters_replace2[] = $ucDelimiter;
$delimiters_cleanup_replace1[] = '/' . preg_quote($delimiter . $uniqid) . ' ' . '/';
$delimiters_cleanup_pattern1[] = $delimiter;
}
$return_string = mb_strtolower($string, $encoding);
//$return_string = $string;
$return_string = preg_replace($delimiters_pattern1, $delimiters_replace1, $return_string);
$words = explode(' ', $return_string);
foreach ($words as $index => $word) {
$words[$index] = mb_strtoupper(mb_substr($word, 0, 1, $encoding), $encoding) .
mb_substr($word, 1, mb_strlen($word, $encoding), $encoding);
}
$return_string = implode(' ', $words);
$return_string = preg_replace($delimiters_pattern2, $delimiters_replace2, $return_string);
$return_string = preg_replace(
$delimiters_cleanup_replace1, $delimiters_cleanup_pattern1, $return_string);
return $return_string;
}
public static function isFormula ($val) {
return preg_match ('/^=/', $val);
}
public static function isShortcode ($val) {
return preg_match ('/^\{.*\}$/', $val);
}
}
?>
|
Java
|
UTF-8
| 24,071 | 1.601563 | 2 |
[] |
no_license
|
package com.ubtechinc.alpha.mini.ui.msg;
import android.arch.lifecycle.Observer;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.content.ContextCompat;
import android.text.TextUtils;
import android.view.View;
import android.view.ViewStub;
import android.widget.CompoundButton;
import android.widget.TextView;
import com.ubtech.utilcode.utils.CollectionUtils;
import com.ubtechinc.alpha.im.IMCmdId;
import com.ubtechinc.alpha.mini.R;
import com.ubtechinc.alpha.mini.common.BaseToolbarActivity;
import com.ubtechinc.alpha.mini.entity.Message;
import com.ubtechinc.alpha.mini.entity.RobotPermission;
import com.ubtechinc.alpha.mini.entity.observable.LiveResult;
import com.ubtechinc.alpha.mini.entity.observable.MessageLive;
import com.ubtechinc.alpha.mini.viewmodel.AccountApplyViewModel;
import com.ubtechinc.alpha.mini.viewmodel.MessageViewModel;
import com.ubtechinc.alpha.mini.widget.MaterialDialog;
import com.ubtechinc.alpha.mini.widget.SwitchButton;
import com.ubtechinc.alpha.mini.widget.taglayout.FlowLayout;
import com.ubtechinc.alpha.mini.widget.taglayout.TagAdapter;
import com.ubtechinc.alpha.mini.widget.taglayout.TagFlowLayout;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import static com.ubtechinc.alpha.mini.constants.Constants.APPLY_HANDEL_ERROR;
import static com.ubtechinc.alpha.mini.constants.Constants.PERMISSIONCODE_AVATAR;
import static com.ubtechinc.alpha.mini.constants.Constants.PERMISSIONCODE_CALL;
import static com.ubtechinc.alpha.mini.constants.Constants.PERMISSIONCODE_PHOTO;
import static com.ubtechinc.alpha.mini.constants.Constants.PERMISSION_CODE_CODING;
public class MessageDetailActivity extends BaseToolbarActivity {
public static final String NOTICE_ID = "noticeId";
public static final String MESSAGE = "message";
public static final String SCENCE = "sence";
public static final int TYPE_DETAIL = 0;
public static final int TYPE_APPLY = 1;
MessageViewModel messageViewModel;
AccountApplyViewModel accountApplyViewModel;
private Message message;
private View shareHandleContent;
private View shareResultContent;
private TextView msgTitleView;
private TextView msgDateView;
private TextView msgTitleRobotIdView;
private View msgTitleLine;
private String permission;
private int sence;
private MaterialDialog errorDialog;
private View rejectBtn;
private View acceptBtn;
private SwitchButton videoSwitch;
private SwitchButton gallerySwitch;
private SwitchButton callSwitchbtn;
private SwitchButton codeSwitch;
private TagFlowLayout tagFlowLayout;
private List<String> tagList;
private String callTag;
private String avatarTag;
private String galleryTag;
private String codeTag;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_message_detail);
initView();
initData();
}
private void initView() {
View toolbar = findViewById(R.id.toolbar);
msgTitleView = findViewById(R.id.msg_title);
msgDateView = findViewById(R.id.msg_date);
msgTitleRobotIdView = findViewById(R.id.msg_title_robot_id);
msgTitleLine = findViewById(R.id.msg_title_line);
initToolbar(toolbar, "", View.GONE, false);
initConnectFailedLayout(R.string.mobile_connected_error, R.string.robot_connected_error);
}
private void initData() {
accountApplyViewModel = AccountApplyViewModel.getInstance();
messageViewModel = MessageViewModel.get();
Intent intent = getIntent();
String noticeId = intent.getStringExtra(NOTICE_ID);
sence = intent.getIntExtra(SCENCE, 0);
message = (Message) intent.getSerializableExtra(MESSAGE);
if (message == null) {
messageViewModel.getMessageById(noticeId).observe(this, new Observer<LiveResult>() {
@Override
public void onChanged(@Nullable LiveResult liveResult) {
switch (liveResult.getState()) {
case LOADING:
showLoadingDialog();
break;
case SUCCESS:
message = (Message) liveResult.getData();
showData(message);
dismissDialog();
break;
case FAIL:
toastError(getString(R.string.op_fail));
dismissDialog();
break;
default:
break;
}
}
});
} else {
showData(message);
}
}
private void showData(Message message) {
if (message != null) {
if (message.getIsRead() != 1) {
messageViewModel.readMessage(message.getNoticeId());
this.message.setIsRead(1);
setResult();
if (message.getNoticeType() == Message.TYPE_SHARE) {
MessageLive.get().readShareMsg();
} else {
MessageLive.get().readSysMsg();
}
}
msgTitleView.setText(message.getNoticeTitle());
msgDateView.setText(message.getDate());
if (!TextUtils.isEmpty(message.getRobotId())) {
msgTitleRobotIdView.setText(getString(R.string.robot_id, message.getRobotId()));
msgTitleLine.setVisibility(View.INVISIBLE);
msgDateView.setPadding(msgDateView.getPaddingLeft(), 0, msgDateView.getPaddingRight(), 0);
} else {
msgTitleRobotIdView.setVisibility(View.GONE);
}
switch (message.getNoticeType()) {
case Message.TYPE_SYS:
showMsgDetail();
break;
case Message.TYPE_SHARE:
if (Integer.valueOf(message.getCommandId()) == IMCmdId.IM_ACCOUNT_APPLY_RESPONSE
|| Integer.valueOf(message.getCommandId()) == IMCmdId.IM_ACCOUNT_PERMISSION_REQUEST_RESPONSE) {
showApplyDetail(message);
} else {
showMsgDetail();
}
break;
default:
break;
}
}
}
private void showApplyDetail(Message message) {
String op = message.getOperation();
int msgOp = 0;
if (!TextUtils.isEmpty(op)) {
msgOp = Integer.valueOf(op);
}
switch (msgOp) {
case Message.OP_NORMAL:
showApplyHandleDetail();
break;
case Message.OP_ACCEPT:
case Message.OP_REJECT:
showApplyResultDetail();
break;
case Message.OP_EXPIRE:
showApplyHandleDetail();
break;
}
}
private void showApplyHandleDetail() {
if (shareResultContent != null) {
shareResultContent.setVisibility(View.GONE);
}
if (shareHandleContent == null) {
ViewStub viewStub = findViewById(R.id.share_handle_content);
shareHandleContent = viewStub.inflate();
}
acceptBtn = findViewById(R.id.accept_btn);
rejectBtn = findViewById(R.id.reject_btn);
videoSwitch = findViewById(R.id.switchbtn_video);
callSwitchbtn = findViewById(R.id.switchbtn_call);
gallerySwitch = findViewById(R.id.switchbtn_gallery);
codeSwitch = findViewById(R.id.switchbtn_coding);
tagFlowLayout = findViewById(R.id.id_flowlayout);
if (String.valueOf(Message.OP_EXPIRE).equals(message.getOperation())) {//过期的消息将按钮不可点击
showHandleExpired();
return;
}
final List<String> tags = Arrays.asList(getResources().getStringArray(R.array.funtion));
tagList = new ArrayList(tags);
showTag();
callTag = getString(R.string.contact);
galleryTag = getString(R.string.gallery);
avatarTag = getString(R.string.video_surveillance);
codeTag = getString(R.string.coding);
gallerySwitch.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean b) {
if (b) {
tagList.add(galleryTag);
} else {
tagList.remove(galleryTag);
}
showTag();
}
});
callSwitchbtn.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean b) {
if (b) {
tagList.add(callTag);
} else {
tagList.remove(callTag);
}
showTag();
}
});
videoSwitch.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean b) {
if (b) {
tagList.add(avatarTag);
} else {
tagList.remove(avatarTag);
}
showTag();
}
});
codeSwitch.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
if (isChecked) {
tagList.add(codeTag);
} else {
tagList.remove(codeTag);
}
showTag();
}
});
acceptBtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
permission = "";
List<RobotPermission> robotPermissions = new ArrayList<RobotPermission>(2);
RobotPermission robotPermission = new RobotPermission();
robotPermission.setStatus(0);
robotPermission.setPermissionCode(PERMISSIONCODE_AVATAR);
robotPermission.setPermissionDesc(getString(R.string.video_surveillance));
RobotPermission albumPermission = new RobotPermission();
albumPermission.setStatus(0);
albumPermission.setPermissionCode(PERMISSIONCODE_PHOTO);
albumPermission.setPermissionDesc(getString(R.string.gallery));
RobotPermission callPermission = new RobotPermission();
callPermission.setStatus(0);
callPermission.setPermissionCode(PERMISSIONCODE_CALL);
callPermission.setPermissionDesc(getString(R.string.make_call));
RobotPermission codePermission = new RobotPermission();
codePermission.setStatus(0);
codePermission.setPermissionCode(PERMISSION_CODE_CODING);
codePermission.setPermissionDesc(getString(R.string.coding));
robotPermissions.add(robotPermission);
robotPermissions.add(albumPermission);
robotPermissions.add(callPermission);
robotPermissions.add(codePermission);
if (videoSwitch.isChecked()) {
permission += PERMISSIONCODE_AVATAR;
robotPermission.setStatus(1);
}
if (gallerySwitch.isChecked()) {
if (!TextUtils.isEmpty(permission)) {
permission += ",";
}
albumPermission.setStatus(1);
permission += PERMISSIONCODE_PHOTO;
}
if (callSwitchbtn.isChecked()) {
if (!TextUtils.isEmpty(permission)) {
permission += ",";
}
callPermission.setStatus(1);
permission += PERMISSIONCODE_CALL;
}
if (codeSwitch.isChecked()) {
if (!TextUtils.isEmpty(permission)) {
permission += ",";
}
codePermission.setStatus(1);
permission += PERMISSION_CODE_CODING;
}
showLoadingDialog();
message.setPermissionList(robotPermissions);
accountApplyViewModel.applyApprove(message, permission).observe(MessageDetailActivity.this, new Observer<LiveResult>() {
@Override
public void onChanged(@Nullable LiveResult liveResult) {
switch (liveResult.getState()) {
case LOADING:
// showLoadingDialog();
break;
case SUCCESS:
if (sence == TYPE_DETAIL) {
setResult();
dismissDialog();
showApplyResultDetail();
liveResult.removeObservers(MessageDetailActivity.this);
if (!TextUtils.isEmpty(message.getSenderName())) {
toastSuccess(getString(R.string.robot_shared_to, message.getSenderName()));
}else{
toastSuccess(getString(R.string.robot_shared_tips));
}
} else {
if (!TextUtils.isEmpty(message.getSenderName())) {
toastSuccess(getString(R.string.robot_shared_to, message.getSenderName()));
}else{
toastSuccess(getString(R.string.robot_shared_tips));
}
finish();
}
break;
case FAIL:
dismissDialog();
if (TextUtils.isEmpty(liveResult.getMsg())) {
toastError(getString(R.string.op_fail));
} else {
if (liveResult.getErrorCode() == APPLY_HANDEL_ERROR) {
showErrorDialog();
} else {
toast(liveResult.getMsg());
}
}
liveResult.removeObservers(MessageDetailActivity.this);
break;
}
}
});
}
});
rejectBtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
showLoadingDialog();
accountApplyViewModel.applyReject(message).observe(MessageDetailActivity.this, new Observer<LiveResult>() {
@Override
public void onChanged(@Nullable LiveResult liveResult) {
switch (liveResult.getState()) {
case LOADING:
// showLoadingDialog();
break;
case SUCCESS:
if (sence == TYPE_DETAIL) {
setResult();
dismissDialog();
showApplyResultDetail();
liveResult.removeObservers(MessageDetailActivity.this);
if (!TextUtils.isEmpty(message.getSenderName())) {
toastError(getString(R.string.rejected_shared_to, message.getSenderName()));
}else{
toastError(getString(R.string.rejected_shared_tips));
}
} else {
if (!TextUtils.isEmpty(message.getSenderName())) {
toastError(getString(R.string.rejected_shared_to, message.getSenderName()));
}else{
toastError(getString(R.string.rejected_shared_tips));
}
finish();
}
break;
case FAIL:
dismissDialog();
if (TextUtils.isEmpty(liveResult.getMsg())) {
toast(R.string.op_fail);
} else {
if (liveResult.getErrorCode() == APPLY_HANDEL_ERROR) {
showErrorDialog();
} else {
toastError(liveResult.getMsg());
}
}
liveResult.removeObservers(MessageDetailActivity.this);
break;
}
}
});
}
});
}
private void showApplyResultDetail() {
if (shareHandleContent != null) {
shareHandleContent.setVisibility(View.GONE);
}
if (shareResultContent == null) {
ViewStub viewStub = findViewById(R.id.share_result_content);
shareResultContent = viewStub.inflate();
}
TextView resultText = findViewById(R.id.msg_apply_result_text);
TextView resultTitle = findViewById(R.id.msg_apply_result);
TextView resultDesc = findViewById(R.id.msg_apply_result_desc);
if (String.valueOf(Message.OP_ACCEPT).equals(message.getOperation())) {
resultText.setText(R.string.robot_shared);
resultTitle.setText(getPermissionDesc(message.getPermissionList()));
resultDesc.setTextColor(getResources().getColor(R.color.black));
} else {
resultText.setText(R.string.rejected);
resultDesc.setVisibility(View.INVISIBLE);
resultTitle.setText(R.string.can_not_use_robot);
resultText.setTextColor(getResources().getColor(R.color.btn_red));
}
}
private String getPermissionDesc(List<RobotPermission> permissions) {
if (CollectionUtils.isEmpty(permissions)) {
//return "对方无法使用视频监控、相册和电话功能";
return getString(R.string.share_permissions, avatarTag, galleryTag, codeTag, callTag);
} else {
String allowPermissions = "";
String rejectPermissions = "";
for (RobotPermission robotPermission : permissions) {
if (robotPermission.getStatus() == 1) {
allowPermissions += (robotPermission.getPermissionDesc() + "、");
} else {
rejectPermissions += (robotPermission.getPermissionDesc() + "、");
}
}
String tips = "";
if (!TextUtils.isEmpty(allowPermissions)) {
if (allowPermissions.endsWith("、")) {
allowPermissions = allowPermissions.substring(0, allowPermissions.length() - 1);
}
//tips += "对方可以使用" + allowPermissions + "功能";
tips += getString(R.string.share_permissions_1, allowPermissions);
}
if (!TextUtils.isEmpty(rejectPermissions)) {
if (rejectPermissions.endsWith("、")) {
rejectPermissions = rejectPermissions.substring(0, rejectPermissions.length() - 1);
}
if (TextUtils.isEmpty(tips)) {
//tips += "对方无法使用" + rejectPermissions + "功能";
tips += getString(R.string.share_permissions_2, rejectPermissions);
} else {
//tips += ",但不可以使用" + rejectPermissions + "功能";
tips += getString(R.string.concat) + getString(R.string.share_permissions_3, rejectPermissions);
}
}
if (TextUtils.isEmpty(tips)) {
//tips = "对方无法使用视频监控、相册和电话功能";
tips = getString(R.string.share_permissions, avatarTag, galleryTag, codeTag, callTag);
}
return tips;
}
}
private void showMsgDetail() {
if (shareHandleContent != null) {
shareHandleContent.setVisibility(View.GONE);
}
if (shareResultContent == null) {
ViewStub viewStub = findViewById(R.id.share_result_content);
shareResultContent = viewStub.inflate();
}
TextView resultText = findViewById(R.id.msg_apply_result_text);
TextView resultTitle = findViewById(R.id.msg_apply_result);
TextView resultDesc = findViewById(R.id.msg_apply_result_desc);
resultText.setVisibility(View.GONE);
resultDesc.setVisibility(View.INVISIBLE);
resultTitle.setText(message.getNoticeDes());
}
private void showHandleExpired() {
if (rejectBtn != null) {
rejectBtn.setEnabled(false);
}
if (acceptBtn != null) {
acceptBtn.setEnabled(false);
}
if (videoSwitch != null) {
videoSwitch.setEnabled(false);
}
if (gallerySwitch != null) {
gallerySwitch.setEnabled(false);
}
if (callSwitchbtn != null) {
callSwitchbtn.setEnabled(false);
}
}
private void showErrorDialog() {
if (errorDialog == null) {
errorDialog = new MaterialDialog(this);
errorDialog.setMessage(getString(R.string.msg_expired));
message.setOperation(String.valueOf(Message.OP_EXPIRE));
setResult();
showHandleExpired();
errorDialog.setPositiveButton(R.string.i_know, new View.OnClickListener() {
@Override
public void onClick(View view) {
errorDialog.dismiss();
}
});
}
errorDialog.show();
}
private void setResult() {
Intent intent = new Intent();
intent.putExtra(MESSAGE, message);
setResult(1, intent);
}
@Override
protected void onDestroy() {
super.onDestroy();
}
private void showTag() {
if (tagFlowLayout == null || tagList == null) {
return;
}
tagFlowLayout.setAdapter(new TagAdapter<String>(tagList) {
@Override
public View getView(FlowLayout parent, int position, String s) {
TextView tv = new TextView(MessageDetailActivity.this);
tv.setTextColor(ContextCompat.getColor(MessageDetailActivity.this, R.color.first_text));
tv.setBackgroundResource(R.drawable.shape_grey_rectangle_tag_bg);
tv.setText(s);
return tv;
}
});
}
}
|
Java
|
UTF-8
| 498 | 3.328125 | 3 |
[] |
no_license
|
public class CoalMine {
private int coal;
private static final int BURN_COST = 10;
public CoalMine() {
coal = 20;
}
public boolean burn() {
if (coal >= BURN_COST) {
coal -= BURN_COST;
return true;
}
return false;
}
public int getBurnCost() {
return BURN_COST;
}
public int getCoal() {
return coal;
}
public void increaseCoal(int addedCoal) {
coal += addedCoal;
}
}
|
Python
|
UTF-8
| 584 | 3.765625 | 4 |
[] |
no_license
|
goods = [(60, 10),(100, 20),(120, 30)] # 每个商品元组表示(价格,重量)
goods.sort(key=lambda x:x[0]/x[1], reverse=True)
#print(goods)
def fraction_backpack(goods, w):
m = [0 for i in range(len(goods))]
total_prize = 0
for ind, (money, weight) in enumerate(goods):
if w >= weight:
m[ind] = 1
total_prize += money
w -= weight
else:
m[ind] = w / weight
w = 0
total_prize += money * m[ind]
break
return m, total_prize
print(fraction_backpack(goods, 50))
|
Markdown
|
UTF-8
| 2,387 | 2.765625 | 3 |
[] |
no_license
|
# Vehicle-Car-detection-and-multilabel-classification 车辆检测和多标签属性识别
## 使用YOLO_v3_tiny和B-CNN实现街头车辆的检测和车辆属性的多标签识别 (Using yolo_v3_tiny to do vehicle or car detection and attribute's multilabel classification or recognize)
## 效果如下: Vehicle detection and recognition results are as follows: </br>


</br>
## 使用方法
python Vehicle_DC -src_dir your_imgs_dir -dst_dir your_result_dir
### 程序简介 brief introductions
#### (1). 程序包含两大模块: The program consists of two parts: first, car detection(only provides model loading and inference code, if you need training code, you can refer to [pytorch_yolo_v3](https://github.com/eriklindernoren/PyTorch-YOLOv3#train)); the car attributes classiyfing(provide both training and testing code, it will predict a vehicle's body color, body direction and car type)
##### <1>. 车辆检测模块: 只提供检测, 训练代码可以参考[pytorch_yolo_v3](https://github.com/eriklindernoren/PyTorch-YOLOv3#train); </br>
##### <2>. 标签识别模块:包含车辆颜色、车辆朝向、车辆类型
将两个模块结合在一起,实现车辆的检测和识别,对室外智能交通信息,进行了一定程度的结构化提取。
#### (2). 程序模块详解 modules detailed introduction </br>
##### <1>. VehicleDC.py </br>
此模块主要是对汽车检测和多标签识别进行封装,输入测试目录和存放结果目录。主类Car_DC, 函数__init__主要负责汽车检测、汽车识别两个模型的初始化。
函数detect_classify负责逐张图像的检测和识别:首先对输入图像进行预处理,统一输入格式,然后输出该图像所有的车的检测框。通过函数process_predict做nms,
坐标系转换,得到所有最终的检测框。然后程序会调用函数cls_draw_bbox。在cls_draw_bbox中逐一处理每个检测框, 首先取出检测框区域的ROI, 送入车辆多标签分类器中。分类器采用B-CNN算法,参考[paper链接](https://arxiv.org/pdf/1709.09890.pdf),B-CNN主要用于训练端到端的细粒度分类。
|
C++
|
UTF-8
| 6,310 | 2.515625 | 3 |
[
"MIT"
] |
permissive
|
//
// Created by Amrik on 28/10/2018.
//
#include "TrainingGround.h"
TrainingGround::TrainingGround(uint16_t populationSize, uint16_t nGenerations, uint32_t nTicks,
shared_ptr<ONFSTrack> &training_track, shared_ptr<Car> &training_car,
std::shared_ptr<Logger> &logger, GLFWwindow *gl_window) : window(gl_window),
raceNetRenderer(gl_window,
logger) {
LOG(INFO) << "Beginning GA evolution session. Population Size: " << populationSize << " nGenerations: "
<< nGenerations << " nTicks: " << nTicks << " Track: " << training_track->name << " ("
<< ToString(training_track->tag) << ")";
this->training_track = training_track;
this->training_car = training_car;
physicsEngine.registerTrack(this->training_track);
InitialiseAgents(populationSize);
std::vector<std::vector<int>> trainedAgentFitness = TrainAgents(nGenerations, nTicks);
LOG(INFO) << "Saving best agent network to " << BEST_NETWORK_PATH;
car_agents[trainedAgentFitness[0][0]]->carNet.net.saveNetworkParams(BEST_NETWORK_PATH.c_str());
LOG(INFO) << "Done";
}
void TrainingGround::Mutate(RaceNet &toMutate) {
for (uint8_t mut_Idx = 0; mut_Idx < 5; ++mut_Idx) {
unsigned long layerToMutate = rand() % toMutate.net.W.size();
auto &m = toMutate.net.W[layerToMutate];
int h = m.getHeight();
int w = m.getWidth();
int xNeuronToMutate = rand() % h;
int yNeuronToMutate = rand() % w;
m.put(xNeuronToMutate, yNeuronToMutate, m.get(xNeuronToMutate, yNeuronToMutate) * Utils::RandomFloat(0.5, 1.5));
}
}
// Move this to agent class?
float TrainingGround::EvaluateFitness(shared_ptr<Car> &car_agent) {
uint32_t nVroad = boost::get<shared_ptr<NFS3_4_DATA::TRACK>>(training_track->trackData)->col.vroadHead.nrec;
int closestVroadID = 0;
float lowestDistanceSqr = FLT_MAX;
for (uint32_t vroad_Idx = 0; vroad_Idx < nVroad; ++vroad_Idx) {
INTPT refPt = boost::get<shared_ptr<NFS3_4_DATA::TRACK>>(training_track->trackData)->col.vroad[vroad_Idx].refPt;
glm::vec3 vroadPoint = glm::normalize(glm::quat(glm::vec3(-SIMD_PI / 2, 0, 0))) *
glm::vec3((refPt.x / 65536.0f) / 10.f, ((refPt.y / 65536.0f) / 10.f),
(refPt.z / 65536.0f) / 10.f);
float distanceSqr = glm::length2(glm::distance(car_agent->car_body_model.position, vroadPoint));
if (distanceSqr < lowestDistanceSqr) {
closestVroadID = vroad_Idx;
lowestDistanceSqr = distanceSqr;
}
}
// Return a number corresponding to the distance driven
return (float) closestVroadID;
}
void TrainingGround::InitialiseAgents(uint16_t populationSize) {
// Create new cars from models loaded in training_car to avoid VIV extract again, each with new RaceNetworks
for (uint16_t pop_Idx = 0; pop_Idx < populationSize; ++pop_Idx) {
shared_ptr<Car> car_agent = std::make_shared<Car>(pop_Idx, this->training_car->all_models, NFS_3, "diab", RaceNet());
car_agent->colour = glm::vec3(Utils::RandomFloat(0.f, 1.f), Utils::RandomFloat(0.f, 1.f), Utils::RandomFloat(0.f, 1.f));
physicsEngine.registerVehicle(car_agent);
Renderer::ResetToVroad(1, training_track, car_agent);
car_agents.emplace_back(car_agent);
}
LOG(INFO) << "Agents initialised";
}
void
TrainingGround::SelectAgents(std::vector<shared_ptr<Car>> &car_agents, std::vector<std::vector<int>> agent_fitnesses) {
// Clone the best network into the worst 50%
for (uint32_t cull_Idx = agent_fitnesses.size() / 2; cull_Idx < agent_fitnesses.size(); ++cull_Idx) {
for (auto &car_agent : car_agents) {
if (car_agent->populationID == agent_fitnesses[cull_Idx][0]) {
car_agent->carNet = car_agents[agent_fitnesses[0][0]]->carNet;
}
}
}
}
void TrainingGround::Crossover(RaceNet &a, RaceNet &b) {
// TODO: Actually implement this
}
std::vector<std::vector<int>> TrainingGround::TrainAgents(uint16_t nGenerations, uint32_t nTicks) {
std::vector<std::vector<int>> agentFitnesses;
// TODO: Remove this and
std::vector<int> dummyAgentData = {0, 0};
agentFitnesses.emplace_back(dummyAgentData);
for (uint16_t gen_Idx = 0; gen_Idx < nGenerations; ++gen_Idx) {
LOG(INFO) << "Beginning Generation " << gen_Idx;
// Simulate the population
for (uint32_t tick_Idx = 0; tick_Idx < nTicks; ++tick_Idx) {
for (auto &car_agent : car_agents) {
car_agent->simulate();
}
physicsEngine.stepSimulation(stepTime);
raceNetRenderer.Render(tick_Idx, car_agents, training_track);
if (glfwWindowShouldClose(window)) return agentFitnesses;
}
// Clear fitness data for next generation
agentFitnesses.clear();
// Evaluate the fitnesses and sort them
for (auto &car_agent : car_agents) {
LOG(INFO) << "Agent " << car_agent->populationID << " made it to trkblock " << EvaluateFitness(car_agent);
std::vector<int> agentData = {car_agent->populationID, (int) EvaluateFitness(car_agent)};
agentFitnesses.emplace_back(agentData);
}
std::sort(agentFitnesses.begin(), agentFitnesses.end(),
[](const std::vector<int> &a, const std::vector<int> &b) {
return a[1] > b[1];
});
LOG(DEBUG) << "Agent " << agentFitnesses[0][0] << " was fittest";
// Mutate the fittest network
// Mutate(car_agents[agentFitnesses[0][0]]->carNet);
// Perform selection
SelectAgents(car_agents, agentFitnesses);
// Mutate all networks
for (auto &car_agent : car_agents) {
Mutate(car_agent->carNet);
}
// Reset the cars for the next generation
for (auto &car_agent : car_agents) {
Renderer::ResetToVroad(1, training_track, car_agent);
}
}
return agentFitnesses;
}
|
C++
|
UTF-8
| 1,722 | 3.390625 | 3 |
[] |
no_license
|
#include "EnvironmentController.h"
EnvironmentController::EnvironmentController(Parser* _parser, Environment* _currentEnvironment)
: parser(_parser), currentEnvironment(_currentEnvironment)
{
}
EnvironmentController::~EnvironmentController()
{
delete currentEnvironment;
}
void EnvironmentController::SetCurrentEnvironment(Environment* _environment)
{
currentEnvironment = _environment;
}
Environment* EnvironmentController::GetCurrentEnvironment() const
{
return currentEnvironment;
}
void EnvironmentController::PrintNeighbourEnvironments() const
{
std::cout << "Current environment:" << std::endl;
if (currentEnvironment != nullptr)
{
const std::vector<Environment*>* environments = currentEnvironment->GetEnvironmentTable().GetAll();
std::cout << " " << currentEnvironment->GetName() << std::endl;
std::cout << "Environments around you:" << std::endl;
if (environments != nullptr)
{
for (auto& env : *environments)
{
std::cout << " " << env->GetName() << std::endl;
}
}
else
{
std::cout << " No other environment found." << std::endl;
}
}
else
{
std::cout << " You are nowhere. Ups." << std::endl;
}
}
void EnvironmentController::PrintCurrentCharacters() const
{
const std::vector<NpcCharacter*>* npcs = currentEnvironment->GetNpcTable().GetAll();
std::cout << "Characters in your environment:" << std::endl;
if (currentEnvironment != nullptr || npcs != nullptr)
{
if (npcs->size() != 0)
{
for (auto& character : *npcs)
{
std::cout << " " << character->GetName() << std::endl;
}
}
else
{
std::cout << " No characters in your environment." << std::endl;
}
}
else
{
std::cout << " You are nowhere. Ups." << std::endl;
}
}
|
C++
|
UTF-8
| 3,902 | 3.390625 | 3 |
[
"BSL-1.0"
] |
permissive
|
/*
* Copyright 2014-2019 Matus Chochlik. Distributed under the Boost
* Software License, Version 1.0. (See accompanying file
* LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
*/
//[oglplus_opt_ranges_begin
namespace ranges {
//]
//[oglplus_opt_ranges_IsRange
template <typename Range>
struct IsRange {
using Type = __Unspecified; /*<
[^std::true_type] if [^Range] conforms to the __Range concept or
[^std::false_type] otherwise.
>*/
};
//]
//[oglplus_opt_ranges_AnyRange
template <typename Element>
class AnyRange {
public:
AnyRange();
template <typename Range>
AnyRange(__Range range); /*<
Construction and assignment from a [^Range] type.
>*/
template <typename Range>
AnyRange& operator=(const __Range& range);
AnyRange(const AnyRange& other); /*<
Copy and move construction.
>*/
AnyRange(AnyRange&& temp);
AnyRange& operator=(const AnyRange& other); /*<
Copy and move assignment.
>*/
AnyRange& operator=(AnyRange&& other);
using ValueType = Element; /*< The __Range interface. >*/
bool Empty() const;
size_t Size() const;
void Next();
ValueType Front() const;
};
template <typename Range>
__AnyRange<typename __Range::ValueType> EraseType(__Range range); /*<
Erases the real type of the range passed as argument.
>*/
//]
//[oglplus_opt_ranges_funcs
template <typename Range>
__Range Find(__Range range, typename __Range::ValueType value); /*<
Traverses a range and stops either if the range
is empty or if the specified value is found. The resulting
range is returned.
>*/
template <typename Range, typename Predicate>
__Range FindIf(__Range range, Predicate predicate); /*<
Finds the first a value satisfying a predicate in a range.
This function traverses a range and stops either if the range
is empty or if a value satisfying the predicate is found.
The resulting range is returned.
>*/
template <typename Range>
bool Contains(__Range range, typename __Range::ValueType value); /*<
Returns true if [^range] contains at least one element with
the specified value.
>*/
template <typename Range, typename Predicate>
bool Has(__Range range, Predicate predicate); /*<
Returns true if [^range] contains at least one element
satisfying the specified [^predicate].
>*/
template <typename Range, typename Transf>
__Range Transform(__Range range, Transf transform); /*<
Transforms the elements in a range by an unary function.
[^Transform] returns a range whose [^Front] member function returns
the [^Front] value of the original [^range] transformed by [^transform].
>*/
template <typename Range, typename State, typename Func>
State Fold(__Range range, State state, Func functor); /*<
Folds a [^range] by using a binary [^functor] and a [^state] value.
Fold gradually updates the [^state] value by successively calling the specified
[^functor] on all elements with [^state] as the first argument and the current
[^Front] element of the [^range] as the second argument. The result of each call
replaces the value stored in [^state]. After the whole [^range] is traversed
the resulting [^state] is returned.
>*/
template <typename Range, typename Predicate>
size_t CountIf(Range range, Predicate predicate); /*<
Counts and returns the number of elements in a __Range satisfying
the specified [^predicate].
>*/
template <typename Range, typename Predicate>
__Range OnlyIf(__Range range, Predicate pred); /*<
The [^OnlyIf] function returns a __Range that contains only those elements
of the original [^range], which satisfy the specified [^predicate].
>*/
template <typename Element, typename R1, typename R2>
__Range Concatenate(R1 r1, R2 r2); /*<
Returns a range that is a concatenation of the ranges [^r1] and [^r2].
The [^ValueType] of both ranges must be explicitly convertible to
the specified [^Element] type.
>*/
//]
//[oglplus_opt_ranges_end
} // namespace ranges
//]
|
PHP
|
UTF-8
| 107 | 3.171875 | 3 |
[] |
no_license
|
<?php
for($i =0; $i < mt_rand(10, 30); $i ++)
{
echo sprintf('Hello world: %s %s',$i,PHP_EOL);
}
die(0);
|
Shell
|
UTF-8
| 649 | 3.5625 | 4 |
[] |
no_license
|
#!/bin/bash -e
. $(dirname $0)/build-properties
. $(dirname $0)/pkgversion
PROGRAM="perl-${PERL_VER}"
TARBALL="$PROGRAM.tar.*"
cd $SOURCE_DIR
if [ "$TARBALL" != "" ]; then
DIRECTORY=`tar -tf $TARBALL | cut -d/ -f1 | uniq`
rm -rf $DIRECTORY || true
tar xf $TARBALL
cd $DIRECTORY
fi
{ time \
{
sh Configure -des -Dprefix=/tools -Dlibs=-lm
make
cp -v perl cpan/podlators/scripts/pod2man /tools/bin
mkdir -pv /tools/lib/perl5/${PERL_VER}
cp -Rv lib/* /tools/lib/perl5/${PERL_VER}
}
} 2>&1 | tee ${LOG_DIR}/$0.log
[ $PIPESTATUS = 0 ] || exit $PIPESTATUS
cd $SOURCE_DIR
if [ "$TARBALL" != "" ]; then
rm -rf $DIRECTORY
fi
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.