Posts

Showing posts from January, 2010

javascript - MongoDB emits HTML as plain text -

why isn't html being rendered whenever output result query. this how save document: data = { title: "article title", body: "<b>this</b> content!!" }; var article = new article(data); article.save(); and how display it: h2.articletitle(style="font-style: italic;") #{article.title} p.articlebody(style="margin-top: 20px;") #{article.body} the out of article body should be: this content!! but instead outputs everything, including html tag: <b>this</b> content!! i reading similar question asked told me add dash (-) before article.body. tried: h2.articletitle(style="font-style: italic;") #{article.title} p.articlebody(style="margin-top: 20px;") - article.body but didn't output when tried way. appreciated. thanks. ok problem how outputting jade, template engine i'm using. managed fix replacing # ! symbol. h2.articletitle(style="font-style: ital...

javascript - How to open iframe popup in parent window -

is there way open popup (which in iframe) in parent window (the iframe , parent in diferent domains) using js/jquery the browser security checks enforce couple of interactions iframes different origin/domain host page blocked. to unblock, need use sandbox attribute on iframe value "allow-popups" relax restrictions. there other possible values can set see here: https://developer.mozilla.org/en/docs/web/html/element/iframe be careful values set here except trust iframe domain.

boot2docker - Slow network performance in Docker container -

