Posts

List Jasmine test results at bottom of console without other output -

is there reporter jasmine 2.5 can list results of tests without clutter of other console logs? i know can suppress logs more difficult (and can useful too) rather not if can use reporter can still list tests , descriptions @ bottom. right because of logs need scroll lot see descriptions of tests passed.

php - The mbstring extension is missing -

i'm new linux. installed apache2, mysql-server, php 7.0 , phpmyadmin on linux mint 18.1. installation went fine, localhost/phpmyadmin gives error (see title). tried: uncommenting "extension_dir" in php.ini uncommenting mbstring.dll extension in php.ini making link /var/www/html/phpmyadmin /usr/share/phpmyadmin reinstalling php7.0-mbstring but neither worked. i've been restarting apache well. if have apache , php running correctly, should install mbstring extension on php , restart apache: sudo apt-get install php7.0-mbstring sudo service httpd restart restarting apache step people forget about. distributions restart apache when install php extension, other don't.

How to define function in class properly in Python? -

this question has answer here: python: nameerror:global name '…‘ not defined [duplicate] 1 answer i want define function sumofleftleaves recursively: class node(object): def __init__(self,x): self.val = x self.left = none self.right = none class solution(object): def sumofleftleaves(self,root): if root.val == none: return 0 elif (root.left.left == none , root.left.right == none): return root.left.val + sumofleftleaves(root.right) else: return sumofleftleaves(root.left)+sumofleftleaves(root.right) but gives error "nameerror: global name 'sumofleftleaves' not defined", think it's defined recursively, what's wrong? sumofleftleaves still method on class , not globally defined function. can access bound method on self , you'd access other method: self.sumofleftleaves(...) you sh...

php - Invalid argument supplied for foreach() in web service API -

i'm using php code call json api, i'm having issues loading. php code $response[$i]['id']=$datafriend[$i]['id']; $response[$i]['name']=$datafriend[$i]['name']; $response[$i]['id']=$id; $response[$i]['lastmsgfrom']=$msg_from; $response[$i]['lastmsgtype']=$type; $response[$i]['lastmsg']=$msg; $response[$i]['lastmsgtime']=$time; $response[$i]['lastseen']=$datafriend[$i]['date']; $response[$i]['status']=$datafriend[$i]['status']; } } foreach ($response $key => $row) { $volume[$key] = $row['lastmsgtime']; } array_multisort($volume, sort_desc, $response); array_unshift($response, $userdata); error log php warning: invalid argument supplied foreach() php...

c# - Getting The connection does not support MultipleActiveResultSets when using Dapper.SimpleCRUD in a forEach -

i have following code: var test = new fallenvironmentalcondition[] { new fallenvironmentalcondition {id=40,fallid=3,environmentalconditionid=1}, new fallenvironmentalcondition {id=41,fallid=3,environmentalconditionid=2}, new fallenvironmentalcondition {id=42,fallid=3,environmentalconditionid=3} }; test.tolist().foreach(async x => await conn.updateasync(x)); i getting invalidoperationexception: connection not support multipleactiveresultsets i don't understand await ing each update why getting error. note: have no control on connection string can't turn mars on. that code starts task each item in list, not wait each task complete before starting next one. inside each task waits update complete. try enumerable.range(1, 10).tolist().foreach(async => await task.delay(1000).continuewith(t => console.writeline(datetime.now))); which equivalent foreach (var in enumerable.range(1, 10).tolist() ) { var task = task...

json - 765: unexpected token at 'Mailgun Magnificent API' (Ruby on Rails, mailgun_rails) -

i've been trying set mailgun api rails app (in development) , i'm using mailgun_rails gem, when trying send message action controller gives me error: json::parsererror in userscontroller#create 765: unexpected token @ 'mailgun magnificent api' the extracted source follows: @user = user.create(user_params) if @user.save usermailer.account_activation(@user).deliver_now flash[:info] = "please check email activate account." redirect_to root_url my development.rb has following lines concerning action mailer: config.action_mailer.raise_delivery_errors = true config.action_mailer.delivery_method = :mailgun config.action_mailer.default_url_options = { :host => 'localhost:3000' } config.action_mailer.perform_deliveries = true config.action_mailer.mailgun_settings = { api_key: env['mailgun_api_key'], domain: env['mailgun_domain'] } config.action_mailer.perform_caching = false the environments in .rbenv-vars file ...

wpf - c# Bluetooth LE - write configuration error - ValueChanged never called -

so try connect c# wpf program ble device , code connect device: private async task connecttowatcher(deviceinformation deviceinfo) { try { // device bluetoothledevice device = await bluetoothledevice.fromidasync(deviceinfo.id); // gatt service thread.sleep(150); var gattservicesresult = await device.getgattservicesforuuidasync(new guid(rx_service_uuid)); service = gattservicesresult.services[0]; // gatt characteristic thread.sleep(150); var gattcharacteristicsresult = await service.getcharacteristicsforuuidasync(new guid(rx_char_uuid)); characteristic = gattcharacteristicsresult.characteristics[0]; // register notifications thread.sleep(150); characteristic.valuechanged += (sender, args) => { debug.writeline($"[{device.name}] received notification containing {args.characteristicvalue.length} ...