Posts

Showing posts from September, 2014

ios - Perform addition of values from each cell of tableview -

i working on shopping app add items in cart. have show sub total amount need perform addition of price of each item in table. how can pick values each cell , add them? below code tableview: #pragma mark - table view data source - (nsinteger)tableview:(uitableview *)tableview numberofrowsinsection:(nsinteger)section { return [cartlist count]; } - (uitableviewcell *)tableview:(uitableview *)tableview cellforrowatindexpath:(nsindexpath *)indexpath { nsdictionary *celldata = [[[cartlist objectatindex:indexpath.row] valueforkey:@"addtocartproductimagemodel"] firstobject]; nsstring *image=[celldata valueforkey:@"productimg"]; nsstring *urlstring = [nsstring stringwithformat:@"http://dealnxt.com/areas/user/productimage/%@", image]; nsurl *url = [nsurl urlwithstring:urlstring]; nsdata *data = [nsdata datawithcontentsofurl:url]; nsstring *celldata = [[cartlist objectatindex:indexpath.row] valueforkey:@"shortdescription

amazon s3 - Where to put S3 secret when deploying using Appveyor? -

i've got appveyor project setup , working awesomely. now, want upload artifacts s3 easy hosting. seems easy outlined in the documentation . question is, put secret write permission? don't want push public repo obvious reasons. on travis put in environment variable never logged. how go in appveyor? i assume need store in yaml. can use secure variables . or can simple put secrets in clear text s3 deployment configuration in ui, save , press export yaml , have yaml section secrets encrypted.

ios - Filter searchText to tableView -

right using following let data = ["new york, ny", "los angeles, ca" . . .] var filtereddata: [string]! filtereddata = data but want use firebase, identical structure, using this var data = [categories]() (this categories ) struct categories { let key:string! let content:string! let itemref:firdatabasereference? init (content:string, key:string = "") { self.key = key self.content = content self.itemref = nil } init (snapshot:firdatasnapshot) { key = snapshot.key itemref = snapshot.ref if let categoriescontent = snapshot.value!["content"] as? string { content = categoriescontent } else { content = "" } } } so when search these lines supposed filter out aren't correct func searchbar(searchbar: uisearchbar, textdidchange searchtext: string) { // unhide tableview, changed method tableview.hidden = false filtereddata = searchtext.isempty ? data : data.

java - For Loop is not running, -

my loop in code being ignored, tested without if statement, , still loop doesn't output when call main method. public void searchbatsmenid(int id){ (batsmen check : batsmen) { exists = false; if (check.id == id && id!=0){ system.out.println("player id: " + check.id); system.out.println("name: " + check.name); system.out.println("age: " + check.age); system.out.println("number of matches played: " + check.matches); system.out.println("runs scored: " + check.runs); system.out.println(""); exists = true; } } assuming not getting error,there 2 possible reason for loop not being able run... 1>. there no element in batsmen ,i.e size zero.to check this,print before if statement. 2>.if (check.id == id && id!=0) false.

Lex Yacc parser compiling get few errors tried searching solution cant find -

