Posts

javascript - Turn several strings of structured text into HTML table -

for example have following text no tags @ within html page: color: red shape: square side: 1mm as rows needed, 3 quite enough question. 1 be. in rows i'll have the beginning of text string , colon+space (: ) , the end of text string . how should turn the beginning of text string <tr><td> , colon+space :</td><td> , the end of text string </td></tr> ? thanks @andrew willems (the script) , @phil (further suggestions) , running. the original text here has unnecessary lines before , after text demonstrate need dealing with, , ability deal with, lines. var opening = '<table id="newborn_table"><tbody>'; var closing = '</tbody></table>'; var origtext = document.queryselector('#source').innertext; var lines = origtext.split('\n').filter(function(line) { return (line !== ""); }); var rowstext = ''; lines.foreach(function(line) { ...

python - TypeError: 'JavaPackage' object is not callable -

i getting below error whilie trying run word count example using sparkstreaming,python. not sure how proceed. below command running , error. /opt/spark/bin/spark-submit --jars spark-streaming_2.10-2.0.0.jar test_kafka.py broker.txt "localhost:2181:mytopic" error: traceback (most recent call last): file "/home/ubuntu/kafka/libs/test_kafka.py", line 21, in <module> kvs = kafkautils.createdirectstream(ssc, [topic], {"metadata.broker.list": brokers}) file "/opt/spark/python/lib/pyspark.zip/pyspark/streaming/kafka.py", line 122, in createdirectstream file "/opt/spark/python/lib/pyspark.zip/pyspark/streaming/kafka.py", line 195, in _get_helper typeerror: 'javapackage' object not callable

javascript - Calculate all item totals to subtotal Jquery -

note: bunch of people have had similar questions code set little differently solutions won't work here. i have subtotal variable should add each total(price * quantity) each item , return combined total. i'm getting subtotal coming as: 8.99undefinedundefinedundefined. if add new item it's now: 8.9911.99undefinedundefined here's code: // defining order items // ea item creates new row 3 td cells. includes item description , price var $burger = $("<tr><td class='addedburger'>royale w/ cheese</td><td></td><td>$8.99</td> <td id='burgercount'></td> </tr>"); var $pizza = $("<tr><td class='addedpizza'>arugula pizza</td><td></td><td>$11.99</td> <td id='pizzacount'></td> </tr>"); var $pork = $("<tr><td class='addedpork'>smoked pork ribs</td><td></td><td...

hadoop - ClickStream Data Analysis -

Image
i new bigdata analysis , came across interesting scenario called clickstream data analysis . know clickstream data. know more , different scenarios in can used in best interests of business , set of tools need process data in different steps of each scenario. any appreciated. thank you. what clickstream data? it virtual trail user leaves behind while surfing internet. clickstream record of user's activity on internet, including every web site , every page of every web site user visits, how long user on page or site, in order pages visited, newsgroups user participates in , e-mail addresses of mail user sends , receives. both isps , individual web sites capable of tracking user's clickstream. clickstream data may include information like: browser height-width,browser name,browser language, device type (desktop,laptop,tablets,mobile),revenue,day,timestamp,ip address, url,number of products added in cart, number of products removed,state,country,billing zip co...

gnu make - How can default env variable in gnu makefile target -

i want this test.install: export build_number=${build_number:-$${another_var}} but not working. come blank edit: this works fine. provided export build_number in shell before invoking make command test.install: export build_number=${build_number} these not working . both give blank build_number test.install: export build_number=${build_number:-$${another_var}} and test.install: export build_number=${build_number:-55}} if want expand variables in bash rather in makefile, you'll need escape expansion otherwise make going variable literally called build_number:-${another_var} or build_number:-55 test.install: export build_number=$${build_number:-$${another_var}} test.install: export build_number=$${build_number:-55}}

python - How to get Read the Docs to generate py-modindex.html? -

i'm trying read docs generate py-modindex.html file. research this question lead me following setup: setup.py in project directory has following contents, minimum needed pytest work , haven't been changed since got part of project working: import setuptools setuptools.setup( name='polygons', packages=setuptools.find_packages(), ) docs/requirements.txt contains single line: sphinx-autodoc-annotation the read docs repository url points github repository. the rtd setting "install project inside virtualenv using setup.py install" checked. the rtd setting "requirements file" points docs/requirements.txt . the "module index" link gets included in index.html , py-modindex.html file missing. my understanding virtualenv setting above, rtd use setup.py file install project sphinx can read documentation found in python docstrings. i'm using function annotations , sphyinx-autodoc-annotation make use of when cre...

python - Nearest match merge on two columns (pandas) -

similar 1 of previous questions ( merge dataframes on nearest datetime / timestamp ), merge 2 pandas data frames on 2 datetime columns using nearest match: let , b 2 dataframes follows: a = pd.dataframe({"id":["a", "a", "c" ,"b", "b"], "init_date":["01/01/2015","07/02/2014","08/02/1999","01/01/1991","06/22/2014"], "fin_date":["04/16/1923","09/24/1945","06/24/1952","11/26/1988","10/05/1990"]}) in [15]: out[15]: id fin_date init_date 0 04/16/1923 01/01/2015 1 09/24/1945 07/02/2014 2 c 06/24/1952 08/02/1999 3 b 11/26/1988 01/01/1991 4 b 10/05/1990 06/22/2014 b = pd.dataframe({"id":["a", "a", "c" ,"b", "b"], "date":["02/15/2015","06/30/2014","07/02/1999","10/05/1990",...