Posts

Showing posts from August, 2013

c++ - Smoothing an inclined line -

Image
i can't find proper way draw smooth inclined line without having over-pixelated in qt qpainterpath object. note know doesn't make sense draw path in paintevent function, put there sake of simplicity. i'm trying draw line directly in central widget. hereafter snippet of code: void myobject::paintevent(qpaintevent *) { qpainterpath apath; apath.moveto(40.0, 60.0); //random values try apath.lineto(254, 354.0); qpainter painter(this); painter.setpen(qpen(qcolor(20, 20, 200), 10, qt::solidline)); painter.drawpath(apath); } and here result get: it's awful! beautiful lines can draw horizontal, vertical or 45° inclined ones... if looking drawing quality, qt documentation provides illustrative example ( 5.x version ) of use of render quality flags. generally, can use flags specified here ( 5.x version ), , set them using qpainter::setrenderhint() ( 5.x version ) function. see if able achieve desired quality using methods. c

Object mapping JScript TestComplete -

is there way write single function map object based on type of control? for example, yes button: function yesbtn() { return aliases.[app].find("mappedname", "*.btnyes", 5, true); } is there more efficient way can find buttons of types using single function, rather mapping each button separately? easy enough, if can save space , avoid doing every single object, i'd prefer way. thank you. assuming framework makes mappedname properties have btn in them, use in wildcard: function allbtns() { return aliases.[app].find("mappedname", "*.btn*", 5, true); } wiki

javascript - Snake dies when it collides with its head -

i have bug in snake game: snake has die when collides body, dies when "collides" head. this happens when press "arrow-left & arrow-down" @ same time (while snake goes up) or "arrow-down & arrow-left" (while snake goes right). how solve bug? here full code: <!doctype html> <html> <head> <title>snake</title> <link rel="stylesheet" href="snakegamestyle.css"> </head> <body> <canvas id="canvas" width="1200" height="800"></canvas> <div id="start"><p id="txt">use arrows control snake. press "p" button pause</p> <button id="easy" onclick="easydisappear()">easy</button> <button id="medium" onclick="mediumdisappear()">medium</button> <button id="hard"

angular - Webpack disable hashing of image name on output -