we have task compile lex , yacc praser code run them using cc tab.y.c -ll -ly command when each apart compile fine compile both parts 1 gives 10 lines of errors. first part lex code: %option yylineno %pointer %{ #include <stdlib.h> #include <string.h> void yyerror(const char *); %} low \_ identifier {letters}{digit}*{low}{letters}|{letters} stringerr {doublequotes}{doublequotes}+|{doublequotes} charerr {singlequotes}+{digits}*{letters}*{singlequotes}+ err {charerr}|{stringerr} type boolean|string|char|integer|intptr|charptr|var dbland "&&" devide "/" assign "=" equal "==" greater ">" lesser "<" greaterequal ">=" lesserequal "<=" minus "-" plus "+" not "!" notequal "!=" or "||" multiply "*" p

php - foreach on Json is not working though var_dump is showing the array -

i'm trying run foreach on decoded array, follows: array: [ { "addresses": [ { "city": "hod hash", "country": "israel", "countrycode": "", "localizedlabel": "work", "originallabel": "_$!<work>!$_", "state": "", "street": "shahaf6\nsec", "zip": 41343 } ], "birthday": "2006-12-2712: 00: 00+0000", "creationdate": "2016-12-2711: 30: 00+0000", "emails": [ { "address": "nir@kfs.fin", "localizedlabel": "lab", "originallabel": "lab" }, {

ruby - Gem has wrong version for Jekyll -

i've installed latest jekyll (3.3.1), gem/ruby still thinks i'm on 3.2.1. e.g.: $ jekyll --version /users/userx/.rvm/gems/ruby-2.4.0/gems/bundler-1.13.7/lib/bundler/resolver.rb:203:in `rescue in start': bundler not find compatible versions gem "jekyll": (bundler::versionconflict) in gemfile: jekyll (= 3.2.1) minima resolved 2.1.0, depends on jekyll (~> 3.3) /users/userx/.rvm/gems/ruby-2.4.0/gems/bundler-1.13.7/lib/bundler/resolver.rb:199:in `start' /users/userx/.rvm/gems/ruby-2.4.0/gems/bundler-1.13.7/lib/bundler/resolver.rb:181:in `resolve' /users/userx/.rvm/gems/ruby-2.4.0/gems/bundler-1.13.7/lib/bundler/definition.rb:250:in `resolve' /users/userx/.rvm/gems/ruby-2.4.0/gems/bundler-1.13.7/lib/bundler/definition.rb:174:in `specs' /users/userx/.rvm/gems/ruby-2.4.0/gems/bundler-1.13.7/lib/bundler/definition.rb:233:in `specs_for' /users/userx/.rvm/gems/ruby-2.4.0/gems/bundler-1.13.7/lib/bundler/de

javascript - Find the largest number in an array of alphanumeric string in Jquery -

i have array data below var arr = [daaguva1, dagguva2, dagguva3, dagguva4, daggu5, dag6, dagguv7, dagg8, daggs9, dagguvati10]; i want highest number in array of string i.e. 10 . need number can auto increment number 11 . help? if names match same structure (letters followed target number) - use regex strip out non-digit characters , parseint remaining portion yield number. set high score , iterate through array , compare stripped down numbers high value , if higher - set higest value that. var arr = ['daaguva1', 'dagguva2', 'dagguva3', 'dagguva4', 'daggu5', 'dag6', 'dagguv7', 'dagg8', 'daggs9', 'dagguvati10']; var high=0; for(i=0; i<arr.length; i++){ var num = parseint(arr[i].replace(/\d+/g, '')); if(num > high){high = num}; } console.log('highest number is: ' + high); var nextnum = high +=1; console.log('next number

time series - ARIMA component with seasonality - Using R -

i trying use auto.arima function in r on time series data.i used both original series , log transformed series , below outputs: with original timeseries: > auto.arima(inflowts) series: inflowts arima(1,1,0)(0,1,0)[12] coefficients: ar1 -0.6812 s.e. 0.1431 sigma^2 estimated 16565: log likelihood=-137.88 aic=279.77 aicc=280.4 bic=281.95 with log transformed series got: > auto.arima(inflowts1) series: inflowts1 arima(1,1,0)(0,1,0)[12] coefficients: ar1 -0.6695 s.e. 0.1488 sigma^2 estimated 0.008878: log likelihood=20.97 aic=-37.93 aicc=-37.3 bic=-35.75 the difference aic , bic parameters have become better when transformed variable used. since data has seasonality question how handle seasonal component here giving both p , q values 0 [arima(1,1,0)(0,1,0)[12] ] any pointer on how handle such scenario highly appreciated.

javascript - Custom sessions in Ember Js. How to set/access session information -

so followed youtube tutorial on how authorize using session tokens. main session code following. //app/services/session.js import ember 'ember'; export default ember.service.extend({ token: null, authenticate(log, pass) { return ember.$.ajax({ method: 'post', url: '/token', data: {username: log, password: pass} }).then((info)=>{ this.set('token',info.access_token); }); } }); server set on here. //server/index.js const bodyparser = require('body-parser'); module.exports = function(app) { app.use(bodyparser.urlencoded({ extended: true})); app.post('/token', function(req, res){ console.log(res); if(req.body.username === 'erik' && req.body.password === 'password') { res.send( { access_token: 'secretcode'}); } else { res.status(400)

javascript - LocalStorage button & list -

i'm pretty new javascript. i need "add favorites/remove favorites" function on several products pages. function save product id , put in array. and then, need write page retrieve products id's localstorage in order display them mysql select. i've got mysql part covered can me bit javascript? thanks. for example can declare array of ids var favourites = new array(); then in code should add items array favourites.push('file1_id') favourites.push('file2_id') at end save localstorage (stringify array json, have store strings in localstorage) localstorage.setitem('favourites', json.stringify(favourites)) on page sql query can saved ids localstorage (parse json original array) json.parse(localstorage.getitem('favourites'))

java - retrieving data from firebase database and storing in an array list -

i attempting create small course aggregator program in form of android application. my courses stored in firebase realtime database, viewable firebase console , appears fine. the issue have written java method connect db, retrieve data db, cast data custom java object course , attach custom java object coursecardmodel , , save coursecardmodel object arraylist. the connection database made successfully, , snapshot generates contains correct information, have verified looping through snapshot , printing variable course name of each course object out successfully. problem when method completes, reason arraylist returns empty, though upon checking size of arraylist throughout snapshot iteration can see cardmodel objects being added it. if has in solving hugely appreciated, new firebase. generatecourses() method private arraylist<coursecardmodel> generatecoursecards() { coursecardmodellist = new arraylist<coursecardmodel>(); cardmodel = new coursecar

.htaccess redirect to another domain and keep original domain -

i have problem .htaccess redirect. i have hosted domain , www.domain-a.com/folder under it. want transparently redirect folder same folder under url : domain-a.com/folder --> xxx.xxx.xxx.xxx/folder , domain.com-a/folder/folder2 --> xxx.xxx.xxx.xxx/folder/folder2 and on. folder same folder2 , on different every user. want address bar show domain-a.com , after whatever folder in, contents needs pulled xxx.xxx.xxx.xxx. i don't want redirect domain-a.com root folder, subfolders. i have tested many solutions have found similar questions of them works partially. example : redirecting xxx.xxx.xxx.xxx/folder keeps original domain in address bar, if go domain-a.com/folder/folder2 etc. address bar shows xxx.xxx.xxx.xxx/folder/folder2 i don't want iframe because ip of server public knowledge. i need because have big databases , scripts uses them on http://xxx.xxx.xxx.xxx (my own server) , hosting costs million. that's why need pull domain-a.com. thank in

Why Laravel Request object is replacing spaces with underscores on my form names? -

i have form posting variables containing spaces in names e.g. i perform ajax request , can see in chrome inspector name correctly passed "with blank space) in api.php: route::post('/user', 'usercontroller@get'); usercontroller function get(request $request) { dd($request->input('name surname')); //display null dd($request->all()); //i notice key's changed name_surname } taken can't change names because have contain spaces (bad practice? ok has that): how can avoid spaces replaced? (maybe without have manipulate request->all() returned array keys hand....) short answer don't believe there such way. you can map response bit of string replace though: $data = $request->all()->mapwithkeys(function($item, $key) { return [str_replace("_", " ", $key) => $item]; }); if it's want apply across board, possible rig middleware apply requests.

sql server - Edit Rows grid: string or binary data would be truncated -

i trying change "y" "n" in column. have changed value in several rows, 1 specific row throwing error. here error: the data in row 170 not committed. error source: .net sqlclient data provider. error statement: string or binary data truncated. the statement has been terminated. what row causing error? changing 'y' 'n' shouldn't cause problem. check table trigger might sending data table truncate occurring on field.

datetime - C# How to convert UTC date time to Mexico date time -

see code used convert mexico date , time utc date , time. string strdatetime = "25/01/2017 07:31:00 am"; datetime localdatetime = datetime.parse(strdatetime); datetime univdatetime = localdatetime.touniversaltime(); touniversaltime return utc 25-01-2017 02:01:00 when again try convert same utc date , time utc 25-01-2017 02:01:00 mexico local time got 24-01-2017 06:01:00 so see 07:31:00 becomes 06:01:00 not right. tell me missing in code getting wrong local time when convert utc mexico time using timezone info. see code converting utc mexico local time using timezone info. string strdatetime = "25-01-2017 02:01:00"; datetime utcdatetime = datetime.parse(strdatetime); string nztimezonekey = "pacific standard time (mexico)"; timezoneinfo nztimezone = timezoneinfo.findsystemtimezonebyid(nztimezonekey); datetime nzdatetime = timezoneinfo.converttimefromutc(utcdatetime, nztimezone); you current time zon

windows - escape drive name in batch file -

my batch file test.bat c:\windows\system32\cmd.exe /c /d %i in (c:\programdata\puppetlabs\puppet\etc\ssl\*) rd /s /q "%i" when run above command manually command prompt, works , deletes contents c:\programdata\puppetlabs\puppet\etc\ssl. now, same command when used in batch file , when run batch file, returns : c:>test.bat c:\>c:\windows\system32\cmd.exe /c /d \programdata\puppetlabs\puppet\etc\ssl\*) rd /s /q "i" \programdata\puppetlabs\puppet\etc\ssl\*) unexpected @ time. above output miss out (c: batch file. any idea ? in advance. the problem different one! note how %i missing in output when running command-line? , lot of different things next %i command-line line? when using for-loop in batch, have escape single percent sign 1 loop parameter: c:\windows\system32\cmd.exe /c /d %%i in (c:\programdata\puppetlabs\puppet\etc\ssl*) rd /s /q "%%i" should working :)

ios - How to create app file with fastlane for simulator -

i need create fastlane .app file (or .ipa file if works to) next drag , drop simulator on computer. tried gym or xcodebuild parameters don't know how it. for in way: in xcode build application simulator next searching app file in deriveddata (~/library/developer/xcode/deriveddata/build/products/debug-iphonesimulator/) i copy file somewhere else but need fastlane. as can found in issues @ fastline repo , can gym, maybe, better if use xcodebuild (example): xcodebuild -configuration debug -target targetname -arch i386 -sdk iphonesimulator10.3 than search ~/library/developer/xcode/archives/<date> (or specify -archivepath ) , inside xcarchive . navigate .xcarchive file in finder right click on .xcarchive file , select "show package contents" in popup menu the finder switch showing contents of .xcarchive file. navigate products/applications your .app located in products/applications from here . here answer , you. update

actionscript 3 - get usb location on android device -

i'm creating app using flash cc as3. in app, load external swf documentsdirectory . works fine on tablets , phones. boss brings me new android projector device. app not locate documentsdirectory in device. tried userdirectory . didn't work. android projector device's usb location /mnt/usb/sda1/myfolder . tried manually set location of file, didn't work. there anyway find location of usb in as3? tried var volumes = storagevolumeinfo.storagevolumeinfo.getstoragevolumes(); available volumes show errors. possible copy files usb drive using as3? appreciated.

javascript - Center a ion-button using Ionic framework -

Image
it's first time ionic framework. want center "ion-button", how can it? view: this html code: <ion-header> <ion-navbar> <button ion-button menutoggle> <ion-icon name="menu"></ion-icon> </button> <ion-title>login</ion-title> </ion-navbar> </ion-header> <ion-content padding> <h3>effettua l'accesso</h3> <p> esegui il login oppure procedi come utente non registrato. clicca in alto sinistra per vedere il menu. </p> <form ng-submit="submitlogin()"> <tr> <td>email</td> <td><input type="text" ng-model="prodescform.description"/></td> </tr> <tr> <td>password</td> <td><input type="text" ng-model="prodescform.registerdiscount" /></td>

java - Compress movies on Android -

i have game users complete assignment making picture send backend. before sending backend image resized limit amount of data has send. works fine. now want extend movie clips. movie clips lot bigger picture. if don't compress them. problem have no clue how this. so main question how can change app user records video , after compress make file smaller in size. there libraries around this? or there in android use? one approach works use ffmpeg compression. there used ffmpeg libraries allow include ffmpge via wrapper , use standard ffmpeg syntax perform compression within app. see 1 includes examples: https://github.com/writingminds/ffmpeg-android-java note video compression power , battery intensive, , takes time may want limit clip size if plan have users use functional regularly.

java - Logback multiple loggers with different configuration -

i want use 2 different loggers in class 1 logger uses 1 logback configuration file , uses configuration file. eg: class sample { // logger 1 follows configuration logback1.xml private static final logger1 = loggerfactory.getlogger(sample.class); // logger 2 follows configuration logback2.xml private static final logger2 = loggerfactory.getlogger(sample.class); public myfunc(){ logger1.info("in myfunc"); // writes file configured in logback1.xml logger2.info("entered myfunc"); // writes graylog server configured in logback2.xml } } the reason want i'm injecting second logger code @ runtime, , don't want injected logger collide logger used in main project. how should go doing this? i went through post: how use multiple configurations logback in single project? seems address problem of choosing 1 configuration file many not "being able use 2 configuration files simultaneously in above example."

image - bwlabel doesn't work as expected? -

Image
this segmented image of brain thresholding segmentation, want a, b, , c regions, brain regions. when apply kind of operation. now, using bwlabel find blob areas , correspondingly extract bigger or circular blobs of kind , blobs a, b,and c. problem when bwlabel don't a, b blobs. here code , attached images before , after bwlabel: temp = before_dicomfiles{1,15}; %figure, imshow(temp, [low1 high1]); temp = double(temp); newimg = temp; % actual brain image used thresholding newimg(newimg <0 ) = 0; % set negative pixels zeros newimg(newimg >1080) = 0; % remove on range figure, imshow(newimg, [low1 high1]); % thresholded image bw = bwlabel(newimg,8) ; figure, imshow(bw, []) % labelled image missing a, blob areas suggest me methods trace regions a, b , better segmentation methods not miss brain regions thanks, gopi

javascript - Web Audio: audio 2 sequential playbackRate values only applies first value -

i have song i'm playing web audio , schedule 2 playbackrate changes before play song. first playbackrate change takes effect, second 1 never triggers. expected behavior? i'm missing make work? basic logic is: sourcenode = _mysourenodegetterfn('blah.mp3'); sourcenode.start(0); sourcenode.playbackrate.setvalueattime(.8, 5); sourcenode.playbackrate.setvalueattime(1.2, 10); audiocontext.resume(); the second playbackrate value, setvalueattime(1.2, 10) , scheduled 10s song not trigger. first playbackrate triggers fine. i'm using chrome 56.0.2924.87 on macbook. closing loop - bug chrome v55. fixed in v58 (dunno if fixed in versions between two).

Is there a way to monitor file changes and auto upload the file in PhpStorm? -

Image
i've switched phpstorm cause it's awesome! but i'm doing sass styling , nice if monitor compiled css file , upload after has been compiled? is there way can done? used able monitor files in sublime files upload direct server after being compiled. any advice appreciated can seem find it. looking @ preferences > file watchers ... this far got, , gets error. not sure how works, documentation little confusing. you can! if go tools->deployment->configuration , , add connection uploads. once you've configured connection, go tools->deployment , click "automatic upload" have phpstorm upload changes files in project. to monitor changes made outside of phpstorm, can go preferences->build, excecution, deployment->deployment->options , , tick box labeled "upload external changes".

typo3 - How to omit empty (optional) segment in realurl? -

currently i'm trying create nice looking url's custom extension. i using plugin on page "products" (uid: 3) list categories. for example there following categories: men shirts sweatshirts women shoes dresses i'd have these corresponding url's: www.mydomain.com/products/men.html www.mydomain.com/products/men/shirts.html this is, get: www.mydomain.com/products//men.html www.mydomain.com/products/men/shirts.html the category "men" on first level not have parent category, segment remains empty. there parent category, fine. typo3 version: 7.6.15 realurl version: 2.1.6 this current configuration fixedpostvars: 'fixedpostvars' => array ( // ext: productsdb start 'productsdbconfiguration' => array( array( 'getvar' => 'tx_productsdb_categories[action]', 'valuemap' => array( ),

devexpress - How to clean install in-house program? -

we have been working hard update of our in-house software @ our company, we're running issue we're not sure how fix. upgrade v14.1 v17, user must run software, fine. issue old version files kept in same folder new ones. so, i'm wondering if there tool or way remove v14.1 files , keep v17 files, doing clean install of program without having remove every system on network. suggestions? thank much!

yii - Where can I find the location of view, edit, delete button in Yii2? -

Image
i want delete view, edit, delete's button. cant find location. buttons picture below: https://ibb.co/eixnpa where can find location of view, edit, delete button in yii2? want edit code. in advance you can hide 3 follows 1.go views folder 2.find folder name(same of table name) 3.now open folder , find index.php , code below code,and use // hide column.just add // before ['class' => 'yii\grid\actioncolumn'] have shown in code. <?= gridview::widget([ 'dataprovider' => $dataprovider, 'filtermodel' => $searchmodel, 'columns' => [ ['class' => 'yii\grid\serialcolumn'], 'id', 'username', 'address', 'head', 'mobile', 'school', 'manager', // ['class' => 'yii\grid\actioncolumn'], ], ]); ?>

osx - Install an homebrew bottled binary package -

i need speed travis package generation in need brew install fftw --with-openmp that takes ~20 minutes build , of time travis kills job. my idea create repo in (once in while) generate binary bottled version of fftw --with-openmp , application repo intall particular bottled version. i'm stuck in last part... i created empty repo linked travis ( https://github.com/iltommi/fftw-openmp ) in have .travis.yml : os: osx osx_image: xcode7.1 sudo: required script: - export compiler=g++-6 - brew update; brew tap homebrew/science - brew install --build-bottle fftw --with-openmp - brew bottle fftw - export release_file=$(ls fftw*bottle*.tar.gz) - ls -la deploy: provider: releases edge: branch: releases-fix api_key: $github_token file: "${release_file}" skip_cleanup: true overwrite: true so file in releases ( https://github.com/iltommi/fftw-openmp/releases ) now, how install other repo? can via wget then? thanks it looks has

.net - The remote server returned an error (550) file unavailable (e.g. File not found no access) -

the remote server returned error (550) file unavailable (e.g. file not found no access). when downloading 2 files 1 21 bytes date.txt file , 1 around 2 gb .zip file. zip file downloading when date.txt downloading getting error: i trying code file download ftp.: private void backgroundworker1_dowork(object sender, doworkeventargs e) { string[] files = readfilelist(); ftpsettings.ip = "xx.xx.xxx.xxx/texturedata"; ftpsettings.userid = "xxxx"; ftpsettings.password = "xxx"; //ftpwebrequest reqftp = null; //stream ftpstream = null; foreach (string file in files) { //string filename = e.argument.tostring(); ftpwebrequest request = (ftpwebrequest)webrequest.create("ftp://" + ftpsettings.ip + "/" + file); request.credentials = new networkcredential(ftpsettings.userid, ftpsettings.password); request.method = webrequestmethods.ftp.getfilesize; request.proxy = null;

c++ - Warnings for uninitialized members disappear on the C++11 -

i compile simple program: #include <cstdio> #include <iostream> using namespace std; struct foo { int a; int b; }; struct bar { //bar() = default; int d; }; int main() { foo foo; bar bar; printf("%d %d\n", foo.a, foo.b); return 0; } and warnings: $ g++ -std=c++11 -wall -wextra -wpedantic foo.cpp -o foo foo.cpp: in function ‘int main()’: foo.cpp:21:9: warning: unused variable ‘bar’ [-wunused-variable] bar bar; ^ foo.cpp:23:11: warning: ‘foo.foo::b’ used uninitialized in function [-wuninitialized] printf("%d %d\n", foo.a, foo.b); ^ foo.cpp:23:11: warning: ‘foo.foo::a’ used uninitialized in function [-wuninitialized] of course, expect. when uncomment bar default ctor, there problem - warnings disappear. why bar ctor disables warnings foo ? my gcc version is: g++ (ubuntu 5.4.0-6ubuntu1~16.04.2) 5.4.0 20160609 . the problem not occur on c++03, on c++11 or newer. i

angularjs - using expandable Angular js ui grid -

i using expandable ui grid. , refreshing grid data in every 5 secs. issue f expand row closed in every 5s(as grid refreshes). please suggest how can make row expanded grid refreshed data. code $scope.fillproductlist = function() { $http({ method: 'get', url: getjobs, data: {} }).success(function(result) { $scope.showsublistgrid = false; $scope.mydata= ''; var griddatawithdownload = result; //grid data $scope.mydata = griddatawithdownload; $scope.gridoptionscategory.data = griddatawithdownload; // $scope.refresh = false; timer = $timeout(function() { $scope.fillproductlist(); }, timeoutstamp); }).error(function(result) { timer = $timeout(function() {

statistics - Automatically finding starting values for a sigmoid curve -

i have ~10.000 of vectors , want fit sigmoid curve each of them; in each case, need define starting parameters fitting, want find these parameters automatically. on stackexchange, there discussed strategies of automatically finding starting values non-linear models ( one , two ), these discussions consider specific cases such fitting gaussian. there general stratagies can applied sigmoid curve too? if there general methods, implemented. need special case methods. if example sigmoid function like: s(x) = l / (1 + exp( -k*(x-x0)) so want find l, k , x0, proceed this: i'll call data x[] , y[] find maximum of y[] , take bit greater estimate of l transform y[] z[i] = log( l/y[i] - 1) (note if l maximum of y[] z y maximum undefined, why should take l greater maximum; alternatively miss out z's y's maximum) so relationship seek z[i] ~ -k*(x[i]-x0) and estimate k , x0 using linear least squares on x[], z[]

Spring Security - AngularJS - Protect Angular static content -

long story short, trying protect legacy angular application spring security. whole angular static stuff under src/main/resources/static and stuff should subject securing under src/main/resources/static/protected-stuff here configuration (it part of overall spring boot app configuration): @override protected void configure(httpsecurity http) throws exception { http.formlogin() .loginpage("/login.html").permitall() .loginprocessingurl("/dologin") .failureforwardurl("/login.html?iserror=true") .failureurl("/login.html?iserror=true") .defaultsuccessurl("/protected-stuff/index.html") .and() .authorizerequests() .antmatchers(httpmethod.get, "/", "/index.html", "/home.html", "/login/**").permitall() .antmatchers("/protected-stuff

using a smaller project as a git submodule in several other projects - can't make it work -

i've seen question crop more once in 1 form or around here, made me choose route. have smallish project (web stuff) has own gruntfile , git repository , under active development. use result of development in several other projects, is, don't want or need gruntfile or sass files etc. however, if there's update in shared project, want able pull , merge updates files in current project. want make modifications these files adapt them current project's needs. the way understand is, should make git submodule in other project want have these files. must new git, far i've been using few personal projects - , loving -, nothing collaborative (so no pulling , merging yet), , feel still don't have grasp on it. anyway added shared project (let's call sub) submodule in project i'm working on (let's call a). sub exists folder in a, , git status lists folder modified . doing git add sub/ not change this. , doing git merge sub/ nets me merge: sub/ - not c

excel - C# Open XML SDK write data at specific cell reference -

Image
i have excel sheet cell changed cell reference. with code, can load excel sheet , load data it. want data begin insert @ specific cell "int_startdok". my code: private byte[] loaddatatofile([notnull] datatable datatable) { if (datatable == null) throw new argumentnullexception(nameof(datatable)); var memorystream = new memorystream(); var bytearray = file.readallbytes(templatefilepath); memorystream.write(bytearray, 0, bytearray.length); using (var spreadsheetdocument = spreadsheetdocument.open(memorystream, true)) { var workbookpart = spreadsheetdocument.workbookpart; var worksheetpart = workbookpart.worksheetparts.first(); var sheetdata = worksheetpart.worksheet.elements<sheetdata>().first(); var headerrow = new row(); var columns = new list<string>(); foreach (datacolumn column in datatable.columns) {

reflection - Decorate all properties with type metadata in TypeScript -

given code: class foo { text: string; } typescript produce javascript: var foo = (function () { function foo() { } return foo; }()); but if decorate text decorator, such function bar(t, k) {} this: class foo { @bar text: string; } typescript produce: var foo = (function () { function foo() { } __decorate([ bar, __metadata('design:type', string) ], foo.prototype, "text", void 0); return foo; }()); that is, decorates text bar function and design:type metadata. great, i'd instruct typescript decorate all properties design:type metadata, without need of bogus decorator @bar . is possibile in latest typescript? if not (see comments) suggestions on how use compiler api achieve this?

java - Using multiple WebSecurityConfigurerAdapter with different AuthenticationProviders (basic auth for API and LDAP for web app) -

according spring security reference section 5.7 should possible define more 1 security adapter. i try same without success. after server reboot, first x times api works fine basic auth, after couple of times i'm redirected login (form) page, should happen our web app, not api calls. my code: @enablewebsecurity public class multihttpsecurityconfig { @configuration @order(1) public static class apiwebsecurityconfigurationadapter extends websecurityconfigureradapter { @autowired private environment env; @autowired public void configureglobal(authenticationmanagerbuilder auth) throws exception { auth.inmemoryauthentication(). withuser("admin").password("pw_test").roles(api_role); } protected void configure(httpsecurity http) throws exception { http .antmatcher("/services/**") .authorizerequests() .any