Posts

Showing posts from September, 2013

angular - Logger requirement in Angular2 project -

is there npm package logging supports following requirements in angular 2 projects - extending logger using decorator pattern push error level log server should able control logging events (framework , custom code) regards, naveen you can have @ angular2-logger has great capabilities , easy use https://www.npmjs.com/package/angular2-logger in case if interested in angular 4 or want switch 1 might helpful angular 4 there great looger can write logs sever https://www.npmjs.com/package/ngx-logger

Calling macro right after importing DB from external DB into Excel -

i have access myexterntable.mde database connect when workbook opened. connection defined regular excel's data-> connections ui, , works well. connection string is: provider=microsoft.ace.oledb.12.0; user id=admin; data source=d:\databases\uuuu\myexterntable.mde; mode=readwrite; extended properties=""; jet oledb:system database=""; jet oledb:registry path=""; jet oledb:engine type=5; jet oledb:database locking mode=1; jet oledb:global partial bulk ops=2; jet oledb:global bulk transactions=1; jet oledb:new database password=""; jet oledb:create system database=false; jet oledb:encrypt database=false; jet oledb:don't copy locale on compact=false; jet oledb:compact without replica repair=false; jet oledb:sfp=false; jet oledb:support complex data=false; jet oledb:bypass userinfo validation=false; jet oledb:limited db caching=false; jet oledb:bypass choicefield validation=false the commadtext is: qryidnameexport my workbook cont

python 3.x - using dask distributed computing via jupyter notebook -

i seeing strange behavior dask when using jupyter notebook. initiating local client , giving list of jobs do. real code bit complex putting simple example here: from dask.distributed import client def inc(x): return x + 1 if __name__ == '__main__': c = client() futures = [c.submit(inc, i) in range(1,10)] result = c.gather(futures) print(len(result)) the problem that, realize that: 1. dask initiates more 9 processes example. 2. after code has ran , done (nothing in notebook running), processes created dask not killed (and client not shutdown). when top, can see processes still alive. i saw in documents there client.close() option, interestingly enough, such functionality not exist in 0.15.2. the time dask processes killed, when stop jupyter notebook. issue causing strange , unpredictable performance behavior. there anyway processes can killed or client shutdown when there no code running on notebook? the default client allows optional parameters pass

apache - Http 403 forbidden when accessing applicaiton url from outside VM -

i have application running on linux os on vm. using vmware. when try access application url outside vm providing proper vm ip address http 403 forbidden in browser. application runs fine within vm on browser when use localhost app. able ping vm without issue host system. my network connection vm nat. tried switching bridged connection didn't help. host os windows 10. has seen behavior? not sure if question elementary. new vms.

ruby on rails - Ignore SSL for MySQL in database.yml -

