Posts

Showing posts from April, 2011

Simple ruby TCP request doesn't hit the server -

i have simple ruby script upload file server/web app through tcp connection doesn't work.when run script nothing happens on web app/server side.the server works fine have tried upload file curl , did upload.take @ code below , let me know doing wrong.i using ruby 1.9.2-p290.thank in advance. require 'socket' host = "myapp.herokuapp.com" port = 80 client = tcpsocket.open(host, port) client.print("post /api/binary http/1.1\r\n") client.print("host: myapp.herokuapp.com\r\n") client.print ("accept: */* \r\n") client.print ("content-type: multipart/form-data;boundary=aab03x \r\n") client.print("\n" + "aab03x"+ "\n" "content-disposition: form-data; name='datafile'; filename='cam.jpg' \n content-type: image/jpeg \r\n") client.print ("\r\n") data = file.open("./pic.jpg", "rb") {|io| io.read} client.print (data) client.print ("\r\

ssl - Java TLS Session Reuse after closed connection -

i have java tls client can send series of requests server, each followed response server. however, there many different servers. "multi-message" servers keep connection open after first request, subsequent requests can sent on first connection. others "single-message" servers close connection after each message , new connection required subsequent messages. there no priori way client know type of server talking to, nor fix servers. it desirable single-message serves able resume session without full handshake. my original client code tried send subsequent requests down same connection. if failed opened new connection server. handle both single , multi-message servers. however, failure when sending second message single-message severs seems kill session resumption. my dirty work around notice if message fails , assume talking single-message server, in case client explicitly closes socket after each response has been received. enables subsequent co

ember.js - EmberJS - testing input action on enter -