i'm running latest docker/ docker-machine on osx yosemite , virtualbox , i'm trying connect lein ring server running in container host loading slow in load time on 1 min following configuration docker 1.12.0 docker machine 0.8.0 virtualbox 5.0.24 my docker machine "configversion": 3, "driver": { "ipaddress": "192.168.99.100", "machinename": "default", "sshuser": "docker", "sshport": 49478, "sshkeypath": "/volumes/nasmac/vms/.docker/machine/machines/default/id_rsa", "storepath": "/volumes/nasmac/vms/.docker/machine", "swarmmaster": false, "swarmhost": "tcp://0.0.0.0:3376", "swarmdiscovery": "", "vboxmanager": {}, "hostinterfaces": {}, "cpu": 1, "memory": 1024, "disksize": 20000, "natnictype": "82540em", ...

git pull --rebase not yeilding deseired outcome -

i lost changes did files after doing git pull --rebase. have absolutely no clue happened here , in end , ended checking out changes ( backing them in seperate folder ) pasting before commiting. here entire terminal showdown. thisuser@desktop-ens2652:/mnt/c/sites/application$ git status changes not staged commit: (use "git add <file>..." update committed) (use "git checkout -- <file>..." discard changes in working directory) modified: gemfile.lock modified: app/controllers/application_controller.rb modified: app/uploaders/pdf_uploader.rb modified: lib/card/print_manager.rb no changes added commit (use "git add" and/or "git commit -a") thisuser@desktop-ens2652:/mnt/c/sites/application$ git add -u thisuser@desktop-ens2652:/mnt/c/sites/application$ git status on branch card_application branch up-to-date 'origin/card_application'. changes committed: (use "git reset head ...

git - Automated heroku deploy from subfolder -

i know can deploy automatically heroku github, haven't found way push subfolder github heroku. from command-line know possible with: git subtree push --prefix <subfolder> heroku master however, know if there way use github integration heroku make pull specific subfolder automatically when commit added branch. i able make work. have server subfolder python flask app , wanted deploy automatically using github integration. heroku uses buildpacks detect language & framework of project. more here . i found source code buildpack here . need @ detection script. python checks requirements.txt file, made symlink using ln -s server/requirements.txt requirements.txt . my procfile looks this: web: gunicorn --pythonpath server/api app:app . everything works now!

html - Space after footer is white? -

hello im trying make there lot of white space after footer(if can call that) picture : after "sponzori" there lot of white space u can see here html code <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="x-ua-compatible" content="ie=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="description" content=""> <meta name="author" content=""> <title>heroic features - start bootstrap template</title> <!-- bootstrap core css --> <link href="css/bootstrap.min.css" rel="stylesheet"> <!-- custom css --> <link href="css/heroic-features.css" rel="stylesheet"> <!-- html5 shim , respond.js ie8 support of html5 elements ...

java.lang.IllegalArgumentException kafka console consumer -

we using kafka 2.10-0.9.0.2.4.2.0-258 in our environments. getting below exception kafka console consumer on few topics. aware times messages coming these topics big not exceed message.max.bytes. ./kafka-console-consumer.sh --zookeeper xxx:2181,xxx:2181,xxx:2181 --topic test-topic {metadata.broker.list=xxx:9092,xxx:9092,xxx:9092, request.timeout.ms=30000, client.id=console-consumer-76015, security.protocol=plaintext} [2016-08-28 21:27:54,795] error error processing message, terminating consumer process: (kafka.tools.consoleconsumer$) java.lang.illegalargumentexception @ java.nio.buffer.limit(buffer.java:275) @ kafka.message.message.slicedelimited(message.scala:237) @ kafka.message.message.key(message.scala:224) @ kafka.message.messageandmetadata.key(messageandmetadata.scala:30) @ kafka.consumer.oldconsumer.receive(baseconsumer.scala:84) @ kafka.tools.consoleconsumer$.process(consoleconsumer.scala:109) @ kafka.tools.consol...

html - 2 item rows wont center and dont act as intended -

alright, have portfolio page i'm working on , reason columns stuck left, margins on auto don't work, float:none doesn't work. i've tried pretty anything. know how fix this? problem site in question: https://jsfiddle.net/p3jgjnbr/ .logo { font-size: 20px; color: white; font-family: monospace; -webkit-transition: ease 0.2s; -moz-transition: ease 0.2s; -o-transition: ease 0.2s; transition: ease 0.2s; } .intro-nav { margin-bottom: 50px; } #logo:hover { font-size: 20px; color: green; font-family: monospace; background-color: white; border-color: white; border-bottom: solid green; } #navlist li { -moz-transition: ease 0.2s -o-transition: ease 0.2s; -webkit-transition: ease 0.2s; transition: ease 0.2s; font-family: monospace; font-size: 20px; } #navlist li:hover { background-color: green; font-family: monospace; border-bottom: solid white; } .slight-round { border-radius: 10px; } .anon...

django - How to move singup\signin templates into dropdown menu? -

i have fixed navigation , want add dropdown box users can singup\in (as twitter uses). i tried: # project/tempates/signup.html {% load i18n %} {% load account socialaccount %} {% block head_title %}{% trans "signup" %}{% endblock %} {% block content %} <h1>{% trans "sign up" %}</h1> <p>{% blocktrans %}already have account? please <a href="{{ login_url }}">sign in</a>.{% endblocktrans %}</p> <form class="signup" id="signup_form" method="post" action="{% url 'account_signup' %}"> {% csrf_token %} {{ signupform.as_p }} {% if redirect_field_value %} <input type="hidden" name="{{ redirect_field_name }}" value="{{ redirect_field_value }}" /> {% endif %} <button type="submit">{% trans "sign up" %} &raquo;</button> </form> {% endblock %} # project/tempa...

wolfram mathematica - I want to define f^2 to be 1 but leave f undefined -

i want, example, mathematica generate 7 + 5f if write expression (2+f) (3+f). want f^2 computed 1 (or other value assign it) f special undefined symbol. if define f^2:=1 tag power protected error message. i mathematica newbie, self taught, please try answer in elementary fashion possible. for record, trying define clifford algebra operations in n-dimensional space-time , being able make assignment tremendously simplify task. generalized symbols e1,e2,e3,...,en x = (a + a1 e1 + a2 e2 + a3 e3 + a4 e1 e2 - a5 e1 e3 + a6 e2 e3 + a7 e1 e2 e3); y = (b + b1 e1 + b2 e2 + b3 e3 + b4 e1 e2 - b5 e1 e3 + b6 e2 e3 + b7 e1 e2 e3); replaceall[ expand[x y], power[e_, 2] /; first[characters[tostring[e]]] === "e" -> 1 ] this way have learned @edmund more elegant: expand[(2 + e1)(3 + e2)] /.power[s_symbol,2]/; stringstartsq["e"]@symbolname[s]->1 6 + 3 e1 + 2 e2 + e1 e2

c# - Using which method in WebAPI for SignalR in this case -

i understand differences of post(add) , put(update) in web api. however, 1 should use in signalr. when developing chat app that hub class public class chathub : hub { .... } that apicontroller class public class chatclientcontroller : apicontroller { // [httppost] or [httpput]?? public bool connect(chatconnectionviewmodel model) { //connection method } //[httppost] or [httpput] ?? public bool sendtextmessage(messageviewmodel model) { //send message method } } my question is: 1. when client side send web api request call connect method, request method should use? post or put ? when client side send web api request call sendtextmessagemethod, request method should use? post or put ? in addition my goal send image file via signalr. got idea this , using signalr via web api. answers?

reactjs - React Router no input file specified -

i'm using react-router navigate page auth page. here code: import react, {component} 'react'; import reactdom 'react-dom'; import {provider} 'react-redux'; import {createstore, applymiddleware} 'redux'; import {router, route, indexroute, browserhistory} 'react-router'; import reducers './reducers'; import app './components/app'; import authenticate './components/auth/index'; import login './components/auth/login'; reactdom.render( <provider store={createstorewithmiddleware(reducers)}> <router history={browserhistory}> <route path="authenticate"> <indexroute component={login} /> <route path="/login" component={login}/> </route> <route path="/" component={app}> <indexroute component={login} /> </route> </r...

amazon ec2 - What is a difference between 1 instance EC2 m3.2xlarge and 2 instances m3.xlarge -

i have web app, installed on ec2 4 instances of m3.xlarge. difference if installed on 2 instances of m3.2xlarge? 1 better? please me explain this? ec2 m3 family includes m3 instance types , provides balance of compute, memory, , network resources model-------------vcpu-------mem(gb)--------ssd storage(gb) m3.xlarge---------4------------15------------------2 x 40 m3.2xlarge--------8------------30-----------------2 x 80 4 instances of m3.xlarge similar 2 instances of m3.2xlarge depend on web app host (redundancy, how application running shared resources etc)

debugging - Why argument has been changed when using subprocess(python) to start application(windows)? -

Image
i use python code below start debugger , application(a simple code write myself) argument: debugger=r'c:\program files (x86)\windows kits\10\debuggers\x86\windbg.exe' exe='test.exe' argument='\x01\x02...\xff'#from 0x01 0xff subprocess.popen(debugger+" "+exe+" "+argument) well worked, when set breakpoint in main function, , checked argument, seemed argv[ 1 ] not right: it seems '\x09' , '\x20' changed '\x00' , '\x22' gone. so what's wrong? doing in wrong way? command arguments shold passed popen list: subprocess.popen([debugger, exe, argument])

jvm - How to fix java.lang.UnsupportedClassVersionError: Unsupported major.minor version -

i trying use notepad++ all-in-one tool edit, run, compile, etc. i have jre installed, , have setup path variable .../bin directory. when run "hello world" in notepad++, message: java.lang.unsupportedclassversionerror: test_hello_world : unsupported major.minor version 51.0 @ java.lang.classloader.defineclass1(native method) @ java.lang.classloader.defineclasscond(unknown source) ......................................... i think problem here versions; version of java may old or new. how fix it? should install jdk, , setup path variable jdk instead of jre? what difference between path variable in jre or jdk? the version number shown describes version of jre class file compatible with. the reported major numbers are: java se 9 = 53, java se 8 = 52, java se 7 = 51, java se 6.0 = 50, java se 5.0 = 49, jdk 1.4 = 48, jdk 1.3 = 47, jdk 1.2 = 46, jdk 1.1 = 45 (source: wikipedia ) to fix actual problem should try either run java cod...

java - List in Android: Rename duplicated items -

Image
i want create lists follows: list-item list-item-1 list-item-2 list-myitem list-myitem-1 as above list-item , if item's name same in next row, add suffix 1 . like done upto enter image description here ok, want ask how implement this. simple solution can think of using map<string, int> keep track of item name. code this: final map<string, integer> listnamemap = new hashmap<string, integer>(); when displaying list item name, you'll do: final string displayedname; if (listnamemap.containskey(name)) { integer newvalue = listnamemap.get(name).intvalue() + 1; listnamemap.put(name, newvalue); displayedname = name + "-" + string.valueof(newvalue); } else { listnamemap.put(name, 0); displayedname = name; } // use displayedname display

What is the essential difference between compound command and normal command in bash? -

i learning bash. learning [[ ... ]] command , (( ... )) command. called compound command, discriminated normal command, [. read article of "compound commands" in bash manual. seems runs own rules. unfortunately, not think of why called "compound". knows it, please let me know. thank much. bash distinguishes between simple commands , compound commands: simple commands single command optional arguments , redirections. example: $ echo hello hello compound commands combine 1 or more simple commands functions single unit. example: $ { echo hello; date; } hello sun aug 28 23:16:03 pdt 2016 one useful feature of compound commands redirections applied compound command applied every command contains. example: $ { echo info1; echo info2; } >logfile $ cat logfile info1 info2 according man bash , there 4 types of compound commands: group: {...;} , illustrated above can used group simple commands form compound command. subshell: (...) s...

javascript - How to set sequence for exact consecutive elements of csv string? -

i have string csv containing portcode , latitude longitude of location. use these values plot marker on google map . eg csv string: anc|61.2181:149.9003, anc|61.2181:149.9003, tlk|62.3209:150.1066, dnl|63.1148:151.1926, dnl|63.1148:151.1926, dnl|63.1148:151.1926, tlk|62.3209:150.1066, tlk|62.3209:150.1066, ale|60.9543:149.1599 i want autonumber similar portcode sequence separated pipe symbol '|' portcode exact consecutive next element. required out put: anc|61.2181:149.9003:1|2, tlk|62.3209:150.1066:3, dnl|63.1148:151.1926:4|5|6, tlk|62.3209:150.1066:7|8, ale|60.9543:149.1599:9 any solution using jquery/javascript/c# ? there's neater/shorter way this, here's first second way came mind using javascript: var input = "anc|61.2181:149.9003,\nanc|61.2181:149.9003,\ntlk|62.3209:150.1066,\ndnl|63.1148:151.1926,\ndnl|63.1148:151.1926,\ndnl|63.1148:151.1926,\ntlk|62.3209:150.1066,\ntlk|62.3209:150.1066,\nale|60.9543:149.1599"; v...

xml - Creating dynamic sitemap with php -

first let me tell learning php. want create automatically dynamic sitemap site. script (suppose sitemap.php) crawl links of site , create array of 1000 urls. once 1000 urls limit reaches, make page id 1000 urls array. script output : <sitemapindex xmlns="http://www.google.com/schemas/sitemap/0.84" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://www.google.com/schemas/sitemap/0.84 http://www.google.com/schemas/sitemap/0.84/siteindex.xsd"> <sitemap> <loc>http://exmaple.com/sitemap.php?page=1</loc> </sitemap> <sitemap> <loc>http://example.com/sitemap.php?page=2</loc> </sitemap> </sitemapindex> page 1 have 1000 urls in xml format , page 2 have , go on site updated.i have tried many codes github , other seach pages google. have not found need. can please. the best solution have access root folder , add apache .htaccess file following line after rewri...

xamarin - Programaticly positioning UI elements in C# -

i've started xamarin , i'm having great difficulty programmatically placing ui elements want them. currently i'm using sort of method: label apptitle = new label { verticaltextalignment = textalignment.end, horizontaltextalignment = textalignment.center, text = "fishbike gps" }; button menubutton = new button { image = "images/hamburger_icon.bmp", horizontaloptions = layoutoptions.start, verticaloptions = layoutoptions.start }; title = "fishbike gps"; content = new stacklayout { children = { apptitle, menubutton } }; however leaves lot desired. 1 thing, want label , button on same 'line' were. puts them 1 under other. i'd have more choice how far left / right label appears. while i'm here can te...

c# - Handling a Jump List event when a file is picked from the "Recent" list of files for a UWP Windows 10 app -

Image
i'm working on uwp windows 10 app in c#/xaml, , i'm planning extend use of jump list. so, know how handle custom jump list tasks (such new file, open file etc.), files in used list, i've no idea @ how intercept file has been selected list (been unable find documentation it, whereas jump list tasks able to). if pick file when app isn't open, splash screen stays open. , if pick 1 when app open, puts focus on app (obviously desired behaviour doesn't happen in scenario because i'm not handling event). this easy figure out, if there way me debug app after i've launched via jump list file (or if there app event called when app isn't in focus , return focus selecting jump list file - maybe there i'm not aware of it). any guidance appreciated! jump list activation you need override onfileactivated event in app.xaml.cs . splash screen stays displayed , nothing happens because in event handler, need check if app has been launched or no...

scala - Is forcing action on spark dataframe required? -

i have below code snippet, working fine. so here 2 actions in code. updatedf.first() , mergeddf.save() updatedf.count() dummy action, if remove job failing. necessary force such kind of action in code. feeling if remove updatedf.count() , first encounter action on mergeddf.save() . , when compute mergeddf.save() creates more intermediary dataframes causing job failed. suggest code change make better. newdatadf.persist() val historydatadf=hivecontext.read.format("orc").load(stagingfullpath).persist() val updatedf = historydatadf.coalesce(5).join(newdatadf, jobprimarykey).select(historydatadf.columns.map(historydatadf(_)): _*).persist() println(updatedf.count()) val unchangeddf = historydatadf.except(updatedf).persist() val mergeddf = unchangeddf.unionall(newdatadf).persist() mergeddf.write.format("orc").mode(org.apache.spark.sql.savemode.overwrite).save(stagingfullpath)

php - second dropdown is not fill when selecting fisrt dropdown value -

i have 2 table , state stcode, statename 2.district distcode, stcode, districtname my code first drop down <td><label for="studentstate"></label> <select name="studentstate" id="studentstate"> <?php $con=mysql_connect("localhost","root",""); if(!$con) { die('could not connect:'.mysql_error()); } mysql_select_db("db_loan",$con); $sqlstr="select stcode,statename state"; $result=mysql_query($sqlstr); while($row=mysql_fetch_array($result)) { echo '<option value="'.$row['stcode'].'">'.$row['statename'].'</option>'; } echo $sccode=$row...

c# - While binding a retrieved excel columns in DataSet all columns are retrieved bind except the last column -

i have requirement import excel file in asp.net mvc. importing working needed, there 78 columns in excel file. columns imported except last column. how retrive last column excel file? string constring = string.empty; if (getfileextension.tolower() == ".xls") { constring = "provider=microsoft.jet.oledb.4.0;data source=" + getfilename + ";extended properties=\"excel 8.0;hdr=yes;imex=2\""; ; } else if (getfileextension.tolower() == ".xlsx") { constring = "provider=microsoft.ace.oledb.12.0;data source=" + getfilename + ";extended properties=\"excel 12.0;hdr=yes;imex=2\""; } oledbconnection con = new oledbconnection(constring); if (con.state == connectionstate...