Posts

Showing posts from July, 2015

javascript - why doesnt print property file.lastModifiedDate of file? -

Image
<tr *ngfor="let file of fileslist; let i=index"> <td><input class="form-control input-sm" value="{{ file.url }}"/></td> <td>{{ file.size/1024 | round }} kb</td> <td>{{ file.lastmodifieddate }} </td> </tr> i see file has property in console log, how can print it? date pipe you, please see below: <td>{{file.lastmodifieddate | date}}</td> this format date, see link above different formats

encryption - How do I add a generated unique link into an email which will lead to an encrypted page? -

allow me better explain: company work work alongside holiday camps etc , want add link booking confirmation email take them through web page (which can accessed through unique link) sign our service. what need able have automatically generated link within email can used access page , stop random person signing happens have link. any info or suggestions welcome, jumping off point research further fantastic- cheers!

javascript - how to pass data from a form to popup form on clicking on a link in mvc -

i doing project in mvc , in have created table. works fine , need on 1 row have given link . on clicking on link have popup form data same particular column. view - students.cshtml <tr> <td style="font-weight:bold; text-align: center;"> sl no </td> <td style="font-weight:bold; text-align: center;"> name </td> <td style="font-weight:bold; text-align: center;"> div </td> <td style="font-weight:bold; text-align: center;"> <a href="@url.action("home", "admin", new { id = @item.id})"> <i class="fa fa-plus-circle" aria-hidden="true"></i> </a> </td> </tr> here problem is, how can popup form data of students.cshtml form popup form. is, sl.no, name , div on pop form. whether need write ajax script

Magento 1.7 product re-import issue -

i trying re-import simple product file in magento 1.7 after deleting these products. file importing products not visible in manage products page after re-indexing if import succesful , products showing in database not in backend, make sure required attributes set. after import can following: go catalog -> manage products . current url like: [yoursite.com]/index.php/admin/catalog_product/index/key/[your_key]/ change url [yoursite.com]/index.php/admin/catalog_product/edit/id/[product_id]/key/[your_key]/ you can find product ids in database. when enter url, can edit product , check/edit product attributes, tax class, status, etc , make sure alle required attributes set.

javascript - JS Userscript to run on Chrome new tab page -

i have simple userscript i've written tampermonkey, , i'd run on chrome new tab page. according this site there no way run userscripts on new tab page: the url of new tab page "chrome://newtab/" , chrome doesn't allow extensions inject scripts pages. but script runs fine if specify in header section // @match *://*/* to match pages. still, i'd rather code ran on new tab page, possible? nb. here's full script: chrome version 59.0.3071.115 // ==userscript== // @name hide buttons // @namespace http://tampermonkey.net/ // @version 0.1 // @description test script // @author greedo // @match *://*/* // @grant none // ==/userscript== (function(window, chrome){ "use strict"; var doc = window.document; doc.getelementbyid("mv-tiles").style.opacity = "0"; doc.getelementbyid("f").style.opacity = "0.1"; }(window, chrome));

sql server - SQL Query - Eliminating rows with logical conditions in SQL -

sql server query remove rows arithmetical logic. ms sql eg: id name varchar a1 b1 1 a1 b1 2 a2 b2 4 a2 b2 2 a3 b3 5 a3 b3 8 expected output a1 b1 1 a2 b2 2 a3 b3 5 logic: need every id , name combination, least var_char value (unfortunately not int, have cast ). please me in resolving this. tried working on many logic's nothing worked. you can use row_number below: select top (1) ties * yourtable order row_number() over(partition id, [name] order convert(int,int_value) ) --you might require convert bigint if value bigger , in varchar or can using sub query: select * ( select *, rown = row_number() over(partition id, [name] order int_value) yourtable )a a.rown = 1 output below: +----+------+-----------+ | id | name | int_value | +----+------+-----------+ | a1 | b1 | 1 | | a2 | b2 | 2 | | a3 | b3 | 5 | +----+------+-----------+ demo

SLURM doesn't recognize the commands in prolog script -

i run commands such as: ifconfig, sminfo in slurm prolog script, these commands not executed , return error: command not found , empty output if check output text file. if try commands such as: ls, hostname; working well. tried execute script manually it's working , commands: sminfo, ifconfig working well. what problem ?? my script: #!/bin/bash echo "==pre job==:" work_dir=`scontrol strong textshow job $slurm_jobid | grep ' workdir' | awk '{print $1}' | awk -f'=' '{print $2}'` sminfo_out=`sminfo` cd $work_dir echo $sminfo_out > /tmp/sminfo_out3 python check_sm.py --sm_input "$sminfo_out" the second sentence of slurm documentation on prolog , epilog scripts reads: note security reasons, these programs not have search path set. either specify qualified path names in program or set "path" environment variable so either set path explicitly @ beginning of script (run echo $path find ou