i want set database.yml (or wherever else more appropriate) ignore ssl certificate when trying connect database. know bad practice temporary thing need. to give example of i'm trying do, want mimic sql connection command: mysql --ssl=0 -h 10.10.10.10 -u admincreds -p i have tried putting each of following parameters in last line (sslca, sslkey, , sslcert) in database.yml configuration such: development: <<: *default host: 10.10.10.10 username: admincreds password: password database: database sslca/sslkey/sslcert: false but i'm still getting ssl error expect: .rvm/gems/ruby-2.2.2/gems/mysql2-0.3.21/lib/mysql2/client.rb:70:in `connect': ssl connection error: error:00000001:lib(0):func(0):reason(1) (mysql2::error) is there different parameter can put in can skip on or not use ssl in database.yml or elsewhere? need run simple script. according mysql2 documentation should set, secure_auth: false when using yaml conf activerecord

python - Removing rows with NaN in MultiIndex with duplicates -

updated dataframe repros exact issue i have issue nan appearing in indexes leading non-unique rows (since nan !== nan ). need drop rows nan occurs in index. previous question had example dataframe single nan row, original solution did not resolve issue did not meet poorly advertised requirement: (note in actual data have thousands of such rows, including duplicate rows since nan !== nan permissible on index) (from original post) the issue >>>import pandas pd >>>import numpy np >>> df = pd.dataframe([[1,1,"a"],[1,2,"b"],[1,3,"c"],[1,np.nan,"x"],[1,np.nan,"x"],[1,np.nan,"x"],[2,1,"d"],[2,2,"e"],[np.nan,1,"x"],[np.nan,2,"x"],[np.nan,1,"x"]], columns=["a","b","c"]) >>>df c b 1.0 1.0 2.0 b 3.0 c nan x nan x nan x 2.0 1.0 d 2.0 e nan 1.0 x 2.0 x

virtual reality - How to install Google VR SDK in Android Studio -

i getting virtual reality apps , build own vr player app. how can download google vr sdk , install in android studio, can start playing around features. thank guys! the requirements listed here (at time of writing): https://developers.google.com/vr/android/get-started its maybe little unclear, need download google vr sdk android , put wherever want on local machine. once have there, can open studio , use 'open existing android studio project', select directory , choose 1 of sample projects , should , running. if want build own project need add in dependency project gradle build file. suggest check link again if having problems, relatively new , instructions may change on time , blog or other guides may out of date.

javascript - Adapt a booking portal widget code to use in a mobile app page -

hi trying adapt small booking widget designed websites, use inside mobile app using jquery mobile , html without accompanying button. (just using rel="external" on link page in jquery mobile) have simple script use on external links social sites (facebook,twitter linkedin,youtube, in fact seems work on of them) links site using hidden div display users relevant profile using site id) code below: <head> <script type="text/javascript"> window.onload = function() { var url, hdiv = document.getelementbyid("hiddendivid"); if (hdiv != null) url = hdiv.innertext || hdiv.textcontent; if (url) { if (top == self) window.location = url; else top.updatewindowwithcontentsofurl(self, url); } } </script> </head> <body> <div id="hiddendivid" style="display:none">https://www.facebook.com/paulanthonymcgowan </div> &

windows - Call PowerShell Script From Batch File With All Parameters -

this question , this blog post address how pass particular parameters powershell script batch file. how can 1 pass parameters powershell script? want splat parameters batch file passes arguments through transparently. edit more context: i'm using line like: powershell.exe -command "& '%~dpn0.ps1' '%1' '%2'" this works, creates redundancy between files such that, if update powershell script take different arguments, have update batch script well. nice if like: powershell.exe -command "& '%~dpn0.ps1' '%*'" try following: powershell -file "%~dpn0.ps1" %* in batch files, %* represents arguments passed. [1] -file parameter use invoke scripts via powershell's cli. all remaining arguments passed through as-is (whereas -command subject them round of interpretation powershell [2] ). [1] note cmd.exe (batch files) recognize argument embedded whitespace single argum

android - LG G4 not seen/recognized by ADB -

i can't lg g4 phone show in adb on windows 10 desktop machine - no devices found running "adb devices" or "adb usb" in cmd or checking android studio's device manager tab. things i've tried: i've toggled usb debugging mode i've rebooted phone , pc i've installed, uninstalled, , reinstalled following drivers in every permutation/combination/etc: lg's driver (lgmobiledriver_whql_ver_4.2.0 , version 4.0.4) google usb driver (via android studio); note, don't see changes whatsoever system when install/uninstall this, i'm not sure it's doing universaladbdriversetup6 whatever windows keeps installing automatically i've tried charge mode / mtp mode / ptp mode. of time leave in ptp mode because seems other posts say, hasn't made difference me. i've tried different usb ports on desktop i've tried "adb kill-server / start-server" i've tried "adb devices / usb" i've unplu

How do I interpret Google Chrome Profiler timings? -

Image
when opening site using chrome performance analysis tab under developer tools, site loads in slowly, around 5-10x slower loading page regularly. the performance analysis tool outputs summary chart below. when force cache refresh, regular page loads takes 800-1200ms me. performance tool suggests time of around 6 seconds. how should timings interpreted?

c - GCC fails(?) to expand complex macro -

the following jumble of macros compiles correctly under visual studio , keil arm compiler, failing gcc arm 6.3.1: #define drv_acfgcal_reg_index(regulator_name,register_num) ((acfg_cfg##register_num##_en##regulator_name##_lsb+3)/4 + ((register_num-2)*8)) #define drv_acfgcal_reset_index(reset_name,reg_offset) ((acfg_cfg##reg_offset##_r##reset_name##_lsb)+((reg_offset-1)*32)) #define drv_acfgcal_info(rst,rst_reg,idx,docx,regi,vtr,pdcal) \ { \ 0 ,\ 0 ,\ idx##_acfg_idx ,\ docx##_word_count ,\

javafx - I got a weird message in the console when running my java project -

when run project in netbeans receive message in console. launching task c:\program files\java\jdk1.8.0_131\jre..\lib\ant-javafx.jar warning: jdk7u25 codebase manifest attribute should used restrict jar repurposing. please set manifest.custom.codebase property override current default non-secure value '*'. launching task c:\program files\java\jdk1.8.0_131\jre..\lib\ant-javafx.jar no base jdk. package use system jre. no base jdk. package use system jre. my project seems run fine want know if worry about. looking @ documentation need have java_home property in build.xml file pointing jdk: <?xml version="1.0" encoding="utf-8" ?> <project name="javafx hello world example" default="default" basedir="." xmlns:fx="javafx:com.sun.javafx.tools.ant"> <property name="java_home" value="c:\\java\\jdk1.8.0"/>

javascript - PHP not reconizing data from jquery only in DELETE and PUT method -

i full stack student , trying homework... sending php object of daya jquery. it's working fine when method or post, not working when it's delete & put, php get's methos wouldn't data object, gives error: undefined index: activitiesarray. using same functions options, , if change method works. problems output debug console terminal .. doing wrong?? thanks! this ajax in javascript: "use static"; function sendajax(method, url, data, calltype) { $.ajax({ type: method, url: url, data: { activitiesarray: data }, success: function(response_text) { callback(response_text, calltype); } }); } and php api: $method = $_server['request_method']; // verb $params = $_request['activitiesarray']; switch ($params['ctrl']) { case 'director': $capi = new directorapi(); $result = $capi->gateway($method, $params); echo json_encode($res

Parse large python xml using xmltree -

i have python script parses huge xml files ( largest 1 446 mb) try: parser = etree.xmlparser(encoding='utf-8') tree = etree.parse(os.path.join(srcdir, filename), parser) root = tree.getroot() except exception, e: print "error parsing file "+str(filename) + " reason "+str(e.message) child in root: if "personname" in child.tag: personname = child.text this xml looks : <?xml version="1.0" encoding="utf-8"?> <myroot xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:xsd="http://www.w3.org/2001/xmlschema" uuid="ertr" xmlns="http://www.example.org/yml/data/litsmlv2"> <aliases authority="opp" xmlns="http://www.example.org/yml/data/commonv2"> <description>mydata</description> <identifier>43hhjh87n4nm</identifier> </aliases> <roll

combinatorics - Algorithm to get all list from sorted set of combinations? -

lets have set of number s = {a,b,c,...,n} < b < c .... < n how many ways can sort combinations? take small example: if set {1,2,8} (so n = 3) can sort combination in ascending order this: 1,2,1+2,8,1+8,2+8,1+2+8 equal to: a,b,c,a+b,a+c,b+c,a+b+c if set of numbers 1,3,4 array equal to: a,b,a+b,c,a+c,b+c,a+b+c can see a+b greater or smaller sometimes. so n = 3 theres follow possible combinations: {a,b,c,a+b,a+c,b+c,a+b+c} , {a,b,a+b,c,a+c,b+c,a+b+c} theres 2 is there algorithm can take out me combinations(dont brute force)? how many combinations in n, want know how many "combinations" can get, n = 3 2 n = 3 ???. thanks.

linux - Unable to install kernel driver rpm during %post section kickstart RHEL7 -

i'm trying install custom driver rpm custom built. have kickstart file bundled rhel7.2 iso %post section. in %post , have yum install of driver rpm seems installed, notice depmod logs fatal errors when driver rpm gets installed: installing : kmod-xnxx-1.0-1_test.x86_64 depmod: fatal: not load 3.10.0-327.el7.x86_64: no such file or directory warning: %post(kmod-xnxx-1.0-1_test.x86_64) scriptlet failed, exit status 1 non-fatal postin scriptlet failure in rpm package kmod-xnxx-1.0-1_test.x86_64 verifying : kmod-xnxx-1.0-1_test.x86_64 installed : kmod-xnxx-1.0-1_test.x86_64 complete! as rpm gets installed, runs depmod -a , dracut rebuild ramdisk. i'm not sure why these errors re occurring during anaconda post install? i've confirmed same kernel "3.10.0-327.el7.x86_64" being used during post have no idea why module doesn't installed correctly without "depmod" errors. recall past running kernel during anaconda install has differences kernel

Cordova run error - No installed build tools found. Install the Android build tools version 19.1.0 or higher -

while running cordova-run @ first time after cordova installation , configuration official guide instalattion: cordova installation guide , folloe error returned: c:\projetoscordova\lsls>cordova run --debug android_home=c:\android\tools java_home=c:\program files\java\jdk1.8.0_144 subproject path: cordovalib failed notify projectevaluationlistener.afterevaluate(), primary configuration failure takes precedence. java.lang.illegalstateexception: buildtoolsversion not specified. @ com.google.common.base.preconditions.checkstate(preconditions.java:173) @ com.android.build.gradle.baseplugin.createandroidtasks(baseplugin.java:645) @ com.android.build.gradle.baseplugin$10.call(baseplugin.java:608) @ com.android.build.gradle.baseplugin$10.call(baseplugin.java:605) @ com.android.builder.profile.threadrecorder.record(threadrecorder.java:156) @ com.android.builder.profile.threadrecorder.record(threadrecorder.java:120) build failed total time: 1.353 secs @

ebay api, change fixed price item to auction -

using site, it's possible "send item auction", is, convert fixedpriceitem chinese auction - far know, not relist item. possible using api, or way enditem additem ? you cannot change fixed price listing auction price listing, way end listing , list again using additem call . https://pages.ebay.in/help/sell/revising_restrictions.html .

java - Spring Security not using custom UserDetaisService -

i using spring security 4.2.5 , trying set simple login page using 'username' , 'password' have user login. right now, not worried whether comes in via http, or https. change setting later on. trying spring security see username/password, call userdetailsservice class, authenticate request, , redirect browser 'index.html'. problem having keep getting access denied. turned on debug logging , noticed custom userdetalsservice not being called user data. missing spring security call adminuserservice? can provide logging statements if need be. <body> <div> <div> <h2>login</h2> </div> </div> <form action="/admin/login" method="post"> login:<br> <input type="text" name="username"> <br> password:<br> <input type="text" name="password">

Angular won't load background image when added in HTML Style -

i have image path <div>{{image}}</div> gives: <div>http://my_ip/images/file.jpg</div> but when add in html style background, doesn't load! <div style="background-image: url('{{image}}')"></div> gives <div style></div> any idea what's going on here? why isn't angular rendering image background image? edit: i'm using angular 4. use directive binding syntax [ngstyle]="{'background-image': 'url('+backgroundurl+')'}" where background url link url address. documented here https://angular.io/api/common/ngstyle

Memory organization for OpenCL local memory on Nvidia GPUs -

i trying optimize opencl kernel using local memory, use on nvidia gpus. read warps , how can access local memory banks efficiently , how bank conflicts happen. 1 thing not find example of how memory allocated multiple local memory declarations. for example in opencl kernel: __kernel void computeexample(__global float* input, __global float* output, __local float* multiplier, __local float* offsets) { uint localid = get_local_id(0); multiplier[localid] = localid * 2.0f; offsets[localid] = localid + 2.0f; // compute here } this illustration, want know when declare 2 or more local memory variables, how organized in memory on nvidia cards. allocated end end 1 begins @ end of previous? or each local variable start @ first memory bank leaving possible padding between variables start on 128byte boundary (32 banks x 4 bytes per bank). order of declaration in kernel determine order

c++ - Trouble passing pointer to class object as template function parameter -

Image
i have template class, inputhandler, should take pointer either class pageone or pagetwo. calling pageone *pageone = new pageone; pagetwo *pagetwo = new pagetwo; inputhandler<pageone> handler; handler.setpage(*pageone); inputhandler header template <class t> class inputhandler { public: inputhandler(); void setpage(t page); t inpage; }; defs template <class t> void inputhandler<t>::setpage(t page) { inpage = page; } these errors i'm getting , seems syntactically correct i'm not sure what's happening. i'm running in qt if helps.

sql - How to fetch dynamic table list in MVC and angularJS -

i'm getting list in angular.js file (editdeleteitem.js) i'm making based on selected table name. the function send list below:- $scope.savetblrecord = function (list) { //alert(json.stringify($scope.employeelist)); $scope.fetchtablename(); //var data = $.param({ tbldata: $scope.mytbldatalist }); var itemlist = []; angular.foreach(list, function (value, key) { if (list[key].selected) { itemlist.push(list[key].selected); } }); $scope.itemslist = []; $scope.itemslist = itemlist; $http({ method: "post", url: "/admin/savetbldata", data: $scope.itemslist, }).success(function (data) { $scope.gettbldata($scope.tempname); }).error(function (err) { alert(err.message); }) };//savetblrecord now in controller want fetch list based on selected table name can'

css - Background not starting at top -

Image
so working on website hosted @ http://development.randomrab.com the background starts off @ top whenever have background attachment set fixed. however, background scroll. whenever set background attachment scroll, background image starts off @ center of page. in, have scroll down see background. tried changing background position top, center top, top center, , none of worked. my css code looks this: body { color: #fff; font-size: 14px; font-family: arial, tahoma, verdana; margin: 0 auto 0; padding: 0; line-height: 24px; background-color: #0c0807; background-attachment: scroll; background-image: url(images/rab_bg.png); background-repeat: no-repeat; background-position: top; } background-attachment: scroll same background-attachment: initial ( more info ). if reset background attachment , position, you'll reset background image top. can manipulate later liking. background-attachment: initial; background-position: center top; and get: in chrome: in firefox:

rust - Using a borrow as an associated trait type -

this code works: struct test { val: string, } impl test { fn mut_out(&mut self) -> &string { self.val = string::from("something"); &self.val } } however, more generic implementation not work: struct test { val: string, } trait mutateout { type out; fn mut_out(&mut self) -> self::out; } impl mutateout test { type out = &string; fn mut_out(&mut self) -> self::out { self.val = string::from("something"); &self.val } } the compiler cannot infer lifetime string borrow: error[e0106]: missing lifetime specifier --> src/main.rs:13:16 | 11 | type out = &string; | ^ expected lifetime parameter i cannot figure out way explicitly state lifetime of borrow, depends on function itself. taking inspiration deref trait , can remove reference associated type , instead note in trait want return reference associated type:

javascript - Later.js shift scheduled day based on exceptions -

i'm trying later.js shift timing of recurring schedule based on exceptions , i'm not sure how that. here can see i'm setting september 30 start date, that's saturday. since have .onweekday() modifier on there it's eliminating date others. i'd able shift closest valid date automatically. possible or know how achieve this? $(document).ready(function() { var d = new date("september 30, 2017"); later.date.localtime(); var dayofmonth = later.day.val(d); var schedule = later.parse.recur().every().month().on(dayofmonth).dayofmonth().onweekday(); var next = later.schedule(schedule).next(6); console.log(next); }); <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <script src="https://rawgit.com/bunkat/later/master/later.js"></script>

node.js - best practice for modeling local events data and querying results by user's location -

i storing live event data on backend in mongodb using mongoose , using map-based interface on frontend query events in user's area. what efficient way structure data in order query results based on user's location? my first approach create event schema location attribute , search results within r radius of user's location feel may inefficient given large database.

json.net - Convert C# DateTime to JavaScript date automatically using Json Serialization in Dot Net Core 2 WebApi -

is possible convert c# datetime fields javascript dates automatically when returning results dot net core 2.0 webapi controller call? at moment, when datetime value returned server side call, returns in format: "2013-02-01t00:00:00" i have thought possible set jsonserializer options return value converted javascript date without needing parse via secondary parser such moment. anyone know how this? you should add following line startup.cs class in configureservice function: services .addmvc() .addjsonoptions(x => x.serializersettings.dateformathandling = newtonsoft.json.dateformathandling.microsoftdateformat); then can date in json format while serialize data.

html - Why is my bootstrap navbar elements shrinking down on sm and xs size -

so have been trying fix issue last 3 hours can't figure out why elements shrinking down on small size. i tried many stuff. objective: avoid collapse of navbar hence trying customize it. want few itesm dissappear on small size. , have not other effect. shifting of element ugly thing , need in stop behavior edit: 1 thing found out there problem navbar-header. here fiddle link: https://jsfiddle.net/lhw3rdvg/1/ ... html .navbar-inverse.nav-top { height: 37px; } .navbar-inverse.nav-top ul { float:right !important; display:table; } .navbar-inverse.nav-top .navbar-top >li{ display:table-cell; font-size: 14px; } .navbar-inverse.nav-top .navbar-top >li >a{ display:table-cell; font-size: 14px; padding:5px 10px; line-height: 12px; } /**********************************/ .navbar-collapse.collapse { display: block!important; } .navbar-nav>li, .navbar-nav { float: left !important; } .nav

react native - Firebase - Saving data -

i have question regarding firebase. i'm developing app there 3 screens: ' registration screen ' user create account email , password. ' building profile screen ', user answer questions implemented in profile, (such "what's name?"). , ' profile screen ', user information displayed, such user name. on ' registration screen ' i'm having no problem, user fills in email input , password input, , clicking "create account", calling .createuserwithemailandpassword, user account created , taken ' building profile screen '. question i'm having in ' building profile screen '. question is: how can save user name , other data? read articles on subject had difficulty understanding. can of guys me this? you're going want create node or multiple nodes in firebase each user hold user-specific information. database structure uniform so: users: { uid_a: { username: 'uid_as_username',

python - Continuous read of i2c device register while not blocking user generated i2c read or write -

i've had success writing driver in python utilizing smbus module communicate i2c device, need determining best way continuously read device's registers while still allowing user generated interactions (read/write) same device. the driver i've written class specific class methods tied specific functionality of i2c device. i feel should putting each i2c read/write queue, such continuous register reads low priority, , user generated reads/writes high priority. i don't know how go this, , cannot seem put search criteria find example of similar.

java - Using if else statements with User inputs -

the if else statement won't work i've tried .equal ("1") doesn't work either double totalnum = numone + numtwo; system.out.println("enter 1 add or 2 multiply number "); double equationtype = input.nextdouble(); if (equationtype == 1)){ total = totalnum + 3.75; } else { total = totalnum * 1.25; } system.out.prinln(total); use of undeclared variable. (totalnum has capital n). totalnum not totalnum in if-else

php - Laravel Storaget get file contents -

i want know if following in code below how check if file exists e.g { $file = storage::disks('local')->get($file); // test if $file exists } there's clear example in docs , if take look. $exists = storage::disk('s3')->exists('file.jpg');

Why my MySQL DB can store Arabic characters correctly with latin1 encoding? -

test select: mysql [chuangwai]> select ar_detail items limit 1\g; *************************** 1. row *************************** ar_detail: {"طراز": "فساتين قفطان", "المواد": "الشيفون"} and can see arabic characters displayed correctly. then check encoding: mysql [chuangwai]> select * information_schema.schemata\g; *************************** 2. row *************************** catalog_name: def schema_name: chuangwai default_character_set_name: latin1 default_collation_name: latin1_swedish_ci sql_path: null in so post , balusc said: if you're trying store non-latin characters chinese, japanese, hebrew, cyrillic, etc using latin1 encoding, end mojibake. as see, not case. please give me explanation why can store arabic characters latin1 encoding? necessary switch encoding of our db latin1 uft8 ? edit: okay, found encoding of items uft8 ... mysql [chuang

sas - what the last "." after the macro variable mean -

below code create dataset exisitng datasets, end , end8 , end7 macro variables, wondering why add . @ end of macro variables? data tab4a_&end.; set mck_tab4a_&end8. mck_raw.mck_tab4a_&end7. run; the dot marks end of macro variable. used when macro text combined static text, e.g. in filename, sas knows macro variable ends. e.g.: %let year=2017; %let filename = &year._accounts.xlsx; %put &filename; produces 2017_accounts.xlsx without first dot, sas produce warning message, because looking macro variable called year_accounts . (it can't tell macro ends , text starts). if there space or end of statement after macro variable dot can omitted. including dot has no effect in case. people think include dot.

php - Wordpress is not getting the correct image thumbnail size -

so have code in functions file create custom image size: add_image_size( 'tiny_thumb', 10, 10, false ); now in template file need tiny thumb can generate base64 image url: $image = get_the_post_thumbnail_url($postid, 'tiny_thumb'); $ext = pathinfo($image, pathinfo_extension); $base64 = 'data:image/' . $ext . ';base64,' . base64_encode(file_get_contents($image)); now problem images it's getting tiny thumb, 10x10 image. others full size image used. have checked , images full size image used there 10x10 version of image. exists. anyone know why might doing this. the reason need use tiny thumb generate base64 image if uses full size image generated base64 html large size. hope make sense cheers ok figured out whats going on. images using 10x10 image size had been uploaded after new image size created(so when new post created). images associated tiny_thumb . i had used regenerate thumbnails plugin on localhost, uploaded new

php - Allowed memory size Laravel (unzipping file with Laravel) -

i'm trying unzip big file unzip big dump file , run common problem: local.error: symfony\component\debug\exception\fatalerrorexception: allowed memory size of 134217728 bytes exhausted (tried allocate 123732000 bytes) in /users/ ... i know can increase memory limit , should work, think problem in code , i'm doing wrong: public function unzip() { // unzip file // set input , output files $out = 'storage/app/dump/auct_lots_full.sql'; $in = 'storage/app/dump/auct_lots_full.sql.bz2'; // decompress file using bzip2 if (file_exists($in)) { $data = ''; $bz = bzopen($in, 'r') or die('error: cannot open input file!'); while (!feof($bz)) { $data .= bzread($bz, 4096) or die('error: cannot read input file');; } bzclose($bz); file_put_contents($out, $data) or die('error: cannot write out

r - Create a matrix of residual plots using purrr and ggplot -

Image
suppose have following dataframe: library(tidyverse) fit <- lm(speed ~ dist, data = cars) select(broom::augment(fit), .fitted:.std.resid) -> dt names(dt) <- substring(names(dt), 2) i create grid of residuals plots using purrr . example, have formulas 2 diagnostic plots far: residual <- function(model) {ggplot(model, aes(fitted, resid)) + geom_point() + geom_hline(yintercept = 0) + geom_smooth(se = false)} stdresidual <- function(model) {ggplot(model, aes(fitted, std.resid)) + geom_point() + geom_hline(yintercept = 0) + geom_smooth(se = false)} and storing formulas in list plan run against fortified dataset dt . formulas <- tibble(charts = list(residual, stdresidual)) # tibble: 2 x 1 charts <list> 1 <fun> 2 <fun> now n

backup - What are the challenges or problems in Backing up and restoring Open source softwares like openstack and kubernetes? -

i understand existing problems in field of openstack , kubernetes respect backup , restore. link or reference research related matter helpful. my usd$0.02: there several projects know of attempt backup k8s clusters @ metadata level we focus on etcd backups, since our risk wider k8s descriptors, adage goes: "they're not backups until you've tested them," (unfortunately) have not made time try one needs exercise caution because cluster state backups contain cleartext secret descriptors; backup solution needs aware of encryption or skip on descriptors

cpython - Python dequeue.remove implementation -

why python dequeue.remove() implementation rotates list -1 each iteration, 1 one? why not rotate list -i , popleft rotate i again? static pyobject * deque_remove(dequeobject *deque, pyobject *value) { py_ssize_t i, n=py_size(deque); (i=0 ; i<n ; i++) { pyobject *item = deque->leftblock->data[deque->leftindex]; int cmp = pyobject_richcomparebool(item, value, py_eq); if (py_size(deque) != n) { pyerr_setstring(pyexc_indexerror, "deque mutated during remove()."); + −return null; } if (cmp > 0) { pyobject *tgt = deque_popleft(deque, null); assert (tgt != null); if (_deque_rotate(deque, i)) return null; py_decref(tgt); py_return_none; } else if (cmp < 0) { _deque_rotate(deque, i); return null; } _deque_rotate(deque, -1); } pyerr

json - Error in retrieving metric values for SQL server data from AZURE -

Image
https://management.azure.com/subscriptions/{subscription id}/resourcegroups/{resource group}/providers/microsoft.sql/servers/{servername}/providers/microsoft.insights/metrics?api-version=2017-05-01-preview&$filter=(name.value eq 'dtu_consumption_percent' ) , starttime eq 2017-09-10 , endtime eq 2017-09-11 , timegrain eq duration'pt1h' the above url passing data sql server metrics the response getting : { "cost": 0, "timespan": "2017-09-12t03:56:27z/2017-09-12t04:56:27z", "interval": "pt1m", "value": [ { "id": "/subscriptions/{subscription id}/resourcegroups/{resource group}/providers/microsoft.sql/servers/{server name}/providers/microsoft.insights/metrics/dtu_consumption_percent", "type": "microsoft.insights/metrics", "name": { "value": "dtu_consumption_percent", "localize