Posts

r - Can ls() have a pattern > 1? -

say have 10 data.frame s contain dates in names 01-01-00 10-01-00 other letters , symbols added end in format ddmmyy e.g. 010100/sgh/d_3 and 020100/aff/d_1 if wanted create vector of above data.frame , there way select them without writing them out individually? i tried creating vector of sequence of dates , putting in pattern = came error (code below): dates <- seq(as.date("2000-01-01"),as.date("2000-01-02"),1) dates <- format(dates,"%d%m%y") ls(pattern=dates) in grep(pattern, all.names, value = true) : argument 'pattern' has length > 1 , first element used i'm assuming pattern can 1 value? create pattern matches of date strings want. 1 way join strings | characters: > dates <- seq(as.date("2000-01-01"),as.date("2000-01-10"),1) > dates [1] "2000-01-01" "2000-01-02" "2000-01-03" "2000-01-04" "2000-01-05" [6] "2000-01-0...

javascript - lodash flow and multiple arguments -

i have 2 functions add in lodash flow: function normalizedformfields(fields) { // needs 1 argument return _.mapvalues( fields, function( value ) { return { 'content': value }; } ); } function mergedmodelandformfieldss(model, normalizedformfields) { return _.merge( {}, model, normalizedformfields ) } const execution = _.flow( normalizedformfields, mergedmodelandformfieldss ) const errormessagebag = function( fields, model ) { return execution( fields, model ) // initiate flow 2 arguments } as can see first function normalizedformfields takes 1 argument. second 1 needs 2: value returned previous function (which normal behavior of flow), , one: model. but in errormessagebag invocation, launch flow process 2 arguments. how have second argument, available second function in addition returned product of first function ? see problem first function in flow takes , need 1 argument. kind of situation "curry" should come play ? please illustr...

javascript - Protect display contact number -

i have classified website , in product detail of page contact number show normal text. these numbers visible in search engine result. how protect or how show phone number image hide se? you can similar this. print phone number image. <?php $img = imagecreate(100, 20); //dimension of image $bg = imagecolorallocate($img, 255, 255, 255); //give white background $textcolor = imagecolorallocate($img, 0, 0, 0); //gives black colour string. both follow format in format (image, red, green, blue) $phone = "1234567890"; imagestring($img, 6, 2, 2, $phone, $textcolor); // imagestring ( resource $image , int $font , int $x , int $y , string $string , int $color ) // output image header('content-type: image/png'); imagepng($img); //outputs png image imagedestroy($img); //frees memory associated image ?>

mysql - sql query return wrong results -

why query returns results companyvisible 0, asking companies companyvisible has value of 1? select c.companyid, c.companydescription , c.companyname ,c.copmanydrastiriotita, c.companyvisible company c c.companyvisible = 1 , c.companydescription '%keyword%' or c.companyname '%keyword%' or c.copmanydrastiriotita '%keyword%' because of or clause apply brackets around and ...or clause use this select c.companyid, c.companydescription , c.companyname ,c.copmanydrastiriotita, c.companyvisible company c c.companyvisible = 1 , (c.companydescription '%keyword%' or c.companyname '%keyword%' or c.copmanydrastiriotita '%keyword%')

docker - Starting Multiple service in Dockefile -

i have 1 dockerfile below. from centos:centos6 run yum install httpd* -y run yum install mysql* -y entrypoint service mysqld start && bash entrypoint service httpd start && bash docker file running successful when enter container 1 service in start start httpd. i want start both service automatically using dockerfile. please let know how that you should create entrypoint.sh file: #!/bin/bash service mysqld start service httpd start and dockerfile: from centos:centos6 run yum install httpd* -y run yum install mysql* -y copy ./entrypoint.sh / run chmod +x /entrypoint.sh entrypoint ["/entrypoint.sh"] you try use supervisord in docker image

c# - Handling CData in converting Xml to Json using Newtonsoft -

i'm trying convert xml json , run business logic , deserialize c# object using newtonsoft json.net . xml has cdata values. how can deserialize json such value inside cdata mapped c# field. edit: xml may/maynot contain cdata e.g. xml: with cdata <?xml version="1.0" encoding="utf-8"?> <root> <text><![cdata[sample text]]></text> </root> with plain text <?xml version="1.0" encoding="utf-8"?> <root> <text>sample text></text> </root> json: with cdata: {"text":{"#cdata-section":"sample text"}} with plain text: {"text":"sample text"} code: class data { [jsonproperty("text")] public string text { get; set; } } public static data convertjsontoobject(string json) { return jsonconvert.deserializeobject<data>(json); } thank advance. xsd xml sample. defin...

How to include Background images for android apps -

i have designed background images layout , list view 6 different dpi scales, how can included them in project cause image assets configuration has luncher , navigation & tabs & notifications icons (not images) . (how include , tell android have background image each screen ??) any suggestions appreciated you have put images different densities (alternate resource files) in different folders contains density qualifier in names. like in: drawable drawable-hdpi drawable-xhdpi to create such folders in android studio: right click on resource folder ('res') or click on file menu new > android resource directory change resource type 'drawable' add (>>) 'density' available qualifiers choose required density qualifier dropped list on right side and click ok or right click on resource folder ('res') new > directory type 'drawable' required qualifier (ex. drawable-xhdpi) read here more det...