Posts

Showing posts from January, 2011

javascript - Trying to get $(document).on('Click') to work for a p tag -

i trying document.on function work when user clicks on p tag has class called card. far function non responsive. should change function respond when click on p tag has class called card. here html , jquery code. <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="description" content="contacts"> <title>contacts</title> <link rel="stylesheet" type="text/css" href="style.css"> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript"> $(document).ready(function(){ $('button').click(function(){ var first = $('input.first').val(); var last = $('input.last').val(); var desc = $('textarea').val(); $('div.right').append("<p class='ca

sql - Why cast as timestamp give out two different result -

i have hive table 2 rows this: 0: jdbc:hive2://localhost:10000/default> select * t2; +-----+--------+ | id | value | +-----+--------+ | 10 | 100 | | 11 | 101 | +-----+--------+ 2 rows selected (1.116 seconds) but when issue query : select cast(1 timestamp) t2; it gives out unconsistent result, can tell me reason ? 0: jdbc:hive2://localhost:10000/default> select cast(1 timestamp) t2; +--------------------------+ | _c0 | +--------------------------+ | 1970-01-01 07:00:00.001 | | 1970-01-01 07:00:00.001 | +--------------------------+ 2 rows selected (0.913 seconds) 0: jdbc:hive2://localhost:10000/default> select cast(1 timestamp) t2; +--------------------------+ | _c0 | +--------------------------+ | 1970-01-01 08:00:00.001 | | 1970-01-01 07:00:00.001 | +--------------------------+ 2 rows selected (1.637 seconds) i can't reproduce problem, hive version using? hive had bug timestamp , bigint (see h

Issue in sending a string from Android to other device via Bluetooth -

