Posts

shell - Centos 6 /usr/sbin/sendmail - how to send email with subject? -

trying send email shell (centos 6) using 1 line command, subject empty echo 'body' | /usr/sbin/sendmail x@gmail.com subject:"test send mail" spent hours trying googling , find answer how send email using "/usr/sbin/sendmail" subject, no matter try, subject empty. (echo "subject: test"; echo; echo 'body')|/usr/sbin/sendmail -i x@gmail.com or cleaner script version #!/bin/sh /usr/sbin/sendmail -i x@gmail.com <<end subject: test body end warning : non us-ascii characters require special encoding in headers , custom headers when included in body.

python - Combining multiple parameters for creating SVM vector -

new scikit-learn , working data following. data[0] = {"string": "some arbitrary text", "label1": "orange", "value1" : false } data[0] = {"string": "some other arbitrary text", "label1": "red", "value1" : true } for single lines of text there countvectorizer , dictvectorizer in pipeline before tfidftransformer . output of these concatenated, i'm hoping following caveat: arbitrary text don't want equal in importance specific, limited , well-defined parameters. finally, other questions, possibly related might data structure indicate svm kernel best? or random forest/decision tree, dbn, or bayes classifier possibly better in case? or ensemble method ? (the output multi-class ) i see there upcoming feature feature union , run different methods on same data , combine them. should using feature selection ? see also: implementing bag-of-words naive-bayes classifi...

envdte - CodeSmith.Insight.ClientError CodeSmith 5.2 -

can me problem?. have been having codesmith 5.2. not sure if messed visual studio..i right click , manage or generate output , error occurs if try open codesmithapplication , debug separately through codesmith studio, generates .cs , generated.cs files correctly. when in application , right click generate outputs, error occurs. why complaining env_dte? this error getting <?xml version="1.0" encoding="utf-16"?> <casereport xmlns:i="http://www.w3.org/2001/xmlschema-instance" xmlns="http://schemas.codesmithtools.com/insight/v2"> <messagesignature i:nil="true" /> <projectid>24</projectid> <description i:nil="true" /> <isdescriptionhtml>false</isdescriptionhtml> <messagedate>2016-02-02t16:47:53.7606242-06:00</messagedate> <messageidentifier>95e884f0-eb58-42e2-8bcc-e52d23909897</messageidentifier> <attachments /> <casetype>...

php - How to display table data ordered by another table data row? -

i have videos , watch_later mysql tables, , want display videos data in page ordered watch_later date, current videos table looks this id | name | views 1 | funny video | 40 2 | sad video | 20 and current watch_later table looks this id | video_id | date 1 | 2 | 2016-02-01 2 | 1 | 2016-02-02 i've tried selecting ids watch_later table ordered date , selecting data videos table id in (previous ids), doesn't me videos data ordered watch_later date. (if didn't make sense, want watch later system youtube.) you have perform query join syntax: "select videos.*, watch_later.date videos join watch_later on videos.id=watch_later.video_id order watch_later.date desc" if prefer sorting in ascendant order, replace desc asc . with query, select either videos fields , date watch_later table. there various join methods: if want study it, @ w3schools edit: i choose select fields o...

physics - Simple 3D particle gravity in javascript? -

i'm trying simple gravity handling in 3d environment (i'm using three.js). i've got code, doesn't work. i'm hoping it's silly bug somewhere. edit: replaced old code function handlegravity() { for(var j = 0; j < spheres.length; j++) { for(var = 0; < spheres.length; i++) { var r1 = new array( spheres[j].position.x, spheres[j].position.y, spheres[j].position.z); var r2 = new array( spheres[i].position.x, spheres[i].position.y, spheres[i].position.z); var r12 = new array(r2[0]-r1[0], r2[1]-r1[1], r2[2]-r1[2]); var r12unitvector = new array( r12[0]/math.abs(r12[0]), r12[1]/math.abs(r12[1]),r12[2]/math.abs(r12[2]) ); var m1 = masses[j]; var m2 = masses[i]; var r12squared = r12[0]*r12[0] + r12[1]*r12[1] + r12[2]*r12[2]; var a12 = new array( -(gravconst*m2/r12squared)*r12unitvector[0], -(gravconst*m2/r12squared)*r12unitvector[1], -(gravconst*m2/r12s...

asp.net - ObjectDisposedException While using Include - why? -

my page calls services layer method uses generic repository "find" method. in services layer method, following: using (iunitofwork unitofwork = new dbcontext()) { genericrepository<operator> operatorrepos = new genericrepository<operator>(unitofwork); { try { var oper = operatorrepos.find(o => o.operatorid == operatorid).include(o => o.cmn_address).single(); return oper; } catch (invalidoperationexception exc) { //handle exception } } } the find method repository: public iqueryable<t> find(func<t, bool> predicate) { return _objectset.where<t>(predicate).asqueryable(); } on page, try acc...

With Elasticsearch function score query with decay against a geo-point, is it possible to set a target distance? -

it doesn't seem possible based on https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-function-score-query.html , i'd confirmation. in plain english, i'm asking score results (with geo-point locations) how close 500km latitude, longitude origin. it's confusing because there parameter called "offset" according documentation doesn't seem offset origin (eg. distance) instead seems mean "threshold" instead. i see few ways accomplish this: a. 1 way sort distance in reverse order origin. you'd use geo_distance query , sort distance . in following query, distant documents come first, i.e. sort value distance origin , we're sorting in decreasing order. { "query": { "filtered": { "filter": { "geo_distance": { "from" : "100km", "to" : "200km", "location": { ...