migration - Making models automatically in django? -

could please tell me there method create , migrate models automatically in django. let me explain in brief: class device1_data(models.model): created_at = models.charfield(max_length=30, null=true) longitude = models.charfield(max_length=20, null=true) latitude = models.charfield(max_length=20, null=true) similary wish same model should create device2_data. , again migrations taken place automatically. there should not necessity of running python manage.py makemigrations. is possible guys?? from comments sounds related performance concern putting data single table. describing sounds attempt @ sharding (or horizontal partitioning) single table device. see https://en.wikipedia.org/wiki/shard_(database_architecture) horizontal partitioning database design principle whereby rows of database table held separately, rather being split columns (which normalization , vertical partitioning do, differing extents). each partition forms part of shard, may in tur

pyspark - How to do a Running (Streaming) reduceByKey in Spark Streaming -

i'm using textfilestream() method in python api spark streaming read in xml files they're created, map them xml elementtree, take "interesting" items elementtree , flatmap them dictionary (key: value), reducebykey() aggregate counts each key. so, if key string network name, value might packet count. upon reducing, i'm left total packet count each network (key) in dictionary. my problem i'm having trouble streaming this. instead of keeping running total re-computes computation each time. think it's paradigmatic issue me i'm wondering if can please me stream analytic correctly, thanks! ah, solution use updatestatebykey doc allows merge results previous step data in current step. in other words, allows keep running calculation without having store entire rdd , having recompute every time data received.

How to calculate Lyapunov Exponent in R? -

i use following code calculate lyapunov exponent. cannot used calculate lyapunov exponent short time series. suggestion? # lyapunov exponent if(freq > n-10) stop("insufficient data") ly <- numeric(n-freq) for(i in 1:(n-freq)) { idx <- order(abs(x[i] - x)) idx <- idx[idx < (n-freq)] j <- idx[2] ly[i] <- log(abs((x[i+freq] - x[j+freq])/(x[i]-x[j])))/freq if(is.na(ly[i]) | ly[i]==inf | ly[i]==-inf) ly[i] <- na } lyap <- mean(ly,na.rm=true) flyap <- exp(lyap)/(1+exp(lyap))

c - What happens to initialization of static variable inside a function -

after stumbling onto this question , reading little more here (c++ issue works same in c/c++ afain) saw no mention realy happening inside function. void f(){ static int c = 0; printf("%d\n",c++); } int main(){ int = 10; while(i--) f(); return 0; } in snippet, c lifetime entire execution of program, line static int c = 0; has no meaning in next calls f() since c defined (static) variable, , assignment part obsolete (in next calls f() ), since takes place @ first time. so, compiler do? split f 2 functions - f_init, f_the_real_thing f_init initializes , f_the_real_thing prints, , calls 1 time f_init , onward, calls f_the_real_thing ? although standard not dictate how compilers must implement behavior, compilers less sophisticated thing: place c static memory segment, , tell loader place 0 c 's address. way f comes straight pre-initialized c , , proceeds printing , incrementing if declaration line not there. in c++ optionally

powershell - If/ elseif giving wrong output -

i having issues script returning correct output: $maximiser = get-childitem -path c:\windows\system32\maximiser.tsp | select name $id6 = get-itemproperty -path 'hklm:\software\microsoft\windows\currentversion\telephony\providers\' | select providerid6 $id5 = get-itemproperty -path 'hklm:\software\microsoft\windows\currentversion\telephony\providers\' | select providerid5 $id4 = get-itemproperty -path 'hklm:\software\microsoft\windows\currentversion\telephony\providers\' | select providerid4 $id3 = get-itemproperty -path 'hklm:\software\microsoft\windows\currentversion\telephony\providers\' | select providerid3 $id2 = get-itemproperty -path 'hklm:\software\microsoft\windows\currentversion\telephony\providers\' | select providerid2 $id1 = get-itemproperty -path 'hklm:\software\microsoft\windows\currentversion\telephony\providers\' | select providerid1 $id = get-itemproperty -path 'hklm:\software\microsoft\windows\currentversion\t

android - Out of memory when trying to get drawable resources from other apps -

