Posts

Showing posts from September, 2011

how to get value from textbox using typescript in angular 2 -

i beginner angular2 / typescript i'm trying numbers 2 textboxes , adding both numbers , display result using interpolation @component({ selector: 'my-app', template: `<h1>hello {{name}}</h1> <h1>{{d}}</h1> <form> <p>first number:<input type="text" id="num1"></p> <p>second number:<input type ="text1" id="num2"></p> <h1> {{result}}</h1> </form> <test-app></test-app>` }) export class appcomponent { name = 'angular'; value : number;value1 : number;result:number; constructor(value : number,value1 : number,result:number) { this.value = parsefloat ((document.getelementbyid("text") htmlinputelement).value); this.value1 = parsefloat((document.getelementbyid("text1") htmlinputelement).value); this.result=this.value+this.value1; }} html <p>first number:<

r - 2-gram and 3-gram instead of 1-gram using RWeka -

i trying extract 1-gram, 2-gram , 3-gram train corpus, using rweka ngramtokenizer function. unfortunately, getting 1-grams. there code: train_corpus # clean-up cleanset1<- tm_map(train_corpus, tolower) cleanset2<- tm_map(cleanset1, removenumbers) cleanset3<- tm_map(cleanset2, removewords, stopwords("english")) cleanset4<- tm_map(cleanset3, removepunctuation) cleanset5<- tm_map(cleanset4, stemdocument, language="english") cleanset6<- tm_map(cleanset5, stripwhitespace) # 1-gram ngramtokenizer1 <- function(x) ngramtokenizer(x, weka_control(min = 1, max = 1)) train_dtm_tf_1g <- documenttermmatrix(cleanset6, control=list(tokenize=ngramtokenizer1)) dim(train_dtm_tf_1g) [1] 5905 15322 # 2-gram ngramtokenizer2 <- function(x) ngramtokenizer(x, weka_control(min = 2, max = 2)) train_dtm_tf_2g <- documenttermmatrix(cleanset6, control=list(tokenize=ngramtokenizer2)) dim(train_dtm_tf_2g) [1] 5905 15322 # 3-gram ngramtokenizer3 <- functi

How would I delete duplicate data from two tables in Oracle SQL Developer -

my first table has columns id, invdate , invnumber values: (1, 01/10/13, 1) (2, 02/10/13, 2) (2, 02/10/13, 2) (3, 03/10/13, 3) (4, 04/10/13, 4) (4, 05/10/13, 4) my second table b has columns id, dateofbirth, lastname, firstname values: (1, 19/06/1997, fox, migan) (2, 30/07/1993, todd, james) (2, 30/07/1993, todd, james) (3, 1/08/1994, xi, ji) (4, 2/07/1992, fared, bob) (4, 2/07/1992, fared, bob) how use delete () function delete duplicated rows in both tables? think should merge tables somehow delete duplicated rows not sure. as results, select * should give: (1, 01/10/13, 1) (2, 02/10/13, 2) (3, 03/10/13, 3) (4, 04/10/13, 4) select * b; should give: (1, 19/06/1997, fox, migan) (2, 30/07/1993, todd, james) (3, 1/08/1994, xi, ji) (4, 2/07/1992, fared, bob) update (solution) : delete rowid>(select min(rowid) b a.id= b.id); can explain sql me? below example "b" table taken here http://www.dba-oracle.com/t_delete_duplicate_table_row

java - SharedPreferences file in Android -

i wonder know if possible modify sharedpreferences' xml file external. if in game use sharedpreferences save score, possible user, searching xml file in app directory, can modify score simple text editor, app read wrong value? in advance :) bro don't worry. these files saves on users google drive associated there google play account privately. no 1 can access it. if the user uninstalls app devices, there always. when users re-install app, fetch data.

ios - CollectionView dataSource not working when using UICollectionViewController, but works when using UIViewController with a CollectionView -

