Posts

javascript - IE onpropertychange event doesn't fire -

<a href="javascript:void(0)" id="select-handler">select</a> <input type="file" id="real-file-input" style="display:none" /> $('#select-handler').click(function(){ $('#real-file-input').click(); }); $('#real-file-input').bind('propertychange', function(){ alert('changed'); }); it's weird when use .click() propertychange won't fired. actually code works fine in ie7 , 8 me, whenever change value of input type ='file' , alert fired. whereas not working in >ie9 versions. from paulbakaus's blog on propertychange on internet explorer 9 what’s wrong propertychange on ie9? ie9 doesn’t fire non-standard events when binding them through addeventlistener. every modern js library uses feature detection, including jquery, fail (see also: http://bugs.jquery.com/ticket/8485 ). “not biggie” say, “simply use attacheven...

Codeigniter: Override variable in auto-loaded config file -

i have following: config/email.php $config['protocol'] = 'smtp'; $config['smtp_host'] = "xxxxxx"; $config['smtp_user'] = "xxxxxx"; $config['smtp_pass'] = "xxxxxx"; $config['smtp_port'] = xx; $config['wordwrap'] = true; $config['mailtype'] = 'html'; $config['charset'] = 'utf-8'; $config['newline'] = "\r\n"; in cases, i'm sending html plain-text alternative emails. config works perfectly. now in 1 special case, i'm wanting send plain-text email need override setting to: $config['mailtype'] = 'text'; how can that? tried specifying new config array , loading library again still sends html: $email_config = array( 'mailtype' => 'text' ); $this->load->library('email', $email_config); i think need call initialize when don't load config file. $this-...

spring validation annotation for compulsory and non-compulsory fields -

@notempty private string cname; public string getcname() { return cname; } public void setcname(string cname) { this.cname = cname; } private string cdescription; public string getcdescription() { return cdescription; } public setcdescription(string cdescription) { if(cdescription.length()>0){ this.cdescription = cdescription;} in above code,cname compulsory field , cdescription non-compulsory field has validated.cname working fine. want know how can validate cdescription w/o making compulsory as per requirement can use different annotations of javax.validation http://docs.oracle.com/javaee/6/api/javax/validation/constraints/package-summary.html hibernate validation you.@notblank , @notnull , @notempty various types of annotation available in hibernate-validator jar.

sed - combine one colum from two files into a thrid file -

i have 2 files a.txt , b.txt contains following data. $ cat a.txt 0x5212cb03caa111e0 0x5212cb03caa113c0 0x5212cb03caa115c0 0x5212cb03caa117c0 0x5212cb03caa119e0 0x5212cb03caa11bc0 0x5212cb03caa11dc0 0x5212cb03caa11fc0 0x5212cb03caa121c0 $ cat b.txt 36 65 fb 60 7a 5e 36 65 fb 60 7a 64 36 65 fb 60 7a 6a 36 65 fb 60 7a 70 36 65 fb 60 7a 76 36 65 fb 60 7a 7c 36 65 fb 60 7a 82 36 65 fb 60 7a 88 36 65 fb 60 7a 8e i want generate third file c.txt contains 0x5212cb03caa111e0 36 65 fb 60 7a 5e 0x5212cb03caa113c0 36 65 fb 60 7a 64 0x5212cb03caa115c0 36 65 fb 60 7a 6a can achieve using awk? how do this? paste shortest solution, if you're looking awk solution stated in question then: awk 'fnr==nr{a[++i]=$0;next} {print a[fnr] "\t" $0}' a.txt b.txt

windows - How to generate .msi installer with cmake? -

i trying generate .msi installer cmake . able generate .dll , .lib files configuration in cmakelists.txt . please provide example cmakelists.txt generate .msi installer. commands need use in command prompt ? the commands using far are: > cmake -g"visual studio 10" -h"root cmakelists.txt path" -b"path generate sln" > cmake --build "path of sln" --config release > cpack -c release output: cpack error: cpack generator not specified i used following configuration generate .dll , .lib files. here cmakelists.txt : cmake_minimum_required(version 2.8) project(mydll) include_directories(common/include) set(my_lib_src dllmain.cpp mydll.cpp ) set_source_files_properties(${my_lib_src} properties language c) add_library(mydll shared ${my_lib_src}) set_target_properties(mydll properties linker_language c runtime_output_directory ${cmake_source_dir}/common/bin...

c# - How to identify third party hardware devices for credit cards and their APIs for Windows 8 Tablet? -

i new windows 8 tablet. question how identify third party hardware devices credit cards , apis need integrate windows 8 tablet type onsite studio app? which type of languages support api windows 8 tablets? by windows 8 tablet, presume mean metro/modern style application? if you'll limited using windows 8 this. instead highly recommend looking @ api's provided in windows 8.1. using newer apis have 3 options: 1) windows.devices.pointofservice - port of pos.net across winrt namespace. basic api's allow access pos peripherals such msr readers. example code can found on: http://msdn.microsoft.com/en-us/library/windows/apps/bg182882.aspx#two 2) if want use nfc-based cards (tap , pay) - theoretically can use winrt port of smartcard framework. isn't straightforward above, , requires understanding of how smartcards work. http://msdn.microsoft.com/en-us/library/windows/apps/windows.devices.smartcards.aspx 3) can assess devices such square use 3.5mm audio jac...

apache - Webapplication common resources & Loadbalance -

i implement load balancing apache webserver , 2 tomcat servers. the war deployed on both tomcats has common resources images , css folders, quietly large, if change happens in image have copy , past again in other war file deployed. i looking out try map fix directory both war files fetch common folder. (i.e tomcat 1 , tomcat 2 access css folder c:\css\ same images ) i tried writing servlet deployed images not feasible. any other way work around high availability resource serving ? please assist if have idea. i got know can map external directory tomcat in server.xml <host name="localhost" appbase="webapps" unpackwars="true" autodeploy="true"> //add host tag <context path="/content" docbase="e:/atul/data/" /> </host>