from app trying other installed apps specific drawable resources. resource exist. use : resources resources = activity.getpackagemanager().getresourcesforapplication(packagename); int previewresid = resources.getidentifier("image", "drawable", packagename); drawable mythemepreview = resources.getdrawable(previewresid); i out of memory on last line before drawable converted bitmap , shows user you use bitmapfactory::decoderesource using bitmapfactory.options specified insamplesize reduce memory. it this: resources resources = activity.getpackagemanager().getresourcesforapplication(packagename); int previewresid = resources.getidentifier("image", "drawable", packagename); bitmapfactory.options options = new bitmapfactory.options(); options.insamplesize = 4; bitmap bitmap = bitmapfactory.decoderesource(resources,previewresid,options);

python - Normalize the Validation Set for a Neural Network in Keras -

so, understand normalization important train neural network. i understand have normalize validation- , test-set parameters training set (see e.g. discussion: https://stats.stackexchange.com/questions/77350/perform-feature-normalization-before-or-within-model-validation ) my question is: how do in keras? what i'm doing is: import numpy np keras.models import sequential keras.layers import dense keras.callbacks import earlystopping def normalize(data): mean_data = np.mean(data) std_data = np.std(data) norm_data = (data-mean_data)/std_data return norm_data input_data, targets = np.loadtxt(fname='data', delimiter=';') norm_input = normalize(input_data) model = sequential() model.add(dense(25, input_dim=20, activation='relu')) model.add(dense(1, activation='sigmoid')) model.compile(optimizer='adam', loss='binary_crossentropy', metrics=['accuracy']) early_stopping = earlystopping(monitor='val_acc

openshift - How can I set a BuildConfig Git source ref to be a GitHub pull request? -

in openshift docs git source input , says following: if ref field denotes pull request, system use git fetch operation , checkout fetch_head. however, there's no example can find of needs put ref match pull request. can't figure out should be, , each variation i've tried, error such this: error: build error: error: pathspec 'pull/128/head' did not match file(s) known git. variations i've tried: refs/pull/128/head pull/128/head pull/128 128 pr-128 origin/pr/128/head origin/pr/128/merge any appreciated, thanks! edit: updating new info based on graham's suggestion in comment : i not sure if shows or not part, set build_loglevel=9 environment variable build configuration. setting build_loglevel=9 shows following: cloning "https://github.com/<org>/<repo>" ... i0725 13:43:32.297019 1 source.go:134] git ls-remote --heads https://github.com/<org>/<repo> ... git ls-remote --heads https

javascript - Up Down arrow is not coming for firefox of tagfield component -

Image
i found 1 weird bug in extjs tag field. after using tagfild not able see up-down arrow of field see selected componet in tagfield. i created fiddler, please open fiddler in chrome , firefox , see difference. here link fiddle. fiddle red circle in image asking in firefox. can give me idea. change growmax property from 5 35 , should fixed. ext.create('ext.form.panel', { renderto: ext.getbody(), title: 'sci-fi television', height: 200, width: 300, items: [{ xtype: 'tagfield', fieldlabel: 'select show', store: shows, displayfield: 'show', valuefield: 'id', growmax : 35, querymode: 'local', filterpicklist: true, }] }); it not possible firefox draw scrollbars when size of element height smaller 34 pixels . i've tried safari , chrome macos , don't show scrollbar in example posted . you can see scrollbars in screenshot height of elem

javascript - Ajax can not send a request other than GET -

i can not. 4 days have been struggling send data ajax using different method , can not advise. create project in spring boot. have created mapped address controller @putmapping(value = "/changeemail") public boolean changeemail( @requestbody changeemaildto changeemaildto ) { system.out.println("email: " + changeemaildto.getemail()); return true; } this controller supposed accept email address sent ajaxa function changeemail() { console.log("event"); $.ajax({ type: 'put', url: '/changeemail', data: { email: $('#email').val() }, success: function (result) { console.log('function'); } }); } however, effect in console crashes me put http://localhost:8080/signin net::err_too_many_redirects send @ jquery-3.2.1.min.js:4 ajax @ jquery-3.2.1.min.js:4 changeemail @ settings.js:58 submithandler @ settings.js:52

java - H2 not creating/updating table in my Spring Boot app. Something's wrong with my Entity? -

i want keep data in h2 database making crud repository, using hibernate. i can't database store entries whatsoever. currently, i'm trying achieve during updating db making sample entry. entry looking in logs, table not created/updated/generated. why hibernate not unable create table in case? (if problem lies in structure of data) here's entity, game.java class (i've tried without @column annotations, no difference. id not auto-generated, need able enter own id everytime): @entity @table(name = "game") public class game { @id @column (name = "id") private long id; @column (name = "name") private string name; @column(name = "storyline", length = 4000) private string storyline; @column(name = "aggregated_rating") @jsonproperty("aggregated_rating") private double aggregatedrating; @column(name = "first_release_date") @jsonproperty("fi

java - need to give margin for each grid -

need give margin each grid. given below grid single view. using view in each grid here need 2dp margin between grids. when use android:layout_margin = "2dp" there occurs problem inner grids there 4dp(2dp+2dp) <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="wrap_content" android:layout_height="wrap_content" android:fitssystemwindows="true" android:orientation="vertical" android:gravity="center" android:background="#ffffff"> <imageview android:id="@+id/grid_image" android:layout_width="50dp" android:layout_gravity="center" android:layout_height="50dp" > </imageview> <textview android:id="@+id/grid_text" android:layout_gravity="cen

php - WooCommerce Get the product object from the product title -

i making code product object product title. reading product title notepad file , passing wordpress function. below function in $pval product title. $productdetail_by_title = get_page_by_title($pval, object, 'product'); print_r($productdetail_by_title); exit; product title this: 200x slopupovací pleťová rusk but not able product object. if pass statically title this: $productdetail_by_title = get_page_by_title("200x slopupovací pleťová rusk", object, 'product'); print_r($productdetail_by_title); exit; then able product object. please help. with get_page_by_title() wordpress function, not wc_product objet if it's working wp_post object. so here custom built function output wc_product object, if title matches real product title: function get_wc_product_by_title( $title ){ global $wpdb; $post_title = strval($title); $post_table = $wpdb->prefix . "posts"; $result = $wpdb->get_col("

entity framework 6 - Why do i get a 404 on some users from the same application on ASP.NET Core on IIS -

i new asp.net, iis , webapplications, maybe question quite stupid, have searched 3 days , don't :-( i have build application in asp.net core 1.1 using ef6 on full framework 4.5.2. build scratch using windows authentification. once had little bit show published site on server iis 8.5 running. site works, in our company authenticated , still is. meanwhile working on site , added new features, including novell.directory.ldap.netstandard package. because of package changed target framework 4.6. now fun part... published upgraded site on iis using exact same configuration. site works expected. 50% of users ends in 404 error , blank screen. if same users starts "old" site can use expected. has idea, problem be, or @ least how can find out going wrong exactly? btw not able debugging on server, since protected smartcard. maybe there trick debug error page on iis express? thanks in advance thoughts :-) edit: ok, found out. problem comes windows authentificatio

html - How to disable a button on an XSL stylesheet? -

i'm trying disable button via xsl stylesheet (for form on infopath 2010), don't want button change appearance or grayed out, remove click "animation" , make static. can done? i've tried messing html no effects: <button type="button" disabled>click me!</button> sample code: </input> <input title="" class="langfont" style="cursor: pointer; font-size: small; text-decoration: ; border-top: #ffffff 4.5pt; height: 33px; border-right: #ffffff 3pt solid; width: 100px; border-bottom: #ffffff 3pt solid; font-weight: bold; color: #ffffff; margin: 0px; border-left: #ffffff 3pt solid; background-color: #002060" size="9" type="button" xd:ctrlid="ctrl26" xd:xctname="button" tabindex="0"> <xsl:if test="function-available('xdxdocument:getdom')"> <xsl:attribute name="value"> <xsl:value-of select="xdxdocument:g

javascript - issue with select list not highlighting correct value in react -

Image
i have following class: class selectcategory extends component { constructor(props){ super(props); this.state = {value: props.book.category}; this.handlechange = this.handlechange.bind(this); } handlechange = (event) => { console.log('set state handle change', event.target.value) this.props.onchange(this.props.book, event.target.value) } render() { return ( <select value={this.state.value} onchange={this.handlechange} > <option value="none" disabled>move to...</option> <option value="currentlyreading">currently reading</option> <option value="wanttoread">want read</option> <option value="read">read</option> <option value="none">none</option> </select>) } } the issue have

How to build a custom connection outside of database.php in Laravel 5.4 -

i building system uses multiple databases. have custom config file using has controls in it. file not put through version control. i these databases independant of git. looking build custom connection without using config/database.php i of course remove config/database.php git want keep neat , make use of custom config file. here clientconfig.php found in /config folder <?php $clientdb = ''; if(isset($_server['server_name'])) { $apidomain = $_server['server_name']; if ( $apidomain == 'www.example.com' ) { $clientdb = 'clientdb_1'; } } return [ 'client_db' => $clientdb ]; i add connections in file found in database.php 'connections' => [ 'sqlite' => [ 'driver' => 'sqlite', 'database' => env('db_database', database_path('database.sqlite')), 'prefix' => '', ], 'mysq

amazon web services - Does reducing desired instances in (AWS::AutoScaling::AutoScalingGroup) terminates the instance without stopping it -

i have created custom ami wherein service xxx started when aws instance gets started , service xxx gets stopped when aws instance gets stopped. have wrapped ami under cloudformation's aws::autoscaling::autoscalinggroup. when new instance gets added using auto scaling group xxx service gets started on it. when reduce number of desired instances xxx not stopped. so reducing desired numinstances in autoscaling group terminates instance without stopping it? how notification stop xxx service before instance termination? yes, when auto scaling scales down/in, terminates instances (it not stop them). to react such event, can use lifecycle hooks allow perform custom actions auto scaling launches or terminates instances.

playframework - play scala return two object -

this question has answer here: no json serializer found type seq[(string, string)]. try implement implicit writes or format type 1 answer is there wey return both yields? val process = { processtemplate <- processtemplatedto.getprocesstemplate(processtemplateid) processsteps <- processtemplatedto.getprocesssteptemplates(processtemplateid) } yield (processtemplate, processsteps) process.map(p => ok(json.tojson(p))) i got error: no json serializer found type (option[models.processtemplatesmodel], seq[models.processsteptemplatesmodel]). try implement implicit writes or format type. you trying write 2-tuple (x,y) json. default there no writes available tuple i.e play framework doesn't know how convert json. you can fix providing writes, implicit val writes = new writes[(a, b)] { override def writes(o: (a, b)): jsvalue

Swift: Compiler's conversion from type to optional type -

it looks compiler automatically converts type optional type when needed, though there no inheritance relationship here. where in documentation behavior specified? func test(value: string?) { // string passed in optional string instead. print(value ?? "") } // pass actual string test(value: "test") this behaviour explicitly documented in well-hidden corner of docs folder of swift github repo. citing swift/docs/archive/langref.html [changed formatting; emphasis mine ]: types type ::= attribute-list type-function type ::= attribute-list type-array ... type-simple ::= type-optional swift has small collection of core datatypes that built compiler . user-facing datatypes defined standard library or declared user defined types. ... optional types similar constructs exist in haskell ( maybe ), boost library ( optional ), , c++14 ( optional ). type-optional ::= type-simple '?'-postfix

magento2 - Override web/template file -

can point me in right direction on how override file in web/template, it's minicart/content.html file change, i've been searching can't find out how! please check url going override template file ; magento 2: how override mini-cart default template html file? also 1 more link can follow : how override template files magento2 extension

tsql - How implement correctly MERGE for tables? Incorrect CDC result -

Image
once of day 1 local sql server doing synchronization linked server. following query using merge: merge [targetdb].[dbo].[targettable] target using (select * [remoteserver].[sourcedb].[dbo].[testtable]) source on (target.[id] = source.[id]) when matched update set target.[id] = source.[id], target.[testfieldstring] = source.[testfieldstring], target.[testfieldint] = source.[testfieldint] when not matched target insert (id, testfieldstring, testfieldint) values (id, source.testfieldstring, source.testfieldint); also on target server works cdc (change data capture). looks @ cdc statistic found transaction on update not register in cdc . following query statistics capture: select ch.*, ch.__$seqval, case ch.__$operation when 1 'delete' when 2 'insert' when 3 'prev val' else 'new val' end operation, map.tran_begin_time, map.tran_end_time [cdc].[dbo_testtable_ct] ch join [cdc].[

c# - register unitofwork in StructureMap -

i need use structuremap register interface . i need register unitofwork in structuremap . definition of unitowork methods in applicationdbcontext . how can register unitofwork ? public static void initioc() { var container = new container(_ => { _.for<iunitofwork>().use<applicationdbcontext>(new applicationdbcontext()); _.for<iuser>().use<efuserservice>(); }); // now, resolve new object instance of ifoo container.getinstance<iuser>(); } it not work . the type 'dbcontext' defined in assembly not referenced. must add reference assembly 'entityframework, version=6.0.0.0, culture=neutral, publickeytoken=19f9d7d4cc76b670'. i think confused register. have register unitofwork registering repositories. can find same problem here. dependency injection in unit of work pattern using repositories

selenium - How to ensure div tag is present in between 2 other tags -

Image
please find attached screenshot: in attached screenshot need ensure selected div tag present after <section class="hp_news"> . what logic need use this? use below code verify weather <div> tag after specific section list<webelement> ads = driver.findelements(by.xpath("//section[@class='hp_news']/following::div[@class='adunit']")); if(ads.size()>0) { system.out.println("add available"); } else { system.out.println("not available"); } use following-sibling method of xpath locate <div> based on <section> tag having class = "hp_news"

No stacktrace in Android Studio with one plus 5 -

with 1 plus 5 don't stacktraces in logcat. same mac same project nexus 6 them. happening on multiple projects guess device issue there seems nothing wrong it. as has been answered on similar question due fact viewing logcat selected process. naturally when process dies no logs. you can instead create filter based on package name , can keep getting logs after application crashes.

android - How to automatically align the height of the GridView item? -

Image
my activity has 3 elements. linearlayout, gridview , linearlayout. see picture. how make gridview items visible if there scroll on screens? p.s. sorry english. use code such layout design... <?xml version="1.0" encoding="utf-8"?> <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:orientation="vertical" android:layout_height="match_parent"> <linearlayout android:id="@+id/layouttoplay" android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@color/btn_br_color" android:gravity="center" android:layout_alignparenttop="true" android:padding="3dp"> <textview android:id

amazon web services - Down Side of Keeping Unused Platform Endpoints in AWS SNS -

to keep question short : are there down sides of keeping unused platform endpoints in aws sns? long story : we storing platform endpoints arn in database, reason need delete of them database. in situation arn stored in aws sns won't deleted. thus, these arns become inaccessible, service won't know these arns. so short version of question: there down sides of doing so?

It is Possible to set the TV remote navigation focus in EPG-GUIDE using Canvas & View Group in android -

Image
1.i developing android electronic program guide(epg) application set-top-box followed project " https://github.com/korre/android-tv-epg ." 2.i able output(design) 3.i want output focus of 1 cell & tv remote navigation travel other cells,so need set focus of corresponding cell. please advice it,

mysql - Replace entire text with part of text string SQL -

im trying update on sql db replace not sure how entire text replaced. using field in ps_product called "location" , want replace rows contains "k" "". example, have row called "k18b" , want replace row containing "k%" replaced "". i got update thinks replaces "k" , not entire row. update ps_product set location = replace(location, 'k%', '') location like('k%'). anyone can me? want result "" rows contains "k", example k18b -> "" its unclear want here possibilities come mind if want remove ks, 1k8b becoming 18b : update ps_product set location = replace(location, 'k', '') if want strip ks locations beginning k, k18b becoming 18b : update ps_product set location = replace(location, 'k', '') location 'k%' if want set blank locations beginning k, k18b becoming '' : u

typescript - Functions higher order with async and await -

compiling following lines tsc import 'core-js/shim'; import { } 'async'; the compiler quits error message: (...)/npm/node_modules/typescript/lib/lib.esnext.asynciterable.d.ts(32,11): error ts2428: declarations of 'asynciterator' must have identical type parameters. (...)/npm/node_modules/typescript/lib/lib.esnext.asynciterable.d.ts(39,31): error ts2314: generic type 'asynciterator' requires 2 type argument(s). (...)npm/node_modules/typescript/lib/lib.esnext.asynciterable.d.ts(42,44): error ts2314: generic type 'asynciterator' requires 2 type argument(s). node_modules/@types/async/index.d.ts(15,11): error ts2428: declarations of 'asynciterator' must have identical type parameters. does know going wrong? my tscongig.json json { "compileroptions": { "target": "es2015", "module": "commonjs", "sourcemap": true, "emi

python - Bokeh change quality export plot -

i trying export grid either png or svg svg option—as doc states-the plots exported multiple files. option png . (for reason if use toolbar, first plot , not other). but quality of png terrible. there option set dpi or whatever? try save graphs on official documentation, obtain poor quality. i bokeh , found nicer use other libs quality export critical me (publication purpose).

python - Speeding up django .exists() -

i have query translationstep.objects.filter(step_id=pk) . need check if object exist or not , if so, return object (or several objects). have read .exists() more fastest way it, should make 2 requests. if translationstep.objects.filter(step_id=pk).exists(): return translationstep.objects.filter(step_id=pk) else: return none how can optimise it? you shouldn't @ all. filter() return empty queryset if there no match, false in boolean context.

python - PySNMP returning different values on different machines -

a script developed on laptop runs fine there, on remote server isn't returning i'd expect. my server has output: python 2.7.5 (default, jun 17 2014, 18:11:42) [gcc 4.8.2 20140120 (red hat 4.8.2-16)] on linux2 type "help", "copyright", "credits" or "license" more information. >>> import pysnmp >>> print pysnmp.__version__ 4.2.5 >>> >>> pysnmp.entity.rfc3413.oneliner import cmdgen >>> cmdgen = cmdgen.commandgenerator() >>> >>> errorindication, errorstatus, errorindex, varbindtable = cmdgen.nextcmd( ... cmdgen.communitydata('communitystringhere'), ... cmdgen.udptransporttarget(('10.10.10.10', 161)), ... '1.3.6.1.2.1.2.2.1.2', ... lookupnames=true, lookupvalues=true) >>> ... varbindtablerow in varbindtable: ... val in varbindtablerow: ... print val ... (mibvariable(objectname(1.3.6.1.2.1.2.2.1.2.1)), oct

caching - Varnish HTTP 503 - backend sick - apache static files not cached -

we have varnish configured below: we have probe validation apache host , port, using context backend (application server / mod jk). we not using cluster , load balance configuration. backend default { .host = "127.0.0.1"; .port = "80"; .max_connections = 300; .probe = { .url = "/webapp-context/healthcheck"; .interval = 60s; .timeout = 20s; .window = 5; .threshold = 3; } .first_byte_timeout = 5s; .connect_timeout = 5s; .between_bytes_timeout = 1s; } we have varnish cache specific contexts we dont have varnish cache staticfiles (www.domain.com/staticfiles/*), because static files on documentroot (apache). sub vcl_recv { // not cache static files if ( req.url ~ "^(/staticfiles)" ) { return(pass); } // create cache if (

Error in R: Error in { : task 1 failed - "'x' must be numeric" -

getting following error in r while running glmnet regression: error in { : task 1 failed - "'x' must numeric" do need make numeric? df$x <- as.numeric(df$x)

How to define different indentation levels in the same document with Xtext formatter -

is possible format document follows, using xtext formatting? can see, test children indented 4 spaces while external children indented 2 spaces only. using xtext 2.12.0. test my_prog { device = "my_device"; param = 0; } external { path = "my_path"; file = "my_file"; } you try work custom replacers, dont know if work nested block though def dispatch void format(external model, extension iformattabledocument document) { model.regionfor.keyword("}").prepend[newline] (l : model.ids) { val region = l.regionfor.feature(mydslpackage.literals.idx__name) region.prepend[newline] val r = new abstracttextreplacer(document, region) { override createreplacements(itextreplacercontext it) { val offset = region.offset it.addreplacement(region.textregionaccess.rewriter.createreplacement(offset, 0, " ")) } }

What is stored in a boolean variable in Java ? (as per the memory, bit patterns) -

i googled , found virtual machine dependent. still in ways ? boolean type converted int there no java virtual machine instructions solely dedicated operations on boolean values. instead, expressions in java programming language operate on boolean values compiled use values of java virtual machine int data type. you can read more in javadoc

rxjs - In what order is the observable code called? -

in following code, having hard time understanding order of chained calls are: function registerdomain(casewebsiteurl) { return this._adminservice.registerdomain(casewebsiteurl.url) .concatmap(registerid => observable.interval(5000) .mergemap(() => this._adminservice.getchange(registerid)) .takewhile((info) => info.changeinfo.status.value !== 'insync') ) } registerdomain.subscribe(res => console.log('res:'+res)); i trying understand above code, having hard time understanding order. easier me understand when see more simple example this: function registerdomain() { return register() .concatmap(registerid => rx.observable.interval(5000) .mergemap(() => getchange(registerid)) .takewhile((info) => info === 'pending') ); } registerdomain().subscribe(x=>console.log(x)); function register() { return rx.observable.of("registerid");

javascript - Element value set by modal button action is not working in jquery? -

my code jquery is: (this trigger on modal button click) $(document).on('click', '.js-modal-remove-button', function () { $('#code-output').attr('da-url',"1111"); }); my code html is: <input type="hidden" name="problemcode" id="code-output" da-url=2/> problem there button in page, on button click modal opens , in modal there button contains class js-modal-remove-button on action of need set main page(on modal opening button present) da-url value just , class button , use jquery html <button class="js-modal-remove-button model_button_class"></button> jquery $(document).on('click', '.js-modal-remove-button .model_button_class', function () { $('#code-output').attr('da-url',"1111"); }); here .model_button_class class . thing you.

Bitbucket and Jenkins remote build trigger -

Image
what trying achieve trigger build bitbucket when pr created using remote trigger option in jenkins. created job in jenkins , configured trigger build remote api. in bitbucket created webhooks trigger build following url structure http://jenkins_server_ip:port/job/job-name/build?token=<t1> i getting following error <html> <head> <meta http-equiv="content-type" content="text/html;charset=utf-8"/> <title>error 403 no valid crumb included in request</title> </head> <body> <h2>http error 403</h2> <p>problem accessing /job/android-sample/build. reason: <pre> no valid crumb included in request</pre> </p> <hr> <a href="http://eclipse.org/jetty">powered jetty:// 9.4.z-snapshot</a> <hr/> </body> </html> digged internet , says need use cru

outlook - VBA to move email folders & contents -

i stumped work on script move email folder (& contents) different parent folder. folder no under parent inbox. have basic, self-taught understanding of vba. eg. thisoutlooksession/[foldera] move thisoutlooksession/inbox/[foldera] ive found lots of examples move emails not folders. thanks in advance assistance. edit: private sub importfolder() <br> ''''''''' '' assume example im not overloading code have created csv im drawing data from, opened in excel & macro running outlook ''''''''' dim xlwkb object ' workbook dim xlsht object ' worksheet set xlsht = xlwkb.worksheets(1) 'set active being first worksheet dim irow integer dim chilcol integer dim parentfoldername irow = 1 'set start row1 chilcol = 1 'set start cola 'set parent static nomination in head macros while xlsht.cells(irow, 1) <> "" 'while parent not blank if chilcol <

concatenation - Excel / DAX Averaging Issue -

Image
thank taking time @ question. dax doesn't allow durational values, in order work out average value list of durational values, i've split durations component 'hour', 'minute' , 'second' values. each of these have been averaged , concatenated of workaround. here's confusion: in excel, when divide duration-in-seconds value 86400 (and consequently format in [h]:mm:ss), individual values tally precisely (e.g. 10:49:12 derived duration-in-seconds value , individual 'hour', 'minute' , 'second' values match - 10, 49 , 12 respectively) - yet when average duration-in-seconds column, receive different value of averaging component time values , concatenating them (separated colon). i'm sure simple, i'm hoping 1 of great minds on here able put me out of misery , provide concise explanation...it's tiny mind is; sleep deprivation notwithstanding! thank in advance, rob i have no issue replicating calculat

proxy - How to change nodes in Tor -

i'm using tor proxy java appliaction have 1 issue.after ammounts of requests server application sends,i error code 429.so resolved problem using tor proxy,but still have 1 issue.everytime when 429 need restart tor can continue working.this code in torrc: # file generated tor; if edit it, comments not preserved # old torrc file renamed torrc.orig.1 or similar, , tor ignore maxcircuitdirtiness 150 datadirectory c:\users\steva\desktop\tor browser\browser\torbrowser\data\tor geoipfile c:\users\steva\desktop\tor browser\browser\torbrowser\data\tor\geoip geoipv6file c:\users\steva\desktop\tor browser\browser\torbrowser\data\tor\geoip6 how can set tor change nodes/ips while application still runnnig , don't have restart tor time? in advance

LinearLayout is getting cut off inside ScrollView Android -

i have activity in app user able vertically scroll content contained inside linearlayout in turn inside scrollview . here summary of layout xml activity looks like: <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent"> <scrollview android:layout_width="fill_parent" android:layout_height="match_parent"> <linearlayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_margin="20dip" android:orientation="vertical"> <!-- bunch of standard widgets, omitted brevity --> <!-- renders starting in textview --> <!-- content begins truncated --> <textview

java - Adding JComponent to JLabel dynamically -

i'm new in java , i'm trying draw graph dynamically in swing. the window, has show first node automatically, hard coded this: lienzo = new lienzografos(this); lienzo.setbounds(0, 0, 800, 200); lienzo.anadircirculo(0, 50, 50); pizarra.add(lienzo); pizarra white jlabel, lienzo jpanel class put nodes , arcs. anadircirculo draw node in lienzo. variable n number shows @ side of node, , 2 others x , y coordenates. to part, works perfect, run main code , have node waiting add others. if set mouse listener add new nodes each click, works fine too, can add want, , set arcs between them, not idea. i'm trying put new node, calling function public void graficarrelacion(int x, int y){ int respuesta = joptionpane.showconfirmdialog(null, "desea relacionar " + x + " con " + y + "?" ); if(respuesta == joptionpane.yes_option){ lienzo.anadircirculo(x, 400, 200); pizzara.add(lienzo); test.reva

java - How to acknowledge rabbitmq message manually using spring intergration -

i have created bean inbound channel acknowledge property manual, , chain method publishing output message , <int-amqp:inbound-channel-adapter channel="inputchannel" queue-names="input" connection-factory="connectionfactory" concurrent-consumers="1" message-converter="converter" acknowledge-mode="manual" prefetch-count="5"/> <int:chain input-channel="inputchannel" output-channel="outputchannel"> <int:transformer method = "transform" > <bean class="com.sampleconverter" /> </int:transformer> <int:service-activator method="transform"> <bean class="com.transformer" /> </int:service-activator> <int:object-to-string-transformer /> </int:chain> can please me way acknowledge messages processed manual acknowledge mode, thanks in