after building angular4 application, webpack changed image name bg_node_new.png bg_node_new.3746bc3ac9b1bf77d2aff2c2df901a48.png . my webpack.config code is: (function(module) { const path = require('path'); const npm_cmd = process.env.npm_lifecycle_event; const p = !(require('yargs').argv.p || false); let config; module.exports = function(env) { let cmds = npm_cmd.split(":"); const cmd = cmds.length >= 2 ? cmds[1] : null; const mod = cmds.length >= 3 ? cmds[2] : null; const aot = cmds.length >= 4 ? cmds[3] : null; const options = { p:!p, mod:mod, aot:aot, env:env, ngv:2, ctx:path.resolve(__dirname, "../../../../..") } //console.log(options); switch (cmd) { case 'app': console.log("building app"); config = require('./w

javascript - current date time to dd-mon-yyyy hh:mm:ss -

this question has answer here: how format javascript date 36 answers where can find documentation on formatting date in javascript? 33 answers format javascript date yyyy-mm-dd 19 answers javascript format date / time [duplicate] 5 answers get string in yyyymmdd format js date object? 35 answers in javascript need change current date in following format?i googled lot didnt find exact result. i'm expecting current date format 22-sep-2017 13:37:02 thanks in advance var ele = document.getelem

python - How to count accesses per hour from log file entries? -

i have log-file every line contains ip address, time of access, , url accessed. want count accesses per hour. time of access data looks this [01/jan/2017:14:15:45 +1000] [01/jan/2017:14:15:45 +1000] [01/jan/2017:15:16:05 +1000] [01/jan/2017:16:16:05 +1000] how can improve don't need set variable , if statement every hour? twopm = 0 thrpm = 0 foupm = 0 timestamp = line.split('[')[1].split(']')[0] formated_timestamp = datetime.datetime.strptime(timestamp,'%d/%b/%y:%h:%m:%s %z').strftime('%h') if formated_timestamp == '14': twopm +=1 if formated_timestamp == '15': thrpm +=1 if formated_timestamp == '16': foupm +=1 you can include brackets strptime format description: datetime.datetime.strptime(line.strip(),'[%d/%b/%y:%h:%m:%s %z]') you can extract hour using .hour attribute of datetime.datetime object: timestamp = datetime.datetime.strptime(…) hour = timestamp.hour you can count

javascript - AWS: Is createLogGroup operation idempotent? -

i using node sdk aws , have question regarding createloggroup , createlogstream operations, these operations idempotent? i.e can call create multiple times without having worry duplication or error. has tried before? help. no, not idempotent. calling them again same names cause error. instance, if follow link through the underlying createloggroup api reference , can see 1 of the possible error responses is: resourcealreadyexistsexception the specified resource exists. http status code: 400 wiki

swift - Not able to load WebView on button click -

i trying load url on dynamically created webview when user clicks on button nothing loads. code : import cocoa import webkit class viewcontroller :nsviewcontroller { override func viewdidload() { super.viewdidload() // additional setup after loading view. } override var representedobject: any? { didset { // update view, if loaded. } } @ibaction func mybutton(_ sender: any) { let url = url(string: "https://www.google.com") let request = urlrequest(url: url!) let webview = webview(frame: nsrect(x: 0, y: 0, width: 400, height: 400)) webview.mainframe.load(request) } } you still have add webview subview of viewcontroller: @ibaction func mybutton(_ sender: any) { let url = url(string: "https://www.google.com") let request = urlrequest(url: url!) let webview = webview(frame: nsrect(x: 0, y: 0, width: 400, height: 400)) webview.mainfram

How do you reference an Empty set ({}) valued field in mongodb through php? -

this question has answer here: best way create empty object in json php? 4 answers how write empty associative array ({}) mongodb php 2 answers i have following code works fine in mongodb client:- db.whatevercollection.update({id:999999,external_ids:{}}, {$unset: { "external_ids": true}}) how reference empty set in php external_ids field removed? using this:- array('id' => $id,'external_ids'=>array()) doesn't work... wiki

python - django 1.8.6 - ModuleNotFoundError: No module named 'django_smtp_ssl' -

i bit stuck here working through, django example. i keep getting error there no module names 'django_smtp_ssl. here mail settings settings.py email_host='smtp.gmail.com' email_host_user = 'xxx@gmail.com' email_host_password = '********' email_port=465 email_use_tls = true email_backend = 'django.core.mail.backends.smtp.emailbackend' command using in shell is: send_mail('django mail', 'this email sent django', ‘123@msn.com', [‘123@msn.com'], fail_silently=false) it don't have package installed. try pip install django-smtp-ssl wiki

javascript - Mock parameters for a database triggered firebase function -

how mock parameters database triggered firebase function in unit test? i tried specifying params in fakeevent below. after passing event in test comes undefined . // cloud function userid parameter module.exports.userupdated = functions.database.ref('users/{userid}').onwrite(event => { // userid undefined when calling function in unit // tests fake event below console.log(event.params.userid); // undefined }); // testing cloud function let fakeevent = { data: new functions.database.deltasnapshot(null, null, null, 'input'), params: {userid: 'abc123'} // not working, userid undefined (see above) }; myfunctions.userupdated(fakeevent).then(() => { assert(true); }); wiki

nlp - Text Analytics Vs Natural Language Processing What is the difference? -

i had tough evening today trying convince 1 of colleagues nlp or natural language processing super set , text analytics sub set of it. @ best both synonymous , can used interchangeably. is correct? has crystal clarity whether these terms have boundary defined or can used interchangeably? natural language processing not bound text only. consider e.g. speech recognition , processing of speech - or sign language visually communicated. simple text analytics may not qualify natural language processing. e.g. can use regular expression pattern matching basic information extraction tasks not kind of linguistics-driven analysis many people have in mind when thinking of nlp. wiki

r - How to efficiently implement dplyr do call for lmer function? -

i have dataset ~400000 rows trying extract lme4 mixed model variance components using dplyr do call in r. function is: myfunc <- function(dat) { if (sum(!is.na(dat$value)) > 840) { # >70% data present v = data.frame(varcorr(lmer(value ~ 0 + (1|gid) + (1|trial:rep) + (1|trial:rep:block), data=dat))) data.frame(a=round(v[1,4]/(v[1,4]+(v[4,4]/2)),2), b=round(v[1,4],2), c=round(v[4,4],2), n_obs=nrow(dat), na_obs=sum(is.na(dat$value))) } else { data.frame(a=na, b=na, c=na, n_obs= nrow(dat), na_obs=sum(is.na(dat$value))) } } this function called dplyr do call after grouping data 4 grouping variables. final dplyr call is: system.time(out <- tst %>% group_by(iyear,ilocation,trait_id,date) %>% do(myfunc(.))) now, when code run on smaller test dataframe of 11000 rows, takes 25 seconds. running on full set of 443k rows takes 8-9 hours finish, awefully slow. seems obvious there part of code pulling down p

package - How to replace runtime/perl-512 with runtime/perl-522 in solaris 11.3 -

i trying install runtime/perl-522 default installed runtime/perl-512 causing error. unable uninstall runtime/perl-512 because causing following error pkg uninstall: unable remove 'runtime/perl-512@5.12.5-0.175.3.0.0.30.0' due following packages depend on it: communication/im/pidgin@2.10.11-0.175.3.0.0.26.0 desktop/compiz@0.8.4-0.175.3.0.0.26.0 desktop/xscreensaver@5.15-0.175.3.0.0.22.0 developer/base-developer-utilities@0.5.11-0.175.3.0.0.30.0 developer/gnome/gettext@2.30.0-0.175.3.0.0.10.0 gnome/zenity@2.30.0-0.175.2.0.0.27.0 install/distribution-constructor@0.5.11-0.175.3.0.0.30.0 library/audio/gstreamer@0.10.32-0.175.3.0.0.26.0 library/gnome/gnome-component@2.24.3-0.175.2.0.0.31.0 library/perl-5/sun-solaris-512@0.5.11-0.175.3.0.0.30.0 network/ipfilter@0.5.11-0.175.3.1.0.3.0 package/rpm@1.3-0.175.3.0.0.30.0 print/cups@1.4.5-0.175.3.0.0.30.0 print/cups/filter/foomatic-db-engine@0.20080903-0.175.3.0.0.30.0 pri

amazon web services - Allowed memory size of 268435456 bytes exhausted (tried to allocate 174936415 bytes)' in ../src/Illuminate/Log/Writer.php:308 -

i using aws ec2 lamp server, after setup php.ini memory limit 256 getting same error, restarted httpd no changes. checked in cmd - php -i shows memory_limit = 256m php.ini updated can change? based on error message, script used allocated memory (256 * 1024 * 1024 byte) php settings fine, script tries use/allocate more 256 mb, check running code wiki

c# - Model class with variable properties -

i have api returning json data response. response answers survey taken. have multiple surveys. each survey have multiple questions can different other surveys. (hope make sense here) i have created model class response 1 of survey follows :- public string value1 { get; set; } public string value2 { get; set; } public string value3 { get; set; } public string value4 { get; set; } public int filesystemobjecttype { get; set; } public int id { get; set; } public object someurl1 { get; set; } public string someurl2 { get; set; } public string typeid { get; set; } public string differentvalue1 { get; set; } public bool differentvalue2 { get; set; } public list<string> differentvalue3 { get; set; } public list<string> differentvalue4 { get; set; the properties differentvalue1, differentvalue2, differentvalue3 .. questions can different each survey. right survey has 4 questions, other surveys can have different number of qu

android - how to set clock permission is boot or how to change HW Rev -

i,m new here , i,m trying learn samsung android developing.i try make roms different converted roms. have bugs.and need fix issues.so 1st 1 issue in rom clock not working,not able set time.everytime giving unfortunately error,according me need fix in boot, guys kindly share experience me how fix issue? 1 rom have issue,after flash no notification panel no screen lock , no wallpaper also,how can fix ? , 3rd 1 important thing me. how can change or edit hw rev/baseband ? see lot of changed or edit. how can changed it. is there person who,s explain me little details ? thanks all wiki

apache kafka - why delete the checkpoint file after finish loading its stored offsets? -

in kafka 0.10.2.0,when finished init processorstatemanager,why delete checkpoint file: // load checkpoint information offsetcheckpoint checkpoint = new offsetcheckpoint(new file(this.basedir, checkpoint_file_name)); this.checkpointedoffsets = new hashmap<>(checkpoint.read()); // delete checkpoint file after finish loading stored offsets checkpoint.delete(); if kill application forcefully, , restart it, not load checkpoint file because deleted, when restoring partition's state: if (checkpointedoffsets.containskey(storepartition)) { restoreconsumer.seek(storepartition, checkpointedoffsets.get(storepartition)); } else { restoreconsumer.seektobeginning(singleton(storepartition)); } as execute seektobeginning, consumer consume offset 0. i find answer: kafka-4317 patch wiki

twitter bootstrap - what is this error (Can't bind to 'ngModel' since it isn't a known property of 'input'. ) -

the error printing on console below one... trying add form add employee buton can't bind 'ngmodel' since isn't known property of 'input'. (" ][(ngmodel)]="model.name" placeholder="enter name"> here error image the below code of it <div class = "container"> <h1>{{title}}</h1> <h2>add employee:</h2> <form class="form-horizontal"> <div class="form-group"> <label class="control-label col-sm-2" for="name">name:</label> <div class="col-sm-10"> <input type="text" class="form-control" id="name" name="name" [(ngmodel)]="model.name" placeholder="enter name"> </div> </div> <div class="form-group"> <label class="control-label col-sm-2" for="position">position:</label> <div cla

What is this assignment? Python -

i copied book genetic code , found assignment: childgenes[index] = alternate \ if newgene == childgenes[index] \ else newgene the full code this: main.py: from population import * while true: child = mutate(bestparent) childfitness = get_fitness(child) if bestfitness >= childfitness: continue print(str(child) + "\t" + str(get_fitness(child))) if childfitness >= len(bestparent): break bestfitness = childfitness bestparent = child population.py: import random geneset = " abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz!.,1234567890-_=+!@#$%^&*():'[]\"" target = input() def generate_parent(length): genes = [] while len(genes) < length: samplesize = min(length - len(genes), len(geneset)) genes.extend(random.sample(geneset, samplesize)) parent = "" in genes: parent += return parent def get_fitness(guess): total = 0

java - my app text is overlapping to going into a corner -

Image
this question has answer here: constraintlayout views in top left corner 3 answers i started coding , wanted make app tells percentage of number ui keeps overlapping each other please me solve because first app , don't want first app made fail this looks in android studio and looks in emulator package com.example.abhay.mathsucks; import android.os.bundle; import android.support.design.widget.floatingactionbutton; import android.support.design.widget.snackbar; import android.support.v7.app.appcompatactivity; import android.support.v7.widget.toolbar; import android.view.view; import android.view.menu; import android.view.menuitem; import android.widget.button; import android.widget.edittext; import android.widget.textview; public class mainactivity extends appcompatactivity { textview totaltextview; edittext percentagetxt; edittext numbertxt;

node.js - Linux - Require error -

i'm working in thing in nodejs. give me error... can't find answer.. var main = electron.remote.require('main.js'); ^ typeerror: cannot read property 'require' of undefined @ object. (/opt/lampp/htdocs/bot_farm/farmer.js:11:27) @ module._compile (module.js:569:30) @ object.module._extensions..js (module.js:580:10) @ module.load (module.js:503:32) @ trymoduleload (module.js:466:12) @ function.module._load (module.js:458:3) @ function.module.runmain (module.js:605:10) @ startup (bootstrap_node.js:158:16) @ bootstrap_node.js:575:3 root@vps21:/opt/lampp/htdocs/bot_fa# node farmer.js module.js:487 throw err; ^ hope u can me fast. typeerror: cannot read property 'require' of undefined means node unable identify remote , might because electron not required. have required electron? guess solution problem is: var electron = require('electron') wiki

python - Various ways to assign multiple columns to existing pandas dataframe -

i have 3 lists of numerical values: jac = [0.66,0.8,0.2,0.5,0.3] sor = [0.8,0.8,0.2,0.5,0.7] diff = [1,0.8,0.2,0.5,0.5] and existing pandas dataframe (df): ham 0 0.5 1 0.6 2 0.6 3 0.7 4 0.9 the following solution df.assign(diff=diffl).assign(sor=sor).assign(jac=jac) what various ways append these lists in 1 shot ? you can this: df.assign(diff=diffl,sor=sor,jac=jac) wiki

How to create templates that update template-based files in Visual Studio Code? -

i'm moving web project dreamweaver visual studio code , after spending many hours going through available extensions in market place, have not been able find 1 updates template-based files when template edited. some of extensions tried: file templates vscode extension, template generator, volt: template engine, code-template-replace does know if possible? in advance. wiki

javascript - Using cache operator for Observables -

i following tutorials angular-university , in video suggest use cache() operator avoid multiple requests. tried following: this.posts$ = this.postsservice.savepost(post) .switchmap(() => this.postsservice.getposts()) .publishreplay(1) .refcount(); and works prefer cache() instead of publishreplay naive way achieve is: this.postsservice.savepost(post) .subscribe(() => this.postsservice.getposts()) but not kind of reactive. so prefer use cache not find on add operators. currently using rxjs: 5.4.3 . so, cache supported version using? cache gone of version 5.0.0 according the changlog wiki

javascript - Hashing and Encoding passwords when Calling SOAP API -

i'm trying call soap api node using strong-soap, , when calling api demands password field md5 hashed in utf-16 little endian (unicode) i want know how can make sure password field meets requirement in javascript / node js. wiki

C# run powershell script (remote start/stop service) -

in c# have script, remotely stops , start service. problem is, work stop service. i need start/stop service, because service must stopped else. may not servicecontroller, because have disabled wmi. initialsessionstate initial = initialsessionstate.createdefault(); runspace runspace = runspacefactory.createrunspace(initial); runspace.open(); powershell ps = powershell.create(); ps.runspace = runspace; ps.addcommand("get-service"); //stop ps.addparameter("computername", textbox7.text); ps.addparameter("name", "spooler*"); ps.addcommand("stop-service"); ps.addparameter("force"); //ps.addcommand("remove-item"); //queue ps.addcommand("get-service"); //start ps.addparameter("computername", textbox7.text); ps.addparameter("name", "spooler*"); ps.addcommand("start-service"); ps.invoke(); oh, found solution: need add.statement between commands.

composer php - Loading OpenTok libraries on Codeigniter -

i have been trying load opentok php sdk in codeigniter. there no actual repository of codeigniter opentok. tried add opentok folder directly libraries folder , called $this->load->library('opentok'); didn't help. currently, using in core php. require "vendor/autoload.php"; use opentok\opentok; use opentok\mediamode; use opentok\archivemode; use opentok\session; use opentok\role; the library opentok composer package. question how call in codeigniter. opentok developer here had used opentok in codeigniter? appreciate help.thanks in config/config.php: $config['composer_autoload'] = true; your composer.json file needs inside application directory. it's going this: { "name": "nsqdev/project", "description": "nsq dev project", "type": "application", "license": "proprietary", "authors": [ { "

header - Getting code 200 on Postman but 403 on Android using HttpUrlConnection -

Image
i using httpurlconnection fire put request in android code. api works on postman , other rest giving 200 success code failing in android code. please check code below , let me know making error. try { url url = new url(myurl); httpurlconnection connection = (httpurlconnection) url.openconnection(); connection.setrequestmethod("put"); connection.setdooutput(true); connection.setrequestproperty("content-type", "application/json"); connection.setrequestproperty("accept", "application/json"); connection.setrequestproperty("cookie", "jsessionid=" + mnetworkmodel.sessionid() + "; x-csrf-token=" + mnetworkmodel.csrftoken()); connection.setrequestproperty("jsessionid", mnetworkmodel.sessionid()); connection.setrequestproperty("x-csrf-token", urlencoder.encode(mnetworkmodel.csrftoken(), "utf-8"));

cuda - error in rainbow table's generation -

Image
i use cuda generate rainbow table, in first few chain, result seems correct. after chain index on specificed number (in example, 12800, , chains num 25600),the end indexs become sorted list. , here's implemention: and here's implemention: __device__ ulong hashtoindex(unsigned char* hash, ulong offset, int pos, ulong plainspacetotal) { ulong* hashp = (ulong*)hash; return (ulong)(((*(hashp) ^ *(hashp + 1) ^ *(hashp + 2) ^ *(hashp + 3)) + offset + pos) % plainspacetotal); } __device__ void indextoplain(ulong index, size_t plaincharsetsize, size_t plainlength, char* plain) { (size_t = 0;i < plainlength;i++) { plain[i] = plaincharset[index % plaincharsetsize]; index /= plaincharsetsize; } } __global__ void generatechain(struct chain* chains, size_t plaincharsetsize, size_t plainlength, size_t chainlength, ulong plainspacetotal) { unsigned char hash[32]; char plain[12]; uint o

sql - nodejs - Running multiple queries using mssql -

i have express api post request containing sql query using mssql . working , returns result json well. issue have, when want call more once while other query still running.. here code: app.post('/select', (req, res) => { config.database = req.body.db; var sqlquery = `select ${req.body.select} ${req.body.from}`; if (req.body.where !== '' && req.body.where !== undefined) sqlquery += ` ${req.body.where}`; if (req.body.order !== '' && req.body.order !== undefined) sqlquery += ` order ${req.body.order}`; console.log(`query: ${sqlquery}`); sql.connect(config).then(pool => { return pool.request().query(sqlquery) }).then(result => { sql.close(); sqldone = true; console.dir(result); res.header('content-type', 'application/json'); res.json(result.recordset); }).catch(err => { sql.close(); sqldone = true; console.log('caught error:'); console.log(err); }

php - My Android app is not getting any response from server -

i'm beginner in android. i'm trying receive data server , check entered username , password correct or not, it's not getting response event showing "wrong match". checked json output suppose show success if entered "hello" name , "hi" password it's not showing on button click. i've added internet permission in manifest.xml . mainactivity.java public class mainactivity extends appcompatactivity { private static final string register_url = "http://192.168.43.218/define_testing.php"; edittext username,pass; button login; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); login = (button) findviewbyid(r.id.login); username=(edittext)findviewbyid(r.id.username); pass=(edittext)findviewbyid(r.id.password); login.setonclicklistener( new view.onclicklistener() { @override

python - Django, creating a functional search bar and search results page -

i'm having trouble working inherited code make functional search bar. i've been having trouble creating search_results page. i stripped down search_results page having 1 line. search_results.html : <div>you searched {{ query }}</div> right now, search_results page doesn't render {{ query }}. no text user entered appears. shows on page "you searched for" searchbox.html <form class="search" action="{% url 'search' %}" method='post'> {% csrf_token %} <input type="search" placeholder="search here..." name="usr_query" value='{{ query }}' required> <button type="submit">search</button> </form> views.py def search(request): query = request.post['usr_query'] print "query: " print query t = loader.get_template('gtr_site/test_search_results.html') c = context({ 'query': query,})

reactjs - Is there any library like getorgchart.js on React? -

is there react version of getorgchart library or similar one you can use react-flowchart wunderlink module create similar tree chart structures provided getorgchart. "you create own components nodes , branches, pass them react-flowchart, , drag & drop wrapping you, along drawing lines connect nodes (the line drawing portion of package desperately needs work)." wiki

bbc microbit - Are there event callbacks in BBC MicroPython? -

i trying translate following javascript micropython micro:bit. code example 3 inventor's kit translated block javascript. let light_state = 0 # how do bit? input.onpinpressed(touchpin.p0, () => { if (light_state == 0) { light_state = 1 } else { light_state = 0 } }) basic.forever(() => { if (light_state == 1) { pins.analogwritepin(analogpin.p2, pins.analogreadpin(analogpin.p1)) } else { pins.digitalwritepin(digitalpin.p2, 0) } }) i can't figure out how input.onpinpressed callback event or lambda. best can come poll pin0 repeatedly. from microbit import * light_on = false while true: if pin0.is_touched(): light_on = not light_on if light_on: aval = pin1.read_analog() pin2.write_analog(aval) else: pin2.write_digital(0) i have seen callbacks on switches in micropython documentation haven't come across event callbacks micro:bit pins.

Is there any "Geometry Contour Line Algorithm"? -

Image
i want find & draw contour line this. data list of (x,y,z) , few points (about 40~60) in there. ( x , y position , z height ) how can find contour line , point? as first approximation, can admit function piecewise planar on triangulation of data points. the delaunay triangulation technique can used, in case, given regular polar arrangement, guess simple rule based on polar arguments do. interpolating inside triangles , obtaining horizontal sections simple matter. unfortunately, produce gross approximation , notice artifacts due coarseness of polylines. a possible cure smooth polylines postprocessing step, instance turning them polybeziers. another method, prefer, use higher order interpolation method. c1 continuity, can compute estimates of gradient @ given points , fit quadratic functions on triangles. subdivide triangles in sub-triangles, interpolate function @ sub-vertices, , switch planar model in these sub-triangles. wiki

javascript - Cant fetch Class id in braintree -

i not able fetch class id's expiration month , expiration year $('#expiration-month').val() + "/" + $('#expiration-year').val(), in briantree html file,although these id defined in html file.as result expiration date getting undefined. kindly help. <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css"> <style> body { background-color: #fff; } .panel { width: 80%; margin: 2em auto; } .bootstrap-basic { background: white; } .panel-body { width: 90%; margin: 2em auto; } .helper-text { color: #8a6d3b; font-size: 12px; margin-top: 5px; height: 12px; display: block; } /* braintree hosted fields styling classes*/ .braintree-hosted-fields-focused { border: 1px solid #0275d8; box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075

php - Magento Fetching image through childcategory -

i have following code set display subcategories of category. (to achieve categories category). however dont seem able fetch images throuhg childcategories, can me ? my code looks following. <?php $_helper = mage::helper('catalog/category') ?> <?php $categoryid = 465;?> <?php $category = mage::getmodel('catalog/category')->load($categoryid) ?> <?php $_categories = $category->getchildrencategories() ?> <?php if (count($_categories) > 0): ?> <ul> <?php foreach($_categories $_category): ?> <li> <?php $_category = mage::getmodel('catalog/category')->load($_category->getid()) ?> <?php if($_category->haschildren()):?> <?php $_subcategories = $_category->getchildrencategories() ?> <ul class="catblocks"> <?php foreach($_subcategories $_subcategory): ?>

typo3 - Page Access for anonymous user and with a specific group -

Image
i have page: /events/ (a) if user not logged in, want him see login -> result: page visible all + login-element on page (with: hide on login ) (b) if user in usergroup eventuser , should see event-plugin on page -> events-plugin on page (with group permission: eventuser ) everything cool 2 guys. but if user normal logged-in user (without group eventuser ) page /events/ empty. how can create page accessible anonymous users (to show login) , visible in navigation eventuser s not standard fe_users? create 2 pages on same level. the first 1 accessible (with "hide on login" set), second 1 accessible eventuser group only. create login plugin on publicly available page , set redirect restricted page on successful login. create event plugin on access restricted page. now need set redirect page other groups (or other way around) after successful login, other groups, except eventuser redirected somewhere else. won't see events page @ all.

java - How to change roles and permissions in runtime in Spring-boot using SpringWebSecurity -

i have same "projects" , same users in database in spring-boot webapp. users access projects using urls like: http: // server / project / 1 http: // server / project / 2 ... http: // server / project / x where "x" project id type long. different users have different privileges projects, eg .: user1 has admin role in "project1" user2 has user role in "project1" user3 has user role in "projec1" user1 has user role in "project2" user2 has admin role in "project2" user3 has user role in "projec2" some user add new project "project3" , grant access project user1 , user2 user , user3 roles admin role. in database have table users (user list) , table authorities (privileges of each user) don't know how link privileges, users , "projects". package pl.pecynki.testapp; import javax.sql.datasource; import org.slf4j.logger; import org.slf4j.loggerfactory; import or