Posts

javascript - Materalize CSS error labels -

materalize supports validation input fields such email, validate input fields such passwords on fly. means adding error or success label through javacript. my success far has been poor. when call change() js function , try addclass('valid') example, nothing happens , can see, class doesn't appear in html. know function working because if add nonsense class 'test', display in html. is not simple adding 'valid' or 'invalid' - need meet other criteria before label appear? any appreciated. my solution include error labels below: <div class="input-field col s9 offset-s1"> <i class="material-icons prefix">perm_identity</i> <input id="register_user" name ="register_user" type="text"> <label id="reg-user-error" style="display:none" for="register_user" data-error="short" d...

SAS - Replace the n'th word in a string, if a certain length -

i have list of customer ids, formatted follows: 123-456-78; 123-345-45; 12-234-345; 123-34-456; i want able find every 2-digit portion of code , replace new number. example, "78" in first entry, "12" in third entry. right i'm using scan function loop find each 2-digit section. data work.test12; set mylib.customers; i=1 5; x=scan(customer_id,i,'-'); if length(x)=2 do; <??????>; end; output; end; i think regular expression work nicely. 33 data _null_; 34 infile cards dsd dlm=';'; 35 input s :$16.; 36 if _n_ eq 1 rx = prxparse('s/(^|-)\d\d($|-)/\100\2/'); 37 retain rx; 38 length new $16; 39 if prxmatch(rx,strip(s)) new=prxchange(rx,1,strip(s)); 40 put s= new=; 41 cards4; s=123-456-78 new=123-456-00 s=123-345-45 new=123-345-00 s=12-234-345 new=00-234-345 s=123-34-456 new=123-00-456

jquery - Google spreadsheet Search using javascript -

Image
i'm trying build search option user input id , see result of corresponding id stored in google spreadsheet. like user input: 1 , see result : nitu 5 , see result : dipon <input id="id" type="text" placeholder="your id"> <input id="search" type="submit" value="search"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <script> function displaycontent(json) { var string = "<table>"; var len = json.feed.entry.length; (var i=0; i<len; i++) { var id = json.feed.entry[i].gsx$id.$t; var name = json.feed.entry[i].gsx$name.$t; string += '<tr><td>' + id + '</td><td>' + name + '</td></tr>'; } string += "</table>"; $(string).appendto('bo...

java - ThreadDump Collection from Tomcat -

i trying threaddump of jvm. used top command , ps aux find process id , user of pid [which root]. so run following command threaddump sudo -u root jstack -f pid > threaddump1.txt but getting following exception--------------------------------- error attaching process: doesn't appear hotspot vm (could not find symbol "ghotspotvmtypes" in remote process) sun.jvm.hotspot.debugger.debuggerexception: doesn't appear hotspot vm (could not find symbol "ghotspotvmtypes" in remote process)** @ sun.jvm.hotspot.hotspotagent.setupvm(hotspotagent.java:411) @ sun.jvm.hotspot.hotspotagent.go(hotspotagent.java:305) @ sun.jvm.hotspot.hotspotagent.attach(hotspotagent.java:140) @ sun.jvm.hotspot.tools.tool.start(tool.java:185) @ sun.jvm.hotspot.tools.tool.execute(tool.java:118) @ sun.jvm.hotspot.tools.jstack.main(jstack.java:92) @ sun.reflect.nativemethodaccessorimpl.invoke0(native method) @ sun.reflect.nativemethodaccessorimpl....

log4j - Log4j2 programmatic configuration Log filename issue -

i have configured log4j2 using programmatic configuration.please find code below.i running code on jdk1.8.the log files getting generated log file names not created appropriately pattern defined.the file generate names test_28_12_2016_24.log looks simpledateformat not getting recognized.please let me know if missing anything. public class test { public static void main(string args[]){ public final string log_file_pattern = "-%d{dd-mm-yyyy-hh}.%i.log"; public final string my_log_pattern_layout = "%msg%n"; /* configuring logger context */ private loggercontext context = (loggercontext) logmanager.getcontext(false); final configuration config = context.getconfiguration(); final layout<? extends serializable> layout = patternlayout.createlayout(my_log_pattern_layout, null, config, null,null,true, true, null, null); /* configuring policies */ final timebasedtriggeringpolicy timebased...

java - How do I set the size of messages in Kafka? -

i'm using kafka 0.9.0.1. according sources i've found, way set sizes of messages modify following key values in server.properties . message.max.bytes replica.fetch.max.bytes fetch.message.max.bytes my server.properties file has these settings. message.max.bytes=10485760 replica.fetch.max.bytes=20971520 fetch.message.max.bytes=10485760 other settings may relevant below. socket.send.buffer.bytes=102400 socket.receive.buffer.bytes=102400 socket.request.max.bytes=104857600 however, when attempt send messages payloads of 4 6 mb in size, consumer never gets messages. producer seems send messages without exceptions being thrown. if send smaller payloads (like < 1 mb) consumer receive messages. any idea on i'm doing wrong in terms of configuration settings? here example code send message. producer<string, byte[]> producer = new kafkaproducer<>(getproducerprops()); file dir = new file("/path/to/dir"); for(string s : dir.list()) { ...

android - How to implement animated vector drawables using the design support library 23.2? -

Image
i've seen android developers blog new design support library 23.2 supports animated vector. when searched came across link implement animated vector drawable. same way implement animated vector drawables in design support library 23.2? can me out new implementation? here's link example project on github implementing support library make floating action button. using support library similar non-support library method in xml files animatedvectordrawables same, objectanimators , static vectordrawables. the differences come when setting project use support library , when referring animatedvectordrawables in code. make sure using @ least version 23.2.0 of appcompat in build.gradle, vectordrawable , animatedvectordrawable libraries not need added separately: dependencies { ... ... compile 'com.android.support:appcompat-v7:23.2.0' } the official anouncement blog linked to gives couple of different ways ensure android studio not convert vector drawa...