Posts

Showing posts from July, 2011

javascript - jQuery form submission is returning false instead of waiting for server response -

i have jquery form sends data server after validating. server sends response , site processes returned information. here's javascript in question: $("#signup").on('submit', function(e){ var isvalidate = $("#signup").valid(); if(isvalidate) { var json = $('#signup').serialize(); var theemail = $('#signup #inputemail').val(); //hide step 1 modal $('#steponesignup').modal('hide'); //open processing modal $('#processingmodal').modal(); $.post('http://localhost:5000/agm/savenewuser/', json, function( data ) { alert('returned data'); if(data === "success"){ //hide processing modal $('#processingmodal').modal('hide'); }else if(data === "userexists"){ $('#...

jsf - Unable to get current date in primefaces schedule? -

when select particular date showing previous date used same example in primefaces schedule can show me within working example how schedule/mark holidays particular month http://www.primefaces.org/showcase/ui/schedule.jsf

Proper way to subtract two 64 bit numbers in x86 assembly -

i'm using 32 bit system , have 64 bit number saved in edx:eax. i'm trying subtract number saved in esi:edi correct? i'm pretty sure not because after 3 iterations results incorrect. sub %esi, %edx #subtract 2 64 bit numbers sub %edi, %eax you need make 2 changes: subtract low order 32-bits first, not high order if subtraction of low order 32-bits generated borrow need subtract 1 more high order bits. fortunately cpu remembers if there borrow (in carry flag cf) , there instruction subtract borrow, sbb here's final code sub %edi, %eax # subtract low order 32-bits, borrow reflected in cf sbb %esi, %edx # subtract high order 32-bits, , borrow if there 1

javascript - Truncate Text in ul li anchor tag -