i subclassing uicollectionview , , taking care of datasource . assign datasource self during init phase of collectionview. import foundation import uikit class collectionviewsubclass: uicollectionview, uicollectionviewdatasource { public override init(frame: cgrect, collectionviewlayout layout: uicollectionviewlayout) { super.init(frame: frame, collectionviewlayout: layout) datasource = self } public required init?(coder adecoder: nscoder) { super.init(coder: adecoder) datasource = self } public func collectionview(_ collectionview: uicollectionview, numberofitemsinsection section: int) -> int { // called first case, not second return 1 } public func collectionview(_ collectionview: uicollectionview, cellforitemat indexpath: indexpath) -> uicollectionviewcell { // called first case, not second return uicollectionviewcell() } } case 1: when use collectionviewsubclass

session - CQ 5.6.1 getWorkflowSession cause Uncaught Throwable java.lang.NullPointerException -

at com.cuso.mao.doget(mao.java:97) @ org.apache.sling.api.servlets.slingsafemethodsservlet.mayservice(slingsafemethodsservlet.java:268) @ org.apache.sling.api.servlets.slingsafemethodsservlet.service(slingsafemethodsservlet.java:344) @ org.apache.sling.api.servlets.slingsafemethodsservlet.service(slingsafemethodsservlet.java:375) @ org.apache.sling.engine.impl.request.requestdata.service(requestdata.java:508) @ org.apache.sling.engine.impl.filter.slingcomponentfilterchain.render(slingcomponentfilterchain.java:45) @ org.apache.sling.engine.impl.filter.abstractslingfilterchain.dofilter(abstractslingfilterchain.java:64) @ com.day.cq.wcm.core.impl.wcmdebugfilter.dofilter(wcmdebugfilter.java:146) @ org.apache.sling.engine.impl.filter.abstractslingfilterchain.dofilter(abstractslingfilterchain.java:60) @ com.day.cq.wcm.core.impl.wcmcomponentfilter.filterrootinclude(wcmcomponentfilter.java:356) @ com.day.cq.wcm.core.impl.wcmcomponentfilter.dofilter(w

trigonometry - C++ Class Variable not updating -

i'm trying code counter class made in c++. i'm passing amount of time, deltat, method of wake class, adds onto value stored variable in class. code is: void checkplayerwakes(int deltat){ for(size_t = 0; < game.getplayer().getwakes().size(); i++){ wake& w = game.getplayer().getwakes().at(i); w.age(deltat); } } however, timer meant increasing, remaining @ 0. code change timer is: void wake::age(int millis) { cout << "updating : " << currentlife; this->currentlife += millis; setalpha(((double)currentlife)/((double)lifetime)); cout << " " << currentlife << endl; } e.g. first current life: 0 second current life: 16 i know if use wake w = w.age(deltat) it wouldn't work because "w" copy of object. however, that's not problem here? game.getplayer() returns reference, playership&. last time had similar problem, solved calling , returning refere

Efficient MySQL Query Method to avoid multiple OR statement -

i quite new queries , know if there easier solution query working on. for instance want data x 5,7,9,11,13,15 , 17. i have query below; select * abc x = 5 or x = 7 or x = 9 or x = 11 or x = 13 or x = 15 or x = 17; is okay use query or there other simpler , efficient solution? edit does affect perfomance when use x=[5,7,8,11,13,15,17] vs x=[5,11,7,15,8,17,13] x id of category instance. this shorter performs equally select * abc x in (5,7,9,11,13,15,17) but remember if 1 entry in in clause null returns false.

Handling Enums with FlowType -

Image
export type size = | 'small' | 'medium' | 'large' | 'big' | 'huge'; defining size type gives me auto-completion in ide wherever use it: yet, want make use of these values inside of component: let's dropdown menu w/ available size values. in order achieve maintaining sizes object out of can extract size flowtype leveraging $keys : export const sizes = { small: 'small', medium: 'medium', large: 'large', big: 'big', huge: 'huge', }; export type size = $keys<typeof sizes>; it kind of works in points out invalid values prop: yet, solution comes @ cost: screws auto-completion goodness ... :( there better way handle enums in flowtype?

How to compile a java file from java program in Heroku -

i'm getting error picked java_tool_options: -xmx350m -xss512k -dfile.encoding=utf-8 while compiling java file programmatically via java program on heroku. it's working fine on ec2 , windows. i'm executing javac testclass through java processbuilder. know why i'm getting error on heroku , solution it? this not error. message jvm letting know it's using java_tool_options environment variable, heroku sets automatically based on dyno size.

r - How to copy values from data.frames with different length? -

i'm trying extract specific values 1 data.frame another. frames have different length similar names (i.e. 'a'::'z' , 'a'::'w' ) names <- letters[1:26] df1 <- data.frame("name" = names[1:20],"value" = rnorm(20, mean = 4, sd = 1)) df2 <- data.frame("name" = names[1:26],"value" = rnorm(26, mean = 4, sd = 1)) df2$value2 <- df1[df2$name %in% df1$name,]$value the last line above not work produces following error: error in `$<-.data.frame`(`*tmp*`, "value2", value = c(4.21005563122984, : replacement has 20 rows, data has 24 any suggestions how produce this: name value value2 1 4.210056 5.918197 2 b 3.203976 4.485109 3 c 4.290336 4.210056 ...... 25 y 5.918197 na 26 z 3.861640 na df2$value2[df2$name %in% df1$name] <- df1$value

android - Starting new fragment from mainactivity -

i read lot of questions here, didn't proper solution problem. have mainactivity java class, , have several activities in app. now, created "tabbed activity" automatically in android studio. have imagebutton use opening new fragment. new fragment called "generaldiscription". learned, fragment can't started activity, need use fragmentmanagener fragment open. app starts, when click on imagebutton, fragment should start, app crashes. in following, can see mainactivity.java, , fragments java , xml. thank in anticipation. mainactivity.java public class mainactivity extends appcompatactivity implements navigationview.onnavigationitemselectedlistener { @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); toolbar toolbar = (toolbar) findviewbyid(r.id.toolbar); final imagebutton generaldiscriptionbutton = (imagebutton) findviewbyid(r.id.imagebutton);

Is there a way to change Kibana's default data path -

kibana being installed, i'm trying configure correctly. have question : there way modify kibana's default data path. example, can modify log path changing logging.dest var value within file "/etc/kibana/kibana.yml" file doesn't contain var changing data path. looked within official documentation found nothing... in meantime, if have advices concerning kibana's installation , configuring, i'm totally listening... thank answers :) data_path=/data /opt/kibana-5.2.0/bin/kibana

Keeping the last entry but removing other duplicate row(s) in a data frame using R -

Image
i have large table containing thousands of entries queried database having structure similar in table 1 in image below. keep duplicate row has highest value var 1, shown in table 2. situation similar described in earlier query in forum remove duplicates based on 1 column , keep last entry . selecting rows using simple for loop works but, taking long time run. there faster elegant way of handling in r? table1 <- structure(list(var1 = 1001:1009, var2 = c("aaa", "bbb", "ccc", "aaa", "ddd", "bbb", "aaa", "eee", "ddd"), var3 = c(95l, 100l, 90l, 95l, 85l, 100l, 95l, 45l, 85l), var4 = c("mg", "kg", "pg", "mg", "mg", "kg", "mg", "mg", "mg")), .names = c("var1", "var2", "var3", "var4"), class = c("tbl_df", "tbl", "data.frame"), row.nam

override - Show customer groups in my account smarty template prestashop 1.6 -

i want show customer groups in account smarty template.that why need add smarty variable template. wanted override frontcontroller.php , use function available in think doing wrong code in prestashop 1.6. public function init() { parent::init(); self::$smarty->assign('customergroups', parent::getcurrentcustomergroups()); }

ios - CollectionView Cell gets shifted to right after horizontal Scrolling -

Image
i have collectionview cell of same size of collectionview i.e. 1 cell @ time displayed on screen , want minimum separation of 10 between cells, problem when scroll cell cells aren't fitting whole screen, , shifting of cell increased after every scroll. (check screenshots better understanding) i assume have set pagingenabled collection view. inherits property uiscrollview (because uicollectionview subclass of uiscrollview ). the problem collection view uses own width (320 points in post) width of page. each of cells same width collection view, have 10 point “gutter” between cells. means distance left edge of cell 0 left edge of cell 1 320 + 10 = 330 points. when scroll show cell 1, collection view stops scrolling @ offset 320 (its own width), cell 1 starts @ offset 330. the easiest fix turn off pagingenabled , implement paging overriding scrollviewwillenddragging(_:withvelocity:targetcontentoffset:) in collection view delegate, this: override func scrol

matlab - Solving a double integral equation for a third variable -

Image
i've been trying solve double integral equation third variable in matlab. an example: at first, tried solve symbolically (when k=1) below: syms x y h f = @(x,y,h) 2*x*y+4*h; f = @(x) x/2; solve(int(int(f(x,y,h)*f(x),x,0,3)*f(y),y,0,1)-3, h) the code gives right answer, i.e. h=2/3 when k=1. for real problem, however, functions f , f more complex. , when applied same code above complex f , f, matlab not solve in appropriate time. not know if ever solves - have let code run 30 mins , forced terminate. i'll have pursue further route now, i'm trying solve numerically. code below have tried: f = @(x,y,h) 2.*x.*y+4.*h; f = @(x) x./2; g1 = @(y,h) integral(@(x) f(x,y,h).*f(x),0,3) g2 = @(h) integral(@(y) g1(y,h).*f(y),0,1)-3 bsolve = fsolve(g2,0) why code give me wrong answer of 0.5833? from documentation integral : for scalar-valued problems function y = fun(x) must accept vector argument x , return vector result y , integrand function

python - Regex match numbers with commas and points -

i match integers , floats using re module. if types 1 of following input types, should validate number: - 1000 - 1.000 - 1,000 - ($1,000.98) - -1.000 - 1.0 - $1,0000 right using following: "^[-+]?[0-9]+$" any appreciated for given input regex should work: ^(?:[+-]|\()?\$?\d+(?:,\d+)*(?:\.\d+)?\)?$ regex demo breakup: ^ - start (?: - start non-capturing group [+-] - match + or - | - or \( - match ( )? - end non-capturing group (optional) \$? - match $ (optional) \d+ - match 1 or more digits (?: - start non-capturing group , - match comma \d+ - match 1 or more digits )* - end non-capturing group (zero or more occurrence) (?: - start non-capturing group \. - match dot \d+ - match 1 or more digits )? - end non-capturing group (optional) \)? - match literal ) (optional) in end $ - end

mysql - How to check input value in a SQL query using CASE-WHEN -

i want create query insert data, 1 of field's data selected table based on value of input field. i got fields : receiver , receiver_type etc. receiver value id 1 of 2 tables users or admins . i created query like: insert nots (receiver,receiver_type,...) values ( case @receiver_type when 1 (select id admins username=@param) when 2 (select id users username=@param) end , 1, ...) does sql offer input value checking, , if yes how write query?

I am attempting to code a card game in Python and want to place an image, but the image wont appear on the canvas in Tkinter -

from tkinter import * frame = tk() frame.geometry("1200x900") w = canvas(frame,width=250,height=450) w.place(x=30,y=300) img=photoimage(file="card2.ppm") w.create_image(100,100,anchor=nw,image=img) frame.mainloop() the photoimage class can read gif , pgm/ppm images files: photo = photoimage(file="image.gif") photo = photoimage(file="lenna.pgm") the photoimage can read base64-encoded gif files strings. can use embed images in python source code (use functions in base64 module convert binary data base64-encoded strings): photo = """ r0lgoddheaaqaicaaaaaaaebaqicagmdawqebaufbqy gbgchbwgicakjcqokcgslcwwmda0ndq4o dg8pdxaqebererisehmtexqufbuvfrywfhcxfxgygbkz groaghsbgxwchb0dhr4ehh8fhyagiceh ... afjhtq1bap/i/gpwry4aap/yatj77x+af4abawdwrzaaap8s /j3dwcafwaa/jsm4j/lfwd+/qma 4b8aap9ci/4holtpfwd+qv4nohvaads= """ photo = photoimage(data=photo) if need work other file formats, pyth

system verilog - In systemverilog, is it possible to conditionalize a parameterized type? -

in systemverilog, can conditionalize parameterized type? i want like: parameter is_r = 0, parameter type id_t = is_r ? r_t : d_t my lint program not this, ideas? illegal? no cannot this. systemverilog lrm allows 2 operations type parameters - assignment , equality. try using generate construct, code using conditional type has inside generated block.

sql server - Sql Update - Ambiguous column name -

i have below query update field sku of table o field autosku of table p. , running give me error: "ambiguous column name 'sku'". know problem because engine doesn't know sku talking in condition. need condition make sure each update row mapped correctly. replacing sku o.sku give error "the multi-part identifier "o..sku" not bound.". ideas? update o set sku = p.autosku o (nolock) join (nolock) on a.sku = o.sku join p (nolock) on p.code = a.productcode o.sku <> p.autosku , sku = a.sku it's due last line - and sku = a.sku need alias first sku column, below: update o set sku = p.autosku o (nolock) join (nolock) on a.sku = o.sku join p (nolock) on p.code = a.productcode o.sku <> p.autosku , o.sku = a.sku -- bit redundant although @gordonlinoff mentioned, don't need condition in where clause, since have in on clause.

arrays - PHP: "Notice: Undefined variable", "Notice: Undefined index", and "Notice: Undefined offset" -

i running php script, , keep getting errors like: notice: undefined variable: my_variable_name in c:\wamp\www\mypath\index.php on line 10 notice: undefined index: my_index c:\wamp\www\mypath\index.php on line 11 line 10 , 11 looks this: echo "my variable value is: " . $my_variable_name; echo "my index value is: " . $my_array["my_index"]; what these errors mean? why appear of sudden? used use script years , i've never had problem. what need fix them? this general reference question people link duplicate, instead of having explain issue on , on again. feel necessary because real-world answers on issue specific. related meta discussion: what can done repetitive questions? do “reference questions” make sense? notice: undefined variable from vast wisdom of php manual : relying on default value of uninitialized variable problematic in case of including 1 file uses same variable name. majo

javascript - Classes is making image load under all results in while loop -

here loading image below submit button being displayed on results in while loop when click on of submit button generated while loop. should displayed below clicked button only. know happening because have used classes here. think should use unique ids here result gets displayed below particular clicked button only. not sure how accomplish this. or should use other method here? please have look. <?php while($a = $stmt->fetch()){ extract($a); ?> <form method="post" action=""> <input type="hidden" value="<?php echo $mbs_id; ?>" class="memid"> <select class="validity" class="upgrade-valsel"> <?php while($mv = $mval->fetch()){ extract($mv); ?> <option value="<?php echo $mv_id; ?>"><?php echo $mv_validity; if($mv_validity == 1){ echo " month"; }else{ echo " months"; } ?></option

c# - How do I edit the Workflow.PropertyInspectorview? -

Image
i'm beginner , rehosting workflow designer , got problem workflowdesigner.propertyinspectorview. i'm using own execution engine. my custom activities have 2 type of attributes on properties. [bdtparmin] input properties , [bdtparmout] output. want separate them in 2 different groups, propertyinspectorview group them under misc. how edit propertyinspectorview separate them out. here image: file output property, cannot identified user. i have solved issue adding attribute properties. named "categoryattribute" , present in system.componentmodel. have found attribute named displaynameattribute present in system.componentmodel change display name of properties passing string it. 'servicename' 'service name' image here

jquery - Dynamically change input names when appending to an existing div -

i have form in need add new inputs based on user interaction. when page loads, form looks this: <li class="basic"> <h4 class="secondary-title" style="margin-top: 0px;">specifications</h4> <span style="float: right; margin-top: -40px;"><a href="#" class="add_specification_group"><i class="fa fa-plus-circle"></i> add group</a></span> </li> <li id="specifications"> <div class="specification_group" style="margin-bottom: 20px;"> <div class="label"> specification group </div> <input name="specification_group_title1[]" type="text" class="short" placeholder="group title" value=""> <a href="#" class="add_specification_group_field"><i class="fa fa-plu

c++ - Compile multiplay files - cannot specify -o when generating multiple output files -

i have problem "cannot specify -o when generating multiple output files" using atom ide gpp-compiler on macos 10.12.1 , error when try compile multiplay files (main.cpp, test.cpp , test.h) happy if can me understand happen , how can fix that. thanks.

ios - undeclared type 'NSPersistenContainer' -

i'm insert in xcode project (swift 2.2 , xcode 7.2.1) code appdelegate file coredata. lazy var persistentcontainer: nspersistentcontainer = { /* persistent container application. implementation creates , returns container, having loaded store application it. property optional since there legitimate error conditions cause creation of store fail. */ let container = nspersistentcontainer(name: "arduinohomekit") container.loadpersistentstores(completionhandler: { (storedescription, error) in if let error = error nserror? { // replace implementation code handle error appropriately. // fatalerror() causes application generate crash log , terminate. should not use function in shipping application, although may useful during development. /* typical reasons error here include: * parent directory not exist, cannot

sql - Getting rows with the highest SELECT COUNT from groups within a resultset -

i have sqlite database contains parsed apache log lines. a simplified version of db's table (accesses) looks this: |referrer|datestamp| +--------+---------+ |xy.de | 20170414| |ab.at | 20170414| |xy.de | 20170414| |xy.de | 20170414| |12.com | 20170413| |12.com | 20170413| |xy.de | 20170413| |12.com | 20170413| |12.com | 20170412| |xy.de | 20170412| |12.com | 20170412| |12.com | 20170412| |ab.at | 20170412| |ab.at | 20170412| |12.com | 20170412| +--------+---------+ i trying retrieve top referrer each day performing sub query select count on referrer. afterwards select entries subquery have highest count: select datestamp, referrer, count(*) accesses datestamp between '20170414' , '20170414' group referrer having count(*) = (select max(anz) (select count(*) anz accesses datestamp between '20170414' , '20170414' group refe

node.js - Node + Express: loadtest causing the application to quit with Error: accept ENFILE -

my app quits @ relatively low stress point when run load test on it. testing use npm package loadtest . i run test @ 1000 requests per second 10 concurrency 10 seconds. loadtest http://localhost:3000/my/api -t 10 -c 10 --rps 1000 the application quits after 2 seconds , gives following error not useful. events.js:163 throw er; // unhandled 'error' event ^ error: accept enfile @ exports._errnoexception (util.js:1050:11) @ tcp.onconnection (net.js:1462:24) apparently, related number of open files. tried command ulimit -n <number> doesn't help. it's limited @ 9999 (i can't set above that). the application can handle around 400rps @ 10 concurrencies. my local machine mac os sierra, cpu: 1.6ghz, ram: 8gb. macos sets rather low kernel limits on allowed number of open file descriptors (both in total , per process). had check on wife's mac, , default per-process limit 10240, spot on being limited using ulimit ( uli

erd - Specialization of a Weak Entity in ER Diagram Modeling -

i've been making erd quite times but, encountered unique case follows*: every account may registration every registration requires acceptance period every registration requires @ least 1 program or more there 2 kinds of registration , uui registration , semas ui registration . registration can either uui registration or semas ui registration can't both (disjoint) semas ui registrasion must either semas s1 registration , semas s2 registration or semas s3 registration (disjoint). uui registration , semas s1 registration records registrant prior school semas s2 registration , semas s3 registration records registrant prior university from description know registration weak entity cannot exist without account , acceptance period , program . registration has specializations here. so question is: am allowed model uui registration , semas ui registration subclasses of registration weak entity? if allowed, how model them? weak entities or stro

wix.com - How to create automatic e mail notification when contacting someone via a web pages forum -

we have web page integrated forum. it´s helping conect people each other. try figure out how make person beeing contacted, send automatic e mail notification contacted. work geolocalizacion, can find different persons , located. ideas e mauil notification system in case writing of map in forum ? check out https://support.wix.com/en/article/customizing-notifications-in-wix-forum always use website's documentation site asking questions or reading articles answers. have tutorials on site. you have tell them enable it. can't have automatically email. wix doesn't allow that.

swift - Button to upload integer to Firebase database IOS -

when button pressed, need save rating of item in database. while slider works , variable 'currentvalue' works, have unable rating submitted database though crashes app. if i've made simple mistake, let me know. import uikit import fbsdkcorekit import fbsdkloginkit import firebasedatabase class secondviewcontroller: uiviewcontroller { var ref:firdatabasereference! @iboutlet weak var sliderlabel: uilabel! @iboutlet weak var verticalslider: uislider! { didset{ verticalslider.transform = cgaffinetransform(rotationangle: cgfloat(-m_pi_2)) } } @ibaction func verticalsliderchanged(_ sender: uislider) { var currentvalue = int(sender.value); sliderlabel?.text = "\(currentvalue)" } @ibaction func checkmarkbuttonpressed(_ sender: any) { let img:uiimageview = uiimageview(frame: cgrect(x: 30, y: 180, width: 250, height: 320)) let randomimage = arc4random() if (randomimage % 4

mysql - Best practice for storing secret in app.yaml -

i'm deploying node.js app on gae connects cloud sql. following docs , i'm told store user/password database inside app.yaml: env_variables: mysql_user: your_user mysql_password: your_password mysql_database: your_database # e.g. my-awesome-project:us-central1:my-cloud-sql-instance instance_connection_name: your_instance_connection_name is place store password? yes. same. there not difference in storing credentials in environment variables or file. storing them in file, found more convenient (through totally subjective). in terms of security concerns, can play file permissions. can create user run app, , grant read access user.

javascript - kendo ui treemap: no capacity for zoom/drill-down? -

does kendo ui treemap widget have capacity zooming , drill-down way d3 treemaps can? a static kendo ui treemap: http://demos.telerik.com/kendo-ui/treemap/index zoom-able d3 treemaps: https://bost.ocks.org/mike/treemap/ http://bl.ocks.org/ganeshv/6a8e9ada3ab7f2d88022 i don't believe kendo treemap widget out of box. not expose event handling tile clicks. in theory build functionality yourself. you'd have use template property create custom tile markup, make tiles clickable. use dataitem method, or own logic, reference selected data. apply filter treemap's datasource, drills data down. , you'll have rebind the treemap. of not snazzy zoom-in animation d3 shows when click.

python - Django : how to delete file record after user close his page? -

i'm making simple file resizer django, there 3 fields, email , size , image . after user arrives last view can download resized, i'd django erase image of imagefield save space on django project whenever user close window final view page. i want keep email , size is , these things shouldn't deleted. i have no idea search, looked stackoverflows posts , in django google groups articles not find me, suggestion on how can done ? https://developer.mozilla.org/en-us/docs/web/api/windoweventhandlers/onunload - can try using method handle browser close tab js , send request django. but in place prefer timeout after images resized time ago removed (it can done simple cron script, possibly management command).

c# - Is not checking key existence in a static dictionary thread-safe? Resharper thinks it's not -

resharper suggests wrapping return dic.contains("v1"); in lock statement saying " the field used inside synchronized block , used without synchronization ": public class myclass { private static dictionary<string, string> _dic = new dictionary<string, string>(); protected bool v1exist() { return dic.contains("v1"); } } however not see why lock needed in example. looks safe-thread me. please advise it's known dictionary not thread-safe, should synchronize both writes , reads. if want specific example of can go wrong - consider small application: static void main(string[] args) { var dict = new dictionary<int, int>(); dict.add(0, 0); new thread(() => { (int = 1; < int.maxvalue; i++) { lock (dict) { dict.add(i, i); dict.remove(i); } } }).start(); new thread(() => { while (

html - Use CSS selector to change div class at pair of 2 elements -

i tried using css select collection of divs in pairs of 2 @ 2. example: i have aa aa aa aa aa aa using selector need change css of 2 elements in step of 2 (a , b letter div): aa bb aa bb aa bb i'm trying &:nth-child(3n+3) but without success. help? if understood correct, need 2 rules that div { display: inline-block; } div:nth-child(4n+3), div:nth-child(4n+4) { color: red; } <div>a</div><div>a</div> <div>a</div><div>a</div> <div>a</div><div>a</div> <div>a</div><div>a</div> <div>a</div><div>a</div> <div>a</div><div>a</div>

download - Archive button in R shiny, activate only once -

i have following code runs perfectly!. however, want restrict archiving of data pushing "export all" button once per day. tried use if statements , not successful. fact code running on shiny-server pro , different browser sessions created. suggestions?. library(shiny) library(shinybs) library(xlconnect) library(lubridate) cdata <- ' candidate,party,province,age,gender "l, l",ndp,quebec,22,female "m, m",bloc quebecois,quebec,43,female "m, s",bloc quebecois,quebec,34,female "s, d",ndp,quebec,,female "s, l",ndp,quebec,72,female "f, h",liberal,british columbia,71,female "t, n",ndp,quebec,70,female "s, j",liberal,ontario,68,female "r, francine",ndp,quebec,67,female "d, patricia",conservative,ontario,66,female "s, joy",conservative,manitoba,65,female "w, alice",conservative,british columbia,64,female "o, tilly",conservative,new brunswic

php - Wordpress settings page options not updating backend -

i'm developing wordpress plugin, , have been basing admin page development off of codex's custom settings page example . have been unable update setting in wp_options db, , can't seem find explanation i've done wrong. when click 'save settings', page refreshes , bar pops @ top saying settings saved properly, nothing shows in wp_options, , text input box isn't populated updated value. here's have: admin init section: function secg_settings_init() { register_setting( 'secg', 'secg_options' ); add_settings_section( 'secg_section_developers', __( 'api keys.', 'secg' ), 'secg_section_developers_cb', 'secg' ); add_settings_field( 'secg_field_test_secret_key', __( 'test-secret-key', 'secg' ), 'secg_field_test_secret_key_cb', 'secg', 'secg_section_developers',

powershell - How to rename a file under an unknown directory, using another directory's name -

i need rename file (or copy new name) based on directory name, under unknown directory name. i have numerous dated folders, sub-directories. under each sub-directory, file named index.txt . txt file needs renamed or copied name of directory above it. name of each of sub-directories known can used in script if necessary. for example: >tree c:\test /f c:\test ├───20170414124512 │ ├───directory1 │ │ index.txt │ │ │ ├───directory2 │ │ index.txt │ │ │ └───directory3 │ index.txt │ └───20170414134345 ├───directory1 │ index.txt │ ├───directory2 │ index.txt │ └───directory3 index.txt i need end result this: c:\test\20170414124512\directory1\directory1.txt c:\test\20170414124512\directory2\directory2.txt c:\test\20170414124512\directory3\directory3.txt c:\test\20170414134345\directory1\directory1.txt c:\test\20170414134345\directory2\directory2.txt c:\test\20170414134345\directory3

c# - Report Builder not showing IIF result -

Image
i'm trying modify report builder report (visual studio 2013) , it's not displaying 4 expressions. following field coded , works great! =first(microsoft.visualbasic.interaction.iif(fields!ispass.value = "y", "yes", "no"), "dataset1") however, have 4 other fields coded same way different field values this: =first(microsoft.visualbasic.interaction.iif(fields!issuccessful.value = "y", "yes", "no"), "dataset1") that don't display "yes" or "no". in particular field, supplying "n". here rb snipit pass expression works great: and here portion of pdf report: here data looks fields i'm having issue (don't worry misspelling on exceptional, misspelled everywhere , isn't issue): here c# code used populate xsd file: if (result.any()) { foreach (var item in result) { dtresult.rows.add(new object[] { item.fullname.toupper(), item

c# - UWP Windows 10 app - Smooth Streaming support -

i looking port silverlight app uwp windows 10 app. read lot of blogs saying possible play smooth streaming videos in uwp, long can see - mediaelement , mediaplayerelement support adaptive streaming not smooth streaming (microsoft implementation of adaptive streaming). this article: https://docs.microsoft.com/en-us/azure/media-services/media-services-deliver-content-overview lists variations of adaptive streaming video formats. (in practical terms) - smooth streaming video can accessed url http://server/video.ism/manifest - , throws exception when use in adaptivemediasource.createfromuriasync while other formats apple hls ( http://server/video.ism/manifest(format=m3u8-aapl-v3) ) works fine. so question - there simple way play reliably microsoft smooth streaming in uwp app? [i have thousands of videos encoded in ss format , there no go unless can play them] is there simple way play reliably microsoft smooth streaming in uwp app according adaptive streaming p

arrays - Using c++ is it possible to convert an Ascii character to Hex? -

i have written program sets client/server tcp socket on user sends integer value server through use of terminal interface. on server side executing byte commands need hex values stored in array. sprint(mychararray, %x, myintvalue); this code takes integer , prints hex value char array. problem when use array set commands registers ascii char. example if send integer equal 3000 converted 0x0bb8 , stored 'b''b''8' corresponds 42 42 38 in hex. have looked on place solution, , have not been able come one. finally came solution problem. first created array , stored hex values 1 - 256 in it. char m_list[256]; //array defined in class m_list[0] = 0x00; //set first array index 0 int count = 1; //count variable step through array , set members while (count < 256) { m_list[count] = m_list[count -1] + 0x01; //populate array hex 0x00 - 0xff count++; } next created function lets me group hex values individual bytes , store array processing command.

hiveql - Hive Query to get the last record inserted in the table -

date time b 35573407 20170412 140930 310260453908912 35573407 20170412 140930 310260453908912 35573407 20170412 141054 310260453908912 35573407 20170412 025339 310260453908912 35573407 20170412 072918 310260453908912 35573407 20170412 091105 310260453908912 35573422 20170412 193605 310260453908912 35573407 20170412 121105 310260453908912 35573407 20170412 032439 310260453908912 35573407 20170412 032605 310260453908912 i trying figure out hive query last record inserted in table b. records need sorted time column , last record. suppose in above records 35573422 20170412 193605 310260453908912 is last record. select a,date,time,b (select * ,row_number() on ( partition b order date desc