Posts

Showing posts from August, 2011

predictionio - prediction io - manage or clear events -

a few questions: suppose train pio system bunch of events, find out events wrong reason, , want system ignore or delete these events next time train it. how can without deleting entire database app? the events flowing pio server add billions. have regularly delete old events system, , if so, how? run queries directly against hbase or there special pio commands that? in installation process saw pio uses both hbase , elastic search. store in elastic search? code samples helpful. thanks. i assume ask universal template. you can change engine.json , remove event types. ignored. see - eventwindow in here hbase used save events data , elasticsearch used save metadata of items. can see in configuration file pio-env.sh please note universal template version (0.3.0) requires predicitionio actionml fork version 0.9.6.

c# - How to set another value on a boolean with defaut value with Entity Framework Core? -

i got quite same problem in question : how override sql server default value constraint on boolean when inserting new entity? [closed] like him, value of boolean client controller, false, it's set true call of _context.savechanges(); because of entity framework , default value constraint in database. but : i'm using entity framework core , don't have [databasegenerated(databasegeneratedoption.computed)] annotation remove fix problem. in applicationdbcontext.cs : modelbuilder.entity<myentity>(entity => { entity.property(e => e.active).hasdefaultvaluesql("1"); //entity.property(e => e.active).hasdefaultvaluesql<bool>("1"); // doesn't fix ... } in database : create table myentity( id integer identity(1,1) not null, ... active bit not null constraint df_myentity_active default 1 ); in controller : [httppost] [validateantiforgerytoken] public async task<iactionresult> create([b...

ios10 - Associate App with Messages Extension -

i created messages extension in xcode 8 using appropriate template, seems working fine , when run extension, it's installed in messages app , can use without issues. my problem wanted create actual app associated extension (so user able search extension through messages store or install actual app through app store). gave matching bundle identifier (my extension com.xxx.testmessage.messagesextension, app set com.xxx.testmessage), when run app, doesn't install extension. is possible that? , if so, missing? in xcode8, open existing app. need add new target app (file->new->target->ios->sticker pack extension (or imessage extension if want custom messages experience)). create folder visible in project navigator. name of folder depends on name gave extension. in folder find stickers.xcassets can drop stickers.

javascript - Optimise Tick Positions To Minimise Wasted Space At Top Of Chart -

if run snippet below, notice in first chart, there lot of space wasted @ top of chart. same chart @ different element height makes better use of space. how can highcharts optimise tickpositions reduce wasted space? i've tried tweak following highcharts properties: ceiling floor min max to no avail. as sidenote, issue started affecting on upgrading v3 v4 (latest) var model1 = { "chart": {}, "xaxis": { "categories": ["2033", "2034", "2035", "2036", "2037", "2038", "2039", "2040", "2041", "2042", "2043", "2044", "2045", "2046", "2047"] }, "yaxis": [{}, { "opposite": true, }], "series": [{ "data": [0, 0, 0, 0.210042, 0.310498, 0.328766, 0.328766, 0.328766, 0.328766, 0.328766, 0.328766, 0.328766, 0.328766, 0....

java - Save jzy3d Chart in PDF using DynamicReports -

i'm using dynamicreports api create pdf report displaying results of java application (tables , charts). 1 of chart have display 3d surface plot build using jzy3d 0.9.0 . here code: import static net.sf.dynamicreports.report.builder.dynamicreports.*; import net.sf.dynamicreports.examples.templates; import net.sf.dynamicreports.examples.complex.invoice.invoicedesign; import net.sf.dynamicreports.examples.complex.sales.salesdesign; import net.sf.dynamicreports.jasper.builder.jasperreportbuilder; import net.sf.dynamicreports.report.constant.horizontalimagealignment; import net.sf.dynamicreports.report.constant.horizontaltextalignment; import net.sf.dynamicreports.report.constant.pagetype; import net.sf.dynamicreports.report.constant.verticalimagealignment; import net.sf.dynamicreports.report.constant.verticaltextalignment; import net.sf.dynamicreports.report.builder.chart.piechartbuilder; import net.sf.dynamicreports.report.builder.component.componentbuilder; import net.sf....

Can Rust optimise away the bit-wise copy during move of an object someday? -

consider snippet struct foo { dummy: [u8; 65536], } fn bar(foo: foo) { println!("{:p}", &foo) } fn main() { let o = foo { dummy: [42u8; 65536] }; println!("{:p}", &o); bar(o); } a typical result of program is 0x7fffc1239890 0x7fffc1229890 where addresses different. apparently, large array dummy has been copied, expected in compiler's move implementation. unfortunately, can have non-trivial performance impact, dummy large array. impact can force people choose passing argument reference instead, when function "consumes" argument conceptually. since foo not derive copy , object o moved. since rust forbids access of moved object, preventing bar "reuse" original object o , forcing compiler generate potentially expensive bit-wise copy? there fundamental difficulty, or see compiler someday optimise away bit-wise copy? given in rust (unlike c or c++) address of value not considered matter, ...

reporting services - SSRS conditional on Date always show error -

i'm blocked because conditional evaluating both side of statement: =iif(isnothing(fields!canceldate.value), nothing, fields!canceldate.value.tolocaltime()) i'd have empty field when canceldate has no value because of tolocaltime(), breaks. is there came across this? you can use local time conversion on conditional statement so: =iif(isnothing(fields!canceldate.value), nothing, cdate(iif(isnothing(fields!canceldate.value), nothing, fields!canceldate.value)).tolocaltime()) this simplified, works.

javascript - table-layout: fixed css not working properly with given column's width -

Image
here table structure <table id="recordingstable" style="width:900px" class="tablesorter fixed_table"> </table> css: .fixed_table{ table-layout: fixed; } populating table js: str = '' str += '<thead>' str += '<tr>' + '<th style="width:150px;text-align:left !important;border-left:0;">col 1</th>' + '<th style="width:150px;text-align:center !important">col 2</th>' + '<th style="width:300px;text-align: center !important;">col 3</th>' + '<th style="width:100px;text-align: center !important;">col 4</th>' + '<th style="width:100px;text-align: center !important;">col 5</th>' + '<th style="width:100px;text-align: center !important;">col 6</th>' + '</tr>' + '</thead><tb...

Eclipse not able to access the internet but Java programs can -

i trying eclipse able access internet can install software, eclipse can't access internet. wrote simple java program accesses internet , able run fine. able browse internet via mozilla. i trying access eclipse marketplace , giving me error: cannot open eclipse marketplace cannot install remote marketplace locations: connection failed caused problem internet connection. please check internet connection , retry. cannot complete request http://marketplace.eclipse.org/catalogs/api/p: unable connect repository http://marketplace.eclipse.org/catalogs/api/p unable connect repository http://marketplace.eclipse.org/catalogs/api/p connection timed out connection failed caused problem internet connection. please check internet connection , retry. connection timed out i tried using internal web-browser , got same issue. os: linux redhat eclipse: neon or helios there few posts similar problems on stack such here there many solutions problem , unsure os , firewall setti...

ios - Why is my interstitial ad not respecting policy? -

i created ios app simulates shaver. user turns on shaver , makes noise, user turns off shaver , noise stops , shows interstitial ad admob. there's button in center of screen switch on/off. after 3 months of earnings email google saying blocked ads reason: layout encourages accidental clicks - interstitial ads: publishers not permitted encourage users click admob interstitial ads in way. includes implementation may encourage accidental clicks, such placing interstitial ad in way prevents viewing app’s core content or placing interstitial ad in way interferes navigating or interacting app’s core content , functionality. please review how you’ve implemented interstitial ads , mindful of following common examples of non-compliant implementations: interstitial ads appear before app has opened or after app has closed. interstitial ads triggered after user closes interstitial ad. interstitial ads loading unexpectedly while user viewing app’s content....

python - x-axis not updating in for loop -

the general question have this: can use plt.axis in loop such if condition isn't met old axis limits replaced new ones? have tried below having x-axis set 0-10 first 10 iterations, set x-axis xmin xmax thereafter plot not updating properly. there missing? from time import sleep import pylab pl import matplotlib.pyplot plt temperature = [] x = list() y = list() y1 = list() dt_tol = .5 plt.ion() fig = plt.figure(1) ax1 = fig.add_subplot(211) temp_plot = plt.scatter([],[]) plt.ylabel('temperature (c)') ax2 = fig.add_subplot(212) delta_temp_plot = plt.scatter([],[],zorder = 2) plt.axhspan(-dt_tol, dt_tol, color='#87cefa', alpha=1, zorder = 1) plt.ylabel('dt') plt.xlabel('time (s)') plt.draw() # read loop in range(60): tempc = #for simplicity, can real t later temperature.append(tempc) dt = temperature[i]-temperature[i-1] x.append(i) y.append(temperature[i]) y1.append(dt) if len(x)>10: del x[0] ...

C random matrix with numbers between 0 and 9 -

i'm c newbie , i'm trying make matrix 5x4 numbers between 0 , 9 each number needs there 2 times (i'm trying make memory game). got code think quite mess , not working, question is, how can improve code or how can make matrix in different way? #include <stdio.h> #include <math.h> #include <stdlib.h> #define maxc 4 #define maxl 5 int main(){ int n1=0, n2=0, n3=0, n4=0, n5=0, n6=0, n7=0, n8=0, n9=0, n0=0; int i=0,j=0,r; int n[maxl][maxc]; srand(time(null)); while(i<5){ j=0; while(j<4){ r=(rand()%10); if(r==0 && n0<2){ n0++; j++; n[i][j]=r; printf(" %3d ",n[i][j]); } if(r==1 && n1<2){ n1++; j++; n[i][j]=r; printf(" %3d ",n[i][j]); } if(r==2 && n2<2){ ...

Android Studio Weird Warning -

after updated support library 23.1.1 23.4.0 warning cannot access android.support.v4.app.basefragmentactivityeclair on every call super , every instance of appcompatactivity and if updated support library 24.1.1 warning changes cannot access android.support.v4.app.basefragmentactivityjb . can tell me why warning shown , how can remove warning: here dependencies before: (no error in this) compile 'com.android.support:palette-v7:23.1.1' compile 'com.android.support:gridlayout-v7:23.1.1' compile 'com.android.support:support-v4:23.1.1' compile 'com.android.support:appcompat-v7:23.1.1' compile 'com.android.support:design:23.1.1' compile 'com.android.support:cardview-v7:23.1.1' here dependencies after cannot access android.support.v4.app.basefragmentactivityeclair warning: compile 'com.android.support:palette-v7:23.4.0' compile 'com.android.support:gridlayout-v7:23.4.0' compile 'com.android.support:suppo...

matrix - Bus arbitration on CAN bus -

hello have question concerning communication/arbitration on can bus. say more 1 masters on can bus want send simultaneously means 1 lowest message identifier win arbitration in end , starts send payload. others lose arbitration, switch receiving mode , wait bus free again. now question: do masters lost arbitration in previous try arbitrate bus again (i.e. when bus free)? wait next activation cycle defined in can matrix? or can defined in can matrix individually? thanks in advance, florian i don't know mean "can matrix", yes bus idle nodes allowed try again on bus starting arbitration process sending start of frame bit , can id. can not know masters or slaves. called multi-master system. every node has same rights on bus. higher layer can protocols canopen define master roler kind of network management.

compilation - C++ compiler gives unitialized variable warnings when declared in if-else statements -

i'm sure there's easy explanation this, have code this: routingtablepoolentry rtpe; routingtablepoolentry* rtpeptr; if (rtpeitr == m_rtpool.end()) { routingtableentry* routeentryptr = m_nlsr.getroutingtable() .findroutingtableentry(destrouter); if (routeentryptr == nullptr) { routingtablepoolentry rtpe(destrouter); } else { routingtablepoolentry rtpe(*routeentryptr); } routingtablepoolentry* rtpeptr = addrtpetopool(rtpe); } else { routingtablepoolentry* rtpeptr = &(rtpeitr->second); } dosomestuffwithrtpe() edit: here real code. error still variable scope? realize in example was, still problem here? tried conditional initialization of form: routingtablepoolentry rtpe(routeentryptr == nullptr? ... : ...); didn't seem cooperate either. edit #2: i'm idiot, excuse me. reason abundantly clear , wasn't seeing it. rtpe = routingtablepoolentry(destrouter) , rtpeptr = &(rtpeitr->second)...

pandas - Split Python Dataframe into multiple Dataframes (where chosen rows are the same) -

i split 1 dataframe n dataframes based on columns x , z same (as eachother column value). for example, input: df = name x y z other 0 1 1 1 1 1 b 1 1 2 2 2 c 1 2 1 3 3 d 1 2 2 4 4 e 1 1 1 5 5 f 2 1 2 6 6 g 2 2 1 7 7 h 2 2 2 8 8 2 1 1 9 9 j 2 1 2 0 would have output: df_group_0 = name x y z other 0 1 1 1 1 2 c 1 2 1 3 4 e 1 1 1 5 df_group_1 = name x y z other 1 b 1 1 2 2 3 d 1 2 2 4 df_group_2 = name x y z other 6 g 2 2 1 7 8 2 1 1 9 df_group_3 = name x y z other 7 h 2 2 2 8 9 j 2 1 2 0 is possible? groupby generates iterator of tuples first element group id, if iterate through groupers , extract second element each tuple, can list of data frames each having unique group: grouper = [g[1] g in df.groupby(['x', 'z'])] grouper[0] name x y z other 0 1 1 1 1 2 c 1 2 1 3 4 e 1 1 1 5 grouper[1] name x y z ...

networking - Android network not reconnecting when Wifi drops -

is there reason why wifi network set on android (lollipop) wouldn't automatically reconnect after router reset? network being set this: private boolean connecttonetwork(scanresult scanresult, string password, wifimanager wifimanager) { wificonfiguration wificonfig = new wificonfiguration(); string quotedssid = "\"" + scanresult.ssid + "\""; wificonfig.ssid = quotedssid; wificonfig.status = wificonfiguration.status.disabled; wificonfig.priority = 40; // dependent on security type of selected network // set security settings configuration securitytype securitytype = getsecuritytype(scanresult); if (securitytype == securitytype.open) { // no security wificonfig.allowedkeymanagement.set(wificonfiguration.keymgmt.none); wificonfig.allowedprotocols.set(wificonfiguration.protocol.rsn); wificonfig.allowedprotocols.set(wificonfiguration.protocol.wpa); wificonfig.allowedauthal...

eloquent - How to pass object in views in laravel -

i'm having set of html codes being called in foreach statement in views , i'm trying push array of object views through controller . following controller code: public function get_template($id) { $template = template::findorfail($id); $getplugin = json_decode($template->templatedata); $plugins = plugin::all(); $userid = $template->user->id; return view('nitseditor.test', ['plugins' => $plugins, 'template'=> $template, 'getplugin' => $getplugin, 'userid' => $userid]); } in views i'm calling this: @foreach($getplugin $renderer) @include('themes.' . $template->theme->name . '.plugins.' . $plugins->find($renderer)->type . '.' . $plugins->find($renderer)->id, ['content' => $plugins->find($renderer)->userplugins()->whereuserid($userid)->first()->pivot->contents]) @endforeach views or html code being genera...

sql server - Delete if record exists and Insert if record doesn't exist -

in loop, i'm writing insert , delete query following: in case if checkbox not check check if record exist & if exist delete. if doesn’t exist don’t anything. if checkbox check check if record exist & if exist don’t if doesn’t exist insert it. i need check on whether queries, subqueries execute or return error because i'm writing without wanting change database right now. for each odatagriditem in valgrid2.items chk = odatagriditem.findcontrol("checkbox1") rn = odatagriditem.findcontrol("lblrptname") rid = odatagriditem.findcontrol("lblreportid") if chk.checked = true rpti = ctype(odatagriditem.findcontrol("lblreportid"), label).text 'valsql2 = "insert companyreportlisttable(companyid, reportid) values (valcompanyid, rpti) not exists(select * companyreportlisttable reportid <> rpti , companyid <> valcompanyid , " & chk.checked & ...

regex - Grabbing a number from .JSON -

i have long list of data, in following format: [ { "id": "1234", "date/time": "2016-07-18 18:21:44", "source_address": "8011", "lat": "40.585260", "lng": "-105.084420", } ] and creating script extract values out of each line. example, if line contains "id": want able store value "1234" variable, can store in different format. here code detect "id": 'use strict'; let linereader = require('line-reader'); //.json variables input file let id; //begin creating new object console.log('var source = {'); //output file linereader.eachline('dataout.json', function (line, last) { //detect id, , print out in new format if (id =~ /^id:$/) { console.log('id: "') + console.log('",'); } //done if (last) { console.log('}'); retur...

c# - ASP.NET MVC with WEB.API and Castle Windsor container -

i have asp.net mvc application integrated castle windsor container. when added apicontroller, , tried post, got error message: "make sure controller has parameterless public constructor." advice. castle windsor integration: public class castlecontrollerfactory : defaultcontrollerfactory { public iwindsorcontainer container { get; protected set; } public castlecontrollerfactory(iwindsorcontainer container) { if (container == null) { throw new argumentexception("container"); } this.container = container; } protected override icontroller getcontrollerinstance(requestcontext requestcontext, type controllertype) { if (controllertype == null) { return null; } return container.resolve(controllertype) icontroller; } public override void releasecontroller(icontroller controller) { var disposablecontroller = ...

c# - Generate Random Password which meets Active Directory Password Policy Complexity Requirements Programmatically -

i trying setpassword forget password functionality. public string setpassword(string username, string randompassword) { string result = string.empty; principalcontext ctx = new principalcontext(contexttype.domain); userprincipal user = userprincipal.findbyidentity(ctx, username); aduser aduser = new aduser(); if (user != null) { user.setpassword(randompassword); result = "success"; } return result; } i need generate random password meets following complexity: not contain user's account name or parts of user's full name exceed 2 consecutive characters be @ least 6 characters in length contain characters 3 of following 4 categories: english uppercase characters (a through z) english lowercase characters (a through z) base 10 digits (0 through 9) non-alphabetic characters (for example, !, $, #, %) complexity requirements enforced when passwords changed or created. is there inbuilt method serves above...

Azure Webjobs System.UnauthorizedAccessException when accessing certain files inside WEBJOBS_DATA_PATH folder -

a file created through webjob in webjobs_data_path folder (resides under "d:\home\data\jobs\continuous\webjob_name\cannot_delete.file") can't deleted giving various errors based on method try access it: trying download kudu file explorer: system.unauthorizedaccessexception trying delete via ftp: 550 access denied. trying delete via powershell console: cannot remove item d:\home\data\jobs\continuous\webjob_name\cannot_delete.file: access path 'd:\home\data\jobs\continuous\webjob_name\cannot_delete.file' denied. searching process explorer, no handles turn if searching file. it happens randomly, files written , deleted often. stopping website , webjobs doesn't help. any idea on how remove locked file (or @ least find process holding lock)?

android - App is affecting "easy mode" on samsung devices -

my app generating bug on samsung devices easy mode. copy how reported. "i installed app yesterday on s7 , reason download or change quicklunch , easy mode activated. re-established setting default configuration in apps" i tried reproduce error using s7 nothing happen, working expected. have no clue how check o should start looking. thanks in advance. if error reported once: might hunt bug never able fix there. possibility high user correlates problem installing app ( because fits timing-wise ) reason different. not waste time before error has not reported x>=2 times ..

php - Migrating from one table to another -

i have 2 tables, 1 100,000 records of data , 1 "not interested" the table "businesses" has "businessid | around 10 other info columns the table "notinterested" has "businessid" , dateofcall. currently filtering out data checking if, if exists in notinterested , dateofcall less 42 days dont show in select. (code below). select * businesses postcode '" . $pcode . "%' , businesstype '%$btype%' , businessid not in (select businessid telesales.notinterested now() between dateofcall , (dateofcall + interval 42 day) ) , appointmentdate null order rand() limit 100" it fine @ first "notinterested" has around 30,000 records getting sluggish 1 letter postcodes. i have added new column bussinesses table called "notinterested" , want put date in there instead. what easyiest way migrate dateofcall "notinterested" table new column in "businesses"? im bit worried live ...

php - String from Mysql results -

im grabbing voltages database , displaying them on page code below: $separator = ''; if ($result->num_rows > 0) { while ($row = $result->fetch_assoc()) { $volt = $separator.$row['volt']; $separator = ','; echo $volt; } } this outputs following: 12.34,12.45,13.01 etc how call data outside while loop? if echo $volt outside 1 value ,12.34 example not full string? save data array : $volts = []; if ($result->num_rows > 0) { while ($row = $result->fetch_assoc()) { $volts[] = $row['volt']; } } echo implode(',',$volts); i used implode() join elements of array

rust - Consolidating cargo dependencies -

i have project has dependency (a cookie utility) has dependency on iron >= 0.3, <= 0.4 . my project has dependency on iron 0.3 (so can use router middleware hasn't yet been updated latest iron). when try compile project, cookie utility pulls 0.4 version of iron, , errors since different versions of iron being used. however, can do: cargo update -p <cookie utility> which (usually) changes package's dependency on iron match 1 using, , removes extraneous dependency on iron 0.4 . (bizarrely, have run command couple of times before updates.) apparently can't specify dependency version of dependency: set specific version of dependency of project's dependency in cargo.toml or cargo.lock . it nice if cargo guess want use single version of iron, understand why can't. however, i'm confused why cargo update -p <package> works; seems non-intuitive update dependency package. i guess first real question is: how can specify dependen...

amazon web services - Loadbalancer cannot get a good health check -

i'm confused how aws load balancers work. have pretty simple setup... i have rest based api needs exposed internet (port 80) via load balancer. want load balancer exposed internet traffic. have security group setup instance restricts direct access ipaddress testing purposes. the load balancer not ip restricted on http, has port 80 open (with listener api service on port 3001). problem load balancer cannot see instance if setup ip restrictions on instances in question. once remove restrictions on instances, health checks start working , can access service through load balancer. problem instances have ports open internet don't want. is there additional need allow load balancer access instances when using ip restrictions? one final note, health checks work fine until add instance-level ip restrictions know health check not problem. think if added load balancer's ip whitelist, work, ip dynamic , not viable purpose. don't use ip restrictions. 1...

Spring security change permitAll list of URLs at runtime -

i need change spring security configuration @ runtime use-case need maintain xml contains vanity urls , corresponding urls. need tell spring @ runtime urls newly added xml , not block access public urls. my start configuration looks this. public static string[] permit_all_urls = new string[] { "/css/**", "/js/**", "/images/**", "/healthcheck.jsp", "/healthcheck", "/healthcheck.xml", "/memberlogin.html", "/login.html","/wro/**","/*home.html", "/home.html","/auctions.html","/*auctions.html", "/upgrade-subscription", "/pages/**","/public/**", "/", "/content/**","/cms/content/**","/salelistresultallframe/**"}; @override protected void configure(httpsecurity http) throws exception { list<string> permitallurls = new arraylist<>(arrays.aslist(permit_all_urls)); ...

sql - How to do conversion on one of the cell in SSRS 2010 while values in a group? -

Image
i have 1 dataset with3 values currence, last value needs number. how can achieve while values in group? all in group i need : iif(fields!booktotal.value ="binds", number, otherwice currency) can achieved format or formatnumber? you in right track. need provide format strings. =iif(fields!booktotal.value ="binds", "#,0;(#,0)", "c") you can generate format strings setting format in textbox properties , see puts or value of format property.

c# - Changing text in textblock to italicized on MouseEnter -

i have textblock contains non-italicized text. when mouse enters textblock, text changes through use of code behind. code behind have ability change text italicized. have far: xaml: <textblock x:name="block1" background="cyan" foreground="{staticresource mybrush2}" grid.column="0" grid.row="0" height="30" horizontalalignment="center" mouseenter="textblock_mouseenter" mouseleave="textblock_mouseleave" padding="0,7,0,0" text ="hover me!" textalignment="center" width="100"/> code behind (c#): public void textblock_mouseenter(object sender, mouseeventargs e) { string blockname = ((textblock)sender).name; var block = sender textblock; if (block != null && blockname == "block1") { block.text = "yo! i'm textblock1"; } } i have looked using system.dr...

css - AngularJS scroll down initial -

Image
i have following div container: <div class="col-md-8 grid-wrapper-div chathistory"> ... </div> with css: .chat .chathistory { overflow-y:scroll; height: 550px; } and if page loaded scroll bar should @ bottom -> use angularjs. there possibility scroll down css or angularjs [edit] i have tried chathistorycontainer.scrollheight undefined. know why? use nginit, runs upon rendering content , $timeout postpone scrolling next digest cycle in order wait content rendered completely. <div id="chat_history" class="col-md-8 grid-wrapper-div chathistory" ng-init="scrolltobottom()"> ... </div> myapp .controller(function($scope, $timeout){ $scope.scrolltobottom = function() { $timeout(function(){ var objdiv = document.getelementbyid("chat_history"); objdiv.scrolltop = objdiv.scrollheight; }); }; });

Set Gradle Cache Directory? -

is possible set gradle cache directory, without having set gradle_user_home environment variable? gradle cache exist in same workspace code, seems possible bash script wrapped around gradle. to clarify, i'm talking gradle cache contains resolved dependency files. i think might useful - appendix d. gradle command line --project-cache-dir specifies project-specific cache directory. default value .gradle in root project directory. --gradle-user-home specifies gradle user home directory. default .gradle directory in user's home directory snippet of in action - tested locally: c:\dev\ws\nyssis-intellij\ear>gradle --gradle-user-home c:\dev\cache-test build build initialized use p12_2014_03_31e-windows-models.jar choicemaker model :compilejava up-to-date :compilegroovy up-to-date :pr...

sql server - Is a Data Adapter always needed? -

if have query want execute, , have no need fill data within table, necessary have data adapter purpose? no not necessary use sqldataadapter . bridge between dataset , sql server. instead can use sqlcommand - executenonquery . you can use executenonquery perform catalog operations (for example, querying structure of database or creating database objects such tables), or change data in database without using dataset executing update, insert, or delete statements. although executenonquery returns no rows, output parameters or return values mapped parameters populated data. using (sqlconnection conn = new sqlconnection( "your connection string")) { using (sqlcommand command = new sqlcommand("your sql", conn) { conn.open(); command.executenonquery(); } }

python - TensorFlow: 2 layer feed forward neural net -

i'm trying implement simple fully-connected feed-forward neural net in tensorflow (python 3 version). network has 2 inputs , 1 output, , i'm trying train output xor of 2 inputs. code follows: import numpy np import tensorflow tf sess = tf.interactivesession() inputs = tf.placeholder(tf.float32, shape = [none, 2]) desired_outputs = tf.placeholder(tf.float32, shape = [none, 1]) weights_1 = tf.variable(tf.zeros([2, 3])) biases_1 = tf.variable(tf.zeros([1, 3])) layer_1_outputs = tf.nn.sigmoid(tf.matmul(inputs, weights_1) + biases_1) weights_2 = tf.variable(tf.zeros([3, 1])) biases_2 = tf.variable(tf.zeros([1, 1])) layer_2_outputs = tf.nn.sigmoid(tf.matmul(layer_1_outputs, weights_2) + biases_2) error_function = -tf.reduce_sum(desired_outputs * tf.log(layer_2_outputs)) train_step = tf.train.gradientdescentoptimizer(0.05).minimize(error_function) sess.run(tf.initialize_all_variables()) training_inputs = [[0.0, 0.0], [0.0, 1.0], [1.0, 0.0], [1.0, 1.0]] training_outputs = ...

javascript - Chrome Extension - Sending variable from content script to event page -

i want event page variable content script sends message. far know, can send simple json message event page, such {greeting: "hello"} . how can send variable content script event page? i've looked json.stringify() send variable through json message haven't had luck. say have variable named var , directly send via chrome.runtime.sendmessage without doing anything, because the message automatically json-serialized . chrome.runtime.sendmessage({ data: var });

Xcode 6 / 7 Project, generate Class Diagram (UML) -

so lately joined company has been developing on core business application several years, has seen multiple developers on past years. in many projects there has been huge lack of documenting source code. my job organise code, find dead code, make stuff more efficient etc. because project 80+ class project appreciate class diagram give me overview of project. when search anwsers date '11 or '14 suggest use omnigraffle. have omnigraffle installed on macbook need have pro version create diagrams xcode projects. is there working tool out there on www me out, or maybe 1 omnigraffle pro license confirm functionality working? in case advise company buy pro license. thanks in advance, tom

ios - Animate a UILabel size doesn't resize the StackView that contains it -

guys... have button , vertical stackview 2 labels inside it. when tap button want decrease/increase font size smoothly using animations. the following code animation (within animation block), stackview doesn't resize self: self.trackingstatus.transform = cgaffinetransformscale(self.trackingstatus.transform, 0.5, 0.5); when use following code, stackview resize, don't think can animate property: self.trackingstatus.font = self.trackingstatus.font.fontwithsize(11.0) besides problem stackview cgaffinetransformscale makes text distorted. me 2 problems? thanks lot!

excel - VBA Match function not working with large numbers -

i made custom type, called run, , 1 of values called runmoa. stores string, 12-digit number. have array of these runs, each different moa. have sheet has column of possible moas, , i'm trying loop through array of runs , row number of run's respective moa (for finding other data in sheet). strangely, working bunch of moas, not specific ones. did playing around, , seems error caused rounding or something. example, these moas being found in column: 200630031111, 200630021593, 200630021593, but these ones aren't: 200000000443, 200000000603, 200000000444. here's code loops through values (numruns length of runs array): dim integer = 0 numruns - 1 getrun i, n, schedule, skus next here's line that's supposed store row number in variable: row = application.worksheetfunction.match(val(runs(i).runmoa), worksheets("sheet1").range(cells(2, 1), cells(n, 1))) - 1 does function have problem when numbers big? it's giving me trouble whe...

amazon web services - Disable pagination in boto -

is possible disable pagination in boto ? the cli mentions can disable paginations, example in listing datapipelines, says - > you can disable pagination providing --no-paginate argument - link however, when @ datapipelines boto docs, can't find place disable pagination. working else's code did not read api docs , assumed everythign non paginated, , easier turn on no pagination . ! specifically, want turn list_pipelines no paginated version. the cli paginates default, in boto3 have opt-in making call get_paginator or manually paginating. shouldn't have anything.

Shell Script : command not found error -

#!/bin/bash calc() { n1=$1 op=$2 n2=$3 ans=0 if [ $# -eq 3 ] $ans=$(expr $n1 $op $n2); echo "$n1 $op $n2 = $ans" return $ans else echo "needs 3 parameters!" fi return; } i googled alot still can not find error in code, know simple code please me i'm totally new , trying self study. the error line 12: 0=11: command not found thank in advance the error coming '$ans' on line $ans=$(expr $n1 $op $n2); should ans=$(expr $n1 $op $n2); the '$' evaluating variable 'ans', result instead of assigning result variable 'ans', trying assign result '0'.

oop - How to use the data generated in a specific class in another class? (in python) -

i'm new in python , in oo programming, don't know if following question makes sense (...but think it's nice way learn): i'm trying have 2 classes. 1 generates data (call datagen() ) , able process data , give me statistics (call stats() ). want put both in different py files keep cleaner , can add methods stats.py without touching datagen.py. this: in datagen.py class datagen(object): def __init__(self, number_of_samples, arg2): self.x = np.zeros([number_of_samples,1]) # etc.. def samples(self): # sampling , save in self.x in stats.py class stats(object): def __init__(self, something): # here initialize # etc.. def mean(self): # calculate mean using datagen.x now, , here comes part lost. want stats() work on data belonging instance of datagen() , don't know how link data contained in datagen.x stats , can use data every time sample datagen.samples() . i tried construct inst...

redhawksdr - REDHAWK Python component calls legacy C-code -

is there referred method of calling c-code python component? porting redhawk csh script calls c-code programs (with "main" entry points , argument lists). prefer implement csh script python component, call c-code programs. couple of notes: i'm familiar doing in swig in gnu radio. i acknowledge bigger issue of rearchitecting entire system connected sdr components, fundamental c-from-python issue remains. this interesting question. have access source code traditional "main" application? statement swig suggest do. if do, best approach may use shared library pattern discussed in section 4.9 of redhawk manual. problem either swig or shared library approach require restructuring of legacy c application shared library. if legacy form of batch processor takes in commands , data , pushes out results, may best using fork/exec paradigm. i'm making huge assumptions here, if legacy app puts output on stdout, can attach stdout pipe read in compo...

javascript - setAttribute() is setting the text of function as href value -

the title didn't make sense here's what's happening. i'm trying run onclick() function swap stylesheets visual change. way i'm doing replace() part of href value. specifically, i'm changing word white black in order change value of href styles-black.css styles-black.css. i'm doing no problem in jquery: $(".onoffswitch").click(function(){ if($('.onoffswitch-checkbox').is(':checked') == false) { $("#pagestyle").attr('href', function(i, blackcss) { return blackcss.replace('white', 'black'); }); } }); i'm no expert might inefficient i'm still trying learn. now, when try replicate using vanilla js weird results. first, here's code: document.getelementbyid("pagestyle").setattribute("href", (function(i,blackcss) { return blackcss.replace("white", "black"); })) ...

how to assign value to pointer string in C -

this question has answer here: why segmentation fault when writing string initialized “char *s” not “char s[]”? 16 answers in c language trying assign value pointer string. cannot use char array, have use pointer string. please tell how can that? i doing (code given), when run code error prompted program stopped working . #include <stdio.h> int main (void) { char *mystring = " "; int value = 1; mystring[0] = value+'0'; printf("%s\n",mystring); return 0; } you cannot modify string literal: mystring initialized point constant storage string literal. attempting modify invokes undefined behavior. use strdup() create copy of string: #include <stdio.h> #include <string.h> int main(void) { char *mystring = strdup(" "); int value = 1; mystring[0] = value + '0...