here html , <ul class="test"> <li><a href="#">python</a></li> <li><a href="#">truncate should apply here </a></li> <li><a href="#">c</a></li> <li><a href="#">cpp</a></li> <li><a href="#">java</a></li> <li><a href="#">.net</a></li> <li><a href="#">this long text in ul </a></li> <li><a href="#">this long text in ul </a></li> </ul> i want truncate text in anchor tag , if length of text higher 6 chars. the output should , python trun.. c cpp java .net this.. this.. how can using jquery ? you can this: $('ul.test li a').each(function() { var text = $(this).text(); if(text.length > 6) { $(...

php - Call to undefined function inval() -

i have error in my_model in codeigniter. i've looked everywhere nothing my_model: <?php if ( ! defined('basepath')) exit('no direct script access allowed'); class my_model extends ci_model { protected $_table_name = ''; protected $_primary_key = 'id'; protected $_primary_filter = 'intval'; protected $_order_by = ''; protected $_rules = array(); protected $_timestamps = false; function __construct(){ parent::__construct(); $this->load->database(); } public function get($id = null, $single = false) { if ($id != null) { $filter = $this->_primary_filter; $id = $filter($id); $this->db->where($this->_primary_key,$id); $method = 'row'; } elseif($single == true) { $method = 'row'; } else { $method = ...

Compile multiple less file and copyto a folder as multiple css file using gruntjs -

i'm trying output multiple less files under less folders build/css folder here code i'm having have specify individual files , working fine less: { build: { options: { yuicompress: true, paths: ['public/less'] }, files: { '.build/css/app1.css': 'public/less/app1.less', '.build/css/app2.css': 'public/less/app2.less' } } } i try make more generic , tried not working less: { build: { options: { yuicompress: true, paths: ['public/less'] }, files: { expand: true, cwd: 'public/css', src: '*.less', dest: '.build/css', ext: '*.css' } } } this grunt versions grunt-cli v0.1.9 ...

iOS Custom button isn't grayed out -

Image
i've noticed custom buttons not grayed out when view appears; example actionsheet or popover. standard button (i.e.: info light) grayed out. here see example. info light standard button , share custom button image. the screen grayed out when actionsheet or popover comes up. notice difference between 2 buttons. how can make custom button grayed out info button? thanks! ps: grayed out button doesn't correspond disabled state!

oracle - work around keyword by calling same procedure? -

since continue keyword wont work coz of following reason tried make work around calling same procedure , passing next value record right way ?? ora-06550: line 1, column 26: pls-00201: identifier 'continue' must declared ora-06550: line 1, column 26: pl/sql: statement ignored declare cust_id info.customer_id@prod%type; v_cust_info_customer_id feb_prd_14_view.cust_info_customer_id@rtx%type; v_initial_start_time_timestamp feb_prd_14_view.initial_start_time_timestamp@rtx%type; cursor rated_rejectes_calls_cursor select s_p_num,call_start_time fi_sdine.rejected_calls_87@prod upper (status)='rated'; begin rated_rejectes_calls_rec in rated_rejectes_calls_cursor loop if (rated_rejectes_calls_rec.s_p_num not null) begin select customer_id cust_id bmh.info@prod dn_num=rated_rejectes_calls_rec.s_p_num; if (v_cust_info_customer_id null ) select cust_info_customer_id, initial_start_time_timestamp v_cust_info_customer_id,v_initial_start_time_timestamp fi_ma...

powershell - Why select-string doesnot receive from pipelining -

i trying parse out patterns file , search files strings group them. here code , error getting ps d:\shared_with_pai\testing> get-content c:\\events.txt | select-string -pattern $_ * |select-object linenumber,filename|format-table -groupby filename select-string : cannot bind argument parameter 'pattern' because null. @ line:1 char:52 + get-content c:\\events.txt | select-string -pattern <<<< $_ * |select-object linenumber,filename|format-table -groupby filename + categoryinfo : invaliddata: (:) [select-string], parameterbindingvalidationexception + fullyqualifiederrorid : parameterargumentvalidationerrornullnotallowed,microsoft.powershell.commands.selectstrin gcommand can making mistake? edit: contents of events.txt like 8,coilevent,networkchange 8,coilevent,malfunction 8,coilevent,conflictwithpc i searching csv files these lines. the current object variable $_ isn't populated objects pipeline if use way. @kayasax suggest...

android - How to load multiple images and text from server -

i developing 1 application 1 real state website. have display dynamic content web mean website display lots of images , description property. need populate images , description in list view similar flipkart android app do. don't know how proceed of have thought can download images sd card , text json , populate both in custom list. feel not approach images grows in no take memory. please give me pointer how should proceed better results. thanks in advance. appreciated. you can use custom listview image , text. image , text both web. can refer this link .

java - how to focus empty combobox -

in project, have empty combobox want populate after clicking on it. combocurrent = new jcombobox<string>(); combocurrent.setbounds(265, 181, 80, 20); add(combocurrent); combocurrent.seteditable(true); combocurrent.setselecteditem(null); combocurrent.addactionlistener(new actionlistener() { public void actionperformed(actionevent e) { // todo populate here system.out.println(e); } }); but somehow action listener not work here. there way listen first click on combobox while still empty? actionlistener invokes when press enter key. first clicking recommend use focuslistener or mouselistener on jcombobox .

java - How to write into Microsoft Access in hebrew? -

hay im trying write database table in hebrew java program after i'm executing query im getting question marks instead of hebrew... what should do? string query="insert client values("'שלום'")"; rs.executeupdate(query); thanks helpers :)

asp.net mvc - CS0121: The call is ambiguous between the following methods or properties: -

i learning entity framework in mvc from https://www.youtube.com/watch?v=8f4p8u1a2ti when placed html.displaynamefor() in 3rd row of html in foreach loop .it give following error : cs0121: call ambiguous between following methods or properties: 'system.web.mvc.html.displaynameextensions.displaynamefor and 'system.web.mvc.html.displaynameextensions.displaynamefor,mvcapplication1.models.department> i have double checked html tags . coudnt find issue index view : @model ienumerable<mvcapplication1.models.employee> @{ viewbag.title = "index"; } <div style="font-family"> <h2> index</h2> <p> @html.actionlink("create new", "create") </p> </div> <table border="1"> <tr> <th> </th> <th> </th> <th> </th> </tr> @foreach (var item in model) ...

Disable Grails Scaffolding Validation for one Class -

we use grails scaffolding our internal part of our web app. have requirement modify values in before validate method. problem is, these fields blank: false or nullable: true it's no problem modify these values in beforevalidate method, problem is, scaffolding adds required attribute html form, , can't submit these empty fields. is there way disable scaffolding validation on specific view specific class? greetings the short answer "no, there isn't way turn of validation specific domain class in scaffolding." however, can generate views domain class , edit gsps remove required attributes on fields in question. grails generate-views com.somewhere.mydomainclass scaffolding starting point work from, not continued use , customization.

symfony - Symfony2 Composer post-install-cmd -

i need install symfony2 bundle on composer , stuff after install process. "stuff" after install add 1 line "post-install-cmd" in composer.json servicebundle\\core\\platform::registerservice and calls function, fine public static function registerservice(event $event) { //some stuff exit; } the command use: php composer.phar update serviceplatform/bundles/poll now question: possible name "serviceplatform/bundles/poll" or pass arguments statement? need path bundle after install. extra node you're looking - https://getcomposer.org/doc/04-schema.md#extra in composer.json : "extra": { "your-parameter": "serviceplatform/bundles/poll" } then, in servicebundle\core\platform::registerservice : public static function registerservice(event $event) { $extras = $event->getcomposer()->getpackage()->getextra(); $yourparameter = $extras['your-parameter']...

sql - Nullify column in update if subquery returns empty -

i have following sql query update container set member_containers = members ( select inter_container_membership.owning_container_id owner_cont ,array_to_string(array_agg(inter_container_membership.member_container_id),',') members inter_container_membership group inter_container_membership.owning_container_id) v container.id = owner_cont; the problem is, if sub-query not return member_containers not updated, need set null if it's case, i've tried using exists clause didn't work. update container set member_containers = case when exists ( select * inter_container_membership container.id = inter_container_membership.owning_container_id ) members else null end ( select inter_container_membership.owning_container_id owner_cont ,array_to_string(array_agg(inter_container_membership.member_container_id),',') members inter_container_membership group inter_container_membership.owning_container...

python - how to use reportlab with google app engine -

i unable import reportlab under google app engine. according following guide (and several other places on web): "all have download , copy 'reportab' directory root directory of app. " when (i download reportlab-3.0.zip here ) , extract root directory of application, try import reportlab using following lines: from reportlab.pdfgen import canvas reportlab.lib.pagesizes import a4 i import error importerror: no module named reportlab.pdfgen i tried googling no avail. on appreciated not sure else try. many thanks! one other thing tried copying what's in src directory of downloaded zip under root directory of application didn't work either. error using is: importerror: cannot re-init internal module __main__ seems version 2.7 imports okay, issues 3.0 if unzip reportlab zip in root directory of application, won't work, reportlab zip intended local setup using setup.py , don't use in appengine. you should inside zip src d...

android pdf viewer stackoverflow error while reading password protected file -

i able read normal pdf file not have password using pdfviewer.jar, when try read password protected file java.lang.stackoverflowerror . can 1 tell me wrong ? following code intent intent = new intent(this, mypdfvieweractivity.class); intent.putextra(pdfvieweractivity.extra_pdffilename,"mnt/sdcard/sample.pdf"); startactivity(intent); the solution mentioned on github.com/jblough/android-pdf-viewer-library/issues/8 worked me , doing changes in src folder of pdf viewer app still referencing jar (which did not have changes)

Stream audio from Raspberry Pi input to Airplay devices -

does know if there way stream audio raspberry pi input airplay enabled device such apple tv ? to sum seeking app http://www.hersson.net/raopx , run on raspberry pi. thanks.

javascript - Object #<HTMLAudioElement> has no method 'stop' -

$(function(){ var clickhover = $('.click'); var clickaudio = clickhover.find('audio')[0]; clickhover.hover(function(){ clickaudio.play(); }, function(){ clickaudio.stop(); }); } uncaught typeerror: object # has no method 'stop' ? how do??? for html5 audio element method called .pause() , not .stop() . you can see method usage (among others) on this mdn page .

ruby on rails - Nothing happens when doing "mina setup" -

i'm trying set mina deploying rails app. unfortunately, when running mina setup or mina deploy , password prompt, , nothing happens anymore. i can manually ssh given user , password, shouldn't problem. have no idea, mina's stuck: josh@macbuech:~/documents/work/muheimwebdesign/base (features/deployment *)$ mina deploy --verbose base@josh.ch's password: -----> mina: sigint received. elapsed time: 61.00 seconds interestingly, yesterday able connect (one of dozen retries worded, guess): josh@macbuech:~/documents/work/muheimwebdesign/base (features/deployment *)$ mina deploy --verbose base@josh.ch's password: stdin: not tty jailshell: line 3: cd: /var/www/base.josh.ch: no such file or directory ! error: not set up. path '/var/www/base.josh.ch' not accessible on server. may need run 'mina setup' first. ! command failed. failed status 15 then, couldn't connect server ...

apache - PHP Script for Downloading more than 2GB Image ZIP -

on server created zip file images..size of zip more 2 gb. want download zip file.. times file downloading stops or fails when using below script. had change server variables.. if (!$filename) { // if variable $filename null or false display message echo $err; } else { // define path download folder plus assign file name $ordercode = $_get['ordercode']; $refid = $_get['refid']; $path = 'files/'.$refid.'/'.$ordercode.'/'.$filename; // check file exists , readable if (file_exists($path) && is_readable($path)) { // file size , send http headers $size = filesize($path); header('content-type: application/octet-stream'); header('content-length: '.$size); header('content-disposition: attachment; filename='.$filename); header('content-transfer-encoding: binary'); // open file in binary read-only mode // d...

python - SQLAlchemy raises exception on query when with_polymorphic used for model with order_by mapper arg presented with string -

i've stuck 1 issue when using sqla inheritance (i have mixin __mapper_args__ set there). to reproduce it: model should have __mapper_arg__ attribute order_by param set string. add with_polymorphic('*') call query model. class user(base): id = column(integer, primary_key=true) name = column(string) __mapper_args__ = {'order_by': 'user.name'} with constructions works fine except when add with_polymorphic('*') query. db.query(user).with_polymorphic('*') this fails exception file "/python2.7/dist-packages/sqlalchemy/sql/visitors.py", line 267, in clone 'no_replacement_traverse' in elem._annotations: attributeerror: 'str' object has no attribute '_annotations' i suppose kind of bug. since reproduces on sqla 0.7-0.9 have doubts way i've run issue. maybe wrong? this issue reproduced on small testcase . p.s. originally needed mixin in project: class docmixin(...

fft - Trouble doing fourier transform of ASK using MATLAB -

we have ask modulated signal. need fourier transform, therefore used fft, need abs() 1 side? , code complete? i'm not sure how transfer time domain (t) frequency domain (f) in order matlab. clear all; clc; close all; f1=input('enter frequency of carrier='); f2=input('enter frequency of pulse='); a=3; t=0:0.001:1; x=a.*sin(2*pi*f1*t); u=a/2.*square(2*pi*f2*t)+(a/2); v=x.*u; figure subplot(4,1,1); plot(t,x); xlabel('time'); ylabel('amplitude'); title('carrier'); grid on; subplot(4,1,2); plot(t,u); xlabel('time'); ylabel('amplitude'); title('square pulses'); grid on; subplot(4,1,3); plot(t,v); xlabel('time'); ylabel('amplitude'); title('ask signal'); grid on; fs=100; q=fft(v); subplot(4,1,4); plot(fs,q); grid on; if not sure if should use abs() or not, use it. more info . fs=100; q=abs(fft(v)); subplot(4,1,4); plot(q);

Check if apprequest exists Facebook API PHP-SDK -

Image
how can check if apprequest have been sent? callback response is: is there way can take request id, , confirm has been sent recipients? want make sure, people don't interfere request callback function, , make 'look like' sent invitation.

sql server - Sql query to get rechargevalue and max date on any number? -

i have table, have rechargevalue,rechargedate,rechargeno column. want retrieve rechargevalue , maximum rechargedate reference rechargeno. upto retrieved maximum date want retrieve rechargevalue also. query: select isnull(max(rechargeon),'01/01/1900') rechargeon o_rechargehistory_retailer kno='mobileno' use top , order by : select top 1 r.* o_rechargehistory_retailer r r.kno = 'mobileno' order r.rechargeon desc;

c++ - Android GCC compiler change -

how change default gcc compiler 4.6 4.8 in ndk-build command? want use arm-linux-androideabi-4.8 default arm-linux-androideabi-4.6. there way ?? you can directly call ndk-build ndk_toolchain_version=4.8 , or set inside jni/ application.mk : ndk_toolchain_version:=4.8

curl - How to upload a file to a folder location on server2, Having php script on server1 -

i having php enabled server1. have php code file upload. need file saved on server2. i have ftp access server2. while searching found code, <?php $ftp_server = "199.53.23.1"; $ftp_user_name = "xxxx"; $ftp_user_pass = "**********"; $remote_dir = "http://server2/images/"; // set basic connection $conn_id = ftp_connect($ftp_server); // login username , password $login_result = @ftp_login($conn_id, $ftp_user_name, $ftp_user_pass); //default values $file_url = ""; if($login_result) { //set passive mode enabled ftp_pasv($conn_id, true); $file = $_files["uploadedfile"]["tmp_name"]; $remote_file = $_files["uploadedfile"]["name"]; $ret = ftp_nb_put($conn_id, $remote_file, $file, ftp_binary, ftp_autoresume); while(ftp_moredata == $ret) { $ret = ftp_nb_continue($conn_id); } if($ret == ftp_finished) { echo "file '" . $remote_file . "' uploaded successfully."...

(Qt) QAxObject: Add Excel worksheet -

i have qt application working excel, , want add worksheet document. simpliest solution call qaxobject *sheets = workbook->querysubobject("worksheets"); sheets->dynamiccall("add()"); but way you'll add sheet before last existing sheet, want place after last sheet. generated documentation you: idispatch* add (qvariant before, qvariant after, qvariant count, qvariant type) [slot] connect signal slot: qobject::connect(sender, signal(somesignal(qvariant, qvariant, qvariant, qvariant)), object, slot(add(qvariant, qvariant, qvariant, qvariant))); or call function directly: qvariantlist params = ... qaxobject * result = object->querysubobject("add(qvariant, qvariant, qvariant, qvariant)", params); but how should params like? can see, "after" second param, don't need "before" @ all. should specify params? you have specify last , new sheet, otherwise if before , after both omitted, new sheet in...

Does sonarqube show cyclomatic complexity of a method? -

apart displaying complexity/function, can configured display cyclomatic complexity of each method? in identifying potential refactoring candidates( methods) in large files large number of methods. sadly, sonarqube not support method-level metrics. however, give codeanalyzer plug-in try: http://frontendart.com/products/codeanalyzer-for-sonarqube/ mccabe's cyclomatic complexity metric looking for, believe. found online demo plug-in ( http://sonarqube.frontendart.com/ ), contain method-level mccc metric values. i hope helps, john

r - Selecting multiple elements from list of matrix that match elements of list of vector -

i have 2 variables, 1 list of matrices , other list of vectors. people: load("https://dl.dropboxusercontent.com/u/22681355/a.rdata") mat: load("https://dl.dropboxusercontent.com/u/22681355/b.rdata") i go [[1]] [[99]] along elements in people , select rows in mat first column of mat matches people , return second column of mat . i tried: lapply(seq_along(people), function(i) mat[mat[,1,i] == people[i], 2, i]) however cannot handle fact there 1 matching entry while in other cases there can 2 or 3 matching entries. can modifying code? small example: people: [[1]] [1] 34 56 7 [[2]] [1] 13 93 [[3]] [1] 42 mat ,,1 [,1] [,2] [,3] [1,] 34 **2** 1 [2,] 56 **2** 1 [3,] 7 **2** 2 ,,2 [,1] [,2] [,3] [1,] 9 2 1 [2,] 13 **2** 1 [3,] 71 2 2 ,,3 [,1] [,2] [,3] [1,] 90 2 1 [2,] 1 2 1 [3,] 42 **2** 2 the output be: i'm not sure if pulling out want. comment matching ele...

user interface - How do I create a reaction timer in python as GUI? -

i have problem making reaction timer. want button in program gives me time took press button time timer started. let's open program want button if click it, print time took me press after timer started. after clicked button want timer reset , again when click button print time took me click button again. i have following code: from tkinter import* import time import os import datetime s=0 m=0 h=0 def myclickme1(): myv=float(myvaluta.get()) valuta=myv label3["text"]=valuta*b label4["text"]=valuta*c label5["text"]=valuta*d label6["text"]=valuta*e return window=tk() myvaluta=stringvar() window.geometry("700x800") window.title("reaktionshastighehs test") button1=button(window, text="klik her!", command=myclickme1) button1.place(x=330, y=460) just clear: have mate button in gui want make work when click it, print time took me press after program started. , if press bu...

Excel 2010: Best use of CASE or IF to define SAVEAS location (VBA) -

program: excel 2010 experience: basic question wanting save workbook sheet (and generated .pdf) in locations dependent on cell value, rather writing 5 subs, i want write 1 using either if or case . have static save location (dropbox), need save duplicates in respective cell locations. i can't syntax correct either working. sub savemanid() dim sdb string dim smdocs string dim smbus string dim sname string dim ssel string dim sman string 'define file name sname = sheets("statement").range("b52").text 'define location name sdb = "e:\location dropbox\" smdocs = "d:\my documents\" smbus = "d:\location alt\" '---- either if or case define saveas location ----' if sheets("statement").range("j2").text = "3" sman = "g:\location\folder3\" if sheets("statement").range("j2").te...

python - Can a WSGI application tell the web server serving it to send its default HTTP 404 error page? -

i have bare wsgi application in module called app (app.py) looks this: def application(environ, start_response): path = environ['path_info'] if path == '/': start_response('200 ok', [('content-type','text/html')]) return [b'<p>it works!</p>\n'] elif path == '/foo': start_response('200 ok', [('content-type','text/html')]) return [b'<p>hello world</p>\n'] else: start_response('404 not found', [('content-type','text/html')]) return [b'<p>page not found</p>\n'] i serving app using nginx + uwsgi configuration. nifty:/www# cat /etc/nginx/sites-enabled/myhost server { listen 8080; root /www/myhost; index index.html index.htm; server_name myhost; location / { uwsgi_pass 127.0.0.1:9090; include uwsgi_params; } } ...

Javascript - string comparison failing -

i comparing 2 strings if (sphtext == sphspantext) { //"sample " === "sample " comparison fails return true; } the comparison fails if both strings have space @ end. sphtext read xml file , sphspantext html page. if there no spaces works fine. wondering due encoding issues. if use trim works. how can make work? your string must have different whitespace character such normal space or non-breaking space. you can replace whitespace regular space : sphspantext.replace(/\s/g, ' ');

asp.net - Visual Studio 2010 - Opened ASPX files are uneditable -

i came across issue in visual studio 2010. when open .aspx files uneditable. files not read-only. possible edit them time time disable editing. have restart whole vs , when open same file able edit it. does have/had similar experience? there kind of fix this? this bug in visual studio. not you. faced issue. try upgrading latest version. also link may helpful https://connect.microsoft.com/visualstudio/feedback/details/615270/file-becomes-completely-uneditable-read-only-in-certain-circumstances

amazon ec2 - ORA-12170 TNS listener in oracle 11g -

i have setup windows server 2008r2 oracle server 11g (11.2) , small database (mydb) in amazon ec2. now want connect computer database (i use pl/sql developer don't mind using other tools) in server side have: (where ec2-xx-xxx-xxx-xx.us-west-2.compute.amazonaws.com public dns win server.) tnsnames.ora: mydb = (description = (address = (protocol = tcp)(host = ec2-xx-xxx-xxx-xx.us-west-2.compute.amazonaws.com)(port = 1521)) (connect_data = (service_name = mydb) ) ) listener.ora: # listener.ora network configuration file: c:\app\administrator\product\11.2.0\dbhome_1\network\admin\listener.ora # generated oracle configuration tools. listener = (description_list = (description = (address = (protocol = tcp)(host = ec2-xx-xxx-xxx-xx.us-west-2.compute.amazonaws.com)(port = 1521)) (address = (protocol = ipc)(key = extproc1521)) ) ) adr_base_listener = c:\app\administrator at pc @ tnsnames.ora have: ...

asp.net mvc - Error in Html.DisplayNameFor() -

i learning entity framework in mvc from https://www.youtube.com/watch?v=8f4p8u1a2ti in index view ,it give following error : cs0121: call ambiguous between following methods or properties: 'system.web.mvc.html.displaynameextensions.displaynamefor and 'system.web.mvc.html.displaynameextensions.displaynamefor,mvcapplication1.models.department> index view : @model ienumerable<mvcapplication1.models.employee> @{ viewbag.title = "index"; } <div style="font-family"> <h2> index</h2> <p> @html.actionlink("create new", "create") </p> </div> <table border="1"> <tr> <th> </th> </tr> @foreach (var item in model) { <tr> <td> @html.displaynamefor(modelitem => item.name) </td> </tr> } </table> employee controller : namespace ...

using if and else if statements in javascript? -

i trying find away (the correct , easy way) use if , else if statements in javascript. here trying do... at moment, joining 2 input fields value , display them in input balue so: function fillin() { document.getelementbyid('custom').value = 'main text:' + ' ' + document.getelementbyid('inputname').value + ', ' + '1st text:' + ' ' + document.getelementbyid('inputname101').value ; } so above code place values of inputname , inputname101 custom input field. works fine. now, have 2 radio buttons want display values custom input field depending on 1 selected/ checked . for using following code: function fillin() { document.getelementbyid('custom').value = 'main text:' + ' ' + document.getelementbyid('inputname').value + ', ' + '1st text:' + ' ' + document.getelementbyid('inputname101').value if(document.getelementb...

ios - UITableViewCell disclosure indicator disappears on scrolling -

i have custom tableviewcell subviews defined in prototype cell in storyboard. in storyboard set accessory disclosure indicator, when scrolling (when cells reused) indicator disappears. i tried set in code: - (uitableviewcell *)tableview:(uitableview *)tableview cellforrowatindexpath:(nsindexpath *)indexpath { ... cell.accessorytype = uitableviewcellaccessorydisclosureindicator; it did not work well. found working solution, weird solution: - (uitableviewcell *)tableview:(uitableview *)tableview cellforrowatindexpath:(nsindexpath *)indexpath { ... cell.accessorytype = uitableviewcellaccessorynone; cell.accessorytype = uitableviewcellaccessorydisclosureindicator; i don't know why can fix anything, works me. can tell me why or if there other problem/fix? update: how reusable cell: activityweekcell *cell = [tableview dequeuereusablecellwithidentifier:@"cell" forindexpath:indexpath]; i tried: activityweekcell *cell = [tableview deque...

excel - How can a Custom Task Pane toggle visibility whilst keeping the UI responsive? -

i'm trying add custom task pane in excel add-in intended work pivot tables pane. the intention when table selected custom pane should appear , should disappear. this, i've created custom task pane: this._taskpane = globals.addin.customtaskpanes.add( new tabletaskpane(), "foopane"); this._taskpane.dockpositionrestrict = msoctpdockpositionrestrict.msoctpdockpositionrestrictnohorizontal; when table selected pane made visible, , when deselected pane hidden: listobject table = addtable(); // creates table , populates data. table.selected += range => this._taskpane.visible = true; table.deselected += range => this._taskpane.visible = false; this achieves effect of showing , hiding pane, unfortunately generates lag in ui, cursor "bounces" between cells task pane transitions between visibility states. this seems because setter of visible property blocks until task pane completes transition. in excel 2013, slides out side of window...

javascript - Backbone events not catching click on div -

i have next html structure: <div class="wrapper"> <div class="top"></div> <div class="bottom></div> </div> i have next event set in backbone view: classname: 'wrapper', events: { 'click .wrapper' : 'click_handler' }, click_handler: function(event) { console.log("click handled") } this code doesn't trigger click event when wrapper clicked if change click selector ".top" or ".bottom" click triggered. what doing wrong ? capture/bubble? is div.wrapper view's $el? 'click .wrapper' indicates delegating event handler, means trigger decendents of view's $el have .wrapper class. jquery's documentation .on describes event delegation. edit dropping .wrapper events hash may give behavior you're looking for. in other words: classname: 'wrapper', events: { 'click' : 'click_handle...

javascript - Yeoman and angular - routing doesn't work -

i'm trying start developing angular apps yeoman. may sounds stupid, have problem creating routes using yo:angular route. when create new route using: yo:angular route foo yeoman creates: app/scripts/controllers/foo.js (controller) app/views/foo.html (view) app/test/spec/controllers/foo.js (testing controller) in app.js creates: .config(function ($routeprovider) { $routeprovider .when('/', { templateurl: 'views/main.html', controller: 'mainctrl' }) .when('/foo', { templateurl: 'views/foo.html', controller: 'fooctrl' }) .otherwise({ redirectto: '/' }); }); so should work fine. unfortunately route doesn't work - when try open http://localhost:9000/foo i following error: cannot /foo the idea of routes in yeoman looks pretty easy , i'm not sure problem is. did enable html5 mode in angular application? if ...

python - Combine multiple QMainWindow into one as tabs in QTabWidget -

so, project had been divided multiple portions each working independently. me , group members worked on individual portions , want combine of them single qmainwindow . have menu items in each qmainwindow makes jumping 1 part possible.. (by closing current window , launching within same qapplication ) but want more elegantly, using qtabwidget , each part have own tab. how achieve this? (btw, i'm using qt designer designing ui) what i've done: -make new window, add qtabwidget , drag , drop widgets previous qmainwindow separate tabs. this works design perspective. don't know how combine code. in separate classes inherited qmainwindow . is there no way manually add associated slots , functions new mainwindow? as each portion qmainwindow, each qmainwindow put in tabwidget. suppose portion_one_qmainwindow derives qmainwindow. use working code, similar following 1 : qtabwidget *tabmaster = new qtabwidget; portion_one_qmainwindow *portion_one = new p...

objective c - iOS - How to restrict application installs on different devices for a specific user -

i working on in-house enterprise application. idea restrict specific user install/run application on x number of devices. what best possible way that? way can think of using kind of certificates ( ones testflight or hockeyapp installs uniquely identify device , communicate server ). have no idea how that? so how can achieve this? edit to explain question further, following sample scenario: ' "i have video streaming application, , want restrict user use login upto 5 different devices. when try login on 6th device. login fail." i want achieve functionality. cannot generate random guid , save along user details on server. if user un-install application on same device , installs again. there no change device have same guid , considers server new device. hope scenario clear. you can using default ad-hoc distribution. udid's devices, add them apple developer portal, , generate new provisioning file once you've gotten devices want. testflight isn...

javascript - jQuery cycle image that are display: none -

i have div contains several images , there's default image. @ beginning displays default image, whenever user mouses hover image should cycle other images display: none . as can see in jsfiddle , div structure following: <div id="2"> <img src="http://www.thesearchagents.com/wp-content/uploads/2013/11/google-search.jpg" class="default" onmouseout="this.src='http://www.thesearchagents.com/wp-content/uploads/2013/11/google-search.jpg'"/> <img src="http://pplware.sapo.pt/wp-content/uploads/2014/02/google_whatsapp.jpg" class="default" style="display: none"/> <img src="http://pplware.sapo.pt/wp-content/uploads/2013/07/google_08.jpg" class="default" style="display: none"/> </div> the first image, default 1 because has event onmouseout . other images complement div. so, want whenever user mouseshover image default cycle begin betw...

How i upload data from internet in sas? -

i have data set: "country" "year" "gdp.per.capita" "infant.mortality.rate" "argentina" 1950 6252.85859891315 68 "australia" 1950 10031.1213832996 25.1 "austria" 1950 5733.09811393918 66 "belgium" 1950 7990.46583983014 53 "benin" 1950 1104.46653022144 204.8 "burkina faso" 1950 515.707854373329 178.7 "canada" 1950 10581.265520182 41.2 "chile" 1950 3713.9960324847 147.7 "colombia" 1950 2087.94941987793 124 "denmark" 1950 8996.05428012913 29.1 "finland" 1950 5845.6263157204 44 "france" 1950 7104.00732497357 47.6 "ghana" 1950 943.100536353646 150.1 "greece" 1950 3040.41319387776 35 i wrote script upload data internet doesn't work. give me bug gdp not veriable. don't undarstand bug. filename regproj url "http://www.math.tau.ac.il/~liadshek/long.txt" ; data book; length country $20; infil...

css - Wordpress navigation horizontal submenu on hover -

Image
i'm using childd theme wordpress twentyfourteen, want submenues of navigation horizontal , contain logos instead of page titles wordpress nav. menu array. there custom solution inlin (horizontal) navigations in wordpress (couldn't find on codex either). main html/php code , screenshot of want listed below. when user hovers on "markalar"(any of primary elements of navigation) submenu must displayed attached image's view. have done of css works, have no idea how place logos instead of sub page titles. <nav id="primary-navigation" class="site-navigation primary-navigation" role="navigation"> <h1 class="menu-toggle"><?php _e( 'primary menu', 'twentyfourteen' ); ?></h1> <?php wp_nav_menu( array( 'theme_location' => 'primary', 'menu_class' => 'nav-menu' ) ); ?> </nav> image: edit: wouldn...

c# - sqlite database is locked on insertion -

there's simple code var insert = @"insert [files] ( [name], [fullname], [md5]) values (@name, @fullname, @md5);"; using (var con = _db.openconnection()) { using (var cmd = con.createcommand()) { cmd.commandtext = insert; cmd.parameters.addwithvalue("@name", item.name); cmd.parameters.addwithvalue("@fullname", item.fullname); cmd.parameters.addwithvalue("@md5", item.md5); cmd.executenonquery(); } } applications hangs time when executing cmd.executenonquery(); and fails exception "database locked". why happening? application not multithreaded. db file just-created. problem solved. before code there call sqlcommand.executereader(). though connection , command created reader disposed, reader wasn't disposed. after fixing "using(reader)" connection closed , error above disappeared. in total: datareader can still hold connect...

hadoop - taging matched keyword in apache flume -

im using 1 of many guides stream data twitters streaming api hdfs, via flume. need append matched keyword somewhere in data flow can see keyword generated tweet. can recommend method? you can using interceptor . flume allows inspect event , add additional data either header or augment existing event.

vbscript - VB script ADODB.Stream creating infinite while loop -

i have vbs file. fetch records sql server 2000 database. using while loop, extract data column record set using steam object, create file & write content of zip file getting infinite loop. please find db records sample file_id file_name file_content(blob datatype) 23127376 file_1 afdfasdf253asdf6asdf52asd45fasf 23127377 file_2 afdfasdf253asdf6asdf52asd45fasf 23127378 file_3 afdfasdf253asdf6asdf52asd45fasf 23127379 file_4 afdfasdf253asdf6asdf52asd45fasf 23127380 file_5 afdfasdf253asdf6asdf52asd45fasf 23127381 file_6 afdfasdf253asdf6asdf52asd45fasf 23127382 file_7 afdfasdf253asdf6asdf52asd45fasf 23127383 file_8 afdfasdf253asdf6asdf52asd45fasf 23127384 file_9 afdfasdf253asdf6asdf52asd45fasf 23127385 file_10 afdfasdf253asdf6asdf52asd45fasf 23127386 file_11 afdfasdf253asdf6asdf52asd45fasf 23127387 file_12 afdfasdf253asdf6asdf52asd45fasf 2312...

wordpress - jQuery(document).ready shouldn't run when I submit the form -

i wrote jquery runs when page loads, , it's good. problem runs when submit form, , messes submission. is there way around that? my form: http://goinspire.com/jwrp-hotel-registration/ and jquery file: http://goinspire.com/wp-content/themes/goinspire/js/customjqueryfunctions.js thanks! here part of code believe pertinent: // custom javascript functions jquery(document).ready(function () { tripfilter = function () { var tripclass = '.hotel-trip select', hotelclass = '.hotel-name select', unusedclass = '.unused-options select'; var tripselect = jquery(tripclass), trip = tripselect.val(), hotelselect = tripselect.parents('form').find(hotelclass); if (trip !== undefined && trip !== "") { if (trip === "none"){ jquery(hotelclass+" > option").each(function() { jquery(this).clone()....

batch file - Search for and kill PIDs, one at a time -

i have following command works pretty well: for /f "tokens=5 delims= " %%p in ('netstat -a -n -o ^| grep :7010') taskkill.exe /pid %%p /f the issue is, if same port found multiple times same pid, script returns errno 1 because attempts kill pid after first have failed. is there way modify above attempts kill pid once? this might work you: @echo off &setlocal disabledelayedexpansion /f "tokens=5 delims= " %%p in ('netstat -a -n -o ^| grep :7010') ( if not defined pid.%%p ( taskkill.exe /pid %%p /f set "pid.%%p=7" ) )