Posts

How to sort values that has different position of the fields in bash -

i discovered looking @ logs; commits git may have or not have name , last name; means if sort using -k, position of fields may not correct. for example, if file commits various repository standard format have is commit - name - surname - date - repo name i sort them sort -k 4, them ordered date (that's need)/ problem is, committer name replaced generic name (not sure why, not managing repository); ends jumping 1 field, , date on 3rd position, not 4th. this results in majority of commits ordered correctly, ones has date on 3rd position, end being @ bottom, don't have them ordered chronologically. since cannot control repo throw @ me, there way tell sort, order date, without specify 1 field has date? or should use different sort? can not check number of fields on line? i.e. counting last element instead of first? granted sort may not have sufficient capabilities specify keys end of line, may have resort small awk script find the right sort key based ...

regex - SQL/Oracle: INSTR or REGEXP? -

i'm studying exam , don't one: i want find cities in table ends ville, in charlottesville. which 1 correct? ... instr(city,'ville') > 0; or ... regexp_substr(b,'ville$') = 'ville' which of these 2 it? , wrong other one? regards jop

php - mPDF $_POST from another page not working -

i generate beautiful looking html based pdf reason, sending html form mpdf generator works outside of $html = ''... i send data html form (form.html) mpdf php page receives post variables. when use simple php tag $_post['preparedby'] in $html='' doesnt work. here's snippet: $html= ' <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td colspan="12"><img src="logo/xxtrasmsw.png"></td> </tr> <tr> <td colspan="12">eval form</td> </tr> <tr > <td width="11%">prepared by</td> <td colspan="7" class="bb">'.$preby.'</td> <td width="11%">date prepared</td> <td colspan="3" class="bb">'.$_post['dateprepared'].'</td> </tr> <tr...

java - How to round double to nearest whole number and return it as Integer -

let suppose have double x . return nearest whole number of x . example: if x = 6.001 return 6 if x = 5.999 return 6 i suppose should use math.ceil , math.floor functions. don't know how return nearest whole number... for example, seems want use math.rint() . return closest integer value given double . int valuex = (int) math.rint(x); int valuey = (int) math.rint(y);

javascript - Cannot read "path" property of undefined Nodejs -

here jade file form(method="post", action="/upload", enctype="multipart/form-data") input(type="file", name="logname") button(type="submit") upload and index.js file /* home page. */ router.get('/', function (req, res) { res.render('fileupload', { title: 'building log file viewer' }); }); var formidable = require('formidable'), fs = require('fs'), util = require('util'); /* post file upload */ router.post('/upload', function (req, res) { var form = new formidable.incomingform(); form.parse(req, function (err, fields, files) { fs.readfilesync(files.upload.path, function (err, data) { if (err) throw err; console.log("test"); }) }); }); i keep getting typeerror property property "path" undefined; however, when sumbit code under http.createserver, instead of rou...

wordpress - Icons to insert new page disappeared -

Image
someone tell me how can icons of wordpress? currently i'm like: i want return normal, thus: does know css can move? according chris herbert , try disabling plugins 1 one. solve problem. if you've edited core wordpress file, consider reinstalling wordpress wp-admin.

assign a variable with the value from a command + bash -

this question has answer here: assign command output variable , if branch on return value 1 answer how assign variable value command? this basic example of variable assignment: $ line_count=2 $ echo $line_count 2 this command(the value 3) assign variable: $ wc -l < file1.csv 3 but have tried not work: $ line_count2=wc -l file1.csv -sh: -l: command not found how can done? one way is: $ line_count2=$(wc -l < file1.csv) $ echo $line_count2