Posts

scala - Applying logical and to list of boolean values -

consider following list of boolean values in scala list(true, false, false, true) how using either foldright or foldleft emulate function of performing logical , on of values within list? val l = list(true, false, false, true) val andall = l.foldleft(true)(_ && _)

javascript - JS $.get method file with path -

i want load * .csv file path wich user can choose. path get: c:\\users\\... but $.get method can't read path. how path have like? $.get(pathandfile, function (data) {... if wanted read csv data in javascript computer need instruct user select file (there no way around this, possible exception of virus). once user selected file can read , parse csv data small amount of javascript ( demo ) with html: <input type="file" id="file" name="file" /> <table id="rows"></table> and javascript: var output = $('#rows'); $('#file').on('change', function(evt) { var files = evt.target.files; (var = 0, f; f = files[i]; i++) { // process text files. if (!f.type.match('text/.*')) { alert('unsupported filetype:'+f.type); continue; } var reader = new filereader(); reader.onloadend = function(evt) { var rows, row, cols, col, html; ...

Data cut in SQL Table -

i'm trying table basic data (last name, first name, id..) i have created table complete name doesn't appear in table, example: last name first name gonzalez rami margarita rami should ramirez. have declared last name longtext . how see complete last name in table or ensure not cut? i use varchar if want performance indexing , searching. such as: last_name varchar(30), the thirty how many characters allow in field. set number want under max(which escapes me @ moment somewhere beyond 60 varchar) excess automatically cut off.

MongoDB Positional Operator $ -

i got following document { _id : 91, "myarray" : [ { "a" : "1", "b" : true }, { "a" : "1", "b" : true }, { "a" : "1", "b" : true } ] } and want update each myarray.b element false b true . running following query: db.mydb.update({"arr.b" : true},{$set : {"arr.$.b":false}},false, true) and getting first array element updated not subdocuments. { _id : "91", "myarray" : [ { "a" : "1", "b" : false }, { "a" : "1", "b" : true }, { "a" : "1", "b"...

exchange server - Cannot use EWS.dll with ExchangeWebServices namespace -

this link outlines trying do http://msdn.microsoft.com/en-us/library/aa494212(v=exchg.140).aspx how right dll this? hard reason.... i trying use class getuseravailabilityresponsetype the dlls can have exchange microsoft.exchange.webservices.dll for while thought ews.dll, not contain namespace 'exchangewebservices'. need access class, contains microsoft.exchange.webservices.data namespace not have required classes. can please tell me how can right namespace? thanks. you have right dll, link refer type defined older ews proxy classes, don't have dll per se, defined via wsdl command. being equal, don't want use these old classes, rather new ews managed api, provided dll in question. equivalent functionality (availability) provided there, , placed start looking how use here:

regex - Match from the third word onwards in a string with PHP -

i'm trying return dolor sit amet following string - $title = 'lorem ipsum dolor sit amet'; preg_match('/^(?:\w+\s+){2}(.)+/', $title, $matches); it's matching last letter. you need put repetition operator inside group: preg_match('/^(?:\w+\s+){2}(.+)/', $title, $matches); otherwise, group captures 1 character.

Displaying other peoples facebook timelines on my site -

i've got website i'm doing around bunch of athletes. all of these athletes have facebook account. the client wants show each of these athletes facebook timelines on individual profile pages using facebook profile handle provide. i'm unfamiliar facebook api 99% sure isn't possible each of athletes have go facebook developers portal , set app right? is there way achieve @ all? nop, you're wrong. athletes don't have setup app. but, on other hand, or developer responsible project, must setup app @ facebook developers website. i'm not going explain process, since facebook docs quite easy understand. https://developers.facebook.com/docs/ after setup facebook app , integrate website, it's time start asking athletes authorization have plenty of ways that, can either use facebook login , dialogs or even manually build login flow . keep in mind have different permissions, here's full list of permissions , small description explai...