Posts

Showing posts from June, 2012

android - save checked state of checkbox in multi select listview -

i'm new multi-select listview. want save checked state of checkbox in listview if user closes app , opens again, selected checkbox still remain selected. there way this. searched , found can done using sharedpreference didn't more information on how use it. thanks public class mainactivity extends appcompatactivity { listview mylist; button getchoice; string[] listcontent = { "january", "february", "march", "april", "may", "june", "july", "august", "september", "october", "november", "december" }; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); mylist = (listview)findvie

R in Shiny: How can I adjust radio buttons to the grid width of column? -

the question straightforward. code contains following lines: fluidrow( column(12, "some text"), fluidrow( column(12, radiobuttons("buttons", "please select choice", choices = list("a" = 1, "b" = 2, "c" = 3), selected = false, inline = true))) i choices (radio buttons) evenly spread on grid width. appreciated! you need use additional css parameters this. assuming parameters choices: parameters <- c("a", "b", "c", "d") to have multi-column radio buttons: add additional class: controls <-list(tags$div(align = 'left', class = 'multicol', radiobuttons(inputid = 'buttons', label = "select parameters: ", choices = parameters, selected = "a",

Outlook add-ins how to hide the body(dialog) of formregion? -

i creat formregion of outlook add-ins, , show in outlook, have problem image1: image1 when click formregion in outlook, shows me white interface, think because didn't design formregion, don't want show white interface, want have function : when click formregion, juste want show dialog message image2 image2 so how hide body of formregion image1, , show popup dialog image2? thank much.

c++ - How to use a openvdb (parallel) foreach accessing multiple grids? -

i have openvdb grid iterate using functor , openvdb::tools::foreach. //the grid iterating on grid g; //the operator used update each single voxel of g struct functor{ inline void operator()(const grid::valueonciter& iter) const { } }; if operation involved g have called functor op; openvdb::tools::foreach(visiblegrid->cbeginvalueon(), op, true, true); at each voxel (iteration) though need access , modify additional grid(s) based on computed value of iteration step. my inital solution involved providing functor accessor of additional grid(s): struct functor{ grid2::accessor grid2_accessor; functor( grid2::accessor& a) : grid2_accessor(a){} inline void operator()(const grid::valueonciter& iter) const { //use grid2_accessor based on iter.getcoord() } }; the accessor provided functor @ construction time , each thread of parallel copy of functor: functor op(g2->getaccessor() ); openvdb::tools::foreach(g1->cbeginvalueon(),

javascript - request a json parameter to java to convert a json array to java array -

basicaly need to pass java string array javascipt array, after pass array via json jsp page, in jsp parse array java array. i try following: jsonarray arr = new jsonarray(); jsonobject tmp; for(int = 0; < invoiceid.length; i++) { tmp = new jsonobject(); tmp.put("invoiceid", invoiceid[i]); arr.add(tmp); } following javascript in same page: var invoiceid = json.stringify(<%=arr%>);` $.ajax({ type: 'get', url: 'crudsettlement.jsp', data: { winvoiceid: invoiceid }, async: false, datatype: 'json', success: function(json) { $("#msg").val(json.msg); } }); in page crudsettlement.jsp try following: jsonobject jobj = new jsonobject(request.getparameter("my

SQL Server Select Record based on datetime and user type -

id| type | datetime | ---| ---------|--------------| 1 | admin | 2016-01-03 | 2 | user | 2016-01-07 | 3 | user | 2016-01-08 | 4 | admin | 2016-01-04 | 5 | user | 2016-01-01 | 6 | user | 2016-01-03 | 7 | user | 2016-01-05 | 8 | user | 2016-01-09 | lets have table above , need rearrange based on datetime. first record must admin latest datetime among type of admin only. second fifth record must type of user sort datetime descending. again, sixth record must type of admin second latest datetime. expected result query shown in table below. expected result: id| type | datetime | ---| ---------|--------------| 4 | admin | 2016-01-04 | 8 | user | 2016-01-09 | 3 | user | 2016-01-08 | 2 | user | 2016-01-07 | 1 | admin | 2016-01-03 | 7 | user | 2016-01-05 | 6 | user | 2016-01-03 |

webrtc - How to make getUserMedia() method works on Chromium Web browser inside WinForms application? -

i'm trying access webcam winforms application using chromium webbrowser control, installed html file - shown below - server (on machine) tried navigate application error callback of getusermedia() method executed showing "permission denied error", on other hand it's working fine if tried navigate directly chrome. so, there know causes error ? // client.js file (function () { window.onerror = function (errormsg, url, linenumber) { alert(errormsg, ',url: ' + url + ' ,line: ' + linenumber); return true; } })(); function hasusermedia() { //check if browser supports webrtc return !!(navigator.getusermedia || navigator.webkitgetusermedia || navigator.mozgetusermedia); } if (hasusermedia()) { navigator.getusermedia = navigator.getusermedia || navigator.webkitgetusermedia || navigator.mozgetusermedia; //enabling video , audio channels navigator.getus

javascript - How to allow HTTPS site to access HTTP enables site in Dynamics CRM 2016 on-prem? -

i trying add autocomplete functionality country/region field on account form in on-prem environment of dynamics crm 2016 following post . crm environment https enabled here in post mentioned add autocomplete functionality have allow access http sites https enabled site. i want know how can job done? that's not supported in ie default (you'll security exception) , wouldn't cause introduce security flaws. vice-versa not same tho, access https site http, that's not problem.

WebStorm 2016.2.0 is adding two space-bars instead of a tab character -

currently when edit file in webstorm 2016.2.0 , press tab, webstrom adding 2 space bars. there should setting somewhere in editor this. want have tab character instead default 2 space-bars, question how ? you can change option each of supported languages at: settings > editor > code style > [choose language] > tabs , indents > use tab character or can add .editorconfig file in root of project set preferences globally. you'll need write in indent_style = tab

android - Why ImageView of screen is not drawn: -

Image
i need create bounce animation on layout contains recylerview , imageview . simplify explanation here illustration of current layout: the recyclerview ( red ) take screen size, , under position imageview ( green ) not seen @ beginning. 2 view contained linearlayout ( blue ) vertical orientations. what want move linearlayout 50dp , drop bounce animation image view visible during animation. the problem when raise linearlayout code: mlayout.postdelayed(new runnable() { @override public void run() { mlayout.animate().y(-500f); } }, 1000); the imageview not shown, more on when use ddms , snapshot of xml layout after move animation looks image not part of layout. update: xml layout: <?xml version="1.0" encoding="utf-8"?> <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:to

email - my code doesn't work (php) -

this question has answer here: php mail function doesn't complete sending of e-mail 24 answers my code save info in database doesn't send message email , alert message not work. can me , please ? ` if(isset($_post['send'])){ $to = "nada_26_@hotmail.com"; // email address $subject = "form contact"; $subject2 = "copy of form submission"; $name = $_post['name']; $from = $_post['email']; $subject3 = $_post['subject']; $company = $_post['company']; $content = $_post['message']; $message = "name: ".$name ." subject: " . $subject3 . " company: " . $company ."\n\n".$content; $message2 = "here copy of message " . "\n\n" . $_post['message']; $headers = "from:" . $from

How to get the desired output by using min function in mysql? -

i using below query in mysql select count(c.id), u.id users u inner join zipcode_users_1_c zu on zu.zipcode_users_1users_idb = u.id left join zipcode z on z.id = zu.zipcode_users_1zipcode_ida left join branches b on u.branch_id = b.id left join branches_loan_1_c bl on b.id = bl.branches_loan_1branches_ida left join loan l on l.id = bl.branches_loan_1loan_idb left join accounts_loan_1_c al on l.id = al.accounts_loan_1loan_idb left join accounts on a.id = accounts_loan_1accounts_ida left join cases_cstm cc on u.id = cc.user_id_c left join cases c on cc.id_c = c.id , u.deleted = 0 , zu.deleted = 0 , z.deleted = 0 , bl.deleted = 0 , b.deleted = 0 , and l.deleted = 0 , al.deleted = 0 , a.deleted = 0 , c.deleted = 0 l.id = '34599008-3931-a6e1-b736-5795f5e9ff0b' , z.code = a.billing_address_postalcode , u.status = 'active' group u.id and getting result +-------------+--------------------------------------+ | count(c.id) | id

android - how to send automatic email with Attachment -

i used this send automatic emails in app. tried add attachment code app not working! how send automatic email attachment ? gmailsender.java package mypack; public class gmailsender extends javax.mail.authenticator { private string mailhost = "smtp.gmail.com"; private string user; private string password; private session session; public multipart _multipart; static { security.addprovider(new hossin.asaadi.mailsender.jsseprovider()); } public gmailsender(string user, string password) { this.user = user; this.password = password; properties props = new properties(); props.setproperty("mail.transport.protocol", "smtp"); props.setproperty("mail.host", mailhost); props.put("mail.smtp.auth", "true"); props.put("mail.smtp.port", "465"); props.put("mail.smtp.socketfactory.port", "465"); props.put("mail.smtp.socketfactory.class&q

How to print pdf from my Android app with Brother HL-1110 Series Printer -

i check brother printer's developer site , provide sdk without support of ink-jet , laser printer. app "starprint" can print on printer slow process , sometime app cannot print thing in brother printer. looking better solution can print pdf directly app using brother hl-1110 series printer. please me valuable suggestion. thanks just had same question. printer (here hl-1110) connected how ? own wifi or via windows or ubuntu (here 16.04) via usb. installed , shared open internal network. problem under ubuntu, there after installation 2 printer * hl-1110, use usb, dont print * hl-1110 series, using brother driver , can print pc good android: used install app "printershare, less mb using", after starting, search wifi search (or choose use) , saw directly hl-1110. test page goes que, before cant print, i have manually move job kl-1110 series, ok. advantage "mistake", can check jobs before printer gets crazy. happy other solutions

c# - Deserialize empty XML element as Guid.Empty -

i have troubles deserializing. <order> ... <cardnumber /> ... </order> if use <cardnumber>00000000-0000-0000-0000-000000000000</cardnumber> it's working normally, in case when use <cardnumber /> - object not deserializing ( is there way deserialize empty element guid.empty? property should mapped value of element: [xmlelement(elementname = "cardnumber")] [jsonproperty("cardnumber")] public guid? cardnumber { get; set; } same situation in json works , use guid.empty instead of empty element value { "cardnumber": "" } the exception seeing explains problem clearly: system.invalidoperationexception occurred message="there error in xml document (3, 3)." innerexception: system.formatexception message="guid should contain 32 digits 4 dashes (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx)." as stated, xmlserializer not support deserializing

materialize css modal loop in ng-repeat is not working -

below sample code according guide http://materializecss.com/modals.html . individual modals working fine loop not working. tried ng-repeat $index getting unique modal'id <tr ng-repeat="u in users"> <td>{{ $index +1 }}</td> <td>{{ u.first_name +" "+ u.last_name }}</td> <td>{{ u.email }}</td> <td>{{ u.plan }}</td> <td> <a class="waves-effect waves-light btn modal-trigger" data-target="modal1" href="#modal{{$index+1}}"> remove </a> <div id="modal{{$index+1}}" class="modal bottom-sheet"> <div class="modal-content"> <h4>modal header</h4> <p>a bunch of text</p> </div> <div class="modal-footer"> <a href="#!" class=" m

How to exclude an entire directory from Android 6 Auto Backup? -

i'd configure android 6 auto backup feature exclude files in entire directories (both in "files" , "external"), specific extensions should excluded. wildcards . , *.tn-png work path value? cannot explicitly define files since these created @ run-time. android:fullbackupcontent="@xml/mybackupscheme" where mybackupscheme example this: <?xml version="1.0" encoding="utf-8"?> <full-backup-content> <exclude domain="file" path="device-links.xml"/> <exclude domain="file" path="*.tn-png"/> <exclude domain="file" path="links/*.*"/> <exclude domain="external" path="external-links/*.*" /> </full-backup-content> thanks in advance, the official documentation says: path: specifies file or folder include in or exclude backup. note that: this attribute not support wildcard or regex sy

node.js - HapiJs: Session store on MongoDB? -

i using hapi-auth-cookie authentication. there example store session on mongo (or) redis in hapi connect-mongo production app.

python - Scripting in logstash -

is possible python scripting in logstash? can import csv data elasticsearch using logstash. need use update api instead of indexing rows. here sample csv file... vi /tmp/head.txt "home","home-66497273a5a83c99","spice xlife 350, 3.5inch android, bit.ly/1vszj","919359000000","hmshop","916265100000","2016-05-18 08:41:49" "home","home-26497273a5a83c99","spice xlife 350, 3.5inch android, bit.ly/1v1","919359000001","hmshop","916265100000","2016-05-18 18:41:49" "home","home-36497273a5a83c99","spice xlife 350, 3.5inch android, bit.ly/szj1","919359000001","hmshop","916265100000","2016-05-18 12:41:49" "home","home-46497273a5a83c99","spice xlife 350, 3.5inch android, bit.ly/1","919359000000","hmshop","916265100000","20

oop - Why I should go for Interfaces in C# when I can implement the methods directly -

i aware basic question, interviewer asked me in trick way , helpless :( i know material or theoretical definition interface , implemented in many projects worked on. don't understand why , how useful. i don't understand 1 thing in interface. i.e example, use conn.dispose(); in block. don't see class implementing or inheriting idisposable interface ( sqlconnection ) class mean. wondering how can call method name. in same thing, not understanding how dispose method works because, need implement function body our own implementation interface methods. how interfaces accepted or named contracts? these questions kept on rolling in mind till , frankly never saw thread explain questions in way can understand. msdn usual looks scary , no single line clear there ( folks, kindly excuse high level development, feel code or article should reach mind of see it, hence many others say, msdn not of use ). the interviewer said: he has 5 methods , happy implement in class di

java - Must be called from a blob upload callback request -

i have implemented gwt example blobstore api in java: https://cloud.google.com/appengine/docs/java/blobstore/ it works fine when post made via client side form (inside browser). however, sending files (images) same /upload service handler python request inside offline program (not browser): r = requests.post(url+'upload', files= {'myfile': open('fig.jpeg', 'rb')}) and following exception must called blob upload callback request in first line of (server side): map<string, list<blobkey>> blobs = blobstoreservice.getuploads(req); list<blobkey> blobkeys = blobs.get("myfile"); what doing wrong?? that /upload handler not meant call directly, neither browser nor python application. instead, application need make 2 calls: first server temporary url, second upload url, connect blobstore directly. server should generate temporary url using blobstoreservice.createuploadurl , described in step 1 of this s

Using java, input string="aabbcdeaaaabbb" and the output must be aaaa -

using java, input string="aabbcdeaaaabbb" , output must aaaa, sequence here having repeated 4 times a. can me "aaaa" output using java implementation. algorithm find longest substring having same character repeated. for eg: i/p: aabbcdefaaaacccccc o/p: cccccc please check program below , suggest optimization faster processing: public class longestsubstring { public static void main(string[] args) throws ioexception { bufferedreader reader = new bufferedreader(new inputstreamreader( system.in)); system.out .println("enter word find longest substring same characters repeated"); string word = reader.readline(); system.out.println("entered word is: " + word); system.out.println("longest repeated characters substring is: " + substringfinder(word)); } /* *longest substring finder same character repeated */ public static string substringfinder(string word) { char[] tokens = word.tochararray(); int l

.net - Should I use nested blocks to improve performance -

i have been learning stack , heap , particularly stack lifo approach. does work nested blocks within methods , can used improve performance e.g. public void test() { int = 5; // int j = 5; // j } in example, @ end of method , j freed stack. would following more efficient? (i know simple procedure.....) or effort of freeing more saving on size of stack? public void test() { { int = 5; // } { int j = 5; // j } } this solely example purposes, know refactor etc. interested in happens memory in method.... the stack allocated whole of method call anyway. there are subtle cases adding blocks help, in terms of captured variables - if have 2 lambda expressions, 1 of captures i , 1 of captures j , in first case you'd end synthesized class captures both variables, whereas in second case you'd end 2 classes... @ least in current implementation. without variable capture, it's @ least possible

sql server - openquery apears to be rolled back when done -

Image
i'm using following query. select * openquery(exitweb,n'set nocount on; declare @result table (id int); insert [system_files] ([is_public], [file_name], [file_size], [content_type], [disk_name], [updated_at], [created_at]) output inserted.id @result(id) values (n''1'',n''7349.jpg'',n''146921'',n''image/jpeg'',n''5799dcc8a1eb1413195192.jpg'',n''2016-07-28 10:22:00.000'',n''2016-07-28 10:22:00.000'') declare @id int = (select top 1 id @result) select * system_files id = @id insert linktoexternal (id, id_ext) values(@id, 47) --select @id ') when perform select within query works fine: but when go check database when call has finished, record no longer t

java - reduce number of cases from a switch -

i have following piece of code. it's kind of factory function retrieves instance of writer base on it's type. notice type enum . public writer getwriter(writertypeenum type){ switch(type){ case a: new awriter() break; case b: ... break; case c: ... break; ... } } the problem have 30 case s. can reduce them or not implement them @ all? i solved cases in past using strategy pattern here facing old enum used in entire app. other problem cannot inject spring beans enum. of instances switch cases bean s. the writertypeenum has id coming ui , based on id have determine right instance. you can setup enum have abstract method public abstract writer getwriter(); and after that, instances have implement method, example public enum yourenum{ first(){ public writer getwriter(){ return null; } }, ... // other enums public abstract writer getwriter(); } or omit break in switch, if there repeating sta

java - Fast tapping on soft keyboard -

i'm using textwatcher prevent users insert double spaces. following part of code. @override public void aftertextchanged(editable s) { final string = s.tostring(); final string b = s.tostring().replace(" ", " "); if (a.length()>b.length()){ int pos = name.getselectionstart(); name.settext(b); name.setselection(pos-1); }} the code works fine if 1 simple taps slowly. anyway, problems arise when tap quite fast, begins deleting characters before first space. do have idea why happen , how solve it?

javascript - Find table row index that contains text JQuery -

i trying find table row index link on table. code trying, returning value 3. have 2 many rows on page. code - table (example) - <table> <tbody> <tr> <td> <div> <a herf="my link here" onclick="findindex(rank1)">rank1</a> </div> </td> </tr> </tbody> </table> jquery - function findindex(rname) { var val = $('table tbody tr td div a:contains(' + rname + ')').index(); alert(val); }); please me how find table row index value. thanks when call index() on selector, you're in fact getting index of a element. text selector working fine, after finding element mached text, need find it's tr , it's index: $('table tbody tr td div a:contains("' + rname + '")').closest("tr").index(); demo also, have syntax errors: onclick="findindex(rank1)" should be: on

objective c - Is possible 'NSSortDescriptor' sort 'NSObject' with specific language first? -

nssortdescriptor *descriptor = [[nssortdescriptor alloc] initwithkey:@"surname" ascending:yes selector:@selector(localizedstandardcompare:)]; i used sort array want show hebrew word first , english possible.

linux - Can't add key to remote machine for user -

i writing script add user aws ec2 instance. below shell script. file=$2 user=$1 user1="ec2-user" basekey="/home/user-home/some-folder/test.pem" keyfile=$3 file1=`cat /home/user-home/.ssh/id_rsa.pub` line in `cat $file` ssh -i $basekey -o stricthostkeychecking=no $user1@$line sudo useradd -m -d /home/$user $user ssh -i $basekey -o stricthostkeychecking=no $user1@$line sudo mkdir /home/$user/.ssh ssh -i $basekey -o stricthostkeychecking=no $user1@$line sudo touch /home/$user/.ssh/authorized_keys ssh -i $basekey -o stricthostkeychecking=no $user1@$line sudo chmod 777 /home/$user/.ssh ssh -i $basekey -o stricthostkeychecking=no $user1@$line sudo chmod 777 /home/$user/.ssh/authorized_keys scp -i $basekey -o stricthostkeychecking=no $keyfile $user1@$line:/home/$user1/ sleep 10 ssh -i $basekey -o stricthostkeychecking=no $user1@$line sudo cat /home/$user1/id_rsa.pub > /home/$user/.ssh/authorized_keys ssh -i $basekey -o stricth

php - Notification system in symfony 3.1 -

i use symfony 3.1. want create notification system in application in symfony. have created entity named notification save notifications. when user creates, edits or removes record in database, want save action in notification table . used haslifecyclecallbacks() annotation method , forced me create controller object in entity nothing has worked. how can it? there solution? /** * @orm\table(name="user") * @orm\entity(repositoryclass="cm\userbundle\repository\userrepository") * @orm\haslifecyclecallbacks() */ class user extends baseuser { /** * @var int * * @orm\column(name="id", type="integer") * @orm\id * @orm\generatedvalue(strategy="auto") */ protected $id; /** * @var string * * @orm\column(name="nom", type="string", unique=true, length=255, nullable=true) * @assert\notblank() */ protected $nom; /** * @var int * * @orm\column(name="numero", type="integer", unique=t

mysql - PHP: Variable showing value, even when submit button hasn't been clicked -

the scenario 1 must search code, , results appear mysql db if code present, otherwise display message "sorry, there no results found" displayed. perhaps re-enter evr no.: or double check entry." however, before search made, error message shown. what doing wrong? <?php $no_results = null; $query = (isset($_post['query']) ? $_post['query'] : null); $raw_results = mysql_query("select * evrdata evr_no = '$query'") or die(mysql_error()); if(mysql_num_rows($raw_results) > 0){ // if 1 or more rows returned following while($results = mysql_fetch_array($raw_results)){ $evr_no ='<br/>evr no. : '.'<b>'.$results['evr_no'].'</b>'; $surname ='<br/>surname : '.'<b>'.$results['surname'].'</b>'; $othername ='<br/>first names : '.'<b>'.$result

css - AngularJS: scrollable typeahead input field -

my html <div class="form-group"> <label class='control-label col-md-4' for='id_paymentcurrency'>{{'payment_currency' | translate}}</label> <div class='col-md-4'> <div id="scrollable-dropdown-menu"> <input type="text" class="form-control" data-trim-value="false" ng-trim="false" id ='id_paymentcurrency' ng-model="vm.data.paymentcurrency" typeahead-append-to-body="true" required typeahead-editable="false" uib-typeahead="currency.code currency in vm.getcurrencies($viewvalue)"ng-disabled="disabled" /> </div> </div> </div> my css #scrollable-dropdown-menu .tt-menu { max-height: 150px; overflow-y: auto; } i'm using angular 1.x , typeahead comes angular-bootsrap, can't make scrollbar appear. http://fiddle.jshel

javascript - Is getting page type/name from selected tab css a feasible idea? -

i have page multiple tabs.i need add google analytics code page,but tabs part of same page,and need tab name have data on phase user interacting with.is using css ,to check selected tab feasible idea or have other possible options achieve same? edit:on tab selection page reloads url remains constant.it 1 portlet in tabs present you can track tabs google analytics. here's article using google analytics on single-page app: https://developers.google.com/analytics/devguides/collection/analyticsjs/single-page-applications you send virtual pageviews each tab view.

reactjs - ReferenceError: [BABEL] Unknown option.babelrc.presets while parsing file -

i using babel 6 es2015 , react have added presets property in .babelrc while running gulp in project getting following error. referenceerror: [babel] c:\sunny\ubuntushare\projects\viewpoint_ui\src\javascript\app-nyi.jsx: unknown option: c:\sunny\ubuntushare\projects\viewpoint_ui\.babelrc.presets while parsing file: c:\sunny\ubuntushare\projects\viewpoint_ui\src\javascript\app-nyi.jsx @ logger.error (c:\sunny\ubuntushare\projects\viewpoint_ui\node_modules\babelify\node_modules\babel-core\lib\transformation\file\logger.js:58:11) @ optionmanager.mergeoptions (c:\sunny\ubuntushare\projects\viewpoint_ui\node_modules\babelify\node_modules\babel-core\lib\transformation\file\options\option-manager.js:126:29) @ optionmanager.addconfig (c:\sunny\ubuntushare\projects\viewpoint_ui\node_modules\babelify\node_modules\babel-core\lib\transformation\file\options\option-manager.js:107:10) @ optionmanager.findconfigs (c:\sunny\ubuntushare\projects\viewpoint_ui\node_modules\babelify\node_modules\bab

php - Mysqli Prepared Statement with AES Encryption -

this question has answer here: why mysqli num_rows return 0? 2 answers i'm having trouble getting prepared statement select rows database thats using built in aes_encryption. if run query though phpmyadmin, works fine, , returns expected values, running through bind_params returns -1. returns -1 , no rows $query = "select `col0`, cast(aes_decrypt(`col1`, '$this->key') char(50)) col1_decrypt, cast(aes_decrypt(`col2`, '$this->key') char(50)) col2_decrypt `$table` `$field` = aes_encrypt(?, '$this->key')"; // tried in clause. // -- cast(aes_decrypt(`$field`, '$this->key') char(50)) = ?"; if($stmt = $this->db->prepare($query)) { try { $stmt->bind_param('s', $incomingfield); } catch (exception $e) { // testing print $this->db->error;

android - Sending text via Wi-Fi when Wi-Fi is ON and received text as Normal message application -

i making sms application in want send text messages on wi-fi. in other words if internet connection on message send on wi-fi , if there no internet message send via app , carrier charges applied. want know possible in android? heard can done in iphone through imessage possible in android? thinking if internet on message should send server , there algorithm on server side receive message , send person sender contact number , message. me in way , how do, directions appreciated. thanks i think it's possible carriers. great deal when wi-fi on, need send message server, server uses service sending sms recipient. when there no wi-fi, need use android's smsmanager send message recipient. another solution found based on question android - try send fake sms myself without mobile network usage you can use service send push notification recipient, , when receive push, simulate sms pushing info sms log, , notifying user.

javascript - setState from input on change - can't delete from input -

i have input : <input type="text" value={this.state.current} onchange={this.handlechange.bind(this)} /> handlechange() method: handlechange(e) { let val = parseint(e.target.value); if (val) { this.set(val); } } and set() method (simple set number between 1 , 5 state): set(val = 1) { if (val < 1) { val = 1; } if (val > 5) { val = 5; } this.setstate({ current: val }); } my problem is: when want change value in input, can't delete number it. think auto filled state imediatly after delete number. problem in code? exmaple on jsfiddle: https://jsfiddle.net/4sc3p2ny/ when trying remove value input, e.target.value returns '' in case parseint(e.target.value) returns nan , because parseint('') returns nan ., need check , set current empty string handlechange(e) { let val = parseint(e.target.value); if (isnan(val)) { this.setstate({ current: '' }); } else { if (

python - Map over a dict -

i'm trying this: list(map(lambda x: x.name, my_dict)) where my_dict dict of form k, v v object , v.name defined. the problem is using key k x want use value v . in other words: how map on values of dict? ps want avoid my_dict[x] using concurrent.futures , won't passing full dict separate threads. to retrieve view of values, may use .values method. map(callable, my_dict.values()) obviously, map trivial callables can avoided in python using list or generator comprehensions. [x.name x in my_dict.values()] # creates list: non-lazy (x.name x in my_dict.values()) # creates generator: lazy

amazon s3 - Opscenter backup failure - S3 500 InternalError -

the backup service using opscenter failing below aws s3 error - 500 internalerror. failing on 3-4 nodes different files error code. aws s3 documentation recommends retry operation (we encountered internal error. please try again). can see file name , error once in agent log , s3 log, means there no retry done after error. there way enable retry s3 500 error code (internalerror) in opscenter? suggestion on how fix error? error while sending opsagent.backups.mytable.sstable@1d6cb0c5 org.jclouds.http.httpresponseexception: request: head https://my-backups.s3.amazonaws.com/snapshots/a3b72e7b-bd70-4f9e-aa2a- cf6c2a5ff336/sstables/1458057843-my_ks-mytable-ka-57417-index.db.gz http/1.1 failed response: http/1.1 500 internal server error @ org.jclouds.aws.handlers.parseawserrorfromxmlcontent.handleerror(parseawserrorfromxmlcontent.java:63) @ org.jclouds.http.handlers.delegatingerrorhandler.handleerror(delegatingerrorhandler.java:67) @ org.jclouds.http.inter