Posts

c# - How to update List<string> column using Mapper.UpdateAsync in Cassandra? -

i newbie cassandra , current project called me create table following columns: id uuid primary key, connections list<text>, username text i using cassandra's imapper interface handle crud operations. while found documentation describes how use mapping component basic operations here: http://docs.datastax.com/en/developer/csharp-driver/2.5/csharp-driver/reference/mappercomponent.html i not find documentation outlines how add , remove items list column specific record using mapper component. tried retrieve record database, update entity , save changes record record not updated in database. remains same after update. however, insert operation works , mirrors entity down object in list. user user = await _mapper.singleasync<t>("where name = " + name); user.addresses = user.addresses.concat(new string[] { address }); await _mapper.updateasync<t>(user); how should scenario handled in cassandra? you can use plus (+) , minus (-) cql ...

php - Removing image from server -

i trying remove records database uploaded image record server.i have function in controller. public function delete(request $request) { if($request->ajax()) { $id=$request->get('id'); if($id) { $delete=category::where('id',$id)->first(); $delete->delete(); $imgfile='c:\xampp\htdocs\larapro\public\newuploads\<?php echo $delete->image;?>'; unlink($imgfile); echo json_encode(true);die; } } echo json_encode(false);die; } unlink(c:\xampp\htdocs\larapro\public\newuploads\<?php echo $delete->image;?>): result large if use $imgfile="c:\xampp\htdocs\larapro\public\newuploads\{$delete->image}"; it displays: unlink(c: mpp\htdocs\larapro\public\ ewuploads{1470667358.png}): invalid argument and wondering why x , n in link missing. ...

java - Why does ArrayIndexOutOfBoundsException occur and how to avoid it in Android? -

why arrayindexoutofboundsexception occur , how avoid in android? this exception thrown when try access array item doesn't exist: string [] myarray = new string[2]; myarray[2] = "something"; // throws exception myarray[-1] = "something"; // throws exception you should check index not negative , not higher array length before accessing array item.

esper - Property 'price' is not available for write access -

i getting following error while performing update operation: property 'price' not available write access. updatestatement : update istream faultystream set price = 100 id = 7; my event class implements java.io.serializable. still unable perform update. for pojo event classes, generate getter , setter methods. ide me. esper calls setter method , public void setprice(...) {...} .

node.js - Nodejs AWS SDK S3 Generate Presigned URL -

i using nodejs aws sdk generate presigned s3 url. docs give example of generating presigned url . here exact code (with sensitive info omitted): const aws = require('aws-sdk') const s3 = new aws.s3() aws.config.update({accesskeyid: 'id-omitted', secretaccesskey: 'key-omitted'}) // tried , without this. since s3 not region-specific, don't // think should necessary. // aws.config.update({region: 'us-west-2'}) const mybucket = 'bucket-name' const mykey = 'file-name.pdf' const signedurlexpireseconds = 60 * 5 const url = s3.getsignedurl('getobject', { bucket: mybucket, key: mykey, expires: signedurlexpireseconds }) console.log(url) the url generates looks this: https://bucket-name.s3-us-west-2.amazonaws.com/file-name.pdf?awsaccesskeyid=[access-key-omitted]&expires=1470666057&signature=[signature-omitted] i copying url browser , getting following response: <error> <code>nosuchbu...

html - How to upload image from <image src> tag in javascript? -

i have image tag on webpage below. <image src='http://xxxxxx.jpg'/> now want image , upload remote http server in javascript. value of image url variable defined in javascript http api call. want upload image remote server below. how can set value on 'how_to_set_this_value' in case? axios({ url: backendserveraddress + '/user/upload_photo', method: 'post', timeout: 30000, headers: { 'access_token': token }, data: how_to_set_this_value, }).then(response => { console.log('update photo response '+ response) }).catch(response=>{ console.log('failed upload photo') }) var filedata = document.getelementbyid('#idofyourfileinputelement').files[0]; var formdata = new formdata(); formdata.append('name_offile_field_of_your_choice',filedata); formdata.append('some_field_other_than_file',valueofthatfield); var how_to_set_this_value = formdata...

nightwatch.js - How to click at a certain location in div -

i want execute click on full-screen div underneath (non full-screen) modal dialog. seems click event automatically targets center of background div, thereby touching content that's on top of div (the modal dialog itself). how can specify click should happen? this verbose output of click command: element not clickable @ point (640, 436). other element receive click: <label class="btn btn-default ">... the root of problem selenium clicks sending mouseclick event not directly element screen coordinates. therefore cannot find clickable element point (as described in verbose output). there 2 possible workaround (for case): 1) click element position not overlapped modal dialog (applicaple fullscreen div): .movetoelement('.backdrop', 900, 10) // 900 x offset .mousebuttonclick(0) 2) better, universal solution. directily sending click event via injected javascript: .execute(function(selector) { document.queryselector(selecto...