Posts

css - Control the dashed border stroke length and distance between strokes -

Image
is possible control length , distance between dashed border strokes in css? this example below displays differently between browsers: div { border: dashed 4px #000; padding: 20px; display: inline-block; } <div>i have dashed border!</div> big differences: ie 11 / firefox / chrome are there methods can provide greater control of dashed borders appearance? css render browser specific , don't know fine tuning on it, should work images recommended ham. reference: http://www.w3.org/tr/css2/box.html#border-style-properties

java - Apache spark in memory caching -

spark caches working dataset memory , performs computations @ memory speeds. there way control how long working set resides in ram? i have huge amount of data accessed through job. takes time load job ram , when next job arrives, has load data again ram time consuming. there way cache data forever(or specified time) ram using spark? to uncache explicitly, can use rdd.unpersist() if want share cached rdds across multiple jobs can try following: cache rdd using same context , re-use context other jobs. way cache once , use many times there 'spark job servers' exist above mentioned functionality. checkout spark job server open sourced ooyala. use external caching solution tachyon i have been experimenting caching options in spark. can read more here : http://sujee.net/understanding-spark-caching/

c3p0 - hibernate 4 session connection remains open -

i use hibernate mysql database in java application migrate hibernate 3 hibernate 4 in new hibernate number of busy thread increased , use of connections application stop working , can not give connection more. hibernate.cfg configuration bellow: <property name="dialect">org.hibernate.dialect.mysqldialect</property> <!-- enable hibernate's automatic session context management --> <property name="current_session_context_class">thread</property> <property name="hibernate.current_session_context_class">thread</property> <!-- disable second-level cache --> <property name="hibernate.cache.use_second_level_cache">true</property> <!--<property name="hibernate.cache.provider_class"> net.sf.ehcache.hibernate.ehcacheprovider </property>--> <property name="hibernate.cache...

ruby on rails - how to put an URL as a parameter in another URL for successful parsing -

say want set url: www.a.com?str1=12&str2=67 parameter in url can parsed properly. problem : set parameter in url as- www.a.com?redirect_to=www.a.com?str1=12&str2=67 then happens when parse url value of redirect_to www.a.com?str1=12 because strt2 considered parameter. can www.a.com?str1=12&str2=67 value of redirect_to ? try escaping redirect url cgi.escape: require 'cgi' my_url = "www.a.com?redirect_to=#{cgi.escape('www.a.com?str1=12&str2=67')}" # my_url => "www.a.com?redirect_to=www.a.com%3fstr1%3d12%26str2%3d67"

unix - UART 0x0D's becoming 0x0A's -

Image
the following code configures 2 uart ports on beaglebone black. // open given file read/write, don't become controlling terminal, don't block int filedescriptor = open(filename, o_rdwr | o_noctty | o_sync); if(filedescriptor == -1) { cerr << "open_port: unable open " << filename << " " << strerror(errno) << endl; return false; } struct termios tty; memset(&tty, 0, sizeof tty); if(tcgetattr(filedescriptor, &tty) != 0) { cerr << strerror(errno) << endl; return false; } // baud cfsetispeed(&tty, b115200); cfsetospeed(&tty, b115200); // 8-bit chars tty.c_cflag = (tty.c_cflag & ~csize) | cs8; // disable ignbrk mismatched speed tests; otherwise receive break // \000 chars tty.c_iflag &= ~ignbrk; // disable break processing tty.c_lflag = 0; // no signaling chars, no echo...

Recording Mobile browser operations using Jmeter tool -

i need record mobile browser operations using jmeter tool. how do this? and need record file download scenario 1 of website using mobile browser under different network conditions (wifi, 3g , 2g) can record file downloading scenario? if yes, please let me know how do that. i need run file downloading scenario 20 times 1 user. possible? pls me out for mobile browser recording - make sure host running jmeter , mobile device on same network , device configured use jmeter host proxy. step-by-step guide see load testing mobile apps. made easy guide. to simulate different network types can change httpclient.socket.http.cps property value in jmeter.properties file. see how simulate network bandwidth in jmeter? wiki page details , values different network types simulation of downloading file 20 times possible loop controller , save responses file test elements combination. see performance testing: upload , download scenarios apache jmeter post instructions

matlab - the fastest way to replicate a vector in two direction -

i have vector want replicate elements in both row , column directions. have found using ones built-in function faster m-file functions repmat , kron . have seen examples replicating vector in 1 direction, not find how in both direction. consider following example: a = [1 2 3]; i want create these matrices: b = [1 1 1 1 1 1 2 2 2 2 2 2 3 3 3 3 3 3]; and c = [1 2 3 1 2 3 1 2 3 1 2 3]; how can ones ? there faster way? in code, vectors replicated bigger , have many vectors in for loop. looking faster way. how if had matrix replicated? example: d = [1 2 3 4 5 6]; and want have: e = [1 2 3 1 2 3 4 5 6 4 5 6 1 2 3 1 2 3 4 5 6 4 5 6]; c , e straightforward cases repmat . b different, common suggestion use kron(a', ones(2,3)) here alternatives: a similar function r's rep in matlab according many answers in link, fastest possibly reshape(repmat(a, 6, 1), 3, 6)'