text
stringlengths 3
181k
| src
stringlengths 5
1.02k
|
---|---|
angular.module('app')
.config(($routeProvider) => {
$routeProvider
.when('/login', {
controller: 'LoginCtrl',
controllerAs: 'auth',
templateUrl: '/app/auth/login.html'
})
.when('/logout', {
controller: 'LogoutCtrl',
controllerAs: 'auth',
template: ''
})
})
| NSS-Cohort-13/angular-addresses-src/app/auth/auth.config.js |
ፈጻሚ ሽማግለ ሰዲህኤ፡ ስረሓቱ ገምጊሙ፡ መጻኢ መደባቱ ተሊሙ
2020-01-05 09:45:45 Written by ቤት ጽሕፈት ዜና ሰዲህኤ Published in EPDP News Read 923 times
ፈጻሚ ሽማግለ ሰልፊ ዲሞክራሲ ህዝቢ ኤርትራ (ሰዲህኤ) ብ4 ጥሪ 2020፡ ድሕሪ 3ይን ሓድነታውን ጉባአ 2ይ ስሩዕ ኣኼባኡ ኣካይዱ። ኣብ መኽፈቲ እዚ ኣኼባ ብጻይ ተስፋይ ወልደሚካኤል (ደጊጋ) ኣቦ-መንበር ሰዲህኤ ናይ እንኳዕ ደሓን መጻእኩምን መእተዊን ቃልን ኣስሚዑ፡ ናይቲ ኣኼባ ዝርዝር ኣጀንዳ ኣቕሪቡ።
ፈጻሚ ሽማግለ ሰዲህኤ ኣብዚ ኣባላቱ ብምልኣት ዝተሳተፍሉ ኣኼባኡ፡ ነቲ ኣቐዲሙ ናብ ተሳተፍቲ ኣኼባ ተዘርጊሑ ዝጸንሐ ናይ ነፍሲ ወከፍ ቤት ጽሕፈት ፈጻሚ ሽማግለ፡ ናይ 4ተ ኣዋርሕ ጸብጻባት በብሓደ መዚኑ። ኣብ ምምዛን ካብ ጸብጻባት ዘይበርሀ ንዝነበረ ኣብሪሁ፡ ሕቶታት መሊሱ ኣብ ኣድለይቲ ዝበሎም ዛዕባታት ከኣ ውሳነታት ብምውሳን ነቲ ጸብጻባት ከም ሰነድ ሰልፊ ኣጽዲቕዎ። ኣብቲ ገምጋሙ ብመሰረቲ ኣቐዲሙ ዝተታሕዘ ትልሚ ጽቡቕ ኣሳልጦ ከምዝተኻየደ መዚኑ፡ ኣብ መጻ | c4-am |
// *** main dependencies *** //
var express = require('express');
var path = require('path');
var bodyParser = require('body-parser');
var http = require('http');
var mongoose = require('mongoose');
var flash = require('connect-flash');
var favicon = require('serve-favicon');
// *** auth dependencies *** //
var passport = require('passport');
var cookieParser = require('cookie-parser');
var session = require('express-session');
// *** routes *** //
var routes = require('./routes/routes.js');
// *** config file *** //
var config = require('./config/config');
// *** express instance *** //
var app = express();
// *** mongoose *** ///
mongoose.connect(config.mongoURI[app.settings.env], function(err, res) {
if(err) {
console.log('Error connecting to the database. ' + err);
} else {
console.log('Connected to Database: ' + config.mongoURI[app.settings.env]);
}
});
// *** tell express that we want to use EJS view engine *** //
app.set('views', path.join(__dirname, 'views'));
app.set('view engine', 'ejs');
// *** required for passport *** //
app.use(cookieParser()); // read cookies (needed for auth)
app.use(session({
secret: 'ilovemoney',
resave: true,
saveUninitialized: true
}));
app.use(passport.initialize());
app.use(passport.session()); // persistent login sessions
app.use(flash()); // use connect-flash for flash messages stored in session
// *** config middleware *** //
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: false }));
app.use(express.static(path.join(__dirname, 'assets')));
app.use(favicon(path.join(__dirname, 'assets', 'img/favicon.png')));
// *** main routes *** //
app.use('/', routes);
// *** server config *** //
var server = http.createServer(app);
server.listen(config.portNumber, function() {
console.log(`Node server running on http://localhost:${config.portNumber}`);
});
module.exports = app;
| pavelzamyatin/js-finance-server/app.js |
package utils
type Queue struct {
elems []interface{}
nelems, popi, pushi int
}
func (q *Queue) Len() int {
return q.nelems
}
func (q *Queue) Push(elem interface{}) {
if q.nelems == len(q.elems) {
q.expand()
}
q.elems[q.pushi] = elem
q.nelems++
q.pushi = (q.pushi + 1) % len(q.elems)
}
func (q *Queue) Pop() (elem interface{}) {
if q.nelems == 0 {
return nil
}
elem = q.elems[q.popi]
q.elems[q.popi] = nil // Help GC.
q.nelems--
q.popi = (q.popi + 1) % len(q.elems)
return elem
}
func (q *Queue) expand() {
curcap := len(q.elems)
var newcap int
if curcap == 0 {
newcap = 8
} else if curcap < 1024 {
newcap = curcap * 2
} else {
newcap = curcap + (curcap / 4)
}
elems := make([]interface{}, newcap)
if q.popi == 0 {
copy(elems, q.elems)
q.pushi = curcap
} else {
newpopi := newcap - (curcap - q.popi)
copy(elems, q.elems[:q.popi])
copy(elems[newpopi:], q.elems[q.popi:])
q.popi = newpopi
}
for i := range q.elems {
q.elems[i] = nil // Help GC.
}
q.elems = elems
}
| dolotech/admins-src/basic/utils/queue.go |
var sum = 0;
for(i=2;i < process.argv.length; i++) {
// + in front of variable somehow converts the variable into an integer
sum += +process.argv[i];
}
console.log(sum); | hoathenguyen85/learn_node-baby_steps.js |
(function() {
if (getVisiblePage() == "dilemmas") {
(new UserSettings()).child("dismiss_all").on(function(data) {
$("button[name='autodismiss_issues']").remove();
if (!data["dismiss_all"]) {
$("<button name='autodismiss_issues' class='button danger'>Auto Dismiss All Issues</button>").insertAfter($("button[name='dismiss_all']"));
} else {
$("<button name='autodismiss_issues' class='button'>Cancel Dismissing All Issues</button>").insertAfter($("button[name='dismiss_all']"));
}
}, false);
$("body").on("click", "button[name='autodismiss_issues']", function(event) {
event.preventDefault();
var enabled = $(this).html() == "Cancel Dismissing All Issues";
(new UserSettings()).child("dismiss_all").set(!enabled);
$(this).attr("disabled", true);
});
}
})();
| NationStates/NationStatesPlusPlus-Extension/js/issues.js |
Config Apache - chyba - C compiler cannot create executables
AbcLinuxu:/ Poradna / Linuxová poradna / Config Apache - chyba - C compiler cannot create executables
Štítky: Apache, C, config, chyba, PHP, programování, Unix
Dotaz: Config Apache - chyba - C compiler cannot create executables
19.4.2010 21:55 Jiri
config.log (7950 bytů)
Proznavam ze jsem uplny novic, pokousim se na serveru s free hostingem rozbehnout php a Apache del tohoto popisu http://www.php.net/manual/en/install.unix.apache2.php ale koncim na chybe po ./config
log je v priloze. Predem dik za radu
19.4.2010 22:00 chrono
Rozbalit Rozbalit vše Re: Config Apache - chyba - C compiler cannot create executables
Toto asi nie je správny log (predpokladám, že chyba bude v tom, čo je v adresári s apr knižnicou).
19.4.2010 22:07 chrono
Inak pri takejto chybe pravdepodobne chýba devel balíček glibc (a potrebné závislosti).
19.4.2010 22:18 vencour | skóre: 55 | blog: Tady je Vencourovo | Praha+západní Čechy
Přímo "cannot create executables" jsem měl v gentoo, když jsem blbě nastavil flagy pro překlad, překládal jsem pro jinej typ procesoru.
20.4.2010 00:48 Michal Kubeček | skóre: 71 | Luštěnice
Ono to může znamenat ledacos od nenainstalovaného gcc po nesmyslný obsah CFLAGS. Prostě cokoli, co může způsobit, že gcc nepřeloží nebo neslinkuje triviální testovací prográmek. Obecně je potřeba podívat se do logu, co přesně selhalo a proč.
20.4.2010 08:11 MMMMMMMMM | skóre: 42 | blog: unstable | Valašsko :-)
Včera jsem si hrál s optimalizací kompilace a když jsem zadal nesprávné flagy, také jsem skončil s touto chybou.
20.4.2010 08:08 Filip Jirsák | skóre: 67 | blog: Fa & Bi
Ten návod popisuje kompilaci a instalaci PHP, to vám ale free hosting určitě nepovolí. Předpokládám tedy, že jde o webhosting a ne o celý virtuální stroj. Pokud jde skutečně o webhosting, pak musí PHP nainstalovat, nakonfigurovat a povolit webhoster – a je možné, že to v programu zdarma neposkytuje (taky to nemusí poskytovat vůbec). V takovém případě byste si musel najít jiný webhosting (těch, které poskytují zdarma i PHP, je dost). Pokud váš webhosting PHP podporuje, mělo by stačit jednoduše vytvořit soubor s příponou .php, a máte hotovo. Pokud by to nefungovalo, přečtěte si dokumentaci k tomu hostingu, tam určitě bude napsané, jak s PHP zacházet.
Obecně, i kdybyste instaloval PHP na svůj server (ať fyzický či virtuální) je lepší použít balíčkovací systém distribuce a PHP nainstalovat pomocí něj. Způsob instalace ze zdrojových kódů není určen pro běžné uživatelské použití. | c4-cs |
#### Howdy, Stranger!
It looks like you're new here. If you want to get involved, click one of these buttons!
# Progress Bar
Member Posts: 72
hello
I have a progress bar in my form and i'd like it to show me the time it takes for a background process to complete.
Basically, when i hit a command button this calls a sub that calculates some stuff and takes a few seconds.
The actual length of time depends on the user input, so say it changes by 10 secs if the user inputs 500 instead of 10 which is almost instantenous.
Does anyone know how to do this?
Thanx a lot
stacey
• Member Posts: 335
: hello
:
: I have a progress bar in my form and i'd like it to show me the time it takes for a background process to complete.
: Basically, when i hit a command button this calls a sub that calculates some stuff and takes a few seconds.
: The actual length of time depends on the user input, so say it changes by 10 secs if the user inputs 500 instead of 10 which is almost instantenous.
:
: Does anyone know how to do this?
: Thanx a lot
:
: stacey
:
:
If your calculation is going through a loop, you can do like this:
progressbar.min=0
progressbar.max=LoopEndCount
inside the loop:
do until counter=LoopEndCount
progressbar.value=counter
counter=counter+1
Loop
------------------------------------------
Only stupidity of mankind and the universe
are infinite, but i'm not sure concerning
the universe. A. Einstein
• Member Posts: 72
: If your calculation is going through a loop, you can do like this:
Hi,
Well, i don't actualy have one loop (have lots of little ones). And i suppose trying to approximate a time would definately depend on the coputer's performance so even if i approximated the time on my pc it would probably be very different on another.
Maybe i can put a little animation instead. Does anyone have any nice .avi of a little calculator vibrating or something?? Hehe...
Thanx anyway!
• Member Posts: 1,625
Vibrating huh?? Ha, it is possible to calculate the ETA as well!
First you must know how many calclations you have. 10 for example.
Now, calculate the time of the first calculation by doing:
lngTime = Timer
' calculate some stuff
lngTime = Timer - lngTime (Note: during calculation the timer may reset to 0 when it reaches it's max.)
Now you have the time for the first calculation.
The rest is simple, multiply it with the number of calcs and decrease it with the first time index after every calc you make.
You i doubt it will be needed. Most cpu's are very fast and have no problems with small or normal calcs. Unless your calc is huge!
Is this ok for yo?
: : If your calculation is going through a loop, you can do like this:
:
: Hi,
:
: Well, i don't actualy have one loop (have lots of little ones). And i suppose trying to approximate a time would definately depend on the coputer's performance so even if i approximated the time on my pc it would probably be very different on another.
:
: Maybe i can put a little animation instead. Does anyone have any nice .avi of a little calculator vibrating or something?? Hehe...
: Thanx anyway!
:
:
:
[HR]
[CODE]
Wot tinkst no wol wr fn my?
Do mast dy in kear dyn stomme bek tigt hlde.
Oars mat ik mem Jelsma es op dy wstjoere!
[/CODE]
[HR]
• Member Posts: 72
Well, it's not really a calculator operation. The process which i want to apply the progress bar to involves various other applications such as opening a database file, reading and writing in it, calculating various variable arrays, just lots of different things. So it's hard to put a timer on opening a file or starting a database connection along with everything else. That's why the animation may be good in this particular case.
I mean... it doesn't have to be a calculator vibrating. It could be for example a little character scribbling on a piece of paper or something. ummmm, got any?
• Member Posts: 1,625
Euh, i got a lot of virbrating stuff around but no AVI's for that. However, the Visual Studio package includes some of those! And the Internet is the biggest resource for that! So finding Avi's on the net is not so hard.
: Well, it's not really a calculator operation. The process which i want to apply the progress bar to involves various other applications such as opening a database file, reading and writing in it, calculating various variable arrays, just lots of different things. So it's hard to put a timer on opening a file or starting a database connection along with everything else. That's why the animation may be good in this particular case.
:
: I mean... it doesn't have to be a calculator vibrating. It could be for example a little character scribbling on a piece of paper or something. ummmm, got any?
:
[HR]
[CODE]
Wot tinkst no wol wr fn my?
Do mast dy in kear dyn stomme bek tigt hlde.
Oars mat ik mem Jelsma es op dy wstjoere!
[/CODE]
[HR]
• Member Posts: 72
oki doki
• USAMember Posts: 0
____ // http://forcoder.org // free ebooks and video tutorials about ( Python Assembly Objective-C Visual Basic .NET MATLAB Delphi C++ PHP Swift Go Visual Basic PL/SQL C C# JavaScript Ruby Perl Java Scratch R Bash Scheme Logo LabVIEW Crystal Kotlin ML SAS Transact-SQL VBScript Hack Erlang D Ada F# Lisp ABAP Alice Fortran Dart FoxPro Scala Apex Lua Clojure Awk Prolog Julia COBOL Rust ) ________ | finemath-3plus |
## Statistical Uncertainty
Despite having developed a strong mathematical aptitude, I entered the final year of my undergraduate education in electrical engineering with great trepidation. My nemesis was a final unmet graduation requirement to complete a course in statistics. I excelled in solving math problems that had a single, unambiguous answer. Unfortunately, I simply could not wrap my head around the idea that some problems had infinite, fuzzy solutions. In the end, I satisfied the requirement with a difficult sounding class that thankfully had very little pure statistics. That course was called “Introduction to Probability and Random Signals.”
A funny thing sometimes happens when you face and conquer your greatest fear. In my case, I rapidly developed a passion for statistics and went on to major in econometrics and statistics. To my great surprise, I was granted a statistics scholarship that covered a healthy chunk of my tuition. Apparently, there are not a lot of statistics geeks, even in a very quantitatively focused business school like Booth.
I offer that background merely to acknowledge my statistics bias. But, though you certainly do not need to excel in statistics to succeed in business or in life, knowing a few rudimentary concepts is extremely valuable.
Embrace Uncertainty
The greatest epiphany that I had was to embrace rather than fear variability. Uncertainty surrounds us in nature, at home, and in business. Absolute randomness is rare. Rather, seek to understand the expected outcome and the range around it (usually wider than you think)
This concept has worked its way into the professional world in the form of the very useful 80-20 rule. In 1941, management scholar Joseph Juran studied the work of Italian economist Vilfredo Pareto. Pareto had observed that 80% of the land in Italy was owned by 20% of the population. Juran honored the economist by formally coining the concept as the Pareto Principle. (Not much has changed; the top 20% of households in the United States hold 85% of the wealth. In fact, the top 1% command nearly 35% of private wealth all by themselves.)
The amazing thing about the 80-20 rule is that it allows you to stop digging when you can account for 80 percent of virtually anything. It only gets better, because you can get to that level of understanding by doing only 20 percent of the work that you would need to do to get to a total and complete answer. Unless you are a brain surgeon or a civil engineer, this rule of thumb is an risk-free and immense productivity booster. To be able to stop when you only have eighty percent of the answer requires that you embrace uncertainty; switch from thinking in terms of yes or no and instead merely accept that an outcome is likely or unlikely.
Take calculated risks
The only way to excel in business and in life is to take calculated risks. In fact, the more risks you take the better, since you will not only learn from your mistakes but will also have better odds of securing at least one big win. Nothing ventured, nothing gained.
As you venture forth, it is critical to understand that people systematically overestimate risk. Factors you should correct for that magnify perceived risk include: limited control, human made rather than natural phenomena, limited information, dreadful outcomes, lack of familiarity, and direct awareness. Moreover, we ascribe greater risk to children than to adults engaged in the exact same activity.
Indulge me in one very personal example. As a father, I am deathly concerned that one or both of my children will experience a severe spinal cord injury. This fear nearly caused me to quash my daughter’s love of participating in recreational gymnastics. But, consider a few facts and figures. In the United States, there are estimated to be 40 cases of spinal cord injury per million people per year. Of these, only 16% are caused by sports and recreation accidents. Researchers in Japan provide the final piece of the puzzle. Among Japanese spinal cord injuries associated with sporting activities, 6.6% result from gymnastics. That means that the annual chance of a person experiencing a spinal cord injury in gymnastics is less than 1 in a million. To put this into perspective, the odds of dying in a motor vehicle accident in the United States are fully 340 times greater at 144 in a million. Based on the data, my fear of recreational gymnastics was completely overblown. In fact, it is really my daughter that should be worried about me.
Beware of assuming that correlation implies causality
In May 1999, a study published in the popular scientific journal Nature nearly put the night light industry out of business, much to the chagrin of frightened infants and toddlers everywhere. In the article, University of Pennsylvania Medical Center researchers studied the amount of ambient light that 479 subjects were exposed to during their nighttime sleep. For children from birth to two years of age, myopia – or nearsightedness – was far more prevalent in children who slept with a night light rather than in darkness. Moreover, those children whose parents left the room’s light fixture on were even more likely to have eye problems later on. Parents of children with glasses must have been feeling extremely guilty for having used nightlights.
The researchers cited similar findings in studies with young chickens and outlined the likely developmental processes impacted by excessive light exposure at an early age. Though they carefully hedged their bets, the researchers teetered on the brink of implying causality when they reported: “Although it does not establish a causal link, the statistical strength of the association of night-time light exposure and childhood myopia does suggest that the absence of a daily period of darkness during early childhood is a potential precipitating factor in the development of myopia.”
Fortunately, a year later, Ohio State University researchers spared millions of innocent children from the boogie man. In a larger study of 1,220 children, Karla Zadnik and her co-authors determined that ambient light during sleep does not cause nearsightedness. Instead, it turns out that nearsighted kids simply have nearsighted parents who are more likely to leave a light on than parents without vision problems, to light their own path in the middle of the night. The cause is genetic. In other words, the researchers of the initial study had found simply a correlation between ambient light and myopia, but not a causality, and thus had engendered needless guilt in many myopic parents.
Even very smart and well-meaning people fall into the trap of assuming that correlation implies causality. To contend against this, in each instance look for three other explanations. The first is an external cause. This is what was at play with the genetic cause that explained the relationship between night lights and nearsightedness. The second is known as reverse causation. For example, you might notice there are more police at larger crime scenes and incorrectly conclude that police cause crime. The third explanation is mere coincidence. Some humorous examples of this are concluding that the growth of social networking websites or hybrid automobile sales fueled the 2009 economic recession.
Recap
Here are the concepts you can immediately apply to take charge of statistical concepts :
• Embrace uncertainty
• Take calculated risks
• Beware of assuming that correlation implies causality
Request a topic
E-mail (required - will not be published) | finemath-3plus |
//
// Main
// -----------------------
$(function() {
window.pool = app = new App();
}); | tuckbick/Pool-public/javascripts/main.js |
class Fargatecli < Formula
desc "CLI for AWS Fargate"
homepage "https://github.com/awslabs/fargatecli"
url "https://github.com/awslabs/fargatecli/archive/0.3.2.tar.gz"
sha256 "f457745c74859c3ab19abc0695530fde97c1932b47458706c835b3ff79c6eba8"
license "Apache-2.0"
bottle do
sha256 cellar: :any_skip_relocation, arm64_big_sur: "ba7b19d6b21be020f27b1fc3b65e41b3c58467d92e289399abecb48cad82b9c9"
sha256 cellar: :any_skip_relocation, big_sur: "c35cbba29b8f2bd5bb92841a2356fa300622a9c42defca0c3f6886e93c3f5ef9"
sha256 cellar: :any_skip_relocation, catalina: "4cf90341de4a444842414de2364ae5ed51283008dfd99739cde4fcd00583f50a"
sha256 cellar: :any_skip_relocation, mojave: "193a1ca57966d54bc0ebaaa5b28397448f2ecc0276d6f69b4adc20acd8324553"
sha256 cellar: :any_skip_relocation, high_sierra: "c5b6d73103fdab97321d13426271177f03bb1240db637f8d252678e376e7f129"
sha256 cellar: :any_skip_relocation, x86_64_linux: "614f3d03030905e357039121a113e56bfbdbad0ba8341807e020a2fb488d7131"
end
depends_on "go" => :build
def install
system "go", "build", *std_go_args
prefix.install_metafiles
end
test do
output = shell_output("#{bin}/fargatecli task list", 1)
assert_match "Your AWS credentials could not be found", output
end
end
| Linuxbrew/homebrew-core-Formula/fargatecli.rb |
// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to permit
// persons to whom the Software is furnished to do so, subject to the
// following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.
var common = require('../common');
var assert = require('assert');
var vm = require('vm');
var ctx = vm.createContext(global);
assert.doesNotThrow(function() {
vm.runInContext("!function() { var x = console.log; }()", ctx);
});
| kotarondo/PersHA.js-test/node/test/simple/test-vm-cross-context.js |
/*****************************************************************************\
* ANALYSIS PERFORMANCE TOOLS *
* Extrae *
* Instrumentation package for parallel applications *
*****************************************************************************
* ___ This library is free software; you can redistribute it and/or *
* / __ modify it under the terms of the GNU LGPL as published *
* / / _____ by the Free Software Foundation; either version 2.1 *
* / / / \ of the License, or (at your option) any later version. *
* ( ( ( B S C ) *
* \ \ \_____/ This library is distributed in 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 LGPL for more details. *
* *
* You should have received a copy of the GNU Lesser General Public License *
* along with this library; if not, write to the Free Software Foundation, *
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
* The GNU LEsser General Public License is contained in the file COPYING. *
* --------- *
* Barcelona Supercomputing Center - Centro Nacional de Supercomputacion *
\*****************************************************************************/
#ifndef __TRACE_MODE_H__
#define __TRACE_MODE_H__
enum
{
TRACE_MODE_DETAIL = 1,
TRACE_MODE_BURSTS,
TRACE_MODE_PHASE_PROFILE,
TRACE_MODE_DISABLED
};
#endif /* __TRACE_MODE_H__ */
| bsc-performance-tools/extrae-src/common/trace_mode.h |
//create server
var http = require("http");
var fs = require("fs");
var path = require("path");
var server = http.createServer(requestListener);
server.listen((process.env.PORT || 5000), function() {
console.log((process.env.PORT || 5000) + "番でサーバ起動");
});
//request server
function requestListener(req, res) {
//request file
var reqURL = req.url;
//get expand
var extensionName = path.extname(reqURL);
//rooting of expand
switch(extensionName){
case ".html":
readFileHandler(reqURL, "text/html", false, res);
break;
case ".css":
readFileHandler(reqURL, "text/css", false, res);
break;
case ".js":
case ".ts":
readFileHandler(reqURL, "text/javascript", false, res);
break;
case ".png":
readFileHandler(reqURL, "image/png", true, res);
break;
case ".jpg":
readFileHandler(reqURL, "image/jpeg", true, res);
break;
case ".gif":
readFileHandler(reqURL, "image/gif", true, res);
break;
default:
//else
readFileHandler("/index.html", "text/html", false, res);
break;
}
}
//read file
function readFileHandler(fileName, contentType, isBinary, response) {
//encode setting
var encoding = !isBinary ? "utf8" : "binary";
var filePath = __dirname + fileName;
fs.exists(filePath, function(exits) {
if(exits) {
fs.readFile(filePath, {encoding: encoding}, function (error, data) {
if (error) {
response.statusCode = 500;
response.end("Internal Server Error");
} else {
response.statusCode = 200;
response.setHeader("Content-Type", contentType);
if(!isBinary) {
response.end(data);
} else {
response.end(data, "binary");
}
}
});
} else {
//400 error
response.statusCode = 400;
response.end("400 Error");
}
});
}
//read socket.io
var socketIO = require("socket.io");
//avairable socket.io
var io = socketIO.listen(server);
//watching server
io.sockets.on("connection", function(socket) {
//tap event
socket.on("tapDown", function(data) {
console.log("push");
//socket.join("connect");
//socket.emit("down", 1);
//socket.to("index").broadcast.emit("down", 1);
socket.broadcast.emit("down", 1);
});
});
//connection error
io.sockets.on("connect_error", function(socket) {
console.log("connection error!");
});
//disconnection
io.sockets.on("disconnect", function(socket) {
socket.emit("disconnectEvent");
console.log("disconnection");
}); | yanoooooo/chemical-server.js |
cask "racket" do
version "7.8"
sha256 "88bf81c54d2ea777194cec5534baaf5096f4398660e09c9075abaf821ec5e135"
url "https://mirror.racket-lang.org/installers/#{version}/racket-#{version}-x86_64-macosx.dmg"
appcast "https://download.racket-lang.org/all-versions.html"
name "Racket"
homepage "https://racket-lang.org/"
conflicts_with cask: "racket-cs"
suite "Racket v#{version}"
binary "#{appdir}/Racket v#{version}/bin/drracket"
binary "#{appdir}/Racket v#{version}/bin/gracket"
binary "#{appdir}/Racket v#{version}/bin/gracket-text"
binary "#{appdir}/Racket v#{version}/bin/mred"
binary "#{appdir}/Racket v#{version}/bin/mred-text"
binary "#{appdir}/Racket v#{version}/bin/mzc"
binary "#{appdir}/Racket v#{version}/bin/mzpp"
binary "#{appdir}/Racket v#{version}/bin/mzscheme"
binary "#{appdir}/Racket v#{version}/bin/mztext"
binary "#{appdir}/Racket v#{version}/bin/pdf-slatex"
binary "#{appdir}/Racket v#{version}/bin/plt-games"
binary "#{appdir}/Racket v#{version}/bin/plt-help"
binary "#{appdir}/Racket v#{version}/bin/plt-r5rs"
binary "#{appdir}/Racket v#{version}/bin/plt-r6rs"
binary "#{appdir}/Racket v#{version}/bin/plt-web-server"
binary "#{appdir}/Racket v#{version}/bin/racket"
binary "#{appdir}/Racket v#{version}/bin/raco"
binary "#{appdir}/Racket v#{version}/bin/scribble"
binary "#{appdir}/Racket v#{version}/bin/setup-plt"
binary "#{appdir}/Racket v#{version}/bin/slatex"
binary "#{appdir}/Racket v#{version}/bin/slideshow"
binary "#{appdir}/Racket v#{version}/bin/swindle"
end
| haha1903/homebrew-cask-Casks/racket.rb |
package aws
// A Handlers provides a collection of request handlers for various
// stages of handling requests.
type Handlers struct {
Validate HandlerList
Build HandlerList
Sign HandlerList
Send HandlerList
ValidateResponse HandlerList
Unmarshal HandlerList
UnmarshalMeta HandlerList
UnmarshalError HandlerList
Retry HandlerList
AfterRetry HandlerList
}
// copy returns of this handler's lists.
func (h *Handlers) copy() Handlers {
return Handlers{
Validate: h.Validate.copy(),
Build: h.Build.copy(),
Sign: h.Sign.copy(),
Send: h.Send.copy(),
ValidateResponse: h.ValidateResponse.copy(),
Unmarshal: h.Unmarshal.copy(),
UnmarshalError: h.UnmarshalError.copy(),
UnmarshalMeta: h.UnmarshalMeta.copy(),
Retry: h.Retry.copy(),
AfterRetry: h.AfterRetry.copy(),
}
}
// Clear removes callback functions for all handlers
func (h *Handlers) Clear() {
h.Validate.Clear()
h.Build.Clear()
h.Send.Clear()
h.Sign.Clear()
h.Unmarshal.Clear()
h.UnmarshalMeta.Clear()
h.UnmarshalError.Clear()
h.ValidateResponse.Clear()
h.Retry.Clear()
h.AfterRetry.Clear()
}
// A HandlerList manages zero or more handlers in a list.
type HandlerList struct {
list []func(*Request)
}
// copy creates a copy of the handler list.
func (l *HandlerList) copy() HandlerList {
var n HandlerList
n.list = append([]func(*Request){}, l.list...)
return n
}
// Clear clears the handler list.
func (l *HandlerList) Clear() {
l.list = []func(*Request){}
}
// Len returns the number of handlers in the list.
func (l *HandlerList) Len() int {
return len(l.list)
}
// PushBack pushes handlers f to the back of the handler list.
func (l *HandlerList) PushBack(f ...func(*Request)) {
l.list = append(l.list, f...)
}
// PushFront pushes handlers f to the front of the handler list.
func (l *HandlerList) PushFront(f ...func(*Request)) {
l.list = append(f, l.list...)
}
// Run executes all handlers in the list with a given request object.
func (l *HandlerList) Run(r *Request) {
for _, f := range l.list {
f(r)
}
}
| nalind/graphc-vendor/src/github.com/docker/docker/vendor/src/github.com/aws/aws-sdk-go/aws/handlers.go |
import math
import unittest
import mock
import numpy
import six
import chainer
from chainer import cuda
from chainer import functions
from chainer import gradient_check
from chainer import testing
from chainer.testing import attr
from chainer.testing import condition
@testing.parameterize(
{'shape': (8, 7), 'normalize': True},
{'shape': (8, 7), 'normalize': False},
{'shape': (8, 7), 'normalize': True, 'ignore_all': True},
# too large shape causes int32 -> float64 issue
{'shape': (65536, 1), 'normalize': False},
)
class TestSigmoidCrossEntropy(unittest.TestCase):
def setUp(self):
self.x = numpy.random.uniform(-1, 1, self.shape).astype(numpy.float32)
if getattr(self, 'ignore_all', False):
self.t = -numpy.ones(self.shape).astype(numpy.int32)
else:
self.t = numpy.random.randint(-1, 2,
self.shape).astype(numpy.int32)
def check_forward(self, x_data, t_data, use_cudnn=True):
x_val = chainer.Variable(x_data)
t_val = chainer.Variable(t_data)
loss = functions.sigmoid_cross_entropy(x_val, t_val,
use_cudnn, self.normalize)
self.assertEqual(loss.data.shape, ())
self.assertEqual(loss.data.dtype, numpy.float32)
loss_value = float(cuda.to_cpu(loss.data))
# Compute expected value
loss_expect = 0
if not getattr(self, 'ignore_all', False):
non_ignore_count = 0
for i in six.moves.range(self.x.shape[0]):
for j in six.moves.range(self.x.shape[1]):
xd, td = self.x[i, j], self.t[i, j]
if td == -1:
continue
loss_expect -= xd * (td - (xd >= 0)) \
- math.log(1 + math.exp(-numpy.abs(xd)))
non_ignore_count += 1
if self.normalize:
loss_expect /= non_ignore_count
else:
loss_expect /= self.t.shape[0]
self.assertAlmostEqual(loss_expect, loss_value, places=5)
@condition.retry(3)
def test_forward_cpu(self):
self.check_forward(self.x, self.t)
@attr.cudnn
@condition.retry(3)
def test_forward_gpu(self):
self.check_forward(cuda.to_gpu(self.x), cuda.to_gpu(self.t))
@attr.gpu
@condition.retry(3)
def test_forward_gpu_no_cudnn(self):
self.check_forward(cuda.to_gpu(self.x), cuda.to_gpu(self.t), False)
def check_backward(self, x_data, t_data, use_cudnn=True):
# Skip too large case. That requires a long time.
if self.shape[0] == 65536:
return
gradient_check.check_backward(
functions.SigmoidCrossEntropy(use_cudnn),
(x_data, t_data), None, eps=1e-2)
@condition.retry(3)
def test_backward_cpu(self):
self.check_backward(self.x, self.t)
@attr.cudnn
@condition.retry(3)
def test_backward_gpu(self):
self.check_backward(cuda.to_gpu(self.x), cuda.to_gpu(self.t))
@attr.gpu
@condition.retry(3)
def test_backward_gpu_no_cudnn(self):
self.check_backward(cuda.to_gpu(self.x), cuda.to_gpu(self.t), False)
@testing.parameterize(
{'use_cudnn': True},
{'use_cudnn': False},
)
@attr.cudnn
class TestSgimoidCrossEntropyCudnnCall(unittest.TestCase):
def setUp(self):
self.x = cuda.cupy.random.uniform(-1, 1, (4, 3)).astype(numpy.float32)
self.t = cuda.cupy.random.randint(0, 3, (4, 3)).astype(numpy.int32)
def forward(self):
x = chainer.Variable(self.x)
t = chainer.Variable(self.t)
return functions.sigmoid_cross_entropy(x, t, self.use_cudnn)
def test_call_cudnn_backward(self):
y = self.forward()
with mock.patch('cupy.cudnn.cudnn.activationForward') as func:
y.backward()
self.assertEqual(func.called, self.use_cudnn)
# Note that SoftmaxCrossEntropy does not use cudnn on backward
testing.run_module(__name__, __file__)
| cemoody/chainer-tests/chainer_tests/functions_tests/loss_tests/test_sigmoid_cross_entropy.py |
STRAIGHT PLUG: YACT26JG35AEV00100 DEUTSCH | TE Connectivity
ACT26JG35AE [V001]
Interne TE-Nummer: YACT26JG35AEV00100
Mil-Spec: D38999/26JG35AE
Alias-ID: D38999/26JG35AE
Anzahl von Positionen 79
Anzahl der Leistungspole 79
Position verschlüsselt E
Kodierung Schlüsselpolarisierung E
Gewicht 28.5 g [ .0629 lb ]
Kontaktaufbau G35
Menge der Kontakte (Größe 22D) 79 | c4-de |
# Skier down a slope
1. Oct 8, 2006
### rkslperez04
Here is the question:
A women skis down a slope 100 m high. Her speed at the foot of the slope is 20 m/s. What percentage of her intial potential engery is lost?
okkk.. here is what I get:
My instructor mentioned this was a Ef/Ei problem. (effientcy final divided by effientcy intial)
my book uses the formula: 1 - (KE2/PE2)
Im confused where the one came from?
then...
I understand we have PE at the top of the hill only being we are to assume she is at rest... so no KE. So does that mean we no PE at the bottom only KE...
Im confused.. can someone explain this to me in laymens terms so I can rework the problem. Is there an easier way to solve this.??
2. Oct 8, 2006
### PhanthomJay
Yes, you are on the right track. She has only PE at the top. At the bottom, no PE, just KE. Calculate her PE at the top. Calculate her KE at the bottom. How much energy was lost (due to friction, snow resistance, air resistance, etc.)? What percentage is that of the initial energy? The result is the same as (1 - E_f/E_i), where E_f and E_i are the final and initial energy, respectively. I don't understand either where the book formula came from.
3. Oct 9, 2006
### andrevdh
The amount of energy that was lost is
$$PE_t - KE_b$$
where t refers to top and b to bottom. The fraction of energy lost will be
$$\frac{PE_t - KE_b}{PE_t}$$
which comes to
$$1 - \frac{KE_b}{PE_t}$$
the percentage will just be this fraction times one hundred. | finemath-3plus |
var Crevice = function(name, x, y, hp) {
var moveSpeed = 3.0;
var skeleton = new Player(x, y, hp, name, moveSpeed);
var facing_left;
var spritesheet_offset_y = 0;
/* Maybe make this heal??
skeleton.leftClick = function(){
};*/
/* Lolswagz */
skeleton.getCharacterType = function() {
return "Crevice";
};
var crevice_l = new PIXI.extras.MovieClip([PIXI.Texture.fromFrame("crevice_l.png")]);
var crevice_r = new PIXI.extras.MovieClip([PIXI.Texture.fromFrame("crevice_r.png")]);
skeleton.imageContainer.addChild(crevice_l);
skeleton.draw = function() {
this.drawText();
var drawAtX = CONFIG.SCREEN_WIDTH / 2 + skeleton.getDrawAtX() - skeleton.localX() - 50; // do + 20 for grimes idk yy
var drawAtY = skeleton.getDrawAtY() - 50;
crevice_r.position.y = drawAtY;
crevice_l.position.y = drawAtY;
crevice_l.position.x = drawAtX;
crevice_r.position.x = drawAtX;
skeleton.setMeeleeAttack(false);
if (this.getMoveDirection() === "left") {
skeleton.imageContainer.removeChild(crevice_r);
skeleton.imageContainer.removeChild(crevice_l);
skeleton.imageContainer.addChild(crevice_l);
} else if (this.getMoveDirection() === "right") {
skeleton.imageContainer.removeChild(crevice_r);
skeleton.imageContainer.removeChild(crevice_l);
skeleton.imageContainer.addChild(crevice_r);
}
/* Decides what sprite to draw
//var drawAtX = skeleton.getX()-50;
this.drawText();
if (this.getMoveDirection() === "left"){
facing_left = true;
} else if (this.getMoveDirection() === "right"){
facing_left = false;
}
if (skeleton.getAnimate() %40 <= 10){
ctx.drawImage(crevice, 0, spritesheet_offset_y, 100, 100, drawAtX,this.getY()-70,100,100);
}
else if (skeleton.getAnimate() <= 20){
ctx.drawImage(crevice, 100, spritesheet_offset_y, 100, 100, drawAtX,this.getY()-70,100,100);
}
else if (skeleton.getAnimate()%40 <= 30){
ctx.drawImage(crevice, 0, spritesheet_offset_y, 100, 100, drawAtX,this.getY()-70,100,100);
} else{
ctx.drawImage(crevice, 200, spritesheet_offset_y, 100, 100, drawAtX,this.getY()-70,100,100);
}*/
};
skeleton.update = function(keys) {};
return skeleton;
}; | hassanshaikley/AOTB-Frontend/JavaScripts/Units/crevice.js |
import random
data = {
"2": 2,
"3": 3,
"4": 4,
"5": 5,
"6": 6,
"7": 7,
"8": 8,
"9": 9,
"10": 10,
"J": 2,
"Q": 3,
"K": 4,
"A": 11
}
def cards():
cards = ["2", "3", "4", "5",
"6", "7", "8", "9", "10",
"J", "Q", "K", "A"] * 4 # карты, умножаем на 4,по 4 масти и выходит 52
random.shuffle(cards)
return cards
| notexit/Black-Jack-core_gui/all_gui.py |
(function() {
'use strict';
var snooze = require('snooze');
snooze.module('chatApp')
.service('Util', function() {
function randomString(len) {
if(!len) {
len = 12;
}
var chars = 'abcdefghijklmnopqrstuvwxyz0987654321';
var randStr = '';
for(var i = 0; i < len; i++) {
randStr += chars[Math.floor(Math.random()*chars.length)];
}
return randStr;
};
return {
randomString: randomString
};
});
})(); | iamchairs/snooze-socket-chat-lib/services/Util.js |
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
* vim: set ts=4 sw=4 et tw=99:
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef jsion_lir_inl_h__
#define jsion_lir_inl_h__
namespace js {
namespace ion {
#define LIROP(name) \
L##name *LInstruction::to##name() \
{ \
JS_ASSERT(is##name()); \
return static_cast<L##name *>(this); \
}
LIR_OPCODE_LIST(LIROP)
#undef LIROP
#define LALLOC_CAST(type) \
L##type *LAllocation::to##type() { \
JS_ASSERT(is##type()); \
return static_cast<L##type *>(this); \
}
#define LALLOC_CONST_CAST(type) \
const L##type *LAllocation::to##type() const { \
JS_ASSERT(is##type()); \
return static_cast<const L##type *>(this); \
}
LALLOC_CAST(Use)
LALLOC_CONST_CAST(Use)
LALLOC_CONST_CAST(GeneralReg)
LALLOC_CONST_CAST(FloatReg)
LALLOC_CONST_CAST(StackSlot)
LALLOC_CONST_CAST(Argument)
LALLOC_CONST_CAST(ConstantIndex)
#undef LALLOC_CAST
#ifdef JS_NUNBOX32
static inline signed
OffsetToOtherHalfOfNunbox(LDefinition::Type type)
{
JS_ASSERT(type == LDefinition::TYPE || type == LDefinition::PAYLOAD);
signed offset = (type == LDefinition::TYPE)
? PAYLOAD_INDEX - TYPE_INDEX
: TYPE_INDEX - PAYLOAD_INDEX;
return offset;
}
static inline void
AssertTypesFormANunbox(LDefinition::Type type1, LDefinition::Type type2)
{
JS_ASSERT((type1 == LDefinition::TYPE && type2 == LDefinition::PAYLOAD) ||
(type2 == LDefinition::TYPE && type1 == LDefinition::PAYLOAD));
}
static inline unsigned
OffsetOfNunboxSlot(LDefinition::Type type)
{
if (type == LDefinition::PAYLOAD)
return NUNBOX32_PAYLOAD_OFFSET / STACK_SLOT_SIZE;
return NUNBOX32_TYPE_OFFSET / STACK_SLOT_SIZE;
}
// Note that stack indexes for LStackSlot are modelled backwards, so a
// double-sized slot starting at 2 has its next word at 1, *not* 3.
static inline unsigned
BaseOfNunboxSlot(LDefinition::Type type, unsigned slot)
{
if (type == LDefinition::PAYLOAD)
return slot + (NUNBOX32_PAYLOAD_OFFSET / STACK_SLOT_SIZE);
return slot + (NUNBOX32_TYPE_OFFSET / STACK_SLOT_SIZE);
}
#endif
} // namespace ion
} // namespace js
#endif // jsion_lir_inl_h__
| sergecodd/FireFox-OS-B2G/gecko/js/src/ion/LIR-inl.h |
/*
* ng_lmi.h
*/
/*-
* Copyright (c) 1996-1999 Whistle Communications, Inc.
* All rights reserved.
*
* Subject to the following obligations and disclaimer of warranty, use and
* redistribution of this software, in source or object code forms, with or
* without modifications are expressly permitted by Whistle Communications;
* provided, however, that:
* 1. Any and all reproductions of the source or object code must include the
* copyright notice above and the following disclaimer of warranties; and
* 2. No rights are granted, in any manner or form, to use Whistle
* Communications, Inc. trademarks, including the mark "WHISTLE
* COMMUNICATIONS" on advertising, endorsements, or otherwise except as
* such appears in the above copyright notice or in the software.
*
* THIS SOFTWARE IS BEING PROVIDED BY WHISTLE COMMUNICATIONS "AS IS", AND
* TO THE MAXIMUM EXTENT PERMITTED BY LAW, WHISTLE COMMUNICATIONS MAKES NO
* REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, REGARDING THIS SOFTWARE,
* INCLUDING WITHOUT LIMITATION, ANY AND ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT.
* WHISTLE COMMUNICATIONS DOES NOT WARRANT, GUARANTEE, OR MAKE ANY
* REPRESENTATIONS REGARDING THE USE OF, OR THE RESULTS OF THE USE OF THIS
* SOFTWARE IN TERMS OF ITS CORRECTNESS, ACCURACY, RELIABILITY OR OTHERWISE.
* IN NO EVENT SHALL WHISTLE COMMUNICATIONS BE LIABLE FOR ANY DAMAGES
* RESULTING FROM OR ARISING OUT OF ANY USE OF THIS SOFTWARE, INCLUDING
* WITHOUT LIMITATION, ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
* PUNITIVE, OR CONSEQUENTIAL DAMAGES, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES, LOSS OF USE, DATA OR PROFITS, HOWEVER CAUSED AND UNDER 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 WHISTLE COMMUNICATIONS IS ADVISED OF THE POSSIBILITY
* OF SUCH DAMAGE.
*
* Author: Archie Cobbs <[email protected]>
*
* $FreeBSD: soc2013/dpl/head/sys/netgraph/ng_lmi.h 139866 2005-01-07 01:45:51Z imp $
* $Whistle: ng_lmi.h,v 1.9 1999/01/20 00:22:13 archie Exp $
*/
#ifndef _NETGRAPH_NG_LMI_H_
#define _NETGRAPH_NG_LMI_H_
/* Node type name and magic cookie */
#define NG_LMI_NODE_TYPE "lmi"
#define NGM_LMI_COOKIE 867184133
/* My hook names */
#define NG_LMI_HOOK_DEBUG "debug"
#define NG_LMI_HOOK_ANNEXA "annexA"
#define NG_LMI_HOOK_ANNEXD "annexD"
#define NG_LMI_HOOK_GROUPOF4 "group4"
#define NG_LMI_HOOK_AUTO0 "auto0"
#define NG_LMI_HOOK_AUTO1023 "auto1023"
/* Netgraph commands */
enum {
NGM_LMI_GET_STATUS = 1,
};
#define NGM_LMI_STAT_ARYSIZE (1024/8)
struct nglmistat {
u_char proto[12]; /* Active proto (same as hook name) */
u_char hook[12]; /* Active hook */
u_char fixed; /* Set to fixed LMI mode */
u_char autod; /* Currently auto-detecting */
u_char seen[NGM_LMI_STAT_ARYSIZE]; /* DLCIs ever seen */
u_char up[NGM_LMI_STAT_ARYSIZE]; /* DLCIs currently up */
};
/* Some default values */
#define NG_LMI_KEEPALIVE_RATE 10 /* seconds per keepalive */
#define NG_LMI_POLL_RATE 3 /* faster when AUTO polling */
#define NG_LMI_SEQ_PER_FULL 5 /* keepalives per full status */
#define NG_LMI_LMI_PRIORITY 64 /* priority for LMI data */
#endif /* _NETGRAPH_NG_LMI_H_ */
| dplbsd/zcaplib-head/sys/netgraph/ng_lmi.h |
//
// HaoTiBenNavgationItem.h
// CropTest
//
// Created by liu on 13-7-5.
//
//
#import <UIKit/UIKit.h>
#import "KLAddition.h"
#import "KLNavigationBar.h"
#define kPhotoButtonNotifaction @"kPhotoButtonNotifaction"
#define kSubjectListButtonNotifaction @"kSubjectListButtonNotifaction"
#define kSubjectCountButtonNotifaction @"kSubjectCountButtonNotifaction"
@interface HaoTiBenNavgationItem :UIView {
UILabel *_nameLabel;
UIButton *_photoButton; /*拍照*/
UIButton *_subjectListButton; /*题目列表*/
UIButton *_subjectCountButton; /*题目统计*/
UIImageView *_logoImageView;
}
@property (nonatomic,retain)UILabel *nameLabel;
@property (nonatomic,retain)UIButton *subjectListButton;
@property (nonatomic,retain)UILabel *unreadMessageLabel;
//- (id)initwithCustomFrame:(CGRect )frame;
@end
| jinliang04551/PhotoCrop-PhotoCrop/PhotoCrop/CustomNavgationItem/HaoTiBenNavgationItem.h |
def to_pygame(p):
"""Small hack to convert pymunk to pygame coordinates"""
return int(p.x), int(-p.y + 600)
| TheoKanning/Jerry-Learns-jerry/conversion.py |
'use strict';
const _ = require('lodash'),
API = require('libs/api'),
pubsub = require('config/pubsub'),
UserControl = require('libs/user'),
Media = require('mongoose').model('Media');
// const debug = require('debug')('app:media');
function updateMedia(media) {
const data = _.pickBy({
video_views: media.video_view_count,
likes: media.edge_media_preview_like.count,
comments: media.edge_media_to_comment.count
});
if (!data.video_views) {
data['$unset'] = { video_views: 1 };
}
return Media.findByIdAndUpdate(media.id, data).lean();
}
function handleMedia(media) {
//debug('handleMedia', media);
media = media.node || media;
return {
updateOne: {
filter: {
_id: media.id
},
update: _.pickBy({
_id: media.id,
user: media.owner.id,
code: media.shortcode,
video_views: media.video_view_count === 0 ? 1 : media.video_view_count,
likes: ( media.edge_media_preview_like || media.edge_liked_by ).count,
comments: media.edge_media_to_comment.count,
created_at: media.taken_at_timestamp * 1000,
}),
upsert: true
}
};
}
function handleMedias(message) {
const data = message && message.data ? JSON.parse(message.data) : message;
// debug('on:data', _.get(data, 'user.edge_owner_to_timeline_media.page_info', data ));
if ( ! _.get(data, 'user.edge_owner_to_timeline_media' ) ) return;
UserControl.handleUser(data.user);
Media.bulkWrite(data.user.edge_owner_to_timeline_media.edges.map(handleMedia), {
ordered: false
})
.catch( err => console.error('Error:media:bulkWrite', err));
return message.ack && message.ack();
}
async function fetch(username, pages) {
if ( pages === null ) {
if ( process.env.NODE_ENV === 'production' ) {
return pubsub.publish('fetch', username);
} else {
pages = 500;
}
}
try {
const fetch = await API.fetch(username, pages + 1);
fetch.on('data', handleMedias);
return fetch;
} catch (err) {
console.error('Error:media:fetch', err);
return err;
}
}
async function get( media ) {
try {
const data = await API.get( `p/${media.code}` );
if ( data ) {
return updateMedia(data.shortcode_media);
}
} catch ( err ) {
if ( err.status === 404 ) {
return Media.deleteOne(media);
} else {
console.error('Error:media:get', err);
return err;
}
}
}
module.exports = { get, fetch, handleMedias }; | lucasmonteverde/topbase-app/libs/media.js |
>
GURUFOCUS.COM > STOCK LIST > > > (:) > Definitions > Financial Strength
Switch to:
# Financial Strength
: 0 (As of . 20)
View and export this data going back to 1990. Start your Free Trial
has the Financial Strength Rank of 0.
GuruFocus Financial Strength Rank measures how strong a company's financial situation is. It is based on these factors:
1. The debt burden that the company has as measured by its Interest Coverage (current year). The higher, the better.
2. Debt to revenue ratio. The lower, the better.
3. Altman Z-Score.
did not have earnings to cover the interest expense. As of today, 's Altman Z-Score is .
## Financial Strength Calculation
GuruFocus Financial Strength Rank measures how strong a company's financial situation is. It is based on these factors
A company ranks high with financial strength is likely to withstand any business slowdowns and recessions.
1. The debt burden that the company has as measured by its Interest Coverage (current year). The higher, the better.
Note: If both Interest Expense and Interest Income are empty, while Net Interest Income is negative, then use Net Interest Income as Interest Expense.
Interest Coverage is a ratio that determines how easily a company can pay interest expenses on outstanding debt. It is calculated by dividing a company's Operating Income (EBIT) by its Interest Expense:
's Interest Expense for the months ended in . 20 was \$0.00 Mil. Its Operating Income for the months ended in . 20 was \$0.00 Mil. And its Long-Term Debt & Capital Lease Obligation for the quarter that ended in . 20 was \$0.00 Mil.
's Interest Coverage for the quarter that ended in . 20 is
The higher the ratio, the stronger the company's financial strength is.
2. Debt to revenue ratio. The lower, the better.
's Debt to Revenue Ratio for the quarter that ended in . 20 is
Debt to Revenue Ratio = Total Debt (Q: . 20 ) / Revenue = (Short-Term Debt & Capital Lease Obligation + Long-Term Debt & Capital Lease Obligation) / Revenue = ( + ) / 0 = N/A
3. Altman Z-Score.
Z-Score model is an accurate forecaster of failure up to two years prior to distress. It can be considered the assessment of the distress of industrial corporations.
The zones of discrimination were as such:
When Z-Score is less than 1.81, it is in Distress Zones.
When Z-Score is greater than 2.99, it is in Safe Zones.
When Z-Score is between 1.81 and 2.99, it is in Grey Zones.
has a Z-score of , indicating it is in Distress Zones. This implies bankrupcy possibility in the next two years.
* For Operating Data section: All numbers are indicated by the unit behind each term and all currency related amount are in USD.
* For other sections: All numbers are in millions except for per share data, ratio, and percentage. All currency related amount are indicated in the company's associated stock exchange currency.
(:) Financial Strength Explanation
The maximum rank is 10. Companies with rank 7 or higher will be unlikely to fall into distressed situations. Companies with rank of 3 or less are likely in financial distress.
has the Financial Strength Rank of 0.
## Financial Strength Related Terms
Thank you for viewing the detailed overview of 's Financial Strength provided by GuruFocus.com. Please click on the following links to see related term pages.
Industry
» NAICS : SIC :
Comparable Companies
N/A
Traded in Other Exchanges
N/A
Website
From GuruFocus
###### Aberdeen Emerging Markets Equity Income Fund, Inc. Announces Results of Annual Meeting of Shareholders
By ACCESSWIRE 04-01-2022
###### Jadestone Energy PLC Announces Canadian reporting status and Notice of Results
By ACCESSWIRE 04-06-2022
###### Love Hemp Group PLC Announces Result of General Meeting
By ACCESSWIRE 04-01-2022
###### Bambuser Accelerates US Expansion Following Strong Market Demand and Opens a Full-Scale Office in New York
By ACCESSWIRE 03-31-2022
###### Gaming Realms Launches Content in Ontario
By ACCESSWIRE 04-06-2022
###### Atlantic Lithium Limited Announces Corporate Update - Canaccord Appointmet
By ACCESSWIRE 04-04-2022
###### AlzeCure Pharma Publishes its Annual Report for 2021
By ACCESSWIRE 04-06-2022
###### Poolbeg Pharma PLC Announces POLB001 Update - Clinical Trial Agreement Signed
By ACCESSWIRE 03-31-2022
###### CTT Systems AB (publ.) - Annual Report 2021
By ACCESSWIRE 03-31-2022
###### Clare Boynton and Pierre Cadena Nominated to Join Raketech's Board of Directors
By ACCESSWIRE 04-04-2022
Other Sources
###### Cheap Juice: Honda and GM Pair Up to Keep Their EV Costs Down
By Fool 2022-04-05
###### Elon Musk is Now Twitter's Biggest Shareholder
By Fool 2022-04-04
###### 3 Pieces of Toxic Real Estate Advice You Must Ignore
By Fool 2022-04-05
###### Dimon Warns Inflation and War "Dramatically Increase Risks Ahead"
By Fool 2022-04-04
###### Why the \$4,194 Max Social Security Benefit Is a Fantasy
By Fool 2022-04-04
###### Here's How to Squeeze an Extra 24% Out of Social Security
By Fool 2022-04-04
###### Housing Inventory Is Extremely Low. Will More Homes Hit in 2022?
By Fool 2022-04-05
###### EV Manufacturer Polestar Lands Major Deal With Hertz
By Fool 2022-04-04
###### 71% of Americans Worry Inflation Will Affect Their Retirement. Here's What to Do if You Feel the Same.
By Fool 2022-04-06
###### Will Home Equity Levels Rise in 2022?
By Fool 2022-04-06
###### 3 Retirement Accounts That Can Help You Go Beyond a 401(k)
By Fool 2022-04-04
###### Why You Should Invest in Real Estate Investment Trusts
By Fool 2022-04-05
###### 93% of HSA Holders Are Making This Huge Mistake
By Fool 2022-04-05
###### Exactly How I'd Invest \$5,000 If I Had to Start From Scratch Today
By Fool 2022-04-04
###### 3 Prerequisites Before Autonomous Vehicles Can Take Over the Roads
By Fool 2022-04-04
Get WordPress Plugins for easy affiliate links on Stock Tickers and Guru Names | Earn affiliate commissions by embedding GuruFocus Charts
GuruFocus Affiliate Program: Earn up to \$400 per referral. ( Learn More) | finemath-3plus |
#region LGPL License
/*----------------------------------------------------------------------------
* This file (CK.Plugin.Model\IPlugin.cs) is part of CiviKey.
*
* CiviKey is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* CiviKey is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
* You should have received a copy of the GNU Lesser General Public License
* along with CiviKey. If not, see <http://www.gnu.org/licenses/>.
*
* Copyright © 2007-2012,
* Invenietis <http://www.invenietis.com>,
* In’Tech INFO <http://www.intechinfo.fr>,
* All rights reserved.
*-----------------------------------------------------------------------------*/
#endregion
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace CK.Plugin
{
/// <summary>
/// This interface defines the minimal properties and behavior of a plugin.
/// </summary>
public interface IPlugin
{
/// <summary>
/// This method initializes the plugin: own resources must be acquired and running conditions should be tested.
/// No interaction with other plugins must occur (interactions must be in <see cref="Start"/>).
/// </summary>
/// <param name="info">Enables the implementation to give detailed information in case of error.</param>
/// <returns>True on success. When returning false, <see cref="IPluginSetupInfo"/> should be used to return detailed explanations.</returns>
bool Setup( IPluginSetupInfo info );
/// <summary>
/// This method must start the plugin: it is called only if <see cref="Setup"/> returned true.
/// Implementations can interact with other components (such as subscribing to their events).
/// </summary>
void Start();
/// <summary>
/// This method uninitializes the plugin (it is called after <see cref="Stop"/>).
/// Implementations MUST NOT interact with any other external components: only internal resources should be freed.
/// </summary>
void Teardown();
/// <summary>
/// This method is called by the host when the plugin must not be running anymore.
/// Implementations can interact with other components (such as unsubscribing to their events).
/// <see cref="Teardown"/> will be called to finalize the stop.
/// </summary>
void Stop();
}
}
| Invenietis/ck-desktop-CK.Plugin.Model/IPlugin.cs |
/*
* FAAC - Freeware Advanced Audio Coder
* Copyright (C) 2001 Menno Bakker
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* $Id: faaccfg.h,v 1.3 2006/07/13 00:49:48 kyang Exp $
*/
#ifndef _FAACCFG_H_
#define _FAACCFG_H_
#define FAAC_CFG_VERSION 104
/* MPEG ID's */
#define MPEG2 1
#define MPEG4 0
/* AAC object types */
#define MAIN 1
#define LOW 2
#define SSR 3
#define LTP 4
/* Input Formats */
#define FAAC_INPUT_NULL 0
#define FAAC_INPUT_16BIT 1
#define FAAC_INPUT_24BIT 2
#define FAAC_INPUT_32BIT 3
#define FAAC_INPUT_FLOAT 4
#define SHORTCTL_NORMAL 0
#define SHORTCTL_NOSHORT 1
#define SHORTCTL_NOLONG 2
#pragma pack(push, 1)
typedef struct faacEncConfiguration
{
/* config version */
int version;
/* library version */
char *name;
/* copyright string */
char *copyright;
/* MPEG version, 2 or 4 */
unsigned int mpegVersion;
/* AAC object type */
unsigned int aacObjectType;
/* Allow mid/side coding */
unsigned int allowMidside;
/* Use one of the channels as LFE channel */
unsigned int useLfe;
/* Use Temporal Noise Shaping */
unsigned int useTns;
/* bitrate / channel of AAC file */
unsigned long bitRate;
/* AAC file frequency bandwidth */
unsigned int bandWidth;
/* Quantizer quality */
unsigned long quantqual;
/* Bitstream output format (0 = Raw; 1 = ADTS) */
unsigned int outputFormat;
/*
PCM Sample Input Format
0 FAAC_INPUT_NULL invalid, signifies a misconfigured config
1 FAAC_INPUT_16BIT native endian 16bit
2 FAAC_INPUT_24BIT native endian 24bit in 24 bits (not implemented)
3 FAAC_INPUT_32BIT native endian 24bit in 32 bits (DEFAULT)
4 FAAC_INPUT_FLOAT 32bit floating point
*/
unsigned int inputFormat;
/* block type enforcing (SHORTCTL_NORMAL/SHORTCTL_NOSHORT/SHORTCTL_NOLONG) */
int shortctl;
/*
Channel Remapping
Default 0, 1, 2, 3 ... 63 (64 is MAX_CHANNELS in coder.h)
WAVE 4.0 2, 0, 1, 3
WAVE 5.0 2, 0, 1, 3, 4
WAVE 5.1 2, 0, 1, 4, 5, 3
AIFF 5.1 2, 0, 3, 1, 4, 5
*/
int channel_map[64];
} faacEncConfiguration, *faacEncConfigurationPtr;
#pragma pack(pop)
#endif /* _FAACCFG_H_ */
| willisyi/LiveServer-wis-streamer/AACEncoder/faaccfg.h |
// jkg_chatcmds.h
// JKG - Chat command processing
// Heavily based on the engine's command tokenizer
// Copyright (c) 2013 Jedi Knight Galaxies
#ifndef CGAME_JKG_CHATCMDS_H
#define CGAME_JKG_CHATCMDS_H
typedef void (*xccommand_t) ( void );
int CCmd_Argc( void );
char *CCmd_Argv( int arg );
void CCmd_ArgvBuffer( int arg, char *buffer, int bufferLength );
char *CCmd_Args( void );
char *CCmd_ArgsFrom( int arg );
void CCmd_ArgsBuffer( char *buffer, int bufferLength );
char *CCmd_Cmd();
qboolean CCmd_Execute(const char *command);
void CCmd_TokenizeString( const char *text_in );
void CCmd_AddCommand( const char *cmd_name, xccommand_t function );
void CCmd_RemoveCommand( const char *cmd_name );
void Text_DrawText(int x, int y, const char *text, const float* rgba, int iFontIndex, const int limit, float scale);
#endif
| JKGDevs/JediKnightGalaxies-codemp/cgame/jkg_chatcmds.h |
# Quick Answer: How Much Torque Does A 40hp Tractor Make?
## How do I find my tractor torque?
Here’s the equation: hp. = If you have a tractor that generates 650 ft. -lbs. of torque at 1,200 rpm, that engine’s horsepower would be 650 × 1,200 ÷ 5,252 = 148.51 hp. at 1,200 rpm.
## How much torque does the average tractor have?
The engine of a semi-truck is up to 6 times larger than that of a car engine in both size and weight. The average semi engine has 400-600 horsepower and around 1-2 thousand FT.LB or torque versus 100-200 horsepower and 100-200 FT.LB of torque. Semi Engines, as opposed to car engines, are designed to run stop.
## Do tractors have more torque?
Just on a larger gap, since a tractor doesn’t have to operate at highway speeds and the truck does. Because they have high torque, all over their power band which is more important than having a huge narrow peak and lots of gears.
## Is 400 ft lbs of torque a lot?
Having 400 pounds of torque down low means you have more horsepower down low. Having 400 pounds of torque up high means you have even more horsepower then you had down low.
You might be interested: Quick Answer: In Lego Avengers Playstation 4 How Do You Get The Tractor Started?
## How do you increase tractor torque?
How You Can Increase Horsepower and Torque?
1. Clean House to Increase Horsepower.
2. Perform a Tune-Up on the Engine.
3. Install a Turbo Kit or Supercharger.
4. Install a Cold-Air Intake.
5. Install an Aftermarket Exhaust System.
## What is better to have torque or horsepower?
Torque, simply, is the ability of a vehicle to perform work — specifically, the twisting force applied by the crankshaft. Horsepower is how rapidly the vehicle can perform that work. Because there is generally a limit on how fast you can spin an engine, having higher torque allows for greater horsepower at lower rpms.
## What tractor has the most torque?
US-made tractor Case IH Steiger/ Quadtrac 620 is the world’s most powerful tractor at an incredible 692 hp, beating the Porsche 911 GT2 RS in performance.
## Which tractor engine is best?
2021 Best Mileage Tractor List in India
• New Holland 3230. To start with the Tenth Most Fuel-Efficient Tractor in the Indian Farming Industry, New Holland 3230.
• Sonalika DI 745 III Sikander.
• Swaraj 735 FE.
• Mahindra 275 DI.
• John Deere 5050 D.
• Powertrac Euro 50.
• Farmtrac 45 Smart.
• Eicher 380.
## What car has the most torque?
Highest Torque Cars:
• 1,696 lb-ft. Koenigsegg Regera.
• 1,254 lb-ft. Bugatti Divo.
• 1,106 lb-ft. Karma Revero.
• 981 lb-ft. Porsche 918 Spyder.
• 944 lb-ft of torque. Koenigsegg Agera RS.
• 774 lb-ft. 2021 Pagani Huayra Roadster BC.
## Is a 25 hp tractor enough?
100 to 150 Horsepower Talk about serious power! For mowing your yard and doing some work with a front-end loader, a tractor with 25 to 35 horsepower might be all you need.
You might be interested: Question: How Did A Fordson Tractor With Tracks Steer?
## What is the best tractor for the money?
5 of the Best Compact Tractor Choices
• John Deere 4066M Heavy Duty.
• Compact Farmall 45C CVT.
• Kubota L2501.
• Massey Ferguson 1740E.
• New Holland Boomer 55 Cab (T4B)
• 5 of the Best Sub Compact Tractors.
• 5 of the Best Compact Tractor Choices.
• 2017 Subcompact Tractor Comparison – Part 2.
## Why do tractors have less horsepower?
There are a lot of gears in a tractor but many of them never get used. HP is a function of torque by RPM so if the engine has its torque band moved up the rpm band it will produce more HP but wont pull on long hills in low gear as another engine with the same torque value but at lower rpm and less HP at higher rpm.
## Does higher torque mean better towing?
To sum up, torque plays a greater role in towing than horsepower. This is because of the ‘low-end rpm’ generated by the higher levels of torque, which allows the engine to easily carry heavy loads. A high torque vehicle will be able to tow trailers or other objects with an extremely low value of rpm.
## What is a ft lb of torque?
A pound-foot (lbf⋅ ft ) is a unit of torque representing one pound of force acting at a perpendicular distance of one foot from a pivot point. Conversely one pound-foot is the moment about an axis that applies one pound-force at a radius of one foot.
## Does higher torque mean faster acceleration?
A car with more hp than torque will always be quicker since this gives a car acceleration and speed. Higher torque doesn’t mean one vehicle will necessarily be faster than another, though. For example, a Ford F-250 makes 925 lb-ft of torque, while a Honda S2000 has just 162 lb-ft. | finemath-3plus |
УЗДЫМ - "Вясёлка", наперад!
"Вясёлка", наперад!
Каманда беларускай нядзельнай школы "Вясёлка", якая працуе пры беларускім культурна-асветніцкім таварыстве «Уздым», у шосты раз прыняла ўдзел у спартыўным свяце "Vienoti sportā" у Рызе. Свята арганізуе і праводзіць Латвійская Алімпійская акадэмія.
У гэтым годзе свята было юбілейным. Яно праходзіла ў трыццаты раз. Штогод школьнікі не стамляюцца прапагандаваць здаровы лад жыцця. Спорт не мае межаў. Пад спартыўнымі сцягамі аб'ядналіся дзеці розных нацыянальнасцяў, каб даказаць самім сабе, што яны моцныя, смелыя і ўмелыя.
Удзел у спаборніцтвах дапамагае і нашым дзецям зблізіцца, адчуць сябе адзінай дружнай камандай.
Гонар беларускай школы "Вясёлка" абаранялі: Элеанора Марчанка, Сафія Блізнакова, Ксенія Лявонава, Вераніка Данесевіч, Павел Кузьміч, Арвід Сонтоцкі, Ганна Платкова, Даніэл Мацвееў (самы маленькі ўдзельнік каманды), Караліна Казачонак, Надзея і Марына Чарновы.
Удзельнічаем не першы раз у спаборніцтвах і ўсё адно едзем з азартам і жаданнем перамагчы. Нашы дзеці выступалі ў розных відах спорту і рабілі гэта годна. Выпадковая памылка за некалькі хвілін да фінальнага свістка ў футболе прывяла да штрафнога ўдару. І мы прайгралі 1: 0. А як трымаліся, абаранялі вароты!
Выдатна гулялі ў народны мяч, прымусілі панэрвавацца супернікаў. А як перацягвалі канат! Перамога была дзесьці побач. Не хапіла толькі трохі сіл.
Але нам пашанцавала ў эстафеце ў другі раз за час нашага ўдзелу. Адна з груп у складзе: Д.Матвеяў, А.Платкова, П.Кузьміч, К.Лявонава заняла 3-е месца. Малайцы!
Вялікі дзякуй бацькам: Сюзане Матвеявай, Віктару Блізнакову, Таццяне Дзянісавай, якія дапамагалі педагогам - Людміле Сіняковай і Алене Радзівонавай у паездцы. Мы рады, што бацькі прымаюць актыўны ўдзел у школьных мерапрыемствах.
Дзякуем за магчымасць нядзельнай школы “Вясёлка” удзельнічаць у Спартыўным свяце ў Рызе: дэпутатам Даўгаўпілскай гарадской думы, якія падтрымалі заяўку таварыства “Уздыма” на сафінансаванне транспартных паслуг; Праўленню таварыства “Уздым” за арганізацыю паездкі, сузаснавальніку таварыства “Уздым” Іосіфу Антонавічу Рэўту за матэрыяльную дапамогу | c4-be |
#ifndef GT_GTL_PARAM_VALUE_PROPERTY_HPP_INCLUDED
#define GT_GTL_PARAM_VALUE_PROPERTY_HPP_INCLUDED
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
/**
* @file gt/gtl/param_value_property.hpp
* @brief Defines GT::GTL::ParamValueProperty class.
* @copyright (C) 2013-2014
* @author Mateusz Kubuszok
*
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero
* General Public License as published by the Free Software Foundation, either version 3 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 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/].
*/
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
namespace GT {
namespace GTL {
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
/**
* @class ParamValueProperty
* @brief Describes Param's value.
*
* @author Mateusz Kubuszok
*
* @see Param
*/
class ParamValueProperty final : public ObjectProperty {
/**
* @brief Described Param.
*/
const Param* param;
public:
/**
* @brief Initiates ObjectProperty with Param it's describing.
*
* @param describedParam described Param
*/
explicit ParamValueProperty(
const Param* describedParam
);
/**
* @brief Returns ObjectProperty's description.
*
* @return description
*/
virtual ResultPtr getDescription() const override;
/**
* @brief Finds Params's value.
*
* @param context Context with values
* @param conditions Conditions to check
* @result search Result
*/
virtual ResultPtr findForConditions(
const Context& context,
const Conditions& conditions
) const override;
}; /* END class ParamValueProperty */
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
} /* END namespace GTL */
} /* END namespace GT */
#endif /* #ifndef GT_GTL_PARAM_VALUE_PROPERTY_HPP_INCLUDED */
| MateuszKubuszok/MasterThesis-src/gt/gtl/param_value_property.hpp |
Rochie, Catifea, Imprimeu Floral - eMAG.ro
Rochie, Catifea, Imprimeu Floral
Rochie Sonia, tafta verde, marimea 36 EU
Rochie de zi cu design de centura in , D&J Exclusive, Bleumarin, 38 EU
Rochie Voal cu Fluturi, ZAZA BOUTIQUE, 42
Rochie de ocazie, City Goddess, de ocazie,culoare Verde,L INTL
Rochie de zi cu design de centura in , D&J Exclusive, Bleumarin, 40 EU
Rochiile din catifea elegante cuceresc tendintele modei 2017! Voglia.ro a creat special pentru tine, rochia trei sferturi din catifea cu imprimeu floral! rochie midi catifea cu imprimeu floral Voglia rochie scurta mulata cu flori rochie eleganta din catifea rochie fara maneci decolteu in V imprimeu floral colorat lungime centru spate: 101 cm material: 98% poliester si 2% elastan
Material 2% Elastan 98% poliester
Rochie, Bleumarin cu Maneci din Dantela, 36
Rochie, Casual, Mustar din Tricot Elastic, 36
ROCHIE MOZE DREAPTA CU FRANJURI VERDE, 42
Rochie Embassy, Bordo cu Perle Colorate, S
Rochie Baby-Doll Mov Very, 36 | c4-co |
/**
* Automatic Tranlsate Generator with google api, and local database language with auto populate
* its easy to implement to your app, use function T("hello") output "ciao", and use function inip_app() for init your code
* declare first "translate.js" and after your code "myscript.js"
* <script src="js/translate.js" type="text/javascript"></script>
* <script src="js/index.js" type="text/javascript"></script>
*
*/
var g_lng = [];
var g_param;
$(document).ready(function () {
$.getJSON('app_setting.json', {_: new Date().getTime()}, function (data) {
g_param = data;
//only translate framemork jquiery easyui
$.getScript('lib/easyui_1.5.1/locale/easyui-lang-' + g_param["lingua corrente"] + '.js')
.fail(function (jqxhr, settings, exception) {
$.getScript('lib/easyui_1.5.1/locale/easyui-lang-en.js')
});
//find all language json dictionary
$.getJSON('language/' + g_param["traduci dalla lingua"] + '2' + g_param["traduci alla lingua"] + '.json', {_: new Date().getTime()})
.done(function (data) {
var lng = g_param["traduci dalla lingua"] + "2" + g_param["traduci alla lingua"];
g_lng[lng] = data;//store language dictionary to global array
init_app();
})
.fail(function (data) {
var lng = g_param["traduci dalla lingua"] + "2" + g_param["traduci alla lingua"];
g_lng[lng] = [];//store language dictionary to global array
init_app();
});
});
});
// Translate multiple language
function T(value) {
var t = (g_param["debug traduzione"]) ? g_param["debug traduzione OK"] : ""; //traslate debug string
var e = (g_param["debug traduzione"]) ? g_param["debug traduzione KO"] : ""; // traslate debug error string
var lng = g_param["traduci dalla lingua"] + "2" + g_param["traduci alla lingua"];
// check if exist data language on array
if (g_lng[lng][value] === undefined) {
//auto translate language with google api or add row to json for manual translate
(g_param["traduci in automatico con google"]) ? $.post('api/auto/translate', {value: value}) : false;
return e + value + e;
} else {
return (g_param["lingua corrente"] != g_param["traduci dalla lingua"]) ? t + g_lng[lng][value] + t : t + value + t;
}
}
| waltex/easyui_gii-js/translate.js |
PAGSALUDO HAN MGA MARTIR HAN PAKIGBISOG HAN TINUOD NGA REPORMA HA TUNA | The Sagupa Bulletin
PAGSALUDO HAN MGA MARTIR HAN PAKIGBISOG HAN TINUOD NGA REPORMA HA TUNA
Posted on November 2, 2010 by SAGUPA-SB
TACLOBAN CITY – Ginsasalin-orog han katawhan Pilipino an adlaw han mga patay yana nga Nobyembre 1 ngan 2, sugad man naghahatag hin hataas nga pagsaludo an SAGUPA-SB han mga martir han katawhan Pilipino nga nakigbisog para han tinuod nga reporma ha tuna ngan hustisya.
“Diri mawawara an ginpakita nga kaisog ngan paghigugma han aton mga martir han makatadungan nga kawsa nga padayon ginpapakigbisog han katawhan ha rehiyon-8, magpapadayon an ira bulawanon nga hinumduman diri la han ira mga minahal nga mga pamilya kundi ha masa nga nakikigbisog para han tinuod nga reporma ha agraryo ngan industriyalisasyon,” pahayag ni Nestor Lebico, Secretary-General han SAGUPA-SB.
Pagmalatumat pa ni Lebico nga yana manta nga bulan paghihinumdumon naton an nahitabo nga pagmasaker han mga sundalo ha aton kabugtuan nga mga parag-uma ha San Agustin, Palo, Leyte diin naghalad hin pito (7) nga kinabuhi an aton mga kablas nga parag-uma tungod han pagdepender han ira tuna ug pakabuhian.
“Kasumpay han aton pagpasidungog han aton mga martir an padayon ngan waray kaguol nga pagserbe ha katawhan Pilipino labi an pagkakaada hin tinuod nga reporma ha tuna ngan mas magmamahinungdanon an ginhalad han aton mga minahal ha kinabuhi nga nakigbisog kun igpapadayon naton an ira prinsipyo para han kaupayan han aton sosyedad labi na yana nga panahon diin nakikita naton an grabe na liwat nga militarisasyon ha kabaryuhan,” pagtatapos ni Lebico.### | c4-ceb |
#region Copyright (C) 2011 Ivan Masmitja
// Copyright (C) 2011 Ivan Masmitja
//
// SamsChannelEditor 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 3 of the License, or
// (at your option) any later version.
//
// SamsChannelEditor 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 SamsChannelEditor. If not, see <http://www.gnu.org/licenses/>.
#endregion
using System;
using System.ComponentModel;
using System.Windows.Forms;
namespace HexComparer
{
public partial class UCViewData : UserControl
{
bool _showInHexadecimal;
byte[] _lastData;
int _lastIdx;
[Browsable(true)]
public override string Text
{
get { return groupBox1.Text; }
set { groupBox1.Text = value; }
}
[Browsable(true), DefaultValue(false)]
public bool ShowInHexadecimal
{
get { return _showInHexadecimal; }
set
{
_showInHexadecimal = value;
if (_lastData != null)
ShowValues(_lastData, _lastIdx);
}
}
public UCViewData()
{
ShowInHexadecimal = false;
InitializeComponent();
}
public void ShowValues(byte[] data, int idx)
{
_lastData = data;
_lastIdx = idx;
var format = ShowInHexadecimal ? "X2" : "d";
txtIndex.Text = idx.ToString(format);
txtByte.Text = idx < data.Length ? data[idx].ToString(format) : "";
txtInt16.Text = idx <= data.Length - 2 ? BitConverter.ToUInt16(data, idx).ToString(format) : "";
txtInt32.Text = idx <= data.Length - 4 ? BitConverter.ToUInt32(data, idx).ToString(format) : "";
txtInt64.Text = idx <= data.Length - 8 ? BitConverter.ToUInt64(data, idx).ToString(format) : "";
}
}
}
| Tiggor/samschanneledit-HexComparer/UCViewData.cs |
$(document).ready(function() {
$('.fslink').hide();
// highlight search string
highlightSearchResult('#filterQuery', '.studentRow, .instructorRow');
$('#rebuildButton').click(function() {
$(this).val('true');
});
$('#searchButton').click(function() {
$('#rebuildButton').val('false');
});
$('.studentRow').click(function() {
var rawId = $(this).attr('id');
if ($(this).attr('class') === 'studentRow active') {
$(this).attr('class', 'studentRow');
} else {
$(this).attr('class', 'studentRow active');
}
$('.fslink' + rawId).toggle();
});
$('.instructorRow').click(function() {
var rawId = $(this).attr('id');
if ($(this).attr('class') === 'instructorRow active') {
$(this).attr('class', 'instructorRow');
} else {
$(this).attr('class', 'instructorRow active');
}
$('.fslink' + rawId).toggle();
});
$('.homePageLink').click(function(e) {
e.stopPropagation();
});
$('.detailsPageLink').click(function(e) {
e.stopPropagation();
});
$('.optionButton').click(function(e) {
e.stopPropagation();
});
$('input').click(function() {
this.select();
});
$('.resetGoogleIdButton').click(function(e) {
e.stopPropagation();
});
});
function submitResetGoogleIdAjaxRequest(studentCourseId, studentEmail, wrongGoogleId, button) {
var params = 'studentemail=' + studentEmail
+ '&courseid=' + studentCourseId
+ '&googleid=' + wrongGoogleId;
var googleIdEntry = $(button).closest('.studentRow').find('.homePageLink');
var originalButton = $(button).html();
var originalGoogleIdEntry = $(googleIdEntry).html();
$.ajax({
type: 'POST',
url: '/admin/adminStudentGoogleIdReset?' + params,
beforeSend: function() {
$(button).html("<img src='/images/ajax-loader.gif'/>");
},
error: function() {
$(button).html('An Error Occurred, Please Retry');
},
success: function(data) {
setTimeout(function() {
if (data.isError) {
$(button).html('An Error Occurred, Please Retry');
} else if (data.isGoogleIdReset) {
googleIdEntry.html('');
$(button).hide();
} else {
googleIdEntry.html(originalGoogleIdEntry);
$(button).html(originalButton);
}
setStatusMessage(data.statusForAjax, StatusType.INFO);
}, 500);
}
});
}
function adminSearchDiscloseAllStudents() {
$('.fslink_student').slideDown();
$('.studentRow').attr('class', 'studentRow active');
}
function adminSearchCollapseAllStudents() {
$('.fslink_student').hide();
$('.studentRow').attr('class', 'studentRow');
}
function adminSearchDiscloseAllInstructors() {
$('.fslink_instructor').slideDown();
$('.instructorRow').attr('class', 'instructorRow active');
}
function adminSearchCollapseAllInstructors() {
$('.fslink_instructor').hide();
$('.instructorRow').attr('class', 'instructorRow');
}
| belyabl9/teammates-src/main/webapp/js/adminSearch.js |
# -*- coding: utf-8 -*-
from xml.etree.ElementTree import Element, SubElement, tostring
__all__ = ['to_string', 'from_dict']
def to_string(xml, encoding='utf-8', xml_declaration=False):
"""Outputs an xml.etree.ElementTree.Element object to a string.
Usage:
xml = from_dict(data)
xml_to_string(xml, xml_declaration=True) # <?xml version ....
Args:
encoding (string): the encoding used for the xml.
xml_declaration (boolean): whether or not to include the xml declaration.
"""
declaration = '<?xml version="1.0" encoding="{encoding}" ?>'.format(
encoding=encoding)
string = tostring(xml).decode(encoding)
return '{0}{1}'.format(declaration if xml_declaration else '', string)
def __dict_to_xml(obj, node_name=None, parent_element=None):
# internal processing for from_dict
if not isinstance(parent_element, Element):
if isinstance(obj, dict) and len(obj) == 1:
node_name, obj = obj.popitem()
parent_element = Element(node_name)
if isinstance(obj, dict):
for key, value in obj.items():
if isinstance(value, (list, tuple)):
__dict_to_xml(value, key, parent_element)
else:
__dict_to_xml(value, key, SubElement(parent_element, key))
elif isinstance(obj, (list, tuple)):
for value in obj:
sub_element = SubElement(parent_element, node_name)
__dict_to_xml(value, node_name, sub_element)
else:
parent_element.text = str(obj)
return parent_element
def from_dict(obj, node_name='root'):
"""Converts a simple dictionary into an XML document.
Example:
.. code-block:: python
data = {
'test': {
'nodes': {
'node': [
'Testing',
'Another node'
]
},
}
}
xml = from_dict(data) # <test><nodes><node>Testing</node><node>Another node</node></nodes></test>
Args:
node_name (string): the initial node name in case there are multiple
top level elements.
"""
return __dict_to_xml(obj, node_name)
| watsonpy/watson-common-watson/common/xml.py |
(function($) {
'use strict';
$().ready(function() {
var paginator = $('.pagination');
var results = $('#final-result')
var pages = paginator.attr('data-pages');
// Variable to keep track of whether we've reached our max page
var cease;
paginator.hide();
results.hide();
// If there is no paginator, don't do any scrolling
cease = (pages == undefined)
$(document).endlessScroll({
// Number of pixels from the bottom at which callback is triggered
bottomPixels: 750,
// Wait a second before we even think of loading more content
fireDelay: 1000,
fireOnce: true,
ceaseFire: function() {
return cease;
},
callback: function(i) {
cease = (pages <= i);
if (cease) {
// Show the user that we have stopped scrolling on purpose.
results.show()
} else {
$.ajax({
data:{'page': i + 1},
dataType: 'html',
success: function(data) {
paginator.before($(data));
}
});
}
}
});
});
})(jQuery);
| glogiotatidis/mozillians-new-media/js/infinite.js |
from django.apps import AppConfig
class AncfinderSiteConfig(AppConfig):
name = 'ancfinder_site'
| codefordc/ancfinder-ancfinder_site/apps.py |
/*
* 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 3 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, see <http://www.gnu.org/licenses/>.
*/
/**
* AtomicMoveSupporter.java
* Copyright (C) 2015 University of Waikato, Hamilton, NZ
*/
package adams.core;
/**
* Interface for classes that support atomic file move operations.
*
* @author FracPete (fracpete at waikato dot ac dot nz)
* @version $Revision$
*/
public interface AtomicMoveSupporter {
/**
* Sets whether to attempt atomic move operation.
*
* @param value if true then attempt atomic move operation
*/
public void setAtomicMove(boolean value);
/**
* Returns whether to attempt atomic move operation.
*
* @return true if to attempt atomic move operation
*/
public boolean getAtomicMove();
/**
* Returns the tip text for this property.
*
* @return tip text for this property suitable for
* displaying in the GUI or for listing the options.
*/
public String atomicMoveTipText();
}
| waikato-datamining/adams-base-adams-core/src/main/java/adams/core/AtomicMoveSupporter.java |
( function( jQuery, undefined ) {
function init() {
var $body = $( 'body' ),
$page = $body.find( '.page' ),
$mainContent = $body.find( '.main-content' );
$( '.teasers' ).each( function() {
var $teasers = $( this ),
$links = $teasers.find( 'a' );
var on = function( e ) {
$teasers.find( 'active' ).removeClass( 'active' );
$( this ).add( $( this ).next( '.title' ) ).addClass( 'active' );
$links.not( '.active' ).addClass( 'inactive' );
};
var off = function( e ) {
$links.removeClass( 'inactive' );
$( this ).add( $( this ).next( '.title' ) ).removeClass( 'active' );
};
$links.hover( on, off );
$links.next( '.title' ).hover( function( e ) {
on.call( $( this ).prev( 'a' ), e )
}, function( e ) {
off.call( $( this ).prev( 'a' ), e );
} );
} );
$( 'a' ).click( function( e ) {
var $el = $( this );
if( $el.attr( 'href' ) && $el.attr( 'href' )[ 0 ] === '/' ) {
e.preventDefault();
$mainContent.fadeOut( 'fast', function() {
window.location.href = $el.attr( 'href' );
} );
}
} );
$body.removeClass( 'no-js' );
$mainContent.fadeIn( 'fast' );
}
$( init );
} )( jQuery ); | DevMonks/site-public/javascripts/fx.js |
/**
* @author alteredq / http://alteredqualia.com/
*/
export function RenderPass(THREE) {
THREE.RenderPass = function ( scene, camera, overrideMaterial, clearColor, clearAlpha ) {
this.scene = scene;
this.camera = camera;
this.overrideMaterial = overrideMaterial;
this.clearColor = clearColor;
this.clearAlpha = ( clearAlpha !== undefined ) ? clearAlpha : 1;
this.oldClearColor = new THREE.Color();
this.oldClearAlpha = 1;
this.enabled = true;
this.clear = true;
this.needsSwap = false;
};
THREE.RenderPass.prototype = {
render: function ( renderer, writeBuffer, readBuffer, delta ) {
this.scene.overrideMaterial = this.overrideMaterial;
if ( this.clearColor ) {
this.oldClearColor.copy( renderer.getClearColor() );
this.oldClearAlpha = renderer.getClearAlpha();
renderer.setClearColor( this.clearColor, this.clearAlpha );
}
renderer.render( this.scene, this.camera, readBuffer, this.clear );
if ( this.clearColor ) {
renderer.setClearColor( this.oldClearColor, this.oldClearAlpha );
}
this.scene.overrideMaterial = null;
}
};
} | SpaceHexagon/convolvr-client/src/lib/threejs/postprocessing/RenderPass.js |
/**
* || ____ _ __
* +------+ / __ )(_) /_______________ _____ ___
* | 0xBC | / __ / / __/ ___/ ___/ __ `/_ / / _ \
* +------+ / /_/ / / /_/ /__/ / / /_/ / / /_/ __/
* || || /_____/_/\__/\___/_/ \__,_/ /___/\___/
*
* Crazyflie 2.1 NRF Firmware
* Copyright (c) 2021, Bitcraze AB, All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3.0 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library.
*/
#pragma once
void shutdownSendRequest();
void shutdownReceivedAck();
void shutdownProcess();
| bitcraze/crazyflie2-nrf-firmware-interface/shutdown.h |
import os
from collections import OrderedDict
import pandas as pd
import numpy as np
class MafObject(object):
"""Holds maf as dataframe.
Dataframe df is set once.
Dataframe df_sm is re-set with each update to use_genes
"""
def __init__(self, maf_path_or_df):
# TEST ARGUMENTS
df_in = None
if type(maf_path_or_df) == str:
if not os.path.isfile(maf_path_or_df):
raise ValueError("Invalid maf path.")
self.maf_path = maf_path_or_df
elif type(maf_path_or_df) == pd.DataFrame:
df_in = maf_path_or_df
self.patient_col = None
self.hugo_col = None
self.chrom_col = None
self.class_col = None
self.ref_col = None
self.alt_col = None
self.start_col = None
self.end_col = None
self.n_all_patients = None
self.df = self._get_maf_df(df_in)
# gene-list dependent
self._use_genes = None
self.use_patients = None
self.matrix = None
self.df_sm = None
self.extra_patients = None
def _get_maf_df(self, df_in=None):
"""Populate column name attributes and whole-maf dataframe."""
if df_in is None:
read_kwargs = dict(sep='\t', comment='#')
df = pd.read_csv(self.maf_path, **read_kwargs)
else:
df = df_in.copy()
df.rename(columns=lambda c: c.lower(), inplace=True)
# GET COLUMN NAMES
hugo_col = [i for i in df.columns if 'hugo' in i
or 'symbol' in i or 'gene' in i][0]
chrom_col = [i for i in df.columns if 'chrom' in i
or i.startswith('chr')][0]
class_col = [i for i in df.columns if 'classification' in i][0]
ref_col = [i for i in df.columns if 'reference' in i or
i.startswith('ref')][0]
start_col = [i for i in df.columns if 'start' in i]
if not start_col:
start_col = [i for i in df.columns if i.startswith('pos')][0]
else:
start_col = start_col[0]
end_col = [i for i in df.columns if 'end' in i]
end_col = end_col[0] if end_col else start_col
alt_cols = [i for i in df.columns if 'tumor_seq' in i]
sample_col = [i for i in df.columns if 'tumor_sample_barcode' in i or
i.startswith('sample')]
sample_col = sample_col[0] if sample_col else None
patient_col = [i for i in df.columns if i.startswith('patient')
or i.startswith('case')]
if alt_cols:
alt_col = 'alt'
df['alt'] = df.apply(lambda d: [n for n in d[alt_cols]
if n != d[ref_col]][0],
axis=1)
else:
alt_col = [i for i in df.columns if i.startswith('alternative') or
i.startswith('alt')][0]
if patient_col:
patient_col = patient_col[0]
else:
barcode_col = 'tumor_sample_barcode'
patient_col = 'patient_id'
df[patient_col] = df[barcode_col].apply(get_patient_from_barcode).\
astype(str)
df[class_col] = df[class_col].str.lower()
df[chrom_col] = df[chrom_col].astype(str)
df[[hugo_col, patient_col, class_col]].head()
if 'aa_change' in df.columns:
df.rename(columns={'aa_change': 'aa_change_orig'}, inplace=True)
df['aa_change'] = np.nan
self.patient_col = patient_col
self.sample_col = sample_col
self.hugo_col = hugo_col
self.chrom_col = chrom_col
self.class_col = class_col
self.ref_col = ref_col
self.alt_col = alt_col
self.start_col = start_col
self.end_col = end_col
return df
def get_vep_df(self):
new_names = OrderedDict([(self.chrom_col, 'Chromosome'),
(self.start_col, 'Start_Position'),
(self.ref_col, 'Reference_Allele'),
(self.alt_col, 'Tumor_Seq_Allele2'),
(self.sample_col, 'Tumor_Sample_Barcode'),
])
m = self.df.loc[:, list(new_names.keys())].copy()
m.rename(columns=new_names, inplace=True)
m.Chromosome = m.Chromosome.apply(fix_chromosomes)
return m
def get_patient_from_barcode(barcode):
if barcode.startswith('TCGA'):
return barcode[:12]
else:
return barcode
def fix_chromosomes(chrom):
chrom = chrom.lstrip('chr')
chrom = 'MT' if chrom == 'M' else chrom
return chrom
if __name__ == "__main__" and __package__ is None:
__package__ = "maf_matrix"
| sggaffney/maf_matrix-maf_matrix/maf_object.py |
#include <iostream>
using namespace std;
/*
²ÉÓö¯Ì¬¹æ»®À´½â´ð£¬¸´ÔÓ¶ÈO(n^2)
*/
/*class Solution {
public:
string longestPalindrome(string s) {
int dp[s.size()][s.size()]={0},l=0,r=0;
int len=0;
for(int i=0;i<s.size();i++)
{
for(int j=0;j<i;j++)
{
dp[j][i]=(s[i]==s[j] &&(i-j<2 || dp[j+1][i-1]));
if(dp[j][i]&&len<i-j+1)//len<i-j+1±£Ö¤µÚÒ»¸ö×µÄ
{
len=i-j+1;
l=j;
r=i;
}
}
dp[i][i]=1;
}
return s.substr(l,r-l+1);//Èç¹ûÓÃlen£¬»á©µôÒ»¸ö×ÖĸµÄÇé¿ö
}
};*/
/*
Ê×ÏÈÔÚÿ¸ö×Ö·û´®×óÓÒ¶¼¼ÓÉÏ#£¬Îª·ÀÖ¹×óÓÒ¶¼ÊÇ#,Êײ¿¼ÓÉÏ·Ç#,ĩβ\0
p[i]±íʾÒÔt[i]×Ö·ûΪÖÐÐĵĻØÎÄ×Ó´®µÄ°ë¾¶£¬
Èôp[i] = 1£¬Ôò¸Ã»ØÎÄ×Ó´®¾ÍÊÇt[i]±¾Éí
idΪ×î´ó»ØÎÄ×Ó´®ÖÐÐĵÄλÖã¬mx±íʾÆä°ë¾¶
Õâ¸ö·½·¨»¹ÊÇÓе㲻¶®£¬µ«ÊÇ×îºÃ¸´ÔÓ¶ÈÊÇO(n)
*/
class Solution {
public:
string longestPalindrome(string s) {
string t ="$#";
for (int i = 0; i < s.size(); ++i) {
t += s[i];
t += '#';
}
int p[t.size()] = {0}, id = 0, mx = 0, resId = 0, resMx = 0;
for (int i = 0; i < t.size(); ++i) {
p[i] = mx > i ? min(p[2 * id - i], mx - i) : 1;
while (t[i + p[i]] == t[i - p[i]]) ++p[i];
if (mx < i + p[i]) {
mx = i + p[i];
id = i;
}
if (resMx < p[i]) {
resMx = p[i];
resId = i;
}
}
return s.substr((resId - resMx) / 2, resMx - 1);
}
};
int main()
{
Solution dx;
string s="babad";
cout << dx.longestPalindrome(s)<<endl;
return 0;
} | xuewz/leetcode-5_m.cpp |
Club Info and FAQ’s - Upvote Market-Buy Reddit Accounts with high karma and upvotes.
Ans: We process the order within few mins and can take upto 48 hours in some cases.
3- Can I ask for extra services regarding reddit?
Ans: Yes you may ask for all kind of Reddit related services from online agent, and we will try our best to provide the best stuff.
4- Can I ask any questions from online agent?
Ans: Yes off course, We have an online agents for your service, they are mostly online 24/7 and will assist you with any possible situtation. | c4-en |
var a = 1 + 2 * 3 / 4 + "foo"; // 2.5foo | aguadev/aguadev-html/js-doc-parse/tests/binary.js |
// Test for errors in range-based for loops
// with member begin/end
// { dg-do compile }
// { dg-options "-std=c++11" }
//These should not be used
template<typename T> int *begin(T &t)
{
T::fail;
}
template<typename T> int *end(T &t)
{
T::fail;
}
struct container1
{
int *begin();
//no end
};
struct container2
{
int *end();
//no begin
};
struct container3
{
private:
int *begin(); // { dg-error "is private" }
int *end(); // { dg-error "is private" }
};
struct container4
{
int *begin;
int *end;
};
struct container5
{
typedef int *begin;
typedef int *end;
};
struct callable
{
int *operator()();
};
struct container6
{
callable begin;
callable end;
};
struct container7
{
static callable begin;
static callable end;
};
struct container8
{
static int *begin();
int *end();
};
struct private_callable
{
private:
int *operator()(); // { dg-error "is private" }
};
struct container9
{
private_callable begin;
private_callable end;
};
struct container10
{
typedef int *(*function)();
function begin;
static function end;
};
void test1()
{
for (int x : container1()); // { dg-error "member but not" }
for (int x : container2()); // { dg-error "member but not" }
for (int x : container3()); // { dg-error "within this context" }
for (int x : container4()); // { dg-error "cannot be used as a function" }
for (int x : container5()); // { dg-error "invalid use of" }
for (int x : container6());
for (int x : container7());
for (int x : container8());
for (int x : container9()); // { dg-error "within this context" }
for (int x : container10());
}
| albertghtoun/gcc-libitm-gcc/testsuite/g++.dg/cpp0x/range-for13.C |
package com.ctrip.xpipe.redis.core.proxy.endpoint;
/**
* @author chen.zhu
* <p>
* Jun 01, 2018
*/
public class SelectNTimes implements SelectStrategy {
private int times;
private ProxyEndpointSelector selector;
public static final int INFINITE = -1;
public SelectNTimes(ProxyEndpointSelector selector, int times) {
this.selector = selector;
this.times = times;
}
@Override
public boolean select() {
if(times == INFINITE) {
return true;
}
return times > selector.selectCounts();
}
}
| ctripcorp/x-pipe-redis/redis-core/src/main/java/com/ctrip/xpipe/redis/core/proxy/endpoint/SelectNTimes.java |
package com.clockwork.scene.plugins.ogre.matext;
import java.util.HashMap;
/**
* MaterialExtension defines a mapping from an Ogre3D "base" material
* to a CW material definition.
*/
public class MaterialExtension {
private String baseMatName;
private String CWMatDefName;
private HashMap<String, String> textureMappings = new HashMap<String, String>();
/**
* Material extension defines a mapping from an Ogre3D "base" material
* to a CW material definition.
*
* @param baseMatName The base material name for Ogre3D
* @param CWMatDefName The material definition name for CW
*/
public MaterialExtension(String baseMatName, String CWMatDefName) {
this.baseMatName = baseMatName;
this.CWMatDefName = CWMatDefName;
}
public String getBaseMaterialName() {
return baseMatName;
}
public String getCWMatDefName() {
return CWMatDefName;
}
/**
* Set mapping from an Ogre3D base material texture alias to a
* CW texture param
* @param ogreTexAlias The texture alias in the Ogre3D base material
* @param CWTexParam The texture param name in the CW material definition.
*/
public void setTextureMapping(String ogreTexAlias, String CWTexParam){
textureMappings.put(ogreTexAlias, CWTexParam);
}
/**
* Retreives a mapping from an Ogre3D base material texture alias
* to a CW texture param
* @param ogreTexAlias The texture alias in the Ogre3D base material
* @return The texture alias in the Ogre3D base material
*/
public String getTextureMapping(String ogreTexAlias){
return textureMappings.get(ogreTexAlias);
}
}
| PlanetWaves/clockworkengine-branches/3.0/engine/src/ogre/com/clockwork/scene/plugins/ogre/matext/MaterialExtension.java |
# A Survey on Deep-Learning Approaches for Vehicle Trajectory Prediction in Autonomous Driving
Jianbang Liu\({}^{*1}\), Xinyu Mao\({}^{*1}\), Yuqi Fang\({}^{2}\), Delong Zhu\({}^{1}\), and Max Q.-H. Meng\({}^{\dagger 3}\),
*Equal contribution. \(\dagger\)The corresponding author.\({}^{1}\)Jianbang Liu, Xinyu Mao and Delong Zhu are with the Department of Electronic Engineering, The Chinese University of Hong Kong, Hong Kong. ({henryliu, maoxinyu, zhudelong}@link.cuhk.edu.hk)\({}^{2}\)Yuqi Fang is with the Department of Biomedical Engineering, The Chinese University of Hong Kong, Hong Kong. ([email protected])\({}^{3}\)Max Q.-H. Meng is with the Department of Electronic and Electrical Engineering of the Southern University of Science and Technology in Shenzhen, China, on leave from the Department of Electronic Engineering, The Chinese University of Hong Kong, Hong Kong, and also with the Shenzhen Research Institute of the Chinese University of Hong Kong in Shenzhen, China. ([email protected].)
###### Abstract
With the rapid development of machine learning, autonomous driving has become a hot issue, making urgent demands for more intelligent perception and planning systems. Self-driving cars can avoid traffic crashes with precisely predicted future trajectories of surrounding vehicles. In this work, we review and categorize existing learning-based trajectory forecasting methods from perspectives of representation, modeling, and learning. Moreover, we make our implementation of Target-driveN Trajectory Prediction publicly available at [https://github.com/Henryliu/TNT-Trajectory-Predition](https://github.com/Henryliu/TNT-Trajectory-Predition), demonstrating its outstanding performance whereas its original codes are withheld. Enlightenment is expected for researchers seeking to improve trajectory prediction performance based on the achievement we have made.
## I Introduction
Human depends increasingly on the autonomous system to be freed from tedious tasks, a typical instance of which is autonomous driving. In the self-driving scenario, safety is the first concern. Predicting the future trajectories of participants helps the autonomous system find the most promising local path planning solution and prevent possible collision.
Pioneers have predicted the motion of dynamic objects with Kalman filter[1], linear trajectory avoidance model[2], and social force model[3]. Compared to these traditional modeling techniques based on hand-crafted features, deep learning algorithms that learn features automatically via optimizing loss functions have recently attracted researchers' attention. In this work, we survey some recent approaches for vehicle trajectory prediction and present some innovative ideas. We implement the approach presented by Zhao et al. in [4] since its vectorized representation is innovative and efficient. By publishing this survey along with our code, we hope that new breakthroughs can be made in this rapidly expanding research field.
The two main contributions are as follows:
1. Recent deep-learning approaches tackling trajectory prediction problems in driving scenarios are reviewed and discussed.
2. We implement the prediction model introduced by Zhao et al. [4] and release our code to the research community.
## II Problem Formulation
A self-driving system is assumed to be equipped with detection and tracking modules that observe state \(\mathbb{S}\) accurately for all the involved agents \(\mathbb{A}\). Given a scene, the prediction target is denoted as \(\mathbf{a}_{tar}\) and the surrounding agents are denoted as \(\mathbb{\emph{A}}_{\emph{nbrs}}=\{\mathbf{a}_{1},\mathbf{a}_{2},...,\mathbf{a}_{m}\}\). The state of agent \(\mathbf{a}_{i}\in\mathbb{A}\) at frame \(t\) is denoted as \(s^{\prime}_{i}\), including features such as position, velocity, heading angle, actor type, and \(\mathbf{s}_{i}=\{s^{-T_{obs}+1}_{i},s^{-T_{obs}+2}_{i},...,s^{0}_{i}\}\) denote the sequence of states sampled at different timestamps throughout the observation period \(T_{obs}\). The objective of a predictive framework is to predict future trajectories \(\tau_{tar}=\{\tau_{i}|i=1,2,...,K\}\) of the target agent \(\mathbf{a}_{tar}\), where \(\tau_{i}=\{(x^{1}_{i},y^{1}_{i}),(x^{2}_{i},y^{2}_{i}),...,(x^{T_{pred}}_{i},y ^{T_{pred}}_{i})\}\) denotes the predicted trajectories for the target agent up to the prediction horizon \(T_{pred}\). Besides, the predicted trajectories \(\tau_{i}\in\tau_{tar}\) need to satisfy the no-collision constraint and target agent's kinematic constraints.
## III Methods
In this section, we review the data representation, model structure, learning techniques, and objective functions of some representative approaches.
### _Representations_
There are mainly two types of representation, i.e., image and continuous-space samples, to describe the historical observation and future prediction in each vehicle trajectory prediction case. Images are commonly used to carry the agents and road observations [8, 9, 11, 13, 16, 21, 22, 25, 28] due to its dense characteristic. Some researchers [14, 4, 7, 26] prefer utilizing sparse points or polylines when describing the historical trajectories or the scene context. | 2110.10436v2.mmd |
/*
* grunt-qunit-amd
* https://github.com/cedmax/grunt-qunit-amd
*
* Copyright (c) 2013 cedmax
* Licensed under the MIT license.
*/
'use strict';
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
jshint: {
all: [
'Gruntfile.js',
'tasks/*.js'
],
options: {
jshintrc: '.jshintrc'
}
},
qunit_amd: {
unit: function(file){
var config = {
include: ['test/fixtures/libs/helper.js'],
require: {
baseUrl: 'test/fixtures/src'
}
};
if (file) {
config.tests = ["test/fixtures/tests/"+file+"Test.js"];
} else {
config.tests = ["test/fixtures/tests/*.js"];
}
return config;
},
verbose: function(file){
var config = {
include: ['test/fixtures/libs/helper.js'],
require: {
baseUrl: 'test/fixtures/src'
},
verbose:true,
coverage: {
tmp: 'tmp',
out: 'out'
}
};
if (file) {
config.tests = ["test/fixtures/tests/"+file+"Test.js"];
} else {
config.tests = ["test/fixtures/tests/*.js"];
}
return config;
},
qunitConf: function(file){
var config = {
include: ['test/fixtures/libs/helper.js'],
require: {
baseUrl: 'test/fixtures/src'
},
qunit: {
requireExpects: false
},
verbose:true,
coverage: {
tmp: 'tmp',
out: 'out'
}
};
if (file) {
config.tests = ["test/fixtures/tests/"+file+"Test.js"];
} else {
config.tests = ["test/fixtures/tests/*.js"];
}
return config;
}
}
});
// Actually load this plugin's task(s).
grunt.loadTasks('tasks');
grunt.loadNpmTasks('grunt-contrib-jshint');
// By default, lint and run all tests.
grunt.registerTask('default', ['qunit_amd:verbose']);
};
| cedmax/grunt-qunit-amd-Gruntfile.js |
//
// AppDelegate.h
// RCA-Student-Client
//
// Created by Roger Luan on 4/21/16.
// Copyright © 2016 Roger Oba. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface AppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
@end
| rogerluan/Redes-A-PUC-Campinas-2016-Chamada Acadêmica/RCA-Student-Client/RCA-Student-Client/AppDelegate.h |
Linying Xian - Wikipedia
Tiganos: 33°50′20″N 113°57′28″E / 33.83887°N 113.9578°Ö / 33.83887; 113.9578
Linying Xian
Linying Xian (临颍县)
Lin-ying Hsien, Linying, 临颍
33°50′20″N 113°57′28″E / 33.83887°N 113.9578°Ö / 33.83887; 113.9578
710,845 (2010) [1]
Gatos ang Linying Xian (Chinese: 临颍县, 临颍) sa Pangmasang Republika sa Tśina.[2] Nahimutang ni sa prepektura sa Luohe Shi ug lalawigan sa Henan Sheng, sa sentro nga bahin sa nasod, 700 km sa habagatan sa Beijing ang ulohan sa nasod. Adunay 710,845 ka molupyo.[1] Ang populasyon sa naglangkob sa 344,913 ka babae ug 365,932 ka lalaki. Mga anak ubos sa edad nga 15 mao ang 18.0%, ang mga hamtong nga nag-edad 15-64 72%, ug mga tigulang labaw sa 65 9.0%.[1]
Linying Xian may sa mosunod nga mga subdibisyon:
城关镇 (临颍县)
Ang klima umogon ug subtropikal.[3] Ang kasarangang giiniton 15 °C. Ang kinainitan nga bulan Hunyo, sa 28 °C, ug ang kinabugnawan Enero, sa 0 °C.[4] Ang kasarangang pag-ulan 863 milimetro matag tuig. Ang kinabasaan nga bulan Hulyo, sa 176 milimetro nga ulan, ug ang kinaugahan Enero, sa 7 milimetro.[5]
Nahimutangan sa Linying Xian sa Pangmasang Republika sa Tśina.
↑ Linying Xian sa Geonames.org (cc-by); post updated 2016-04-12; database download sa 2017-02-07
Gikuha gikan sa "https://ceb.wikipedia.org/w/index.php?title=Linying_Xian&oldid=27614319"
Kining maong panid kataposang giusab niadtong 27 Hunyo 2019 sa 10:09. | c4-ceb |
// uri site routes
module.exports = (options) => {
var express = require('express');
var router = express.Router();
var db = options.db;
router.get('/', function(req,res,next) {
res.render('index', { title: 'URI hell', message: ''});
});
router.get('/:uri', function(req,res,next) {
db.presentation.findByUriNoPwd(req.params.uri, function(err,presentation) {
if (presentation) {
if(presentation.testBingoId) {
db.bingo.findById(presentation.testBingoId, function(err,bingoDoc) {
var thesechoices = Array(), tmp = bingoDoc.choices;
while (thesechoices.length < 24 && tmp.length > 0) {
var thisone;
do {
thisone = tmp.splice(Math.floor(Math.random() * tmp.length), 1);
} while (thisone == '' && tmp.length > 0);
if (thisone != '')
thesechoices.push(thisone);
}
res.render('uri-card', { uri: req.params.uri, title: bingoDoc.title, choices: thesechoices });
});
} else
res.render('uri-hello', { uri: req.params.uri })
}
else
res.render('index', { title: 'URI hell', message: 'URI not found' });
});
})
return router;
}; | manminusone/speaker-bingo-routes/uri.js |
We use cookies to give you the best experience possible. By continuing we’ll assume you’re on board with our cookie policy
# Alphabet of Lines: Geometric Construction
The whole doc is available only for registered users
A limited time offer! Get a custom sample essay written according to your requirements urgent 3h delivery guaranteed
Order Now
In antiquity, geometric constructions of figures and lengths were restricted to the use of only a straightedge and compass (or in Plato’s case, a compass only; a technique now called a Mascheroni construction). Although the term “ruler” is sometimes used instead of “straightedge,” the Greek prescription prohibited markings that could be used to make measurements. Furthermore, the “compass” could not even be used to mark off distances by setting it and then “walking” it along, so the compass had to be considered to automatically collapse when not in the process of drawing a circle.
Because of the prominent place Greek geometric constructions held in Euclid’s Elements, these constructions are sometimes also known as Euclidean constructions. Such constructions lay at the heart of the geometric problems of antiquity of circle squaring, cube duplication, and angle trisection. The Greeks were unable to solve these problems, but it was not until hundreds of years later that the problems were proved to be actually impossible under the limitations imposed. In 1796, Gauss proved that the number of sides of constructible polygons had to be of a certain form involving Fermat primes, corresponding to the so-called Trigonometry Angles.
Although constructions for the regular triangle, square, pentagon, and their derivatives had been given by Euclid, constructions based on the Fermat primes were unknown to the ancients. The first explicit construction of a heptadecagon (17-gon) was given by Erchinger in about 1800. Richelot and Schwendenwein found constructions for the 257-gon in 1832, and Hermes spent 10 years on the construction of the 65537-gon at Göttingen around 1900 (Coxeter 1969). Constructions for the equilateral triangle and square are trivial (top figures below). Elegant constructions for the pentagon and heptadecagon are due to Richmond (1893) (bottom figures below).
Given a point, a circle may be constructed of any desired radius, and a diameter drawn through the center. Call the center , and the right end of the diameter . The diameter perpendicular to the original diameter may be constructed by finding the perpendicular bisector. Call the upper endpoint of this perpendicular diameter . For the pentagon, find the midpoint of and call it . Draw , and bisect , calling the intersection point with. Draw parallel to , and the first two points of the pentagon are and . The construction for the heptadecagon is more complicated, but can be accomplished in 17 relatively simple steps. The construction problem has now been automated (Bishop 1978).
Simple algebraic operations such as , , (for a rational number), , , and can be performed using geometric constructions (Bold 1982, Courant and Robbins 1996). Other more complicated constructions, such as the solution of Apollonius’ problem and the construction of inverse points can also accomplished.
One of the simplest geometric constructions is the construction of a bisector of a line segment, illustrated above.
The Greeks were very adept at constructing polygons, but it took the genius of Gauss to mathematically determine which constructions were possible and which were not. As a result, Gauss determined that a series of polygons (the smallest of which has 17 sides; the heptadecagon) had constructions unknown to the Greeks. Gauss showed that the constructible polygons (several of which are illustrated above) were closely related to numbers called the Fermat primes.
Wernick (1982) gave a list of 139 sets of three located points from which a triangle was to be constructed. Of Wernick’s original list of 139 problems, 20 had not yet been solved as of 1996 (Meyers 1996).
It is possible to construct rational numbers and Euclidean numbers using a straightedge and compass construction. In general, the term for a number that can be constructed using a compass and straightedge is a constructible number. Some irrational numbers, but no transcendental numbers, can be constructed.
It turns out that all constructions possible with a compass and straightedge can be done with a compass alone, as long as a line is considered constructed when its two endpoints are located. The reverse is also true, since Jacob Steiner showed that all constructions possible with straightedge and compass can be done using only a straightedge, as long as a fixed circle and its center (or two intersecting circles without their centers, or three nonintersecting circles) have been drawn beforehand. Such a construction is known as a Steiner construction.
Geometrography is a quantitative measure of the simplicity of a geometric construction. It reduces geometric constructions to five types of operations, and seeks to reduce the total number of operations (called the “simplicity”) needed to effect a geometric construction.
##### Related Topics
We can write a custom essay
According to Your Specific Requirements
Order an essay
300+
Materials Daily
100,000+ Subjects
2000+ Topics
Free Plagiarism
Checker
All Materials
are Cataloged Well
Sorry, but copying text is forbidden on this website. If you need this or any other sample, we can send it to you via email.
By clicking "SEND", you agree to our terms of service and privacy policy. We'll occasionally send you account related and promo emails.
Sorry, but only registered users have full access
How about getting this access
immediately?
Thank You A Lot!
Emma Taylor
online
Hi there!
Would you like to get such a paper?
How about getting a customized one?
Can't find What you were Looking for?
Get access to our huge, continuously updated knowledge base
The next update will be in:
14 : 59 : 59 | finemath-3plus |
/*
* Copyright (c) 2011 Citrix Systems, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#define LIST_HEAD(name, type) \
struct name { \
type *e_first; \
}
#define LIST_HEAD_INITIALIZER {NULL}
#define LIST_HEAD_INIT(a) (a)->e_first=NULL
#define LIST_ENTRY(type) \
struct { \
type *e_next; \
type **e_prev; \
}
#define LIST_INIT(head) \
do { (head)->e_first = NULL } while (0)
#define LIST_INSERT_AFTER(this_e, new_e, field) \
do { \
if (((new_e)->field.e_next = (this_e)->field.e_next) != NULL) \
(this_e)->field.e_next->field.e_prev = &(new_e)->field.e_next; \
(this_e)->field.e_next = (new_e); \
(new_e)->field.e_prev = &(this_e)->field.e_next; \
} while (0)
#define LIST_INSERT_BEFORE(this_e, new_e, field) \
do { \
(new_e)->field.e_prev = (this_e)->field.e_prev; \
(new_e)->field.e_next = (this_e); \
*(this_e)->field.e_prev = (new_e); \
(this_e)->field.e_prev = &(new_e)->field.e_next; \
} while (0)
#define LIST_INSERT_HEAD(head, new_e, field) \
do { \
if (((new_e)->field.e_next = (head)->e_first) != NULL) \
(head)->e_first->field.e_prev = &(new_e)->field.e_next; \
(head)->e_first = (new_e); \
(new_e)->field.e_prev = &(head)->e_first; \
} while (0)
#define LIST_REMOVE(this_e, field) \
do { \
if ((this_e)->field.e_next != NULL) \
(this_e)->field.e_next->field.e_prev = (this_e)->field.e_prev; \
*(this_e)->field.e_prev = (this_e)->field.e_next; \
} while (0)
#define LIST_FOREACH(var, head, field) \
for ((var) = (head)->e_first; (var) != NULL; (var) = (var)->field.e_next)
#define LIST_FOREACH_SAFE(var, next, head, field) \
for ((var) = (head)->e_first, (next) = (var) ? (var)->field.e_next : NULL; \
(var) != NULL; \
(var) = (next), (next) = (var) ? (var)->field.e_next : NULL)
#define LIST_EMPTY(head) ((head)->e_first == NULL)
#define LIST_FIRST(head) ((head)->e_first)
#define LIST_NEXT(this_e, field) ((this_e)->field.e_next)
| eric-ch/surfman-plugins/vnc/list.h |
/*-
* Copyright (c) 1990, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 4. Neither the name of the University nor 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 REGENTS 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 REGENTS 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.
*
* @(#)filedesc.h 8.1 (Berkeley) 6/2/93
* $FreeBSD: releng/9.3/sys/sys/sigio.h 139825 2005-01-07 02:29:27Z imp $
*/
#ifndef _SYS_SIGIO_H_
#define _SYS_SIGIO_H_
/*
* This structure holds the information needed to send a SIGIO or
* a SIGURG signal to a process or process group when new data arrives
* on a device or socket. The structure is placed on an SLIST belonging
* to the proc or pgrp so that the entire list may be revoked when the
* process exits or the process group disappears.
*
* (c) const
* (pg) locked by either the process or process group lock
*/
struct sigio {
union {
struct proc *siu_proc; /* (c) process to receive SIGIO/SIGURG */
struct pgrp *siu_pgrp; /* (c) process group to receive ... */
} sio_u;
SLIST_ENTRY(sigio) sio_pgsigio; /* (pg) sigio's for process or group */
struct sigio **sio_myref; /* (c) location of the pointer that holds
* the reference to this structure */
struct ucred *sio_ucred; /* (c) current credentials */
pid_t sio_pgid; /* (c) pgid for signals */
};
#define sio_proc sio_u.siu_proc
#define sio_pgrp sio_u.siu_pgrp
SLIST_HEAD(sigiolst, sigio);
pid_t fgetown(struct sigio **sigiop);
int fsetown(pid_t pgid, struct sigio **sigiop);
void funsetown(struct sigio **sigiop);
void funsetownlst(struct sigiolst *sigiolst);
#endif /* _SYS_SIGIO_H_ */
| dcui/FreeBSD-9.3_kernel-sys/sys/sigio.h |
// Peripheral: FSMC_Bank1_Periph Flexible Static Memory Controller.
// Instances:
// FSMC_Bank1 mmap.FSMC_Bank1_R_BASE
// Registers:
// 0x00 32 BTCR{BCR,BTR}[4]
// Import:
// stm32/o/f10x_hd/mmap
package fsmc
// DO NOT EDIT THIS FILE. GENERATED BY stm32xgen.
const (
MBKEN BCR = 0x01 << 0 //+ Memory bank enable bit.
MUXEN BCR = 0x01 << 1 //+ Address/data multiplexing enable bit.
MTYP BCR = 0x03 << 2 //+ MTYP[1:0] bits (Memory type).
MTYP_0 BCR = 0x01 << 2 // Bit 0.
MTYP_1 BCR = 0x02 << 2 // Bit 1.
MWID BCR = 0x03 << 4 //+ MWID[1:0] bits (Memory data bus width).
MWID_0 BCR = 0x01 << 4 // Bit 0.
MWID_1 BCR = 0x02 << 4 // Bit 1.
FACCEN BCR = 0x01 << 6 //+ Flash access enable.
BURSTEN BCR = 0x01 << 8 //+ Burst enable bit.
WAITPOL BCR = 0x01 << 9 //+ Wait signal polarity bit.
WRAPMOD BCR = 0x01 << 10 //+ Wrapped burst mode support.
WAITCFG BCR = 0x01 << 11 //+ Wait timing configuration.
WREN BCR = 0x01 << 12 //+ Write enable bit.
WAITEN BCR = 0x01 << 13 //+ Wait enable bit.
EXTMOD BCR = 0x01 << 14 //+ Extended mode enable.
ASYNCWAIT BCR = 0x01 << 15 //+ Asynchronous wait.
CBURSTRW BCR = 0x01 << 19 //+ Write burst enable.
)
const (
MBKENn = 0
MUXENn = 1
MTYPn = 2
MWIDn = 4
FACCENn = 6
BURSTENn = 8
WAITPOLn = 9
WRAPMODn = 10
WAITCFGn = 11
WRENn = 12
WAITENn = 13
EXTMODn = 14
ASYNCWAITn = 15
CBURSTRWn = 19
)
const (
ADDSET BTR = 0x0F << 0 //+ ADDSET[3:0] bits (Address setup phase duration).
ADDSET_0 BTR = 0x01 << 0 // Bit 0.
ADDSET_1 BTR = 0x02 << 0 // Bit 1.
ADDSET_2 BTR = 0x04 << 0 // Bit 2.
ADDSET_3 BTR = 0x08 << 0 // Bit 3.
ADDHLD BTR = 0x0F << 4 //+ ADDHLD[3:0] bits (Address-hold phase duration).
ADDHLD_0 BTR = 0x01 << 4 // Bit 0.
ADDHLD_1 BTR = 0x02 << 4 // Bit 1.
ADDHLD_2 BTR = 0x04 << 4 // Bit 2.
ADDHLD_3 BTR = 0x08 << 4 // Bit 3.
DATAST BTR = 0xFF << 8 //+ DATAST [3:0] bits (Data-phase duration).
DATAST_0 BTR = 0x01 << 8 // Bit 0.
DATAST_1 BTR = 0x02 << 8 // Bit 1.
DATAST_2 BTR = 0x04 << 8 // Bit 2.
DATAST_3 BTR = 0x08 << 8 // Bit 3.
BUSTURN BTR = 0x0F << 16 //+ BUSTURN[3:0] bits (Bus turnaround phase duration).
BUSTURN_0 BTR = 0x01 << 16 // Bit 0.
BUSTURN_1 BTR = 0x02 << 16 // Bit 1.
BUSTURN_2 BTR = 0x04 << 16 // Bit 2.
BUSTURN_3 BTR = 0x08 << 16 // Bit 3.
CLKDIV BTR = 0x0F << 20 //+ CLKDIV[3:0] bits (Clock divide ratio).
CLKDIV_0 BTR = 0x01 << 20 // Bit 0.
CLKDIV_1 BTR = 0x02 << 20 // Bit 1.
CLKDIV_2 BTR = 0x04 << 20 // Bit 2.
CLKDIV_3 BTR = 0x08 << 20 // Bit 3.
DATLAT BTR = 0x0F << 24 //+ DATLA[3:0] bits (Data latency).
DATLAT_0 BTR = 0x01 << 24 // Bit 0.
DATLAT_1 BTR = 0x02 << 24 // Bit 1.
DATLAT_2 BTR = 0x04 << 24 // Bit 2.
DATLAT_3 BTR = 0x08 << 24 // Bit 3.
ACCMOD BTR = 0x03 << 28 //+ ACCMOD[1:0] bits (Access mode).
ACCMOD_0 BTR = 0x01 << 28 // Bit 0.
ACCMOD_1 BTR = 0x02 << 28 // Bit 1.
)
const (
ADDSETn = 0
ADDHLDn = 4
DATASTn = 8
BUSTURNn = 16
CLKDIVn = 20
DATLATn = 24
ACCMODn = 28
)
| ziutek/emgo-egpath/src/stm32/o/f10x_hd/fsmc/fsmc_bank1.go |
// { dg-do compile { target c++11 } }
// Copyright (C) 2009-2021 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library 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 3, or (at your option)
// any later version.
// This library 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 library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
#include <forward_list>
void f()
{
typedef std::forward_list<std::forward_list<int> > test_type;
test_type l(10, 1); // { dg-error "no matching" }
}
// { dg-prune-output "iterator_traits" }
| Gurgel100/gcc-libstdc++-v3/testsuite/23_containers/forward_list/requirements/dr438/constructor_1_neg.cc |
/* global describe, it */
const ledgerUtil = require('../../../app/common/lib/ledgerUtil')
const assert = require('assert')
require('../braveUnit')
describe('ledgerUtil test', function () {
describe('shouldTrackView', function () {
const validView = { tabId: 1, url: 'https://brave.com/' }
const validResponseList = [{ tabId: validView.tabId, details: { newURL: validView.url, httpResponseCode: 200 } }]
const noMatchResponseList = [{ tabId: 3, details: { newURL: 'https://not-brave.com' } }]
const matchButErrored = [{ tabId: validView.tabId, details: { newURL: validView.url, httpResponseCode: 404 } }]
describe('input validation', function () {
it('returns false if view is falsey', function () {
assert.equal(ledgerUtil.shouldTrackView(null, validResponseList), false)
})
it('returns false if view.url is falsey', function () {
assert.equal(ledgerUtil.shouldTrackView({tabId: 1}, validResponseList), false)
})
it('returns false if view.tabId is falsey', function () {
assert.equal(ledgerUtil.shouldTrackView({url: 'https://brave.com/'}, validResponseList), false)
})
it('returns false if responseList is falsey', function () {
assert.equal(ledgerUtil.shouldTrackView(validView, null), false)
})
it('returns false if responseList is not an array', function () {
assert.equal(ledgerUtil.shouldTrackView(validView, {}), false)
})
it('returns false if responseList is a 0 length array', function () {
assert.equal(ledgerUtil.shouldTrackView(validView, []), false)
})
})
describe('when finding a matching response based on tabId and url', function () {
it('returns false if no match found', function () {
assert.equal(ledgerUtil.shouldTrackView(validView, noMatchResponseList), false)
})
it('returns false if match is found BUT response code is a failure (ex: 404)', function () {
assert.equal(ledgerUtil.shouldTrackView(validView, matchButErrored), false)
})
it('returns true when match is found AND response code is a success (ex: 200)', function () {
assert.equal(ledgerUtil.shouldTrackView(validView, validResponseList), true)
})
})
})
})
| pmkary/braver-test/unit/lib/ledgerUtilTest.js |
/**
* Copyright (c) 2010-2020 Contributors to the openHAB project
*
* See the NOTICE file(s) distributed with this work for additional
* information.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.openhab.binding.ihc.internal.ws.resourcevalues;
/**
* Class for WSBooleanValue complex type.
*
* @author Pauli Anttila - Initial contribution
*/
public class WSBooleanValue extends WSResourceValue {
public final boolean value;
public WSBooleanValue(int resourceID, boolean value) {
super(resourceID);
this.value = value;
}
@Override
public String toString() {
return String.format("[resourceId=%d, value=%b]", super.resourceID, value);
}
}
| openhab/openhab2-bundles/org.openhab.binding.ihc/src/main/java/org/openhab/binding/ihc/internal/ws/resourcevalues/WSBooleanValue.java |
package org.github.wpiasecki.graviola.db;
public interface UriQuery {
public static final int LINHAS = 1;
public static final int LINHA = 2;
}
| wpiasecki/graviola-android-src/org/github/wpiasecki/graviola/db/UriQuery.java |
/**
* Visual Blocks Editor
*
* Copyright 2012 Google Inc.
* http://blockly.googlecode.com/
*
* 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.
*/
/**
* @fileoverview Object representing an input (value, statement, or dummy).
* @author [email protected] (Neil Fraser)
*/
'use strict';
goog.provide('Blockly.Input');
// TODO(scr): Fix circular dependencies
// goog.require('Blockly.Block');
goog.require('Blockly.Connection');
goog.require('Blockly.FieldLabel');
/**
* Class for an input with an optional title.
* @param {number} type The type of the input.
* @param {string} name Language-neutral identifier which may used to find this
* input again.
* @param {!Blockly.Block} block The block containing this input.
* @param {Blockly.Connection} connection Optional connection for this input.
* @constructor
*/
Blockly.Input = function(type, name, block, connection) {
if (type == Blockly.INDENTED_VALUE){
this.type = Blockly.INPUT_VALUE;
this.subtype = Blockly.INDENTED_VALUE;
} else if (type == Blockly.DUMMY_COLLAPSED_INPUT){
this.type = Blockly.DUMMY_INPUT;
this.subtype = Blockly.DUMMY_COLLAPSED_INPUT;
}
else {
this.type = type;
}
this.name = name;
this.sourceBlock_ = block;
this.connection = connection;
this.titleRow = [];
this.align = Blockly.ALIGN_LEFT;
};
/**
* Add an item to the end of the input's title row.
* @param {*} title Something to add as a title.
* @param {string} opt_name Language-neutral identifier which may used to find
* this title again. Should be unique to the host block.
* @return {!Blockly.Input} The input being append to (to allow chaining).
*/
Blockly.Input.prototype.appendTitle = function(title, opt_name) {
// Empty string, Null or undefined generates no title, unless title is named.
if (!title && !opt_name) {
return this;
}
// Generate a FieldLabel when given a plain text title.
if (goog.isString(title)) {
title = new Blockly.FieldLabel(/** @type {string} */ (title));
}
if (this.sourceBlock_.svg_) {
title.init(this.sourceBlock_);
}
title.name = opt_name;
if (title.prefixTitle) {
// Add any prefix.
this.appendTitle(title.prefixTitle);
}
// Add the title to the title row.
this.titleRow.push(title);
if (title.suffixTitle) {
// Add any suffix.
this.appendTitle(title.suffixTitle);
}
//If it's a COLLAPSE_TEXT input, hide it by default
if (opt_name === 'COLLAPSED_TEXT')
this.sourceBlock_.getTitle_(opt_name).getRootElement().style.display = 'none';
if (this.sourceBlock_.rendered) {
this.sourceBlock_.render();
// Adding a title will cause the block to change shape.
this.sourceBlock_.bumpNeighbours_();
}
return this;
};
/**
* Change a connection's compatibility.
* @param {string|Array.<string>|null} check Compatible value type or
* list of value types. Null if all types are compatible.
* @return {!Blockly.Input} The input being modified (to allow chaining).
*/
Blockly.Input.prototype.setCheck = function(check) {
if (!this.connection) {
throw 'This input does not have a connection.';
}
this.connection.setCheck(check);
return this;
};
/**
* Change the alignment of the connection's title(s).
* @param {number} align One of Blockly.ALIGN_LEFT, ALIGN_CENTRE, ALIGN_RIGHT.
* In RTL mode directions are reversed, and ALIGN_RIGHT aligns to the left.
* @return {!Blockly.Input} The input being modified (to allow chaining).
*/
Blockly.Input.prototype.setAlign = function(align) {
this.align = align;
if (this.sourceBlock_.rendered) {
this.sourceBlock_.render();
}
return this;
};
/**
* Initialize the titles on this input.
*/
Blockly.Input.prototype.init = function() {
for (var x = 0; x < this.titleRow.length; x++) {
this.titleRow[x].init(this.sourceBlock_);
}
};
/**
* Sever all links to this input.
*/
Blockly.Input.prototype.dispose = function() {
for (var i = 0, title; title = this.titleRow[i]; i++) {
title.dispose();
}
if (this.connection) {
this.connection.dispose();
}
this.sourceBlock_ = null;
};
| wanddy/ai4cn-appinventor/lib/blockly/src/core/input.js |
//
// ModalViewController.h
// YSTransitionExample
//
// Created by ysakui on 2013/11/01.
// Copyright (c) 2013年 YoshimitsuSakui. All rights reserved.
//
#import "YSViewController.h"
@interface ModalViewController : YSViewController
@property (nonatomic, assign) NSInteger transitionType;
@end
| ysakui/YSTransition-YSTransitionExample/YSTransitionExample/ModalViewController.h |
x Turn on thread page Beta
You are Here: Home >< Maths
# FP1 - Edexcel - Coordinate systems - Need help with question watch
1. (Original post by Joshmeid)
Ah yeah, stumped me there lol. The square roots have very weird rules.
I'd just stick to implicit to avoid the confusion.
Posted from TSR Mobile
Yeah I will but its always annoying not knowing why.
2. (Original post by Jackabc)
I think that's where I am going wrong, how do we know from example 11 that t has a negative gradient? As if t was negative then wouldn't the equation I am supposed to be proving have a positive gradient. It is weird but it seems that it seems to work whatever the case.
OK, let's nail this mother
This defines a parabola with 2 "branches" - one above the x-axis and one below the x-axis. We are told that a>0, and y^2>0, so the graph is only defined for x>0. However, if y>0 corresponds to a point on the upper branch then there is a corresponding point on the lower branch with a negative y value since we could square both values of y and get the same number.
What they have done in the question is treat the uppermost branch of the parabola, which can be written: (using the convention that the radical sign represents the positive square root). All the analysis they have done works fine because for all the points on this branch we have t>0, x>0, y>0 so we can take square roots in a "sensible" way.
If we tried to do a similar thing for the lower branch, we would be considering the function .
In this case we have to be careful when we take square roots. Because t is negative on this branch of the parabola,
as before.
Note that the gradient has to be 1/t in both cases: above the x-axis the curve has a positive gradient and t>0; below the axis the curve has a negative gradient and t<0.
Now for the safer methods
Method 1 - Implicit differentiation
From
we have
Method 2 - Parametric differentiation
With these approaches we can ignore square roots altogether and arrive at the desired equation for the normal
3. (Original post by davros)
OK, let's nail this mother
This defines a parabola with 2 "branches" - one above the x-axis and one below the x-axis. We are told that a>0, and y^2>0, so the graph is only defined for x>0. However, if y>0 corresponds to a point on the upper branch then there is a corresponding point on the lower branch with a negative y value since we could square both values of y and get the same number.
What they have done in the question is treat the uppermost branch of the parabola, which can be written: (using the convention that the radical sign represents the positive square root). All the analysis they have done works fine because for all the points on this branch we have t>0, x>0, y>0 so we can take square roots in a "sensible" way.
If we tried to do a similar thing for the lower branch, we would be considering the function .
In this case we have to be careful when we take square roots. Because t is negative on this branch of the parabola,
as before.
Note that the gradient has to be 1/t in both cases: above the x-axis the curve has a positive gradient and t>0; below the axis the curve has a negative gradient and t<0.
Now for the safer methods
Method 1 - Implicit differentiation
From
we have
Method 2 - Parametric differentiation
With these approaches we can ignore square roots altogether and arrive at the desired equation for the normal
Thanks a lot you really cleared things up for me. I tried to write out the gradient with a negative t but where you put the square root of t^2 equal to -t I put it equal to t. Am I right in saying that in algebra t^2 is equal to -t and positive t.
4. (Original post by Jackabc)
Thanks a lot you really cleared things up for me. I tried to write out the gradient with a negative t but where you put the square root of t^2 equal to -t I put it equal to t. Am I right in saying that in algebra t^2 is equal to -t and positive t.
It's because we have the convention that the square root is positive:
if t>0,
If t<0,
Your book's approach is simplistic but works because of the symmetry of the (complete) curve so you get the same answer as if you did the analysis in detail.
Personally I would hope that you either don't get such a horrible question, or if you do that you are allowed to use implicit or parametric differentiation
5. (Original post by davros)
It's because we have the convention that the square root is positive:
if t>0,
If t<0,
Your book's approach is simplistic but works because of the symmetry of the (complete) curve so you get the same answer as if you did the analysis in detail.
Personally I would hope that you either don't get such a horrible question, or if you do that you are allowed to use implicit or parametric differentiation
I am a bit confused again actually, where you put the root of t^2 as -t then if t is negative wouldn't that put it back to positive if you get me as t can be any value.
6. (Original post by Jackabc)
Attachment 205195
I understand how to work out the normal of the equation but here is where I am confused... When you square root something there is a positive and a negative solution so why have they presumed that y is positive. Isn't there two solutions?
The square root by definition is always positive.
7. (Original post by Music99)
The square root by definition is always positive.
If you look at post 22 at what davros put at the part where he worked out the gradient for a negative branch, do you know how that works as if you leave the gradient formula in the form -1 over the square root of t^2. Then if t was -3 which gives a negative y value on the negative branch then you would expect the gradient to be negative. So substituting t= -3 then it becomes -1 over the square root of (-3)^2 which is equal to -1 over -3 which is positive 1/3 which isn't a negative gradient.
8. (Original post by Jackabc)
If you look at post 22 at what davros put at the part where he worked out the gradient for a negative branch, do you know how that works as if you leave the gradient formula in the form -1 over the square root of t^2. Then if t was -3 which gives a negative y value on the negative branch then you would expect the gradient to be negative. So substituting t= -3 then it becomes -1 over the square root of (-3)^2 which is equal to -1 over -3 which is positive 1/3 which isn't a negative gradient.
-1/t^2 if t is -3 then it's -1/9 which is negative...
9. (Original post by Music99)
-1/t^2 if t is -3 then it's -1/9 which is negative...
I meant the square root of t^2 so it would be -3 and so 1/9 which would make the gradient positive when it needs to be negative.
10. (Original post by Jackabc)
I meant the square root of t^2 so it would be -3 and so 1/9 which would make the gradient positive when it needs to be negative.
- we must always get a positive number from the square root operator.
E.g,
Suppose y=mx+c is a tangent to at the point
The line and curve intersect, so:
or
so
For a tangent we need equal roots, which means the discriminant must be 0:
Expanding the LHS:
or
so
Now, at
so
Hence
so
or
which is
Therefore,
giving
and
as the equation of the tangent.
11. (Original post by davros)
- we must always get a positive number from the square root operator.
E.g,
Suppose y=mx+c is a tangent to at the point
The line and curve intersect, so:
or
so
For a tangent we need equal roots, which means the discriminant must be 0:
Expanding the LHS:
or
so
Now, at
so
Hence
so
or
which is
Therefore,
giving
and
as the equation of the tangent.
I am going to use this in the exam to impress the examiner. Thanks! Good original thinking! I've already given you a positive rep but you are in need of more.
TSR Support Team
We have a brilliant team of more than 60 Support Team members looking after discussions on The Student Room, helping to make it a fun, safe and useful place to hang out.
This forum is supported by:
Updated: March 27, 2013
Today on TSR
### How do I turn down a guy in a club?
What should I do?
Poll
Useful resources
### Maths Forum posting guidelines
Not sure where to post? Read the updated guidelines here
### How to use LaTex
Writing equations the easy way
### Study habits of A* students
Top tips from students who have already aced their exams | finemath-3plus |
#!/usr/bin/env python3
# transpiled with BefunCompile v1.3.0 (c) 2017
import gzip, base64
_g = ("AR+LCAAAAAAABADt2slqwzAQgOFXcb1cIi8jxzpEBNEHCUkPBV110skPnwmmgdCWlDaB0PzfRaPRgpDxnJQLPJIKAAAAAAAAAAAAAAAAAIB/4OqDuZA/gvPcfIq2d3qg"
+ "9+RC+V5OK28lObdaiSSRGGzn/ajhbhz8HDSMu6baH/xaklkv49qt8/XtcQOz/zKdjB2i2ChjszT8IreX6/qin6zIxT0H++3a/X2O9NSC1ifbnYrTRlLQymQlNkszWBMn"
+ "SdOSm845J6nQGU5iV+WDRjr09rKEfVl0Rdm2reZ650xLTfuDOcnYWa+l6Kcrtp9D/bLGRJl0lygbatrvvPZc3iM4ApHVms+QMwAA")
g = base64.b64decode(_g)[1:]
for i in range(base64.b64decode(_g)[0]):
g = gzip.decompress(g)
g=list(g)
def gr(x,y):
if(x>=0 and y>=0 and x<400 and y<33):
return g[y*400 + x];
return 0;
def gw(x,y,v):
if(x>=0 and y>=0 and x<400 and y<33):
g[y*400 + x]=v;
def td(a,b):
return ((0)if(b==0)else(a//b))
def tm(a,b):
return ((0)if(b==0)else(a%b))
s=[]
def sp():
global s
if (len(s) == 0):
return 0
return s.pop()
def sa(v):
global s
s.append(v)
def sr():
global s
if (len(s) == 0):
return 0
return s[-1]
def _0():
gw(1,0,400)
gw(0,0,10000)
sa(gr(0,0)-1)
sa(0)
sa((gr(0,0)-1)/2)
sa((gr(0,0)-1)/2)
gw(2,0,gr(0,0)-1)
return 1
def _1():
return (2)if(sp()!=0)else(15)
def _2():
global t0
global t1
t0=gr(2,0)
sa(sr());
sa(t0)
v0=sp()
v1=sp()
sa(v0)
sa(v1)
v0=sp()
sa(tm(sp(),v0))
t1=sp()
return (14)if((t1)!=0)else(3)
def _3():
sa(sr());
gw(3,0,sp())
sa(sp()+sp());
sa(gr(3,0)-1)
sa(gr(3,0)-1)
return 4
def _4():
return (2)if(sp()!=0)else(5)
def _5():
sp();
gw(tm(gr(2,0),gr(1,0)),(td(gr(2,0),gr(1,0)))+1,sp())
return 6
def _6():
sa(sr());
return (13)if(sp()!=0)else(7)
def _7():
gw(0,1,0)
gw(2,0,gr(0,0)-1)
gw(9,0,0)
sp();
sp();
return 8
def _8():
gw(4,0,gr(tm(gr(2,0),gr(1,0)),(td(gr(2,0),gr(1,0)))+1))
gw(5,0,gr(tm(gr(4,0),gr(1,0)),(td(gr(4,0),gr(1,0)))+1))
return (9)if((gr(2,0)-gr(5,0))!=0)else(11)
def _9():
global t2
t2=gr(2,0)
gw(2,0,gr(2,0)-1)
return (8)if((t2)!=0)else(10)
def _10():
print(gr(9,0),end=" ",flush=True)
return 16
def _11():
return (12)if(gr(2,0)>gr(4,0))else(9)
def _12():
print(gr(2,0),end=" ",flush=True)
print(" - ",end="",flush=True)
print(gr(4,0),end=" ",flush=True)
print(chr(10),end="",flush=True)
gw(9,0,gr(9,0)+gr(2,0)+gr(4,0))
return 9
def _13():
sa(sp()-1)
sa(sr());
sa(sr());
gw(2,0,sp())
sa(0)
v0=sp()
v1=sp()
sa(v0)
sa(v1)
sa(sp()/2);
sa(sr());
return 1
def _14():
sa(sp()-1)
sa(sr());
return 4
def _15():
gw(tm(gr(2,0),gr(1,0)),(td(gr(2,0),gr(1,0)))+1,1)
return 6
m=[_0,_1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12,_13,_14,_15]
c=0
while c<16:
c=m[c]()
| Mikescher/Project-Euler_Befunge-compiled/Python3/Euler_Problem-021.py |
/*
* Copyright (C) 2015 Florent Pouthier
* Copyright (C) 2015 Emmanuel Pouthier
*
* This file is part of SIGMAE.
*
* Aye-Aye 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 3 of the License, or
* (at your option) any later version.
*
* Aye-Aye 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, see <http://www.gnu.org/licenses/>.
*/
/* SIGMAE
* elem.h
*/
#define SG_ELEMFLAG_IMPLICIT 8
/*end*/
| hasardel/sigmae-elem.h |
require 'rails_helper'
describe Page, type: :model do
before(:all) do
@editor = FactoryGirl.create(:user)
end
describe 'acts_as_authority_controlled' do
it 'should be in the “Content” area' do
expect(Page.authority_area).to eq 'Content'
end
end
describe 'validation' do
describe 'of filename' do
it 'should allow the filename to be a single slash for the root path' do
page = Page.new(title: 'A', filename: '/')
expect(page.valid?).to be_truthy
end
it 'should not allow slashes in the filename, except for the root path' do
page = Page.new(title: 'A', filename: '/filename')
expect(page.valid?).to be_falsey
end
it 'should not allow leading periods in the filename' do
page = Page.new(title: 'A', filename: '.filename')
expect(page.valid?).to be_falsey
end
it 'should not allow trailing periods in the filename' do
page = Page.new(title: 'A', filename: 'filename.')
expect(page.valid?).to be_falsey
end
it 'should not allow series of periods in the filename' do
page = Page.new(title: 'A', filename: 'file..name')
expect(page.valid?).to be_falsey
end
it 'should not allow high-byte characters in the filename' do
page = Page.new(title: 'A', filename: 'ƒilename')
expect(page.valid?).to be_falsey
end
it 'should not allow ampersands in the filename' do
page = Page.new(title: 'A', filename: 'file&name')
expect(page.valid?).to be_falsey
end
it 'should not allow spaces in the filename' do
page = Page.new(title: 'A', filename: 'file name')
expect(page.valid?).to be_falsey
end
# it "should not allow in the filename" do
# page = Page.new(:filename => 'filename')
# expect(page.valid?).to be_falsey
# end
it 'should not allow the filename to exceed 127 characters' do
page = Page.new(title: 'A', filename: 'a' * 128)
expect(page.valid?).to be_falsey
end
it 'should allow the filename to reach 127 characters' do
page = Page.new(title: 'A', filename: 'a' * 127)
expect(page.valid?).to be_truthy
end
it 'should allow letters, numbers, dashes, underscores and a file extension in the filename' do
page = Page.new(
title: 'A', filename: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ-abcdefghijklmnopqrstuvwxyz_01234567.89'
)
expect(page.valid?).to be_truthy
end
end
describe 'of title' do
it 'should not allow a blank title' do
page = Page.new(title: '', filename: 'a')
expect(page.valid?).to be_falsey
end
it 'should not allow a missing title' do
page = Page.new(filename: 'a')
expect(page.valid?).to be_falsey
end
end
end
describe '#generate_path' do
it 'should be called after the Page is saved' do
page = Page.new(filename: 'page', title: 'Page')
page.editor = @editor
page.save!
expect(page.path).not_to be_nil
end
end
describe '#update_path' do
it 'should make no change to the path if the Page’s filename did not change' do
page = FactoryGirl.create(:page, filename: 'original')
page.update!(description: 'Not changing the filename.')
expect(page.sitepath).to eq '/original'
end
it 'should update the path if the Page’s filename changed' do
page = FactoryGirl.create(:page, filename: 'original')
page.update!(filename: 'changed')
expect(page.sitepath).to eq '/changed'
end
it 'should create the path if the Page doesn’t have one' do
page = FactoryGirl.create(:page, filename: 'original')
page.path.destroy
page.path = nil
page.filename = 'changed'
page.update_path
expect(page.sitepath).to eq '/changed'
end
end
describe '#calculate_sitepath' do
it 'should just be the filename with a leading slash if no parent Page' do
expect(Page.new(filename: 'page', title: 'Page').calculate_sitepath).to eq '/page'
end
it 'should have be the parent’s sitepath plus a slash and the filename' do
parent = FactoryGirl.create(:page, filename: 'parent')
page = Page.new(filename: 'page', title: 'Page')
page.parent = parent
expect(page.calculate_sitepath).to eq '/parent/page'
end
it 'should just be a slash for the home Page' do
expect(Page.new(filename: '/', title: 'Page').calculate_sitepath).to eq '/'
end
end
describe '#breadcrumbs' do
it 'should be an empty array if no parent' do
expect(Page.new.breadcrumbs).to eq []
end
it 'should point to the parent, if there is one' do
parent = FactoryGirl.create(:page, filename: 'parent', title: 'Parent')
page = Page.new(filename: 'page', title: 'Page')
page.parent = parent
expect(page.breadcrumbs).to eq [{ text: 'Parent', url: '/parent' }]
end
it 'should point to the parents, if there is more than one in the parent chain' do
grandparent = FactoryGirl.create(:page, filename: 'grandparent', title: 'Grandparent')
parent = FactoryGirl.create(:page, parent: grandparent, filename: 'parent', title: 'Parent')
page = Page.new(filename: 'page', title: 'Page')
page.parent = parent
expect(page.breadcrumbs).to eq [
{ text: 'Grandparent', url: '/grandparent' },
{ text: 'Parent', url: '/grandparent/parent' }
]
end
end
describe '#sitepath' do
it 'should be the path’s sitepath' do
page = Page.new(filename: 'testpage', title: 'Page')
page.editor = @editor
page.save!
expect(page.sitepath).to eq '/testpage'
end
end
end
| grantneufeld/Wayground-spec/models/page_spec.rb |
class MARS_gui_ctrlShortcutButton: MARS_gui_ctrlDefaultButton {
type = CT_SHORTCUTBUTTON;
style = ST_UPPERCASE + ST_VCENTER;
font = FONT2_THIN;
text = "";
size = SIZE_PURISTA_M;
sizeEx = SIZE_PURISTA_M;
color[] = {COLOR_TEXT_RGBA};
color2[] = {COLOR_TEXT_RGBA};
colorFocused[] = {COLOR_TEXT_RGBA};
colorDisabled[] = {COLOR_TEXT_RGB,0.25};
colorBackground[] = {0,0,0,1};
colorBackground2[] = {QCOLOR_ACTIVE_RGBA};
colorBackgroundFocused[] = {QCOLOR_ACTIVE_RGBA};
colorBackgroundActive[] = {QCOLOR_ACTIVE_RGBA};
animTextureNormal = "#(argb,8,8,3)color(1,1,1,1)";
animTextureOver = "#(argb,8,8,3)color(1,1,1,1)";
animTexturePressed = "#(argb,8,8,3)color(1,1,1,1)";
animTextureFocused = "#(argb,8,8,3)color(1,1,1,1)";
animTextureDisabled = "#(argb,8,8,3)color(1,1,1,1)";
animTextureDefault = "#(argb,8,8,3)color(1,1,1,1)";
period = 1;
periodFocus = 1;
periodOver = 0.5;
shortcuts[] = {KEY_XBOX_A, DIK_RETURN, DIK_SPACE, DIK_NUMPADENTER};
textureNoShortcut = "#(argb,8,8,3)color(1,1,1,1)";
onCanDestroy = "";
onDestroy = "";
onMouseEnter = "";
onMouseExit = "";
onSetFocus = "";
onKillFocus = "";
onKeyDown = "";
onKeyUp = "";
onMouseButtonDown = "";
onMouseButtonUp = "";
onMouseButtonClick = "";
onMouseButtonDblClick = "";
onMouseZChanged = "";
onMouseMoving = "";
onMouseHolding = "";
onButtonClick = "";
onButtonDown = "";
onButtonUp = "";
class Attributes {
align = "center";
color = "#ffffff";
font = FONT2_THIN;
shadow = 0;
};
class HitZone {
left = 0;
top = 0;
right = 0;
bottom = 0;
};
class TextPos {
left = 0;
top = 0;
right = 0;
bottom = 0;
};
class ShortcutPos {
left = 0;
top = 0;
w = 0;
h = 0;
};
};
class MARS_gui_ctrlShortcutButtonOK: MARS_gui_ctrlShortcutButton {
default = 1;
idc = IDC_OK;
text = "";
};
class MARS_gui_ctrlShortcutButtonCancel: MARS_gui_ctrlShortcutButton {
idc = IDC_CANCEL;
text = "";
}; | jameslkingsley/Mars-addons/common/UI/Controls/ctrlShortcutButton.hpp |
var xpath = require('xpath');
exports.getComment = function(node){
var commentNode = xpath.select1("preceding-sibling::node()[self::*|self::comment()][1][self::comment()]", node);
var comment = commentNode ? commentNode.nodeValue : "N/A";
return comment;
};
| jeeeyul/jeeebot-lib/parts/lib/xml-util.js |
'use strict';
require('dotenv').config();
//
// Load all needed modules
const Hapi = require('hapi');
const fs = require('fs');
//
// Helper consts
const PROJECTS = __dirname+'/projects/';
//
// Server creation
const server = new Hapi.Server();
server.connection({ port: process.env.PORT || 5000 });
//
// Entry Point
server.route([
{
method : "GET",
path : "/",
handler : function(request, reply){
reply({result:true});
}
},
{
method : "GET",
path : "/*",
handler : function(request, reply){
reply({result:false,message:'Unknown route'});
}
}
]);
//
// Projects
// loop over projects
fs.readdirSync(PROJECTS)
.filter((projectDirectory) => {
// TODO : Here we check for valid names or other special cases
return true;
})
.forEach((projectDirectory) => {
let projectIndex = PROJECTS+projectDirectory+'/index.js';
// check if there's an index file in the project directory
fs.access(projectIndex, fs.F_OK, function(err) {
if (!err) {
// require the node module and loop over the routes
let projectRoutes = require(projectIndex);
console.info('Loading project "'+projectDirectory+'"');
for (let routeIndex in projectRoutes) {
let route = projectRoutes[routeIndex];
// we use some fallback defaults for now, be we should just exit
let method = route.method || 'GET';
let path = route.path || '/';
let handler = route.handler || function(){};
// we use relative path on the projects to simplify changes in the future
let projectPath = '/projects/'+projectDirectory+path;
console.info('Adding route ('+method+') "'+path+'" to project "'+projectDirectory+'": ',projectPath);
server.route({
method: method,
path: projectPath,
handler: handler
});
}
} else {
console.error('Loading of project "'+projectDirectory+'" failed because the required index.js file is missing.',projectIndex); // TODO : Use templates!
}
});
return true;
});
server.start(() => {
console.log('Server running at:', server.info.uri);
}); | dacostafilipe/openapi-server-server.js |
//
// ObjectDisplayable.h
// Azure Activity Logger
//
#import <Foundation/Foundation.h>
/**
* Simple protocol to generalize how to display a given object.
*/
@protocol ObjectDisplayable <NSObject>
- (NSString *)resultLine1;
- (NSString *)resultLine2;
- (NSString *)detailLine1;
- (NSString *)detailLine2;
- (NSString *)detailLine3;
@end
| Azure/mobile-services-dynamics-connector-MobileServicesCrm/client/AzureActivityLogger.iOS/Azure Activity Logger/Objects/ObjectDisplayable.h |
Роднина опитва да погуби семейството ми! :: BG-Mamma
Роднина опитва да погуби семейството ми!
27 ян. 2007, 14:04 ч.
Вече не знам какво да правя. От почти две години сестрата на жена ми ме сваля. В началото бяха шегички, по-късно се превърнаха в намеци, а от 10на месеца действията са конкретни. Тя и мъжът и са в много открит брак - сменят си партньорите често. Моят брак е традиционен - ходя си по момичета когато искам и винаги всичко е дискретно. Жена ми хем знае хем не знае ако се сещате за какво говоря.
Адски неудобно ми е това положение тъй като всеки ден получавам палави sms съобщения и знам, че ако споделя с моята сигурно ще бъде афектирана и не знам какво ще направи, но не желая синът ни да расте с лишена от свобода майка. Освен това ще имам доста разходи по чистене, готвене и гледане на детето - все неща, които жена ми прави като за без пари почти.
Сестра и иначе не е за изпускане - с 5 години е по-млада, което си дава видими преимущества. Много кофти ситуация се получи.
# 1 27 ян. 2007, 14:16 ч.
Направо си направете комуна,супер ще е-две чистачки и....
# 2 27 ян. 2007, 14:29 ч.
Според мен, за съжеление, нашето мнение няма да е много компетентно.
Съветвам те по най-бързия начин да се насочиш към професионалист - нарича се сексолог*, ако бъдеш себе си и се отпуснеш пред него и споделиш всичко, може да извадиш късмет и да ти даде направление за психиатър.
* - човек, който решава проблемите на мъжете с малки пи**и
# 3 27 ян. 2007, 14:32 ч.
Цитат на: Samantha Jones в сб, 27 яну 2007, 14:29
Долавям някаква ирония в поста ти. Не мисля, че е редно да ми се подиграваш. Също така забелязах, че намекваш нещо за големината МУ. Ако за теб 11 сантима са малко значи просто докторът не си е свършил работата когато е трябвало. Точка.
# 4 27 ян. 2007, 14:39 ч.
# 5 27 ян. 2007, 14:51 ч.
Изградил си си имидж във форума и малко трудно ще се приеме насериозно този така дълбок проблем
Нали си чувал приказката...Който има балдъза спи между два гъза
Цитат на: joro01 в сб, 27 яну 2007, 14:04
Тя и мъжът и са в много открит брак - сменят си партньорите често. Моят брак е традиционен - ходя си по момичета когато искам и винаги всичко е дискретно. Жена ми хем знае хем не знае ако се сещате за какво говоря.
# 6 27 ян. 2007, 15:21 ч.
Моят брак е традиционен - ходя си по момичета когато искам и винаги всичко е дискретно. Жена ми хем знае хем не знае ако се сещате за какво говоря.
Ти на това ли му викаш | c4-bg |
import { assert } from 'chai';
import getThemeProps from './getThemeProps';
describe('getThemeProps', () => {
it('should ignore empty theme', () => {
const props = getThemeProps({
theme: {},
name: 'MuiFoo',
props: {},
});
assert.deepEqual(props, {});
});
it('should ignore different component', () => {
const props = getThemeProps({
theme: {
props: {
MuiBar: {
disableRipple: true,
},
},
},
name: 'MuiFoo',
props: {},
});
assert.deepEqual(props, {});
});
it('should return the props', () => {
const props = getThemeProps({
theme: {
props: {
MuiFoo: {
disableRipple: true,
},
},
},
name: 'MuiFoo',
props: {},
});
assert.deepEqual(props, {
disableRipple: true,
});
});
});
| kybarg/material-ui-packages/material-ui-styles/src/getThemeProps/getThemeProps.test.js |
# functions for rounding and truncatin
What are the functions for rounding and truncatin a float number?
What headers have to be included?
Thanks.
• : What are the functions for rounding and truncatin a float number?
: What headers have to be included?
: Thanks.
:
[blue]
Hi,
One could do the above by using [b]simple type casting[/b].
Note that [b]type casting[/b] 'truncates a number, not rounds.
For example:
[code]
#include
using namespace std;
int main()
{
// Declaring the variable
double v = 1234.56789;
// Casting the double to an int
int n = int(v);
cout << "v = " << v << " , n = " << n << endl;
return 0;
}
[/code]
The program should return [code]v = 1234.57, n = 1234[/code]
The double value 1234.57 is converted to an integer value 1234.
[/blue]
• : : What are the functions for rounding and truncatin a float number?
: : What headers have to be included?
: : Thanks.
: :
: [blue]
: Hi,
:
: One could do the above by using [b]simple type casting[/b].
:
: Note that [b]type casting[/b] 'truncates a number, not rounds.
:
: For example:
:
: [code]
: #include
: using namespace std;
:
: int main()
: {
: // Declaring the variable
: double v = 1234.56789;
:
: // Casting the double to an int
: int n = int(v);
:
: cout << "v = " << v << " , n = " << n << endl;
:
: return 0;
: }
: [/code]
:
: The program should return [code]v = 1234.57, n = 1234[/code]
:
: The double value 1234.57 is converted to an integer value 1234.
: [/blue]
:
You can also round floats to the nearest whole number (up or down) with a small amount of code
[CODE]
float a = 5.7f;
float r = (long)((a)+0.5);
printf("%f
", r);
[/CODE]
That would print "6.000000"
If a = 5.3f then it would print "5.000000"
Or you could use printf("%ld
", r); and it would print "6" or "5"
• Thank you. That really worked and solved part of my problem. But what if I need to round the number keeping two decimal digits, for example, from 1.5492 to 1.55?
• [b][red]This message was edited by DB1 at 2002-10-14 14:23:44[/red][/b][hr]
: Thank you. That really worked and solved part of my problem. But what if I need to round the number keeping two decimal digits, for example, from 1.5492 to 1.55?
:
Well, you need to do a bit of math. One way is to step through the number and round as you go..
[CODE]
float a = 1.5492f;
printf("a: %f
", a);
float b = a - (long)a;
float c = b*1000.0f;
float d = (long)((c)+0.5f);
float e = d/10.0f;
float f = (long)((e)+0.5f);
float g = f/100.0f;
float h = g + (a-b);
printf("h: %f
", h);
[/CODE]
The easy way is to just use precision..
[CODE]
float a = 1.5492f;
printf("a: %.2f
", a);
[/CODE] | finemath-3plus |
define([
'App'
], function(DSW) {
'use strict';
DSW.module('Modules.ManageEnvironments', {
moduleClass: DSW.moduleClasses.Common,
define: function(module, app) {
module.startWithParent = false;
module.opts = {};
module.showDialog = function(projectName) {
module.opts.projectName = projectName;
var aLevels = app.request('get:accessLevels');
if (!aLevels.level2()) {
app.trigger('alert:show', {
type: 'danger',
message: 'Sorry, you\'re not authorized for this operation.'
});
app.trigger('workspace:nav:close');
require(['modules/ProjectsList'], function(ProjectsList) {
ProjectsList.start();
ProjectsList.showProjectsList();
});
return false;
}
app.userRouter.navigate('#projects/' + projectName + '/environments');
app.trigger('bc:route', new Backbone.Collection([
{
title: 'projects',
link: 'projects'
},
{
title: projectName,
link: 'projects/' + projectName
},
{
title: 'environments',
link: 'projects/' + projectName + '/environments'
}
]));
require(['views/item/LoadingView'], function(LoadingView) {
var loadingView = new LoadingView({
title: "Loading Manage Environments...",
message: "Please wait, loading environments data..."
});
app.trigger('workspace:show', loadingView)
});
module.fetchDependencies();
};
module.getCollectionsToFetch = function(collectionsToFetch, data, colls) {
var promise = app.request('fetch', collectionsToFetch);
promise.done(function() {
module.log('fetching dependencies... Done.');
data.deps = colls;
require(['views/modals/ManageEnvironments'], function(ManageEnvironmentsModal) {
var view = new ManageEnvironmentsModal(data);
app.trigger('workspace:show', view);
})
});
};
}
});
return DSW.Modules.ManageEnvironments;
}); | ggasoftware/devops-service-devops-service-web-core/public/js/app/modules/ManageEnvironments.js |
Mathematical description
Let \(A,B\) be the adjacency matrices of the graphs \(G,H\) each with \(n\) vertices. In the graph matching problem, the goal is to find the solution of the following optimization problem
\[\max_{x\in\mathcal{S}_{n}}\sum_{i,j}A_{ij}B_{x(i)x(j)}\] (P1)
which is equivalent to solving
\[\max_{X\in\mathcal{P}_{n}}\langle A,XBX^{T}\rangle_{F}.\] (P1')
Observe that (P1) is a well-defined problem - not only for adjacency matrices - but for any pair of matrices of the same size. In particular, it is well-defined when \(A,B\) are adjacency matrices of weighted graphs, which is the main setting of this paper. Moreover, this is an instance of the well-known _quadratic assignment problem_, which is a combinatorial optimization problem known to be NP-hard in the worst case (Burkard et al., 1998). Another equivalent formulation of (P1) is given by the following "lifted" (or vector) version of the problem
\[\max_{[X]\in[\mathcal{P}_{n}]}[X]^{T}(B\otimes A)[X]\] (P1")
where \([\mathcal{P}_{n}]\) is the set of permutation matrices in vector form. This form has been already considered in the literature, notably in the family of spectral methods (Onaran and Villar, 2017; Feizi et al., 2020).
### Statistical models for correlated random graphs
Most of the theoretical statistical analysis for the graph matching problem has been performed so far under two random graph models: the _Correlated Erdos-Renyi_ and the _Correlated Gaussian Wigner model_. In these models the dependence between the two graphs \(A\) and \(B\) is explicitly described by the inclusion of a "noise" parameter which captures the degree of correlation between \(A\) and \(B\).
Correlated Gaussian Wigner (CGW) model \(W(n,\sigma,x^{*})\).The problem (P1) is well-defined for matrices that are not necessarily \(0/1\) graph adjacencies, so a natural extension is to consider two complete weighted graphs. The following Gaussian model has been proposed in (Ding et al., 2021)
\[A_{ij}\sim\begin{cases}\mathcal{N}(0,\frac{1}{n})\text{ if }i<j,\\ \mathcal{N}(0,\frac{2}{n})\text{ if }i=j,\end{cases}\]
\(A_{ij}=A_{ji}\) for all \(i,j\in[n]\), and \(B_{x^{*}(i)x^{*}(j)}=\sqrt{1-\sigma^{2}}A_{ij}+\sigma Z_{ij}\), where \(Z\stackrel{{ d}}{{=}}A\). Both \(A\) and \(B\) are distributed as the GOE (Gaussian orthogonal ensemble). Here the parameter \(\sigma>0\) should be interpreted as the noise parameter and in that sense, \(B\) can be regarded as a "noisy perturbation" of \(A\). Moreover, \(x^{*}\in\mathcal{S}_{n}\) is the ground-truth (or latent) permutation that we seek to recover. It is not difficult to verify that the problem (P1) is in fact the maximum likelihood estimator (MLE) of \(x^{*}\) under the CGW model.
Correlated Erdos-Renyi (CER) model \(G(n,q,s,x^{*})\). For \(q,s\in[0,1]\), the correlated Erdos-Renyi model with latent permutation \(x^{*}\in\mathcal{S}_{n}\) can be described in two steps.
1. \(A\) is generated according to the Erdos-Renyi model \(G(n,q)\), i.e. for all \(i<j\), \(A_{ij}\) is sampled from independent Bernoulli's r.v. with parameter \(q\), \(A_{ji}=A_{ij}\) and \(A_{ii}=0\).
2. Conditionally on \(A\), the entries of \(B\) are i.i.d according to the law \[B_{x^{*}(i),x^{*}(j)}\sim\begin{cases}Bern(s)\quad\text{if}\quad A_{ij}=1,\\ Bern\big{(}\frac{q}{1-q}(1-s)\big{)}\quad\text{if}\ A_{ij}=0.\end{cases}\] (1.1) There is another equivalent description of this model in the literature, where to obtain CER graphs, we first sample an Erdos-Renyi "mother" graph and then define \(A,B\) as independent subsamples with certain density parameter. We refer to (Pedarsani and Grossglauser, 2011) for details.
### Related work
Information-theoretic limits of graph matching.The necessary and sufficient conditions for correctly estimating the matching between two graphs when they are generated from the CGW or the CER model have been investigated in (Cullina and Kiyavash, 2017; Hall and Massoulie, 2022; Wu et al., 2021). In particular, for the CGW model, it has been shown in (Wu et al., 2021, Thm.1) that the ground truth permutation \(x^{*}\) can be exactly recovered w.h.p. only when \(\sigma^{2}\leq 1-\frac{(4+\epsilon)\log n}{n}\). When \(\sigma^{2}\geq 1-\frac{(4-\epsilon)\log n}{n}\) no algorithm can even partially recover \(x^{*}\). However, it is not known if there is a polynomial time algorithm that can reach this threshold.
Efficient algorithms
* **Seedless algorithms.** Several polynomial time algorithms have been proposed relying on spectral methods (Umeyama, 1988; Fan et al., 2019; Ganassali et al., 2022; Feizi et al., 2020; Cour et al., 2006), degree profiles (Ding et al., 2021; Osman Emre Dai and Grossglauser, 2019), other vertex signatures (Mao et al., 2021), random walk based approaches (Rohit Singh and Berger, 2008; Kazemi and Grossglauser, 2016; Gori et al., 2004), convex and concave relaxations (Aflalo et al., 2015; Lyzinski et al., 2016; Zaslavskiy et al., 2009a), and other non-convex methods (Yu et al., 2018; Xu et al., 2019; Onaran and Villar, 2017). Most of the previous algorithms have theoretical guarantees only in the low noise regime. For instance, the Grampa algorithm proposed in (Fan et al., 2019) provably exactly recovers the ground truth permutation for the CGW model when \(\sigma=\mathcal{O}(\frac{1}{\log n})\), and in (Ding et al., 2021) it is required for the CER (resp. CGW) model that the two graphs differ by at most \(1-s=\mathcal{O}(\frac{1}{\log^{2}n})\) fraction of edges (resp. \(\sigma=O(\frac{1}{\log n})\)). There are only two exceptions for the CER model where the noise level is constant: the work of (Ganassali and Massoulie, 2020) and (Mao et al., 2021). But these algorithms exploit the sparsity of the graph in a fundamental manner and cannot be extended to dense graphs.
* **Seeded algorithms.** In the seeded case, different kinds of consistency guarantees have been proposed: consistency after one refinement step (Yu et al., 2021; Lubars and Srikant, 2018), consistency after several refinement steps uniformly over the seed (Mao et al., 2021). For the dense CER (\(p\) of constant order), one needs to have an initial seed with \(\Omega(\sqrt{n\log n})\) overlap in order to have consistency after one step for a given seed (Yu et al., 2021). But if we want to have a uniform result, one needs to have a seed that overlaps the ground-truth permutation in \(O(n)\) points (Mao et al., 2021). Our results for the CGW model are similar in that respect. Besides, contrary to seedless algorithms, our algorithm works even if the the noise level \(\sigma\) is constant.
Projected power method (PPM).PPM, which is also often referred to as a _generalized power method_ (GPM) in the literature is a family of iterative algorithms for solving constrained optimization problems. It has been used with success for various tasks including clustering SBM (Wang et al., 2021), group synchronization (Gao and Zhang, 2022; Boumal, 2016), joint alignment from pairwise difference (Chen and Candes, 2016), low rank-matrix recovery (Chi et al., 2019) and the generalized orthogonal Procrustes problem (Ling, 2021). It is a useful iterative strategy for solving non-convex optimization problems, and usually requires a good enough initial estimate. In general, we start with an initial candidate satisfying a set of constraints and at each iteration we perform
1. a _power step_, which typically consists in multiplying our initial candidate with one or more data dependent matrices, and 2. a _projection step_ where the result of the power step is projected onto the set of constraints of the optimization problem.
These two operations are iteratively repeated and often convergence to the "ground-truth signal" can be ensured in \(\mathcal{O}(\log n)\) iterations, provided that a reasonably good initialization is provided.
The projected power method (PPM) has also been used to solve the graph matching problem, and its variants, by several authors. In some works, it has been explicitly mentioned (Onaran and Villar, 2017; Bernard et al., 2019), while in others (Mao et al., 2021; Yu et al., 2021; Lubars and Srikant, 2018) very similar algorithms have been proposed without acknowledging the relation with PPM (which we explain in more detail below). All the works that study PPM explicitly do not report statistical guarantees and, to the best of our knowledge, theoretical guarantees have been obtained only in the case of sparse Erdos-Renyi graphs, such as in (Mao et al., 2021, Thm.B) in the case of multiple iterations, and (Yu et al., 2021; Lubars and Srikant, 2018) in the case of one iteration. Interestingly, the connection with the PPM is not explicitly stated in any of these works.
## 2 Algorithm | 2204.04099v2.mmd |
/**************************************************************************
Copyright [2009] [CrypTool Team]
This file is part of CrypTool.
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 _DLGSIDECHANNELATTACKVISUALIZATIONHEPREPARATIONSREQUEST2_H_
#define _DLGSIDECHANNELATTACKVISUALIZATIONHEPREPARATIONSREQUEST2_H_
class CDlgSideChannelAttackVisualizationHEPreparationsRequest2 : public CDialog {
enum { IDD = IDD_SIDECHANNELATTACKVISUALIZATION_HE_PREPARATIONS_REQUEST_2 };
public:
CDlgSideChannelAttackVisualizationHEPreparationsRequest2(CWnd* pParent = NULL);
virtual ~CDlgSideChannelAttackVisualizationHEPreparationsRequest2();
public:
bool getRadioChoice1() const { return radioChoice1; }
bool getRadioChoice2() const { return radioChoice2; }
bool getRadioChoice3() const { return radioChoice3; }
protected:
virtual BOOL OnInitDialog();
protected:
virtual void OnBnClickedRadioChoice1();
virtual void OnBnClickedRadioChoice2();
virtual void OnBnClickedRadioChoice3();
virtual void OnBnClickedOK();
virtual void OnBnClickedCancel();
protected:
bool radioChoice1;
bool radioChoice2;
bool radioChoice3;
DECLARE_MESSAGE_MAP()
};
#endif | flomar/CrypTool-VS2015-trunk/CrypTool/DlgSideChannelAttackVisualizationHEPreparationsRequest2.h |
# 6 - Sum square difference
# The sum of the squares of the first ten natural numbers is,
# 1^2 + 2^2 + ... + 10^2 = 385
# The square of the sum of the fist ten natural numbers is,
# (1+2+...+10)^2 = 55^2 = 3025
# Hence the difference between the sum of the squares of the first ten natural numbers and the square of the sum is 3025 - 385 = 2640.
# Find the difference between the sum of the squares of the first one hundred natural numbers and the square of the sum
timer_start = Time.now
def sum_square_difference(num)
sum_of_squares_result = 0
for i in (1..num)
sum_of_squares_result = sum_of_squares_result + i*i
end
i_square_of_sums_result = 0
for i in (1..num)
i_square_of_sums_result = i_square_of_sums_result + i
end
f_square_of_sums_result = i_square_of_sums_result * i_square_of_sums_result
final = f_square_of_sums_result - sum_of_squares_result
puts final
end
sum_square_difference(100)
#25164150
#Elapsed Time: 0.061 milliseconds
#---------------------------------
# def sum_square_difference_2(num)
# array = []
# for i in (1..num)
# array.push(i)
# end
# sum_of_squares_result = 0
# array.inject { |sum_of_squares_result, x| sum_of_squares_result = sum_of_squares_result + x*x }
# puts sum_of_squares_result
# end
# sum_square_difference_2(100)
#Elapsed time: 0.074 milliseconds, arrays are inefficient when not neccesary
puts "Elapsed Time: #{(Time.now - timer_start)*1000} milliseconds" | mliew21396/Project-Euler-6_sum_square_difference.rb |
# RUN: %python -m artiq.compiler.testbench.inferencer +diag %s >%t
# RUN: OutputCheck %s --file-to-check=%t
# CHECK-L: ${LINE:+1}: fatal: undefined variable 'x'
x
| JQIamo/artiq-artiq/test/lit/inferencer/error_local_unbound.py |
package ar.uba.fi.lfd.testbedcamerapreviewapi1;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.Matrix;
import android.view.Display;
import android.view.Surface;
import android.view.WindowManager;
import java.util.HashMap;
import java.util.Map;
/**
* Created by fluidodinamica on 27/04/15.
*/
public class OrientationHandler {
private Display display;
private Map<Integer, Integer> displayRotationPreviewOrientationMap;
public OrientationHandler(Context context){
this.display = ((WindowManager)context.getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay();
this.displayRotationPreviewOrientationMap = new HashMap<Integer, Integer>();
this.displayRotationPreviewOrientationMap.put(Surface.ROTATION_0, 90);
this.displayRotationPreviewOrientationMap.put(Surface.ROTATION_90, 0);
this.displayRotationPreviewOrientationMap.put(Surface.ROTATION_180, 0);
this.displayRotationPreviewOrientationMap.put(Surface.ROTATION_270, 180);
}
public Bitmap rotate(Bitmap bitmap) {
int degrees = this.getDegrees();
if (degrees == 0)
return bitmap;
else {
int with = bitmap.getWidth();
int height = bitmap.getHeight();
Matrix mtx = new Matrix();
mtx.setRotate(degrees);
return Bitmap.createBitmap(bitmap, 0, 0, with, height, mtx, true);
}
}
public int getDegrees() {
return this.displayRotationPreviewOrientationMap.get(this.display.getOrientation());
}
}
| pablodroca/android-camera-manager-kitcat/TestbedCameraPreviewAPI1/app/src/main/java/ar/uba/fi/lfd/testbedcamerapreviewapi1/OrientationHandler.java |
/*********************************************************************
*
* Software License Agreement (BSD License)
*
* Copyright (c) 2015, Daichi Yoshikawa
* 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 the Daichi Yoshikawa nor 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 OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
* Author: Daichi Yoshikawa
*
*********************************************************************/
#ifndef __AHL_ROBOT_CONTROLLER_EFFECTIVE_MASS_MATRIX3D_HPP
#define __AHL_ROBOT_CONTROLLER_EFFECTIVE_MASS_MATRIX3D_HPP
#include <Eigen/Dense>
namespace ahl_ctrl
{
class EffectiveMassMatrix3d
{
public:
static void compute(const Eigen::Matrix3d& lambda_inv, Eigen::Matrix3d& lambda, double thresh = 0.0);
};
} // namespace ahl_ctrl
#endif // __AHL_ROBOT_CONTROLLER_EFFECTIVE_MASS_MATRIX3D_HPP
| daichi-yoshikawa/ahl_wbc-wbc/ahl_robot_controller/include/ahl_robot_controller/common/effective_mass_matrix3d.hpp |
Find all School-related info fast with the new School-Specific MBA Forum
It is currently 13 Oct 2015, 13:46
### GMAT Club Daily Prep
#### Thank you for using the timer - this advanced tool can estimate your performance and suggest more practice questions. We have subscribed you to Daily Prep Questions via email.
Customized
for You
we will pick new questions that match your level based on your Timer History
Track
every week, we’ll send you an estimated GMAT score based on your performance
Practice
Pays
we will pick new questions that match your level based on your Timer History
# Events & Promotions
###### Events & Promotions in June
Open Detailed Calendar
# [b]Get through all ?s or no?[/b]
Author Message
Intern
Joined: 06 Apr 2003
Posts: 1
Followers: 0
Kudos [?]: 0 [0], given: 0
[b]Get through all ?s or no?[/b] [#permalink] 16 Apr 2003, 23:39
Does anyone know if it is best to try to answer all the questions, even if it means guessing or to go at your own pace and not answer all of them?
Which one benefits a more positive score?
Sera
Manager
Joined: 12 Mar 2003
Posts: 59
Followers: 1
Kudos [?]: 1 [0], given: 0
Work at your own pace but be aware of timing. (see a great document on timing on main website under Maths section). Complete all Q's even if you have to guess try do so intelligently.
Founder
Affiliations: AS - Gold, HH-Diamond
Joined: 04 Dec 2002
Posts: 12943
Location: United States (WA)
GMAT 1: 750 Q49 V42
GPA: 3.5
Followers: 2934
Kudos [?]: 15323 [0], given: 3947
Re: [b]Get through all ?s or no?[/b] [#permalink] 17 Apr 2003, 09:33
Expert's post
pagesera wrote:
Does anyone know if it is best to try to answer all the questions, even if it means guessing or to go at your own pace and not answer all of them?
Which one benefits a more positive score?
Sera
I agree with Tzolkin,
The number of points that you lose by answering the question wrong will be less than if you skip it, so it will be more effective to answer questions wrong than skip them
Re: [b]Get through all ?s or no?[/b] [#permalink] 17 Apr 2003, 09:33
Similar topics Replies Last post
Similar
Topics:
10 days enough to go through entire OG? 4 25 May 2011, 20:30
2 Help getting through 3 hours of Exam. Is it ADD? 10 14 Sep 2010, 06:25
1 MGMAT books - best way to go through them? 7 17 Aug 2010, 01:55
list of the books to go through for GMAT 5 06 Oct 2009, 02:27
Half way through .....need some advice. 5 27 Apr 2009, 12:33
Display posts from previous: Sort by
# [b]Get through all ?s or no?[/b]
Moderators: bagdbmba, WaterFlowsUp
Powered by phpBB © phpBB Group and phpBB SEO Kindly note that the GMAT® test is a registered trademark of the Graduate Management Admission Council®, and this site has neither been reviewed nor endorsed by GMAC®. | finemath-3plus |
/* _newlib_version.h. Generated from _newlib_version.hin by configure. */
/* Version macros for internal and downstream use. */
#ifndef _NEWLIB_VERSION_H__
#define _NEWLIB_VERSION_H__ 1
#define _NEWLIB_VERSION "2.5.0"
#define __NEWLIB__ 2
#define __NEWLIB_MINOR__ 5
#define __NEWLIB_PATCHLEVEL__ 0
#endif /* !_NEWLIB_VERSION_H__ */
| ChangsoonKim/STM32F7DiscTutor-toolchain/osx/gcc-arm-none-eabi-6-2017-q1-update/arm-none-eabi/include/_newlib_version.h |
Thai Massage Lyngbyvej Vop Dk Thai Massage Lyngbyvej Vop Dk
Thai massage lyngbyvej vop dk
Modtager handicappede Thai massage 2 ny piger i Kolding er frække søde og Jylland · Amy Dk sexy thai ladyboy Amy Dk sexy thai. Massage. LÆKKER. Escort Pige, Trans & Maend» Thaimassage Område København . Velkommen til Phan Wellness Thai massage Østerbro ved Lyngbyvej. Døjer du med ømme. Escort Pige, Trans & Maend» 48 thaimassage butik Velkommen til Phan Wellness Thai massage Østerbro ved Lyngbyvej. Døjer du med.
Drunk: Thai massage lyngbyvej vop dk
Thai massage lyngbyvej vop dk Annoncelight esbjerg lægerne dannebrogsgade
Thai massage lyngbyvej vop dk Bordel vestsjælland frække skolepiger
Thai massage lyngbyvej vop dk Denne hjemmeside indeholder erotisk indhold. Maximum visibility - more visitors. Dansk amatør sex todelte kropsmassage København IcemandThai-fan23 og 2 andre synes godt om dette. Amager thaimassage Øresundsvej Thaimassage. Escort Piger Jylland Hos os er du altid en VIP!
Massage extrabladet støvring motel 924
Thai massage sjælland taletidskort udland ØSTERBRO OBS DISKRET HEJ Kom og besøg os i dag! Vis Kalasin Thai Massage på kort. Hovedstaden København København Ø Lyngbyvej. Er en skøn sympatisk fyr, så send mig en besked og vi prøver om vi kan arrangere!!!! Rainbow Wellness i Valby - Pim 1 2. Amager thaimassage Øresundsvej Thaimassage. Skriv en besked og bestil tid med mig.
Thai massage lyngbyvej vop dk - blowjob
Escort Piger København Amager thaimassage Øresundsvej Thaimassage. Derfor er det så farligt at bestige Mount Everest. Kat thai massage glostrup Kat Thai Massage Glostrup Massage København Advantages for the VIP advertisements:
thai massage lyngbyvej vop dk.
0 Comment on "Thai massage lyngbyvej vop dk"
Sexy tranny privat sex århus
Dansk porno torrent massage vesterbro københavn
Dejlig kusse swingerklub i randers | c4-da |
# -*- coding: utf-8 -*-
"""
App name
~~~~~~
:copyright: (c) 2014 by mrknow
:license: GNU GPL Version 3, see LICENSE for more details.
"""
import urllib
import urlparse, httplib, random, string
def getHostName(url):
hostName = urlparse.urlparse(url)[1].split('.')
return hostName[-2] + '.' + hostName[-1]
| mrknow/filmkodi-plugin.video.mrknow/lib/mrknow_utils.py |
module.exports = {
dist: {
options: {
// cssmin will minify later
style: 'expanded'
},
files: {
'build/assets/css/global.css': 'assets/css/global.scss'
}
}
};
| uicoded/linezero-tasks/options/sass.js |
You are on page 1of 4
# UN
CARLETON
VERSITY
Midterm
EXAMINATION
October 2005
DURATION:1.5 HOURS
## Department Name: Mechanical
Course Number: AERIO 4306
Instructor(s) D. Feszty
& Aerospace
Engineering
Student MUST count the number of pages in this examination question paper before beginning to write, and report any
discrepancy immediately to a proctor. This question paper has 4 pages.
This examination
Note:
## paper MAY be taken from the examination
AI_L TWO
room.
(2) QUESTIONS.
1. [12.5 marks] The wing of a light aircraft of 1,440 kg gross weight has the following
characteristics:
-NACA 651-212 a=0.6 airfoil (see page 2 for airfoil data)
-Wing planform area of 18.58 m2
-Wing span of 10.7 m
-Rectangular
-Full-span
wing
## split flaps of 20% chord length
The aircraft cruise speed at 3,000 ft altitude (~= 1.76x10-5 kg/m/s) is 200 km/h. The loading on
the wing may be assumed to be elliptic. Determine:
a)
lift coefficient, profile drag coefficient and induced drag coefficients at cruise. [3.5 marks]
b)
## the flaps up stall speed at 3,000 ft. [2 marks]
c)
the sea-level stall speed with the split flaps deflected to 60 deg. You may assume a
Reynolds number of 6x106 for these conditions. [2 marks]
d)
the induced angle of attack and induced velocity in cruise condition. [2.5 marks]
e)
the effective angle of attack, i.e. the angle between the resultant flow and the zero lift line
of the wing section in cruise conditions. [2.5 marks]
,[~
!~
I
w
N
I
"->
~
I
0)
(f)~
'P
'"'
a.m
o'
:J
'P
'9.
g,o
'"
OJ
...
...
?'""m
R
(!)
to
0)
0-I\J
.I:.
Wi-
N,
"t71
I
...
.!..
;..,
~4
-'I
wi\-':"
I
a
~_!
00
~
"0
0
!!!.
o'
:J
0
.~
P
--
i\~-
"0
""
"0
00
0>
0)
"0
~
"0
..
N
'.10.
"0
I\.)
~
.
C)
0
~
",..
"0
""
"0
0
"'"
## Moment coefficient, C,nc
t><>oo
0)0)00)(00)<.>
x~
oo~oooo
'i?
'"
(X)
I
.0
C/)
~
C/) '..
000
3_.0
C/)
f I
a;
COCO01
fJ)
QrNNN"I~
0.::)010)0)
Ih
~o.
'0.,
0.
C)
.,
.,
m
;:)
c:
.~
~ I
Q
0
~o
m C I
v,
0 "I'~
I
a
0. -00
m'",(O(Om
0.
...
(1)~~~~
-'"
"C'g.ooo, .
cc
~
;:)
"'
'"
0
:) .j-.
-'",.,.
-n
i:n
'"
.!II
(X)
::1;
-.c:
f?o
<I>
=:
-a.
n
~. 0
'u1
ac
Moment coefficient, C In
## NACA 651-212 a=0.6 airfoil data
nl'~
0
;.,
2. [17.5 marks] The diagram shows a large passenger transport aircraft proposed by Boeing in
1996. It has the following major characteristics:
gross take off weight
453,600 kg
0.85
wing span
79.2 m
7.3
1 ,720 m2
66.8 m2
86.86 m2
173.7 m2
0.6
a)
4
Q.{/\~~~
## If the aerodynamic cleanness of the aircraft is judged to be similar to C5-A, 8757-200
or DC-8, then what would be the parasite zero lift drag coefficient of the aircraft?
[3 marks]
b)
Estimate the drag polar relation for this aircraft. [1.5 marks]
c)
At what lift coefficient would be the lift-to-drag ratio a maximum? Estimate the
maximum lift-to-drag ratio. [3.5 marks]
d)
At what altitude should the aircraft cruise to minimize fuel consumption? (Hint: consider
that jetliners typically fly in the lower stratosphere) [3.5 marks]
e)
f)
## Assuming thrust being proportional to ambient pressure, what would be the
corresponding value of thrust at sea-level? [2 marks]
g)
If an engine of this thrust would not be available at the time of design, than which two
major performance parameters would have to be compromised by installing smaller
engines? You may assume that the cruise lift-to-drag ratio is the same as for "optimum
engine" availability. Support analysis with equations. [2 marks]
## Note: a wetted area chart is provided on page 4 for your convenience
i_~!
1'1.0
t..
-,-.
:""---"-"--'
! i
:j~
'wi
.t---
...J'-.'-f-~'
-=
~
1-
10
:--,. -J)C9-,""lQ~
=~~I1~~~
~.~~j~..
" r
737-lOQ
Bs8:A
01
\,111
,-
/-._"/~-
,---
~~~~T~:::.=':::::;-=r~'~
Gl:~
..'r
:--
-'..'
'
(tIlO
'0
.
.0
STt'Be:)
---"7'"-'..
10
-"
_._~-~:~~=-:-:~::-.=-::'::-=:~~:::::~~:-:-'
.JI
F..;.
~O9.:p
F... to,"A
t~S"--"-'" -.",
'---".-,. ~
ijj!)!
-""--
._.:~-._~'--~.,-~--~~=...:.
';-'
,><-3
~~~ff!'9~~(
~~~~-=--~~ 3).~
: .,:
~:-~_! :
; --:-:-.:
10)
.A'w.
~mE"D.!A.~!~,.- I~
## Wetted area chart
A.
2..:::::.::::.':_:..:-:;::::::-
FT; ...tI
_:;::_~~=1
MF~~~3-:~.--::':';,,;-~:::
--:-..;:,::::.::::.:':...
r~
."
.! .::-'::-,:
:: .::..:
:-.:~
'.
;01.
".'
/'"'== 707",,~2Q.:
7-eT -lOa
--~.;
4-f y--'-'
./' | finemath-3plus |
load(libdir + 'asserts.js');
function test() {
assertTypeErrorMessage(() => { ctypes.default_abi.toSource(1); },
"ABI.prototype.toSource takes no arguments");
}
if (typeof ctypes === "object")
test();
| cstipkovic/spidermonkey-research-js/src/jit-test/tests/ctypes/argument-length-abi.js |
//
// IAWPersistenceDatastore.h
// Answers
//
// Created by Enrique de la Torre (dev) on 06/02/2015.
// Copyright (c) 2015 Enrique de la Torre. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file
// except in compliance with the License. You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, software distributed under the
// License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
// either express or implied. See the License for the specific language governing permissions
// and limitations under the License.
//
#import <Foundation/Foundation.h>
#import "IAWPersistenceDatastoreProtocol.h"
#import "IAWPersistenceDatastoreLocalStorageProtocol.h"
#import "IAWPersistenceDatastoreIndexManagerProtocol.h"
#import "IAWPersistenceDatastoreReplicatorFactoryProtocol.h"
#import "IAWPersistenceDatastoreSyncManager.h"
#import "IAWPersistenceDatastoreNotificationCenter.h"
@interface IAWPersistenceDatastore : NSObject <IAWPersistenceDatastoreProtocol>
@property (strong, nonatomic, readonly) id<IAWPersistenceDatastoreIndexManagerProtocol> indexManager;
@property (strong, nonatomic, readonly) IAWPersistenceDatastoreNotificationCenter *notificationCenter;
- (id)initWithLocalStorage:(id<IAWPersistenceDatastoreLocalStorageProtocol>)localStorage
indexManager:(id<IAWPersistenceDatastoreIndexManagerProtocol>)indexManager
replicatorFactory:(id<IAWPersistenceDatastoreReplicatorFactoryProtocol>)replicatorFactory
syncManager:(IAWPersistenceDatastoreSyncManager *)syncManager
notificationCenter:(IAWPersistenceDatastoreNotificationCenter *)notificationCenter;
@end
| indisoluble/Answers-Answers/Answers/Persistence/Datastore/IAWPersistenceDatastore.h |
/*
Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it is able to trap after raining.
For example,
Given [0,1,0,2,1,0,1,3,2,1,2,1], return 6.
The above elevation map is represented by array [0,1,0,2,1,0,1,3,2,1,2,1]. In this case, 6 units of rain water (blue section) are being trapped. Thanks Marcos for contributing this image!
*/
class Solution {
public:
int trap(int A[], int n) {
int rst = 0;
if(n<3) return rst;
vector<int> tHigh(A, A+n);
for(int i=1; i<n-1; ++i) //find the highest bar in the left
tHigh[i] = max(tHigh[i-1], A[i]);
for(int i=n-2; i>0; --i) { //find the highest bar in the right
tHigh[i] = max(tHigh[i+1], A[i]);
rst += max(min(tHigh[i-1], tHigh[i+1])-A[i], 0); //volume this bar can hold
}
return rst;
}
};
int trap(int A[], int n) {
int i = 0, j = n-1;
int volume = 0;
int k = 0;
while (i < j) {
if (A[i] <= A[j]) {
k = i+1;
while (A[i] > A[k]) {
volume += (A[i]-A[k]);
k++;
}
i = k;
}
else {
k = j-1;
while (A[j] > A[k]) {
volume += (A[j]-A[k]);
k--;
}
j = k;
}
}
return volume;
}
| quantumlaser/code2016-LeetCode/Answers/Leetcode-cpp-solution/dp/42_Trapping Rain Water.cpp |
//
// KTopicCell.h
// kedashixunDemo
//
// Created by KZL on 16/5/8.
// Copyright © 2016年 wangbing. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "KTopicFrameModel.h"
@interface KTopicCell : UITableViewCell
@property (nonatomic, strong) KTopicFrameModel *topicFrameModel;
@property (nonatomic, copy) NSString *commentCount;
@end
| wb708861178/kedashixun-kedashixunDemo/kedashixunDemo/论坛/views/KTopicCell.h |
Vzorkovače přenosné
Vzorkovač srážkové vody
Další informace v položce "Meteorologické stanice"
Samply Sampler - economy
Jednoduchý všestranně využitelný vzorkovač odpadních vod za dostupnou cenu. Dle velikosti připojeného signálu se mění i objem vzorku, který je odebírán v pravidelných časových intervalech.
Vzorkovač lze s konfiguračním konektorem provozovat v režimu závislém na čase, případně jevech, kdy signálem z přístroje analyzujícího sledovaný jev (beznapěťový kontakt), se spouští a zastavuje vzorkování.
Nabízíme programovací sadu konfiguračního konektoru se SW pro WIN95/98/NT.
Samply Sampler
Vzorkovač Samply Sampler je určený pro jednorázové odběry vzorků vod v terénu. Napájení přístroje je zajištěno bezúdržbovým akumulátorem.
Přístroj lze přenášet pomocí držadla, nebo popruhu přes rameno.
XIAN 1000 A
Xian 1000 A je vzorkovač s odnímatelným, snadno ovladatelným programátorem. Velký výběr sestav skleněných a plastových nádob.
Přenosný vzorkovač WS PORTI
Vzorkovač WS PORTI pracuje na vakuovém principu. Je osazen kruhovým rozdělovačem, vestavěným akumulátorem a zabudovanou nabíječkou. Pro WS PORTI lze dodat různé typy spodních částí. Základní sestava obsahuje PE láhve 24x1 litr, nebo 1x10 litrů.
Neumožňuje vzorkování v systému VAR, vzorkování „C“.
Pro chlazení vzorků lze použít standardní izolovaný box naplněný ledem
nebo chladící kompresorový box.
1. V čase, kdy je odebírán konstantní vzorek pravidelně v nastaveném čase obsluhou.
2. Na základě pulsů vysílaných z průtokoměru je odebíráno konstantní množství, ale čas mezi jednotlivými odběry se mění v závislosti na protečeném množství.
3. Na základě zadaných jevů, např. zvýšení pH, hladiny, apod. podle připojeného systému.
· malé rozměry, snadný transport
· 9 programů pro odběry vzorků s možností vzájemných kombinací
· odolné antikorozní nerezové provedení pro venkovní prostor /ochrana IP 55/
12.12.06 – Ponorné čerpadlo GIGANT do hloubkových vrtů
Výkonné odstředivé čerpadlo GIGANT napájené z akumulátoru 12 V. Je vhodné k čerpání vody z vrtů o průměru větším než 38 mm. Výtlačná výška 10 m, s výkonem až 8 litrů/min. Výtlačnou výšku lze až z trojnásobit, zapojením dvou až tří čerpadel do kaskády (série). | c4-cs |
# zbMATH — the first resource for mathematics
Slopes of effective divisors on the moduli space of stable curves. (English) Zbl 0705.14026
Let $$\bar {\mathcal M}_ g$$ be the moduli space of stable curves of genus g and E the cone of effective divisor classes in $$P=Pic(\bar {\mathcal M}_ g)\otimes {\mathbb{R}}$$; let $$\Delta$$ be the locus of singular curves in $$\bar {\mathcal M}_ g$$, $$\delta$$ its class in P, and $$\delta_ i$$ the classes in P corresponding to the irreducible components of $$\Delta$$. P is generated by the boundary classes $$\delta_ i$$ and by $$\lambda$$, the class of the Hodge line bundle. The authors describe the intersection of E with the plane spanned by $$\lambda$$ and any effective sum $$\gamma$$ of the boundary classes, in particular the slopes of the effective cone $$s_{\gamma}$$. For the most important of these slopes $$s_ g:=s_{\delta}$$ they conjecture that $$s_ g\geq 6+12/(g+1)$$ with equality when $$g+1$$ is composite. In their main theorem they prove their conjecture for $$2\leq g\leq 5$$ and in particular they show that the inequality can be strict if $$g+1$$ is prime. They also give a geometric description of effective irreducible divisors with slope $$s_ g$$ for $$g=3$$ and 5.
The paper contains a very well written introduction on the subject, a description of some consequences of the conjecture and a discussion on why the construction proves the conjecture for small g only.
Reviewer: A.Papantonopoulou
##### MSC:
14H10 Families, moduli of curves (algebraic) 14C20 Divisors, linear systems, invertible sheaves
Full Text:
##### References:
[1] [Arakelov] Arakelov, S.Ju.: Families of algebraic curves. Iz. Akad. Nauk.35, 1269–1293 (1971) · Zbl 0248.14004 [2] [Arbarello] Arbarello, E., Cornalba, M.: Footnotes to a paper of Beniamino Segre. Math. Ann.256, 341–362 (1981) · Zbl 0461.14006 [3] [Burnside] Burnside, W.: Theory of Groups of Finite Order: 2nd ed. New York: Dover 1955 · Zbl 0064.25105 [4] [Chang-Ran 1] Chang, M., Ran, Z.: Unirationality of the moduli space of curves of genus 11, 13 (and 12). Invent. Math.76, 41–54 (1984) · Zbl 0541.14025 [5] [Chang-Ran 2] Chang, M., Ran, Z.: The Kodaira dimension of the moduli space of curves of genus 15. J. Differ. Geom.24, 205 220 (1986) · Zbl 0649.14015 [6] [Chang-Ran 3] Chang, M., Ran, Z.: Divisors on and the cosmological constant 386 393 in Mathematical aspects of string theory (S.T. Yau ed.) Singapore: World Scientific (1987) [7] [C-H] Cornalba, M., Harris, J.: Divisor classes associated to families of stable varieties with applications to the moduli space of curves. Ann. Sci. de l’Ecole Norm. Sup. (Ser. 4)21, 455–475 (1988) · Zbl 0674.14006 [8] [D] Diaz, S.: Exceptional Weierstrass points and the divisor on moduli space that they define. Mem. Am. Math. Soc.56, (1985) · Zbl 0581.14018 [9] [EH] Eisenbud, D., Harris, J.: The Kodaira dimension of the moduli space of curves of genusg3. Invent. Math.90, 359–388 (1987) · Zbl 0631.14023 [10] [Fr] Freitag, E.: Der Körper der Seigelsche Modulfunktionen. Abh. Math. Sem. Univ. Hamb.47, 25–41 (1978) · Zbl 0402.10028 [11] [Gou-Ja] Goulden, I., Jackson, D.: Combinatorial Enumeration, New York, Wiley 1983 · Zbl 0519.05001 [12] [HM] Harris, J., Mumford, D.: On the Kodaira dimension of the moduli space of curves. Invent. Math.67, 23–86 (1982) · Zbl 0506.14016 [13] [Ha] Harer, J.: The second homology group of the mapping class group of an orientable surface. Invent. Math.72, 221–240 (1983) · Zbl 0533.57003 [14] [HZ] Harer, J., Zagier, D.: The Euler characteristic of the moduli space of curves. Invent. Math.85, 457–486 (1986) · Zbl 0616.14017 [15] [Hu] Hurwitz, A.: Über die Anzahl der Riemannschen Flächen mit Gegebenen Verzweigungspunkten. Math. Ann.55, 53–66 (1901) · JFM 32.0404.04 [16] [Jam-Ker] James, G., Kerber, A.: The Representation Theory of the Symmetric Group (Encyclopedia of Mathematics and its Applications). Reading, MA: Addison-Wesley 1981 [17] [MJNS] Moore, G., Harris, J., Nelson, P., Singer, I.: Modular forms and the cosmological constant. Preprint [18] [Mu1] Mumford, D.: Stability of Projective Varieties. L’Ens. Math.23, 39–110 (1977) · Zbl 0363.14003 [19] [Mu2] Mumford, D.: On the Kodaira dimension of the Siegel modular variety, in Algebraic Geometry–Open Problems. (Lect. Notes Math., Vol. 97). Berlin-Heidelberg, New York: Springer 1983 [20] [Sernesi] Sernesi, E.; L’unirazionalità dei moduli delle curve di genere dodici. Ann. Sc. Norm. Super. Pisa, Cl. Sci., IV. Ser.8, 405–440 (1981) · Zbl 0475.14024 [21] [Severi] Severi, F.: Vorlesungen über Algebraische Geometrie. Leipzig: Teubner 1921 · JFM 48.0687.01
This reference list is based on information provided by the publisher or from digital mathematics libraries. Its items are heuristically matched to zbMATH identifiers and may contain data conversion errors. It attempts to reflect the references listed in the original paper as accurately as possible without claiming the completeness or perfect precision of the matching. | finemath-3plus |
# Online Meta-Learning
Chelsea Finn
Aravind Rajeswaran
Equal contribution \({}^{1}\)University of California, Berkeley University of Washington. Correspondence to: Chelsea Finn <[email protected]>, Aravind Rajeswaran <[email protected]>.
Sham Kakade
University of Washington. Correspondence to: Chelsea Finn <[email protected]>, Aravind Rajeswaran <[email protected]>.
Sergey Levine
###### Abstract
A central capability of intelligent systems is the ability to continuously build upon previous experiences to speed up and enhance learning of new tasks. Two distinct research paradigms have studied this question. Meta-learning views this problem as learning a prior over model parameters that is amenable for fast adaptation on a new task, but typically assumes the set of tasks are available together as a batch. In contrast, online (regret based) learning considers a sequential setting in which problems are revealed one after the other, but conventionally train only a single model without any task-specific adaptation. This work introduces an online meta-learning setting, which merges ideas from both the aforementioned paradigms to better capture the spirit and practice of continual lifelong learning. We propose the follow the meta leader (FTML) algorithm which extends the MAML algorithm to this setting. Theoretically, this work provides an \(O(\log T)\) regret guarantee with one additional higher order smoothness assumption (in comparison to the standard online setting). Our experimental evaluation on three different large-scale tasks suggest that the proposed algorithm significantly outperforms alternatives based on traditional online learning approaches.
Machine Learning, ICML
## 1 Introduction
Two distinct research paradigms have studied how prior tasks or experiences can be used by an agent to inform future learning. Meta-learning (Schmidhuber, 1987; Vinyals et al., 2016; Finn et al., 2017) casts this as the problem of _learning to learn_, where past experience is used to acquire a prior over model parameters or a learning procedure, and typically studies a setting where a set of meta-training tasks are made available together upfront. In contrast, online learning (Hannan, 1957; Cesa-Bianchi & Lugosi, 2006) considers a sequential setting where tasks are revealed one after another, but aims to attain zero-shot generalization without any task-specific adaptation. We argue that neither setting is ideal for studying continual lifelong learning. Meta-learning deals with learning to learn, but neglects the sequential and non-stationary aspects of the problem. Online learning offers an appealing theoretical framework, but does not generally consider how past experience can accelerate adaptation to a new task. In this work, we motivate and present the _online meta-learning_ problem setting, where the agent simultaneously uses past experiences in a sequential setting to learn good priors, and also adapt quickly to the current task at hand.
As an example, Figure 1 shows a family of sinusoids. Imagine that each task is a regression problem from \(x\) to \(y\) corresponding to _one_ sinusoid. When presented with data from a large collection of such tasks, a naive approach that does not consider the task structure would collectively use all the data, and learn a prior that corresponds to the model \(y=0\). An algorithm that understands the underlying structure would recognize that each curve in the family is a (different) sinusoid, and would therefore attempt to identify, for a new batch of data, which sinusoid it corresponds to. As another example where naive training on prior tasks fails, Figure 1 also shows colored MNIST digits with different backgrounds. Suppose we've seen MNIST digits with various colored backgrounds, and then observe a "7" on a new color. We might conclude from training on all of the data seen so far that all digits with that color must all be "7." In fact, this is an optimal conclusion from a purely statistical standpoint. However, if we understand that the data is divided into different tasks, and take note of the fact that each task has a different color, a better conclusion is that the color is irrelevant. Training on all of the data together, or only on the new data, does not achieve this goal.
Figure 1: (left) sinusoid functions and (right) colored MNISTMeta-learning offers an appealing solution: by learning how to learn from past tasks, we can make use of task structure and extract information from the data that both allows us to succeed on the current task and adapt to new tasks more quickly. However, typical meta learning approaches assume that a sufficiently large set of tasks are made available upfront for meta-training. In the real world, tasks are likely available only sequentially, as the agent is learning in the world, and also from a non-stationary distribution. By re-casting meta-learning in a sequential or online setting, that does not make strong distributional assumptions, we can enable faster learning on new tasks as they are presented.
**Our contributions:** In this work, we formulate the online meta-learning problem setting and present the _follow the meta-leader (FTML)_ algorithm. This extends the MAML algorithm to the online meta-learning setting, and is analogous to follow the leader in online learning. We analyze FTML and show that it enjoys a \(O(\log T)\) regret guarantee when competing with the best meta-learner in hindsight. In this endeavor, we also provide the first set of results (under any assumptions) where MAML-like objective functions can be provably and efficiently optimized. We also develop a practical form of FTML that can be used effectively with deep neural networks on large scale tasks, and show that it significantly outperforms prior methods. The experiments involve vision-based sequential learning tasks with the MNIST, CIFAR-100, and PASCAL 3D+ datasets.
## 2 Foundations
Before introducing online meta-learning, we first briefly summarize the foundations of meta-learning, the model-agnostic meta-learning (MAML) algorithm, and online learning. To illustrate the differences in setting and algorithms, we will use the running example of few-shot learning, which we describe below first. We emphasize that online learning, MAML, and the online meta-learning formulations have a broader scope than few-shot supervised learning. We use the few-shot supervised learning example primarily for illustration. | 1902.08438v4.mmd |
var width = 500;
var height = 250;
var data = [{
'State': 'AL',
'Under 5 Years': '310',
'5 to 13 Years': '552',
'14 to 17 Years': '259',
'18 to 24 Years': '450',
'25 to 44 Years': '1215',
'45 to 64 Years': '641'
}, {
'State': 'AK',
'Under 5 Years': '52',
'5 to 13 Years': '85',
'14 to 17 Years': '42',
'18 to 24 Years': '74',
'25 to 44 Years': '183',
'45 to 64 Years': '50'
}, {
'State': 'AZ',
'Under 5 Years': '515',
'5 to 13 Years': '828',
'14 to 17 Years': '362',
'18 to 24 Years': '601',
'25 to 44 Years': '1804',
'45 to 64 Years': '1523'
}, {
'State': 'AR',
'Under 5 Years': '202',
'5 to 13 Years': '343',
'14 to 17 Years': '157',
'18 to 24 Years': '264',
'25 to 44 Years': '754',
'45 to 64 Years': '727'
}];
// manipulate the data into stacked series
var group = fc.group()
.key('State');
var series = group(data);
// use a band scale, which provides the bandwidth value to the grouped
// series via fc.autoBandwidth
var x = d3.scaleBand()
.domain(data.map(function(d) { return d.State; }))
.paddingInner(0.2)
.paddingOuter(0.1)
.rangeRound([0, width]);
var yExtent = fc.extentLinear()
.accessors([
function(a) {
return a.map(function(d) { return d[1]; });
}
])
.include([0]);
var y = d3.scaleLinear()
.domain(yExtent(series))
.range([height, 0]);
var groupedSeries = fc.seriesSvgBar();
var color = d3.scaleOrdinal(d3.schemeCategory10);
// create the grouped series
var groupedBar = fc.seriesSvgGrouped(groupedSeries)
.xScale(x)
.yScale(y)
.align('left')
.crossValue(function(d) { return d[0]; })
.mainValue(function(d) { return d[1]; })
.decorate(function(sel, data, index) {
sel.enter()
.select('path')
.attr('fill', function() { return color(index); });
});
d3.select('#grouped-svg-autobandwidth-bandscale')
.attr('width', width)
.attr('height', height)
.datum(series)
.call(fc.autoBandwidth(groupedBar));
// now render the same series against a linear scale. In this case the auto-bandwidth
// wrapper will compute the bandwidth based on the underlying data
var x2 = d3.scaleLinear()
.domain([-0.5, data.length - 0.5])
.range([0, width]);
groupedBar.xScale(x2)
.crossValue(function(d, i) { return i; })
// centre align the bars around the points on the scale
.align('center');
d3.select('#grouped-svg-autobandwidth-linearscale')
.attr('width', width)
.attr('height', height)
.datum(series)
.call(fc.autoBandwidth(groupedBar));
// now render the same series against a point scale.
var x3 = d3.scalePoint()
.domain(data.map(function(d) { return d.State; }))
.padding(0.5)
.range([0, width]);
groupedBar.xScale(x3)
.crossValue(function(d) { return d[0]; })
// centre align the bars around the points on the scale
.align('center')
// because point scales have a zero bandwidth, in this context we
// provide an explicit bandwidth and don't wrap the series in fc.autoBandwidth.
// this example also shows how bandwidth can vary on a point-to-point basis
.bandwidth((_, i) => 50 + i % 2 * 50);
d3.select('#grouped-svg-variable-bandwidth')
.attr('width', width)
.attr('height', height)
.datum(series)
.call(groupedBar);
var canvas = d3.select('#grouped-canvas').node();
canvas.width = width;
canvas.height = height;
var ctx = canvas.getContext('2d');
var groupedCanvasSeries = fc.seriesCanvasBar();
// create the grouped series
var groupedCanvasBar = fc.autoBandwidth(fc.seriesCanvasGrouped(groupedCanvasSeries))
.xScale(x)
.yScale(y)
.align('left')
.crossValue(function(d) { return d[0]; })
.mainValue(function(d) { return d[1]; })
.context(ctx)
.decorate(function(ctx, data, index) {
ctx.fillStyle = color(index);
});
groupedCanvasBar(series);
| chrisprice/d3fc-packages/d3fc-series/examples/grouped.js |
Subsets and Splits