i have emberjs (2.5.0) component similar following: {{input type="text" value=searchvalue enter='handlesearch'}} basically, hitting enter on input field should trigger 'handlesearch' action. , in component, far have this: searchvalue: null, actions: { handlesearch() { var searchvalue = this.get('searchvalue'); var submitsearch = this.get('submitsearch'); console.log('search term entered: ', searchvalue); if (submitsearch) { submitsearch(searchvalue); } } } and component called via: {{my-component submitsearch=(action 'externalaction')}} that works fine , all, i'm having trouble testing it. here's integration test (pseudo-copied the guide ): test('search input', function(assert) { this.set('externalaction', (actual) => { console.log('in external action'); assert.equal(actual, 'hithere'); }); this.render(hbs`{{universal-heade

html - Keyframe animation making image blurry -

i have elements background image. using keyframe animation grow elements on page load. elements becoming blurry , adjusting 5 seconds after grow. know fix this? below code , have tried: https://jsfiddle.net/ozy4dpk0/ animation: @keyframes animation { 0% { transform: matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); } 4.2% { transform: matrix3d(2.099, 0, 0, 0, 0, 1.549, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); } 8.31% { transform: matrix3d(2.768, 0, 0, 0, 0, 1.884, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); } 12.51% { transform: matrix3d(3.064, 0, 0, 0, 0, 2.032, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); } 16.62% { transform: matrix3d(3.127, 0, 0, 0, 0, 2.063, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); } 27.73% { transform: matrix3d(3.026, 0, 0, 0, 0, 2.013, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); } 38.84% { transform: matrix3d(2.995, 0, 0, 0, 0, 1.997, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); } 61.06% { transform: matrix3d(3, 0, 0, 0, 0, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); } 83.28% { transform: matrix3d(3, 0, 0, 0,

javascript - Get headers Ajax Jquery -

i try header value "date" gives: xhr.getresponseheader not function i see response header in firebug , exists :s maybe no jquery support? can done in javascript instead maybe? must work, can see headers... code: function ajaxdate(myurl){ var res; var ajaxcall=$.ajax({ type: 'get', url: myurl, crossdomain: true, async: false, cache: false }).always(function(output, status, xhr) { //alert(xhr.getresponseheader("mycookie")); console.log(xhr); console.log(output); console.log(status); res=xhr.getresponseheader('date'); }); return res; } debug dump firebug, url: www.google.se: 200 ok 92ms jquery.min.js (line 5) response headers alternate-protocol 80:quic cache-control private, max-age=0 content-encoding gzip content-type text/html; charset=utf-8 date fri, 09 aug 2013 00:57:43 gmt expires -1 p3p cp="this not p3

c# - Getting Error 500 after adding taghelper -

i studying mvc 6. going ok, after adding taghelper in _viewimports.cshtml app stopped. these dependencies: "dependencies": { "microsoft.aspnetcore.mvc": "1.0.0-rc2-final", "microsoft.aspnetcore.server.iisintegration": "1.0.0-rc2-final", "microsoft.aspnetcore.server.kestrel": "1.0.0-rc2-final", "microsoft.aspnetcore.staticfiles": "1.0.0-rc2-final", "microsoft.aspnet.mvc.taghelpers": "6.0.0-rc1-final", "microsoft.aspnetcore.diagnostics": "1.0.0-rc2-final" }, i added line: @addtaghelper "*, microsoft.aspnet.mvc.taghelpers" and getting error: cannot resolve taghelper containing assembly 'microsoft.aspnet.mvc.taghelpers'. error: not load type 'microsoft.extensions.logging.ilogvalues' assembly 'microsoft.extensions.logging.abstractions, version=1.0.0.0, culture=neutral, publickeytoken=adb97

mysql - How to make use of variable on a function -

i need make stored function: this code select count(dominio) thogar dominio='%' i need make stored function write letter between (u,c,r) , function replace % in previous code selected letter. how can it? thanks! got working create function `buscar`(`param` char(1)) returns int language sql not deterministic contains sql sql security definer comment '' begin declare res int; select count(dominio) res thogar dominio=param; return res; end call buscar('c') this should work: drop function if exists myfunc; delimiter $$ create function myfunc( param char(1) ) returns int; begin declare res int; select count(dominio) res thogar dominio=param; return res; end; $$ delimiter ;

Unable to pass json value in jmeter POST request -

i have 2 http requests return different json responses. used json path postprocessor retrieve values (value , value b) 2 json responses. when tried pass values , b in request body of http request, value b passed. http://screencast.com/t/y3e9pze2om5 http://screencast.com/t/tfuwm2kkqe if you're trying build composite variable like: you have ${a} variable value of foo you have ${b} variable value of bar you need build ${ab} variable this can done using __v() function like: ${__v(a${b})} see here’s combine multiple jmeter variables article more detailed information

javascript - Node.js filesystem save file error 56 EROFS while saving every 2 seconds -

i running node.js on raspbian , trying save/update file every 2/3 seconds using following code: var savefilesaving = false; function loop() { mainloop = settimeout(function() { // update data savesavefile(data, function() { //console.log("saved data file"); loop(); }); }, 1500); } function savesavefile(data, callback) { if(!savefilesaving) { savefilesaving = true; var wstream = fs.createwritestream(path.join(__dirname, 'save.json')); wstream.on('finish', function () { savefilesaving = false; callback(data); }); wstream.on('error', function (error) { console.log(error); savefilesaving = false; wstream.end(); callback(null); }); wstream.write(json.stringify(data)); wstream.end(); } else { callback(null); } } when run works fine hour

ssl - Issues with self-signed certificate behind an Apache reverse-proxy? -

i understand topic discussed in couple of older posts, will self-signed certificate work behind apache reverse-proxy? posted @ryan i facing same issue unable around it. have apache 2.4.12 setup reverse proxy in front of oracle http server. have valid certs on proxy server self signed certs on oracle http server. goal https way through, whenever browser gets myhost.domain, throws cert warning(because of self signed certs). having authentic certs on oracle http server not option , users browsers restricted , hence cannot ignore self signed cert warning. here's virtual host loglevel error servername myhost.domain serveralias xxx.xxx.xxx.xx documentroot d:/xyz/pubdocs sslengine on sslproxyengine on sslcertificatefile certs/myserver.crt sslcertificatekeyfile certs/myserver.key sslcertificatechainfile certs/myserver_chain.crt sslproxycacertificatefile certs/my_self_signed.pem sslproxyverify none sslproxycheckpeername off sslproxycheckpeercn off sslproxyche

android - How to save Credit card with Paypal without Paypal account? -

i need implement payment transactions paypal account , credit/debit card using paypal on mobile application (android , ios sdk's). in 1 hand understand part of having paypal account , paying it, in other hand took @ uber , found users can save credit card without creating paypal account. how can achieve behavior? have save credit cards on server? or feature of paypal? pd: know uber uses braintree, have seen same feature on other apps paypal. what you're looking called "reference transactions" or "vaulted credit cards". paypal saves card data on server, , save transaction id on server. when submit reference transaction request include transaction id original transaction processed (could auth or sale transaction) along new amount need process. depending on you're using process cards, though, api use reference / vaulted transaction different. if you're using payments pro using either dodirectpayment / doreferencetransaction or

opengl - Heightmap generation finishes halfway through -

Image
currently, i'm trying make noise generated heightmap , display opengl. i'm following this tutorial , heightmap doesn't seem work. seems generates (or displays) half of supposed to. this heightmap normals color: as can see, though supposed square, appears rectangular unfinished edge. this heightmap generation code: public class heightmap extends gamemodel { private static final float start_x = -0.5f; private static final float start_z = -0.5f; public heightmap(float miny, float maxy, float persistence, int width, int height) { super(createmesh(miny, maxy, persistence, width, height)); } protected static mesh createmesh(final float miny, final float maxy, final float persistence, final int width, final int height) { simplexnoise noise = new simplexnoise(128, persistence, 2);// utils.getrandom().nextint()); float xstep = math.abs(start_x * 2) / width; float zstep = math.abs(start_z * 2) / height;

Assign numbers to characters C++ -

i need way assign numbers letters in c++, example, '$' represent number 1. need able obtain number character function, e.g. getnumfromchar('$') return 1 , getnumfromchar('#') return 2. there easy , fast way in c++? create vector std::vector<int> v(256,0); indexed characters , of numbers zeros treat invalid numbers. assign each 'numbered' character number e.g. v['$'] = 1; v['#'] = 2; using fact characters integers 0 255.

iphone - CGRectOffset Causes Swiping The Wrong Way -

trying able swipe away cell , view show up. code far, unable see rightview. instead limits me seeing leftview(i want opposite...leftview not exist). confused cgrects , cgrectoffsets. if correct code great. thanks. - (void)layoutsubviews { [super layoutsubviews]; cgrect frame = self.bounds; self.scrollview.frame = frame; self.scrollview.contentsize = cgsizemake(frame.size.width*2, frame.size.height); self.centerview.frame = cgrectoffset(frame, frame.size.width, 0); self.rightview.frame = cgrectoffset(frame, frame.size.width*2, 0); [self.scrollview scrollrecttovisible:self.centerview.frame animated:no]; [self.scrollview setuserinteractionenabled:yes]; self.scrollview.scrollenabled = yes; } you setting centerview , rightview's offset frame.size.width , frame.size.width*2 respectively. want center 0 , right view frame.size.width . you moving views on left frame.size.width number of pixels dont have view.

Kubernetes ConfigMap volume doesn't create file in container -

k8s 1.2 deployed locally, single-node docker am doing wrong? working else or broken in k8s deployment? following example in configmaps guide, /etc/config/special.how should created below not: [root@totoro brs-kubernetes]# kubectl create -f example.yaml configmap "special-config" created pod "dapi-test-pod" created [root@totoro brs-kubernetes]# kubectl exec -it dapi-test-pod -- sh / # cd /etc/config/ /etc/config # ls /etc/config # ls -alh total 4 drwxrwxrwt 2 root root 40 mar 23 18:47 . drwxr-xr-x 7 root root 4.0k mar 23 18:47 .. /etc/config # example.yaml apiversion: v1 kind: configmap metadata: name: special-config namespace: default data: special.how: special.type: charm --- apiversion: v1 kind: pod metadata: name: dapi-test-pod spec: containers: - name: test-container image: gcr.io/google_containers/busybox command: ["sleep", "100"] volumemounts: - name: con

javascript - Closest function in jquery and extracting the elements -

i have html fragment follows: <div id="samplediv"> <ul> <li name="a"> <a id="a"> </li> <li name="b"> <a id="b"> </li> </ul> </div> i have text called: var text = "b"; i have want check if text matches of elements of li , add class name "disable" anchor element not matching text. case want add class called "disable" <a id="a"> this have tried: $("#samplediv li").each(function() { if($(this).name != text){ $(this).closest("a").addclass("disabled"); } }); but thing here $(this).name evaluating "undefined" . missing? edit: due typo ,had missed tag there multiple issues, $(this) returns jquery object not have name property, instead can use $(this).attr('name') .closest() used find ancestor element, a descendant of

c# - How can i add close button to toastr.js in asp.net web form? -

i'm beginning in asp.net , want use toastr.js show user message,for purpose download toastr.js , in web form in submit button write code: protected void submit(object sender, eventargs e) { page.clientscript.registerstartupscript(this.gettype(), "toastr_message", "toastr.error('there error', 'error')", true); div3.visible = true; } show me message correctly,but message box not hide,and want add close button message box ,when user fire close button,message start unhide fade effect.how can solve ?thanks. adding closebutton option should trick https://github.com/codeseven/toastr#close-button : page.clientscript.registerstartupscript(this.gettype(), "toastr_message", "toastr.error('there error', 'error', { closebutton: true })", true);

Connecting an Oracle DB Container and a Java application Container (Docker) -

i working on docker project 2 docker containers - 1 oracle db , other java application. the container oracle db working ok. used built image oracle , created tablespaces , users in it. commands used pull , use oracle db container given below: docker pull wnameless/oracle-xe-11g docker run -d -p 49160:22 -p 49161:1521 -e oracle_allow_remote=true wnameless/oracle-xe-11g now have own java application interacts oracle db , run using command given below: docker run -it --name mypgm myrepo/oracletesting it runs interactive java program asks oracle db details , allows users interact db. however not figure out how have specify details such driver name, connection url, username, , password the values gave given below: driver name: oracle.jdbc.oracledriver connection url:jdbc:oracle:thin:@ localhost:1521 :orcl11g username: imtheuser password: ********** i dont know whats going wrong not working. tried giving different inputs connection url after inspecting

php - PHPMailer - Code seems to do nothing -

i need help, getting undefined error , being caused code deals attachments @ top of php file. know because if comment out don't error. the next thing using xampp , followed couple tutorials sendmail in php.ini file , c://xampp/sendmail/senmail.ini setup hoping send email via gmail when tested form haven't gotten through yet. i don't know begin, i've used 2 tutorials make php code, please take look. <?php header('content-type: application/json'); $status = array( 'type'=>'success', 'message'=>'thank contact us. possible contact ' ); //added deal files require_once('../phpmailer/class.phpmailer.php') //get uploaded file information $name_of_uploaded_file = basename($_files['uploaded_file']['name']); //get file extension of file $type_of_uploaded_file = substr($name_of_uploaded_file, strrpos($name_of_uploaded_file, '.') + 1); $s

Using php variable in jQuery Script -

i trying code work cannot figure out how make work correctly. think close though. code works fine on page: var entryid = $(this).attr('id'); if ("<?php echo $locations[2]['floor']; ?>" == 'firstfloor' ) { $("#drawtable").attr("style", "background:url(\'images/firstfloor.jpg\') 50% / 100% no-repeat;"); } else if ("<?php echo $locations[2]['floor']; ?>" == 'secondfloor' ) { $("#drawtable").attr("style", "background:url(\'images/secondfloor.jpg\') 50% / 100% no-repeat;"); } i trying make array changeable using entryid instead of number '2'. not think concatenating correctly below. if can appreciated! thank you var entryid = $(this).attr('id'); if ("<?php echo $locations . "[";?>" +entryid+ "<?php echo "]['floor']"; ?>" ==

ios - Firebase causes issue "Missing Push Notification Entitlement" after delivery to itunes connect -

as may aware, google starts use firebase analytics want use in current project. succesfully finished implementation , upload project itunes connect. got mail below. not want use push notificaiton option of firebase included in sdk. need remove it?how? cause rejection review? dear developer, we have discovered 1 or more issues recent delivery "instant baby dream". delivery successful, may wish correct following issues in next delivery: missing push notification entitlement - app appears include api used register apple push notification service, app signature's entitlements not include "aps-environment" entitlement. if app uses apple push notification service, make sure app id enabled push notification in provisioning portal, , resubmit after signing app distribution provisioning profile includes "aps-environment" entitlement. see "provisioning , development" in local , push notification programming guide more information.

javascript - console.log without arguments? How does this work? -

probably basic question haven't found answer in docs or google... i doing nodeschool's "learnyounode" module, , intro http client question found official answer used console.log without arguments (and indeed args in function, understand) : var http = require('http') http.get(process.argv[2], function (response) { response.setencoding('utf8') response.on('data', console.log) response.on('error', console.error) }) how work? looks clean , obvious, i'm not sure can use style confidently without better understanding what's going on. btw comparison (and see i'm not understanding), here's own similar, longer answer: var http = require('http'); http.get(process.argv[2], function callback(response) { response.setencoding('utf8'); response.on('data', function(data) { console.log(data); }); response.on('error', function(error) {

configuration - What is the meaning of this tag <sanitize> in portal-model-hints.xml? -

i curious following line mean in file portal-model-hints.xml : <field name="title" type="string"> <sanitize content-type="text/plain" modes="all" /> </field> so here questions: what changes <sanitize> tag make field ? what attributes mean? what different types of modes ? and there other attributes tag? i have gone through wiki deals model-hints. thanks it seams me hint says liferay portal use sanitizer before storing field database. sanitizers filtering elements "sanitize" web content (usually html or javascript code) doesn't contain unappropiate content javascript malicious code or swearwords, example. can find more info on sanitizers here . so answers questions are: what changes tag make field? - field should sanitized what attributes mean? - field supposed contain plain text , sanitizer use sanitizing mode what different types of modes? - can find there 3 modes (&

Spark Streaming - Kafka - java.nio.BufferUnderflowException -

i'm running below error while trying consume message kafka through spark streaming (kafka direct api). used work ok when using spark standalone cluster manager. switched using cloudera 5.7 using yarn manage spark cluster , started see below error. few details: - spark 1.6.0 - using kafka direct stream api - kafka broker version (0.8.2.1) - kafka version in classpath of yarn executors (0.9) - kafka brokers not managed cloudera the difference see between using standalone cluster manager , yarn kafka version being used on consumer end. (0.8.2.1 vs 0.9) trying figure if version mismatch issue ? if indeed case, fix other upgrading kafka brokers 0.9 well. (eventually yes not now) org.apache.spark.sparkexception: job aborted due stage failure: task 0 in stage 200.0 failed 4 times, recent failure: lost task 0.3 in stage 200.0 (tid 203,..): java.nio.bufferunderflowexception @ java.nio.heapbytebuffer.get(heapbytebuffer.java:151) @ java.nio.bytebuffer.get(bytebuffer.java

python - Determinate if class has user defined __init__ -

i'm trying identify if class received via argument has user defined __init__ function in class passed. not in super class. class hasinit(object): def __init__(self): pass class noinit(object): pass class base(object): def __init__(self): pass class stillnoinit(base): pass def has_user_defined_init_in(clazz): return true if # magic assert has_user_defined_init_in(hasinit) == true assert has_user_defined_init_in(noinit) == false assert has_user_defined_init_in(stillnoinit) == false i think work: def has_user_defined_init_in(clazz): return "__init__" in clazz.__dict__

Mysql Select Query Success on Mysql Client But Failed through PHP -

i have query run fine through heidisql if through php, fails without error report. here code php $sql = "select `pob`.`id` , `pob`.`po_qty` , ifnull(`mrb`.`rcv_qty`,0) `rcv_qty` , ( `pob`.`po_qty` - ifnull( sum( `mrb`.`rcv_qty` ), 0 )) balance `mpo_body` `pob` left join `mrcv_body` `mrb` on `pob`.`id` = `mrb`.`po_id` `pob`.`id`='$id' group `pob`.`id`"; $result = $mysqli->query($sql); if($result->num_rows>0){ $row = $result -> fetch_assoc(); if($row['balance']>0){ $sql = "update `mpo_body` set close='y' `id`='$id'"; echo $mysqli->query($sql); }else{ echo "failed here"; } }else{ echo "failed @ here"; } what causing problem here? update this structure of data in mpo_body drop table if exists `mpo_body`; create table `mpo_body` ( `id` int(10) unsigned not null auto_increment, `po_no`

excel - How can I group records and do calculations between first and last records in each group using Oracle SQL? -

i have table in oracle 10g db engine contains records of service operations. requirement calculate processing time of each service request. each service request may generate multiple records each representing step in process. have table following columns: id created_on service_operation result fk_service_request_id where last column identifier of service requests. how can calculate difference between created_on of first , last records in each group identified fk_service_request_id ? better off do: select fk_service_request_id, created_on, service_operation, result table order fk_service_request_id, id; and tricks in excel? if so, how can achieve in excel? select fk_service_request_id, min(created_on) min_dt, max(created_on) max_dt, max(created_on)-min(created_on) proc_time table group fk_service_request_id order fk_service_request_id;

How to check if char is in a double char array? Java -

i have array in java: public static char array[][] = new char[3[3]; during running program array fills characters. how can check if array[3][3] has character' '(space) return true ? thanks. do try ? public boolean check(char[][] array){ for(int i=0; i<char.length; i++){ for(int j=0; j<char[i].length; j++){ if(char[i][j] == ' ') return true ; } } return false; } i advice read algorithm tutorial, it's base !!

c# - Why when loading messages form the hard disk using MimeKit it's ver slow? -

i understand when downloading emails server it's slow. when running program , reading/loading messages hard disk there way make faster ? in constructor start background worker directoryinfo di = new directoryinfo(emailsdirectory); files = di.getfiles(); if (files.length > 0) { backgroundworker2.runworkerasync(); } then in dowork event private void backgroundworker2_dowork(object sender, doworkeventargs e) { int counter = 0; mimekitallloadedmessages = new list<mimekit.mimemessage>(); mimekit.mimemessage loadedmessage = null; directoryinfo di = new directoryinfo(emailsdirectory); fileinfo[] files = di.getfiles(); (int = 0; < files.length; i++) { string uid = seenuids[0]; loadedmessage = mimekit.mimemessage.load(files[i].fullname); mimekitallloadedmessages.add(

c# - Could there be an unexpected collision of MS VC runtimes? -

i have learned hard way, it's not share heap pointers between 2 dlls each depends on different ms vc runtime. fair enough. based on experience , current weird behavior of program chain being debugged ask a question: could lib1.dll using 1 runtime (eg. msvcrt.dll ) possibly damage heap of lib2.dll using different runtime (eg. vcruntime140d.dll )? no pointers shared, pairs of malloc/free on same runtime. background: (for ask it) i have standard zeranoe ffmpeg libraries dependent on msvcrt.dll . i created small c dll covering required functionality based on ffmpeg libs, let's call libvideo.dll . it's dependent on vs2015 runtime. i created libvideosharp.dll managed c# wrapper library (also vs2015) libvideo.dll (marshalling). i created c# test app using libvideosharp.dll (also vs2015). debugging c# test app (and associated libraries in chain) experience following: libvideo.dll mallocs , inits data structure. libvideo.dll calls ffmpeg init routines (

Selenium Cucumber ruby code for element count -

good day all, can please me number of transaction on banking page using selenium webdriver - cucumber - ruby. please me . thanks. we might need more information in order give accurate answer. here's code give idea: when (/^i transaction number/) selector = "your_selector_goes_here" $transaction = page.find(:xpath, selector).text end later access text stored in $transaction , whatever need it.

Points per right answer using php and mysql -

i trying figure out how create system user answers bunch of questions once week , gets point per right answer. admin add correct answers week after users answers must stored in database. would appriciate how accomplice using php , mysql. thanks! you'll need few pages: 1) questions page: in questions.php page have form under each question allow user select checkboxes: <form action="answers_submitted.php" method="post"> 1 + 5 equal to?<br> <input type="radio" name="answer0" value="3"> 3 <input type="radio" name="answer0" value="6"> 6 <input type="radio" name="answer0" value="99"> 99 <br> <input type="submit" value="send answers"> </form> 2) answers submitted page: the answers_submitted.php page have retrieve these values once user clicks "send answers" . after re

ios - Swift, QuickBlox Error Domain=com.quickblox.chat Code=-1004 "(null)" -

i trying join group on quickblox , after compiling join group code. it's showing me error. (error domain=com.quickblox.chat code=-1004 "(null)" userinfo={nslocalizedrecoverysuggestion=you have connected chat in order use chat api.}) my code :- let groupchatdialog: qbchatdialog = qbchatdialog(dialogid: "57442b84a28f9a759100000e", type: qbchatdialogtype.group) self.groupchatdialog.joinwithcompletionblock { (error: nserror?) -> void in print(error) anybody knows problem here. himanshu, error description says have login chat session before joining group dialog. in case if not aware, quickblox makes use of 2 sessions user session : session establish server using [qbrequest loginwithuserlogin:"quickblox_user_name" password: "quickblox_password" successblock:^(qbresponse *response, qbuuser *user) { } errorblock:^(qbresponse *response) { }]; this authenticate user valid quickblox user. docs says

asp.net mvc 3 - issue regarding re direct from aspx page to mvc -

i have used postbackurl(url) re direct aspx mvc page . because aspx , mvc projects on different domain. its getting redirected have refresh page go "url". please give me solution on how re direct aspx mvc page in different domain

opc ua - How to get OPC UA Client certificate (.NET) -

i'm working on c# client opc ua server. i'm not paying member of opc foundation, don't have access sdk. i'm using sample applications , .net stack freely available. one of problems i'm facing don't have security certificate. client can connect server, in unsecured mode. results in not being able access databases on server. believe i'm missing client side (and possibly server side) certificate. have full access server's administration, i've been unable figure out how retrieve/generate certificate. how do this? in general how client certificate opc ua client application's responsibility. if there no certificate generated , configured, sdk creates default self-signed one. if @ xml configuration file of .net ua application, should find place certificate parameters defined, , either can generated automatically. in order communicate on secured mode, both client , server should trust each other's certificates. if certificate stores

Rails model attribute allow nil but validate when not -

i want validate input box value in 2 cases: if nil? save successfully, no errors if not nil? validate format i have simple line here: validates :ip_addr, format: { with: regexp.union(resolv::ipv4::regex)} this work in cases won't allow nil/empty value throws exception. but: validates :ip_addr, format: { with: regexp.union(resolv::ipv4::regex)}, allow_nil: true and validates :ip_addr, format: { with: regexp.union(resolv::ipv4::regex)}, allow_blank: true will allow nil/empty values if input invalid e.g. "33@@@#$" returns "true". how include both cases ? possible ? edit: seems regexp.union(resolv::ipv4::regex).match("something") returns nil if validation works same way, return nil in wrong values , allow_nil: true allow them persisted this. try this validates :ip_addr, format: { with: regexp.union(resolv::ipv4::regex)}, if: :ip_addr i not sure whether above 1 work. if doesn't, this validate :ip_addr_format_c

java - Google Analytics throws NoClassDefFoundError at runtime -

when compiling project, works fine when run throws runtime exception java.lang.noclassdeffounderror: com.fiz.analyticstrackers$1 everything configured added google analytics dependency in gradle file dependencies { compile filetree(dir: 'libs', include: ['*.jar']) compile 'com.android.support:appcompat-v7:22.2.0' compile 'com.google.android.gms:play-services-analytics:7.3.0' } permission in manifest file <uses-permission android:name="android.permission.internet" /> <uses-permission android:name="android.permission.access_network_state" /> initialization , trigger event code base analyticstrackers analyticstrackers = analyticstrackers.getinstance(); tracker tracker = analyticstrackers.gettracker(); tracker.send(new hitbuilders.eventbuilder().setcategory(category).setaction(action).setlabel(label).build()); here analyticstrackers custom class contains common googleanalytics functionality.

Working with SQL in Clojure/Luminus/Composure -

1) have luminus app. want execute multiple db requests within single db connection, meaning, without having open connection second time. have this: (defn page1 [id] (layout/render "page1.html" (my-var1 (db/get-single-article {:id (integer/parseint id)})))) i want execute else, say, db/get-something-else, within same db connection db/get-single-article executed. how? 2) in resources/sql/queries.sql have this: -- :name get-single-article :? :1 -- :doc retrieve article given id. select * article id = :id how can add 1 more query it'll execute within db/get-single-article call , return different result set? this: -- :name get-single-article :? :1 -- :doc retrieve article given id. select * article id = :id select * another_table ... how can navigate them when calling db/get-single-article then? go ahead , define second query in sql file: -- :name get-something-else :? :* select * another_table ... then assign query results both queries th

javascript - window.opener is null in safari on iPad -

i running web application in opening child window parent window . child window want open new link in parent window using window.opener opener property of window object null. works fine in internet explorer (ver. 11) google chrome firefox safari the problem occurs on ipad in safari . code snippet follow: window.opener.location.href = '../default.aspx?argval=' + bookopenargs + '&windowname=' + swindowname + '&userid=' + suserid + '&csl=y';

iteration a json object on Ngfor in angular 2 -

Image
i'm having trouble iteration json object in ngfor, there template : template: <h1>hey</h1> <div>{{ people| json}}</div> <h1>***************************</h1> <ul> <li *ngfor="#person of people"> {{ person.label }} </li> </ul> people json object i'm trying iterate, i'm having rhe result of (people | json) , not getting list, here screenshot: and finish, here part of json file : { "actionlist": { "count": 35, "list": [ { "action": { "label": "a1", "httpmethod": "post", "actiontype": "indexation", "status": "active", "description": "ajout d'une transcription dans le lac de données", "resourcepattern": "transcriptions/", "par

android - I want to disable onTouch Listener -

i playing gif animation ontouch event. want disable ontouch listener when animation playing. don't want animation replayed until , unless 1 loop of animation completed. in short want disable ontouch event time till animation completes loop. after 1 loop played want touch event enabled again. please help. try can use this:: anim.setanimationlistener(new animationlistener() { @override public void onanimationstart(animation animation) { // todo auto-generated method stub } @override public void onanimationrepeat(animation animation) { // todo auto-generated method stub } @override public void onanimationend(animation animation) { // todo auto-generated method stub } }) use onanimationstart listener disable touch. , onanimationend enable touch. hope helps!!

sql server - Coverting a Windows 7 touchscreen application to iPad -

i have created touchscreen system runs of windows 7 , writes central sql server, production logging system. i have been asked if develop app ipad same. i have several problems this. 1) @ moment have no experience in developing ipad, there actual ipad apps allow develop apps in more gui friendly manner? 1 looking myself, unfortuanly see xcode , dont have mac. 2) thoughts create app records information local database on ipad, @ end of day upload information central server, keeps traffic down. possible talk mssql database via ipad , if needed done in realtime, every button press on ipad recorded mssql database in realtime. 3) have go app store used, program internal company on company network, if works may use lots of ipads application. thanks reading dj 1) you're right. need mac, apple developer account, , xcode develop ipad apps. 2) used way of doing web service layer between ipad app , mssql. however, i've heard of other alternatives, when seems the

javascript - Return multiple response from a single function in Node (sails js) -

i developing web application using angular js , sails. struck issue.in application there menu, displays different count values database.plz see back getallcountmyprofile: function(req,res){ usertokenservice.checktoken(req.get('user-token'), function (err, tokencheck) { var userid = tokencheck.tokendetails.userid; var query = "select (select count(*) review userid="+ userid +" , approvalstatus = 'approved') reviewreceived ,"+ " (select count(*) review reviewerid="+ userid +" ) reviewpenned, "+ "(select count(*) photos userid="+ userid +" , accesstype='private' , status='active') privatephotocount, "+ "(select count(*) photos userid="+ userid +" , accesstype='public' , status='active') publicphotocount"; review.query(query, function (err, photoreviewcount) { if(err){ console.log("error"+ err); }

c++ - how to free malloc outside of function -

can't resolve problem - compiler allways tells me have troubles free(pointer) function. i'm not sure working of pointers debugging has shown works well. free function could't free memory. #include <stdio.h> //bibliothek für input/output. #include <stdlib.h> //for malloc #include <math.h> //bibliothek für matchematische operationen. #include <iostream> //bibliothek für in/output in c++. #include <stdbool.h> //bibliothek für boolean //prototypes int* readnumbers(int size); int sumupnumbers(int* sumpointer, int size); //main function int main() { int arraysize; //size of malloc-array int* pointer; //pointer storing of malloc-address int total; //variable sumupnumbers function pointer = null; //point on 0 //inform user before getting number him std::cout << "please give size of array:" << std::endl;