i trying send string android device other device. in code trying fetch date , time , storing in string , sending string device via bluetooth. the issue when send string, of characters missing when received other device. my code : private void time() { int day = 0; date = new date(); string sdf = new simpledateformat("eeee", locale.english).format(now); switch (sdf) { case ("monday"): day = 1; break; case ("tuesday"): day = 2; break; case ("wednesday"): day = 3; break; case ("thursday"): day = 4; break; case ("friday"): day = 5; break; case ("saturday"): day = 6; break; case ("sunday"): day = 7; break; } int mm = calendar.getinstance().get(calendar.min

java - How do I check if a string contains keywords? -

i'm writing program asks user enter keywords, , essay, , checks how many keywords used in essay. current output: enter keywords: dog, cat enter essay: i cat exception in thread "main" java.lang.runtimeexception desired output: enter keywords: dog, cat enter essay: i cat 1 here's code far: static int keywordschecker(string shortessay, string keywords) { int count = 0; (int = 0; < keywords.length(); i++) { string[] ary = keywords.split(","); if (shortessay.contains(ary)) { count++; } system.out.println(count); } return count; } public static void main(string[] args) { scanner input = new scanner(system.in); system.out.println("enter keywords: "); string keyword = input.nextline(); system.out.println("enter essay: "); string essay = input.nextline();

go - What is the best way to map windows drives using golang? -

what best way map network share windows drive using go-lang? share requires username , password. similar question asked python what best way map windows drives using python? as of there no direct way in go; recommend using net use , of course limits functionality windows, that's need. so, when open command prompt in windows can map network shares windows drives using: net use q: \\server\share /user:alice pa$$word /p q: represents windows drive, \\server\share network address, /user:alice pa$$word credentials, , /p persistence. executing in go like: func mapdrive(letter string, address string, user string, pw string) ([]byte, error) { // return combined output std , err return exec.command("net use", letter, address, fmt.sprintf("/user:%s", user), pw, "/p").combinedoutput() } func main() { out, err := mapdrive("q:", `\\server\share`, "alice", "pa$$word") if err != nil { log.fatal(err

javascript - Treegrid library with connector functionality? -

Image
i have data needs multiple columns. 1 of columns (preferably not first, can be) display nested tree structure data. both maxazan's treegrid.js , ludo van den boom's treetable.js accomplish want, almost. can hard distinguish hierarchy quick glance: the data hierarchy unclear here and here solution: adding connectors -> the visualisation fixed connectors the actual data has 7 columns ...but treegrid nor treetable support functionality. in both, indentation accomplished through spans padding. treetable uses single spans, makes connector implementation near impossible. treegrid uses multiple spans, imitate connector distinguish levels better. how implement connectors eg. treegrid, or there similar js libraries creating tree grids connectors have missed? if answer is: "it's semantically incorrect, should use nested lists" (in connectors quite trivial implement), follow-up question is: what different possibilities vertically align elements

ios - Basic Questions about Create Texture Atlas in Xcode -

i think might using texture atlases incorrectly, , wanted ask advice. i found few sites online suggested create folder, let's ball.atlas, , in there, add animation frames (ball1, ball2, ball3). then drag , drop ball.atlas actual xcode content tree, , reference atlas in code this: self.ballatlas = sktextureatlas(named: "ball") self.ballimages.append(self.ballatlas.texturenamed("ball1")); self.ballimages.append(self.ballatlas.texturenamed("ball2")); self.ballimages.append(self.ballatlas.texturenamed("ball3")); self.ballimages.append(self.ballatlas.texturenamed("ball4")); self.ballimages.append(self.ballatlas.texturenamed("ball5")); and can reference self.ballimages display animation, etc. i saw guide, however, said go xcassets folder, , click '+', , hit 'new texture atlas', , creates folder. drag ball images in there. there 1 fundamental difference here, however: in second approach, can

tensorflow - Regarding setting up the target tensor shape for sparse_categorical_crossentropy -

Image
i trying experiment multi-layer encoder-decoder type of network. screenshot of last several layers of network architecture follows. how setup model compiling , training process. optimizer = sgd(lr=0.001, momentum=0.9, decay=0.0005, nesterov=false) autoencoder.compile(loss="sparse_categorical_crossentropy", optimizer=optimizer, metrics=['accuracy']) model.fit(imgs_train, imgs_mask_train, batch_size=batch_size, nb_epoch=nb_epoch, verbose=1,callbacks=[model_checkpoint]) imgs_train , imgs_mask_train of shape (2000, 1, 128, 128) . imgs_train represent raw image , imgs_mask_train represents mask image. trying solve semantic segmentation problem. however, running program generates following error message, (i keep main related part). tensorflow.python.pywrap_tensorflow.statusnotok: invalid argument: logits first dimension must match labels size. logits shape=[4096,128] labels shape=[524288]

vba - Excel-Range XML uses two rows for header -

i use this function recordsets range -objects without setting ado-connections. function getrecordset(rng range) object dim xlxml object dim rst object set rst = createobject("adodb.recordset") set xlxml = createobject("msxml2.domdocument") xlxml.loadxml rng.value(xlrangevaluemspersistxml) rst.open xlxml set getrecordset = rst end function i typically use one header row. expected results if data starts in row(1) . however, if there 1+ rows above data, excel assumes have two header-rows , concatenates them blank. therefore, recordset uses fieldnames ![underneath's header, mate myfield] instead of ![myfield] . more technically speaking, problem rng.value(xlrangevaluemspersistxml) returns concatenated 2 rows header , i'm unable set 1 row. interested hear thoughts! edit: workaround might replace leading blanks like xlxml.loadxml replace(rng.value(xlrangevaluemspersistxml), "rs:name=""

Spring data redis - listen to expiration event -

i listen expiration events keyexpirationeventmessagelistener can't find example. someone know how using spring boot 1.4.3 & spring data redis? i doing jedispool pool = new jedispool(new jedispoolconfig(), "localhost"); this.jedis = pool.getresource(); this.jedis.psubscribe(new jedispubsub() { @override public void onpmessage(string pattern, string channel, string message) { system.out.println("onpmessage pattern " + pattern + " " + channel + " " + message); list<object> txresults = redistemplate.execute(new sessioncallback<list<object>>() { public list<object> execute(redisoperations operations) throws dataaccessexception { operations.multi(); operations.opsforvalue().get("val:" + message); operations.delete("val:" + message); return operat

r - How to use the function variables (x and y) in the plot title that the function creates -

i'm working on creating function graphs linear regressions , residuals. i've created body of function, add more details plot produces, such title , axis labels. specifically, want have title of plot variables input function, this: "y x" y , x name input function. i've tried using paste() , print() accomplish this, hasn't been successful. also, i've been using rnorm(10) produce values x , y, still want title reflect whatever input function, title should "rnorm(10) rnorm(10)" instead turns out "print(y) print(x)". suggestions on correct code use accomplish this? reslines <- function(x,y) { x <- x y <- y plot(y~x, pch=20, col=1, title=print(y) print(x)) lm.xy <- lm(y~x) abline(lm.xy) segments(x0 = x, y0 = y, y1 = predict(lm.xy), col = 130) summary(lm.xy) } reslines(rnorm(10,rnorm(10)) try this: reslines <- function(x, y) { # x <- x # y <- y plot(y ~ x, pch = 20, col = 1, main = paste(c(substitute

Symfony multiple firewalls with same context -

i'm trying have 2 firewalls working in same context, when user logs in using form api methods available him. i've defined way: api: anonymous: true stateless: true guard: authenticators: - 'jwt_token_authenticator' pattern: ^/api/ context: retain_security main: pattern: ^/ anonymous: false provider: our_db_provider form_login: always_use_default_target_path: true csrf_token_generator: security.csrf.token_manager login_path: /login check_path: /login_check default_target_path: / logout: path: logout target: / remember_me: secret: '%secret%' lifetime: 604800 # 1 week in seconds path: / context: retain

How to Insert Value From Radio Button in MySQL in PHP -

i'm making online voting system. system has limit people (population of area) can vote (example-10) & votes add database. want insert values radio buttons in database. tried code. has error.the vote form data doesn't insert db & don't know suitable code case. please if has idea, please let me know. thank-you <html> <head> <title>election</title> <link rel="stylesheet" href="bootstrap-3.3.4-dist/css/bootstrap.min.css"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script> <link rel="stylesheet" href="css/presidential.css" type="text/css"> <link rel="stylesheet" href="css/login.css" type="text/css"> <l

visual studio - Failed to add reference to 'Microsoft.DiaSymReader.Native.amd64' -

Image
i have created nuget package , published azure. when add package project fails following error: i followed same process every other nuget package without issues. tips?

php - symfony crawler not work from this site -

i want data site symfony crawler not worked http://www.varzesh3.com/livescore/feed , string not gain <?php //echo __dir__.'/vendor/autoload.php'; require_once __dir__.'/vendor/autoload.php'; use symfony\component\domcrawler\crawler; $html2 = file_get_contents('http://www.varzesh3.com/livescore/feed'); $crawler = new crawler($html2); $atc = $crawler->filter('.stage-wrapper')->each(function (crawler $nodecrawler) { var_dump($nodecrawler->html()); echo "a"; }); i solved it get data guzzle php , pass body symfony crawler

sql - Remove records by clustered or non-clustered index -

Image
i have table (let's errorlog ) create table [dbo].[errorlog] ( [id] [int] identity(1,1) not null, [created] [datetime] not null, [message] [varchar](max) not null, constraint [pk_errorlog] primary key clustered ([id] asc) ) i want remove records older 3 months. i have non-clustered index on created column (ascending). i not sure 1 of these better (seem take same time). query #1 : delete errorlog created <= dateadd(month, - 3, getdate()) query #2 : declare @id int select @id = max(l.id) errorlog l l.created <= dateadd(month, - 3, getdate()) delete errorlog id <= @id once know maximum clustered key want delete faster use key. question whether worth selecting key first using date. right decision depends on size of table , portion of data need delete. smaller table , smaller number of records deletion more efficient should first option (query #1). however, if number of records delete large enough, non-clustered index

playframework - taking play framework object in a javascript variable -

i have map declared in template parameters following syntax @(formdata : scala.collection.map[string, scala.list[string]], previousdata : scala.collection.map[string,string], resultlist: scala.list[string])(implicit flash: play.api.mvc.flash) i want read previousdata map object , want store in javascript variable. want set value in textbox fetching value map object. know can use document.getelementbyid in javascript set value of particular textbox. please help? if other way possible please let me know. tried following method isn't working. function loadpreviousdata() { if(@previousdata != null) { var x = @{previousdata.getorelse("name",null)}; alert("name " +x); } } yes can use jquery used nowadays. let's txtname id of textbox can $("#txtname").val(x); here x variable in extracts data.

web - Upload image from devide to FTP using android app -

hey have code let user pick image gallery , after chooses image shown in image view, when user click button should upload image ftp server , reason app tells me location of file giving not found. here ftp upload code (i execute using asynctask) public uploadimage(string host,int port,string username,string password,string imagepath) { this.host = host; this.port = port; this.username = username; this.password = password; this.imagepath = imagepath; } public void uploadingfilestoftp() throws ioexception { ftpclient con = null; try { con = new ftpclient(); con.connect(host); if (con.login(username, password)) { con.enterlocalpassivemode(); // important! con.setfiletype(ftp.binary_file_type); uri uri = uri.parse(this.imagepath); string data = uri.getpath(); fileinputstream in = new fileinputstream(new file(data)); boolean result =

Kafka Consumer Group Id and consumer rebalance issue -

i using kafka 0.10.0 , zookeeper 3.4.6 in production server .i having 20 topics each approx 50 partitions. having total of 100 consumers each subscribed different topics , partitions .all consumers having same groupid. case if consumer added or removed specific topic consumers attached different topic undergo rebalancing? my consumer code is: public static void main(string[] args) { string groupid = "prod" string topicregex = args[0] string consumertimeout = "10000" int n_threads = 1 if (args && args.size() > 1) { configloader.init(args[1]) } else { configloader.init('development') } if(args && args.size() > 2 && args[2].isinteger()){ n_threads = (args[2]).tointeger() } executorservice executor = executors.newfixedthreadpool(n_threads) addshutdownhook(executor) string zookeeper =

Interpretation of the ccf function from statsmodel python library -

i using ccf (cross correlation) follows: from statsmodels.tsa.stattools import ccf print ccf(np.array(x), np.array(y), unbiased=true) i having hard time interpreting results. question whether output cross-correlation @ possible lags or result of multiplications of data points @ lag 0? documentation not provide insights on issue. in advance.

java - Android SQL update query returns 1 but not updating -

i'm trying update simple boolean value in sql table per docs here: updating db row, developer.android.com when attempt update table, update statement returns 1 after closing , re-opening app database remains unchanged. here code: in mainactivity.java: void checkunchecktodaytask (string taskid, boolean newstate) { new checkunchecktodaytask().execute(taskid, string.valueof(newstate)); } class checkunchecktodaytask extends asynctask<string, void, void> { @override protected void doinbackground(string... strings) { sqlitedatabase db = mdbhelper.getreadabledatabase(); // new value 1 column contentvalues values = new contentvalues(); values.put(taskcontract.todaytask.column_name_completed, boolean.valueof(strings[1])); // row update, based on title string selection = taskcontract.todaytask._id+ " = ?"; string[] selectionargs = { strings[0] }; db.update( taskcontra

java - Cant hit my API, have i the wrong URL? -

i have dynamic java web project jersey libs called myapi... the apache tomcat server starts ok ... http 404 status no mattr url enter. have web.xml... <?xml version="1.0" encoding="utf-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xsi:schemalocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" id="webapp_id" version="3.1"> <servlet> <servlet-name>myapi</servlet-name> <servlet-class>org.glassfish.jersey.servlet.servletcontainer</servlet-class> <init-param> <param-name>jersey.config.server.provider.packages</param-name> <!-- package resource classes --> <param-value>ws</param-value> </init-param> </servlet> <servlet-mapping> <servlet-name>myapi</servlet-nam

database - Android save data from Amazon API locally to reduce load times? -

i'm new android developer , use advice on problem i've come across. i have app querying data amazon product api on every activity open. i'm able data, activities take forever load because i'm running api queries. the app video game review app. wouldn't uncommon users load same data game multiple times. i'm thinking making api calls same data on , on again inefficient. my question in scenario, should saving game data local, or remote (firebase) database every time data retrieved amazon api? , whenever data needs retrieved, check first see if it's present in database before making api call? if correct, should saving data (shared prefs, sqllite, internal storage, etc.)? if not, can make app pull & display data faster? when activities take forever load, assume not making these calls within activities. , lets answer questions 1 one. 1) shared prefs not option. (try use shared prefs when have bunch of things persist). while in case if wa

model view controller - Opencart v 2.3 create module from another module -

on opencart v2.3 did create module manufacturer i created table on mysql similar manufacturer table , duplicated files admin/controller/catalog/manufacturer.php admin/language/en-gb/catalog/manufacturer.php admin/model/catalog/manufacturer.php admin/view/template/catalog/manufacturer_form.tpl admin/view/template/catalog/manufacturer_list.tpl and changed manufacturer enchere , inside files changed manufacturer enchere , class names admin/controller/catalog/enchere.php admin/language/en-gb/catalog/enchere.php admin/model/catalog/enchere.php admin/view/template/catalog/enchere_form.tpl admin/view/template/catalog/enchere_list.tpl but when uploaded files opencart in same folders manufacturer didn't see no enchere can me plz

php - Use PostgreSQL NOT SIMILAR TO in Symfony Doctrine query builder -

i attempting use postgresql's not similar to exclude blacklist results of query, when run query in repository method below: $qb = $this->getentitymanager()->createquerybuilder('p'); $query = $qb ->select('p') ->from('crmpiccobundle:person', 'p') ->where("lower(p.email) not similar '(" . implode('|', $blacklist) . ")%'") ->getquery(); return $query->getresult(); i following error: [doctrine\orm\query\queryexception] select p crmpiccobundle:person p lower(p.email) not similar '(abuse@|admin@|billing@|compliance@|devnull@)%' [doctrine\orm\query\queryexception] [syntax error] line 0, col 94: error: expected end of string, got 'to' however , when run query against local db pgadmin works. how can ach

android - Why <merge> root not call onFinishInflate() after inflation? -

my custom view not call onfinishinflate() after inflate(), found out custom view layout file root , android not call onfinishinflate() in condition. wonder why android way? the comment onfinishinflate() following: finalize inflating view xml. called last phase * of inflation, after child views have been added. if inflate layout file root tag , add view, can't receive onfinishinflate() callback. kind of strange me. the following code snippet layoutinflater.java android 24. void rinflate(xmlpullparser parser, view parent, context context, attributeset attrs, boolean finishinflate) throws xmlpullparserexception, ioexception { final int depth = parser.getdepth(); int type; while (((type = parser.next()) != xmlpullparser.end_tag || parser.getdepth() > depth) && type != xmlpullparser.end_document) { if (type != xmlpullparser.start_tag) { continue; } final string name = parser.ge

rsa archer data extract -

when use etl tool download data using webservices following issues. when there more fields in module 400 becoming tough extract data using webservices api it extracting in xml need parse is there script can called download data in txt or csv format? there bulk extract method extract data 400 fields in single shot? is there script can called download data in txt or csv format? there bulk extract method extract data 400 fields in single shot? short answer no. but have 2 options here: option 1. can write code extract data via archer api page page , convert data format etl tool can integrate with. archer return data in xml described, can changed custom code. note - example informatica (etl tool) allows embed java , c# code etl workflow, can extract data need etl tool right away. configuration (report id in archer) can stored in file, solution should easy support in long run. option 2: if have read access archer database may create sql statement extract data direct

javascript - Modal window doesnt open from another modal window -

i have modal window button. button must open modal window, nothing happens. tested 'alert': script runs. heres html: <a href="#" id='goto' onclick="calc();">Рассчитать</a> and heres js: $(document).ready(function() { $('a#goto').click( function(event){ event.preventdefault();

c# - Change background color of ToolbarItems -

how change background color , text of toolbaritems? default color black , change how it? click here see example image <contentpage.toolbaritems> <toolbaritem order="secondary" icon="morevert.png" text="atualizar" command="{binding atualizar}"/> <toolbaritem order="secondary" text="ajuda" command="{binding ajuda}"/> <toolbaritem order="secondary" text="sair" command="{binding sair}"/> </contentpage.toolbaritems> try in navigationpage: barbackgroundcolor = color.black; bartextcolor = color.white; edited i sorry. can apply style android app within android project. easy way generate style take @ android style generator . must create style , use in app. how use - read article .

oracle - Trigger not updating table -

i have function/trigger create or replace function carrinho_saldo (car in number default null) return number sald number; begin select saldo sald carrinho_compra conta = car; return sald; end carrinho_saldo; create or replace trigger efetuar_compra_trigger after insert or update on efetuar_carrinho_compra each row declare sald number; begin sald:=carrinho_saldo(:new.conta); if :new.compra = 'c' sald := sald - :new.valor; else sald := sald + :new.valor; end if; update carrinho_compra set saldo = sald conta = :new.conta; end; its supose work like;everytime add in "efetuar_carrinho_compra"table table carrinho_compra have update "saldo".i insert correctly insert efetuar_carrinho_compra(conta,id_compra,compra,valor,data) values(2,616,'c',1000,'30-06-2017'); the table "efetuar_carrinho_compra" updates ok.but table carrinho_compra dont values supose update inse

Why Google Maps v2 are Blank on Android emulator? -

i creating new maps activity using android studio , following steps, adding api_key, manifest, enabling android maps api in google console, , restricting package , sha1. have searched internet , tried many things, map still blank. can help? blank screen means have problem google maps api signing. probably have created new keystore file , used sha enabling maps api. but while developing runs signed debug.keystore default unless declare one. you can use keystore file created debug runs signing configs in project settings android studio. good luck emre

javascript - How do you set a variable as the label for an input field? -

here sample input field: <div class="md-form form-sm"> <input type="text" id="form1" class="form-control"> <label for="form1" class="">example label</label> </div> if want set label variable can update it. how that? please bear in mind, i'm new js , jquery , tools i'm using. i'm not using other frameworks , prefer not @ point, unless absolutely necessary. you're looking dynamic templating framework of somesort. i've used underscore.js , has templating functionality gets job done: http://underscorejs.org/#template

apache - Nginx - preventing slow HTTP DoS attacks -

i need preventing slow http dos attacks on nginx. use following configuration on apache, using mod_reqtimeout: <ifmodule mod_reqtimeout.c> requestreadtimeout header=20-40,minrate=500 body=20,minrate=500 </ifmodule> how using nginx?

.net - error CS2001: Source file could not be found -

i have .net application , configured application in jenkins automation build. have used svn "source code management". when build application through jenkins shows below error: csc : error cs2001: source file 'app_start\filterclass.cs' not found [f:\pankaj\projects\jenkins code\workspace\mysolution.csproj] and issue coming multiple files. however, when latest code svn , build project separably working fine. when use jenkins files missing. you need force checkout repo instead of using update in jekins. in addition make sure have correct version of msbuild plugin intalled jenkins. had similar issues when correct dependencies not installed jenkins on slave node. i hope these tips you. regards, yasir

java - How to access TLS certificates in Jetty Websocket -

i have tls secured connection, on top of communication on web sockets performed. want check attributes contained in certificate used tls connection. jetty used http communication, , protocol going run karaf component. i tried dig layers deep possible. hoped find in websocketcomponentservlet. there servletupgraderequest @ least: public class websocketcomponentservlet extends websocketservlet { @override public void configure(websocketservletfactory factory) { factory.setcreator(new websocketcreator() { @override public object createwebsocket(servletupgraderequest req, servletupgraderesponse resp) ... i tried dig httpsession or servletupgraderequest, not able find certificate information there. if go down further, websocketcomponent, contains @ least sslcontextparameters. besides key store password, correctly set, fields empty. heading in right direction or entirely missing point here? edit: guess need more speci

android - Change undeline color of Textview -

i have 7 textview 1 selectable @ time,selected textview should contain underline,i want change underline color(not textview color). i using following code underline textview , addunderlinetotext.setpaintflags(addunderlinetotext.getpaintflags() | paint.underline_text_flag); i using following line remove under line. if ((removeunderline[i].getpaintflags() & paint.underline_text_flag) > 0) { textview[i].setpaintflags(textview[i].getpaintflags() & (~paint.underline_text_flag)); } first defined custom attributes easy customization in xml layout files <declare-styleable name="underlinedtextview" > <attr name="underlinewidth" format="dimension" /> <attr name="underlinecolor" format="color" /> and custom textview class public class underlinedtextview extends textview { private rect lineboundsrect; private paint underlinepaint; public underli

android - Espresso how to assert intent data -

this intent: -intent { act=android.intent.action.view dat=smsto:xxxxxxx@xxxxx.xxx (has extras) } handling packages:[[com.android.messaging]], extras:[bundle[{sms_body=mytext}]]) how matcher should in order assert data this: dat=smsto:xxxxxxx@xxxxx.xxx for example won't work: intented(hasdata("xxxxxxx@xxxxx.xxx"); try : intented(hasdata(uri.parse("smsto:xxxxxxx@xxxxx.xxx")); it should work ! (replace 'xxx's actual characters.)

java - Jsoup, HTMLUnit, phantomJS: How can I click on Button OR fill out Formular TO bypass agecheck -

i collected urls mainpage (steam-gamestore) , want call each single site, of them have agecheck. identified 2 different types of agechecks: only simple button expected click a whole table has filled (with concrete specifications of age) here pictures find in html-code agecheck type 1 agecheck type 2 my question is: how can click on damn button? in way, for-loop (which running through 11 thousands urls) isn't breaking , redirect me website behind agecheck (so can read out data it)? i tried phantomjs, javascript , dont know how include in jsoup-code. i'm trying htmlunit. ideas? and have fill whole form (for complex age-check). how can this? possible htmlunit? ok, solved problem. in short terms: switched selenium webdriver (for javacode) , selenium ide (firefox plugin). ________ elaborately description (step step): 1. install selenium ide firefox-browser: go to: !!!fuck: i'm not allowed post links cause of low reputation. want

Unexpected mysql behavior when inserting new rows -

i've got query: insert series_measures (sensor_sid,dataset_sid,created_on) values (841468,145,'2016-10-26 11:36:07'), ... ,(841505,145,'2016-10-26 11:36:07') on duplicate key update sensor_sid=values(sensor_sid),dataset_sid=values(dataset_sid),created_on=values(created_on); two things don't understand happening here: a. if (sensor_sid-dataset_sid) inserted: error: duplicate entry '145-841468' key 'fk_series_meas_dataset_idx' but on duplicate key update should avoid that. b. if (sensor_sid-dataset_sid) not inserted yet: error: duplicate entry '412870' key 'primary' primary sid , has auto-increment (see create statement below), makes no sense me. this create statement of table: create table `series_measures` ( `sid` bigint(20) unsigned not null auto_increment, `sensor_sid` int(10) unsigned not null, `dataset_sid` int(10) unsigned not null, `created_on` timestamp not null default curr

logrotate - Log rotation in redhat santiago -

i have daemon , fills 4 files every second , theses files piled end of day. folder structure /logs/project/ files error.log warning.log notice.log inmessage.log and want these logs folder backed automatically using log rotation below have looked https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/6/html/deployment_guide/s2-log_rotation.html can roate logs but not understanding how set files in folder @ time @ moment , config file has /logs/project/error.log{ rotate 5 daily postrotate /usr/bin/killall -hup syslogd endscript } /logs/project/warning.log{ rotate 5 daily postrotate /usr/bin/killall -hup syslogd endscript } /logs/project/notice.log{ rotate 5 daily postrotate /usr/bin/killall -hup syslogd endscript } /logs/project/inmessage.log{ rotate 5 daily postrotate /usr/bin/killall -hup syslogd endscript } some of questions have 1. abo

filesystems - How to read and write into file using JavaScript -

can give sample code read , write file using javascript? for completeness, op not state looking in browser (if is, has been stated, not possible) however javascript per se allow this; can done server side javascript. see documentation on javascript file class edit : link sun docs have been moved oracle. to keep times here's node.js documentation filesystem class: http://nodejs.org/docs/latest/api/fs.html edit(2) : can read files client side html5: http://www.html5rocks.com/en/tutorials/file/dndfiles/