Posts

Showing posts from August, 2013

php - select2 required field not working in Internet Explorer and Safari -

i have several fields using select2 v=3.4.1. have 2 of these fields set required, works in chrome , firefox, it's not working in ie8. validation works , show warning in chrome , firefox, , ie11 warning display first field not second field enabled selecting first. i have spent far time trying find work around, it's not working. i know required not supported attribute within ie , safari, there way these fields required without installing new plugin? i under confidentiality agreement, can post generic code if needed. dc http://www.2play4.net/register.html utilized select2 above domain. check if can try getting requirement here. check refered field

Encoding video stream by http protocol using ffmpeg library -

i'm trying encode video files, users upload on server. interpretate file stream, incoming on server http protocol , use ffmpeg realtime file encoding, while upload procedure executes. when source file have .avi format, have successful encoding result, on .mp4 format appears error: --------------------- [buffer @ 0000000000308380] unable parse option value "-1" pixel format last message repeated 1 times [buffer @ 0000000000308380] error setting option pix_fmt value -1. --------------------- i think might because .mp4 contains "moov atom" data in end of file. think because when processing file "-movflags faststart" command before encoding, have successful result. that command using now: ffmpeg -i http://myhost.com/app/video/video2.mp4 -f mp4 -vcodec libx264 -b:v 800k -acodec libvo_aacenc -b:a 128k -ar 44100 -ac 2 -y c:/watch-and-get/video/video5.mp4 can resolve problem , encode multiple video formats stream without excess steps?

java - Watermark in itextsharp is not displaying properly -

Image
i'm using itextsharp populate data pdf templates, created in openoffice. populating fine, i'm getting proper pdf, watermark not displaying properly. below code: public void addwatermark(pdfstamper stamper, int pagenumber, watermark watermark) { list<watermarkfield> watermarkfields = watermark.getwatermarkfieldasreference(); (watermarkfield watermarkfield : watermarkfields) { // setting font , font size watermark text font font = new font(fontfamily.helvetica, watermarkfield.getfontsize(), font.bold, new graycolor(0.75f)); // setting alignment watermark columntext.showtextaligned(stamper.getundercontent(pagenumber), element.align_center, new phrase(watermarkfield.gettext(), font), watermarkfield.getxdirection(), watermarkfield.getydirection(), watermarkfield.getrotation()); } } when putting in background text-boxes hiding watermark. when putting in foreground watermark hiding text

Add an interval to a date until is today sql server query -

i need query table rows date field + amount of 7 day intervals today, date in past , can number of days in past. for example if today 2014-06-27 , have table below: table ------------------ id | date ------------------ 1 | 2014-06-13 ------------------ 2 | 2014-06-14 ------------------ 3 | 2014-05-30 ------------------ the rows 1 , 3 should returned, row 2 shouldn't because 2014-06-14 + 2 x 7 day intervals = 2014-06-28 after today. try select * datediff(dd,date,getdate())% 7 = 0

c++ - knnsearch taking lot of time for large number of features -

i using flann based knnsearch. feature-set contains 4 images of size 500*500. want nearest neighbors points in 4 images(the query set same feature set) taking lot of time run in opencv cpp. there can done reduce run-time. have set num_features = 500*500 , dimensionality = 4. want distance , nearest neighbors each point in 4 images, dists , index matrix should have same no.of elements features. here code mat features,temp[4]; //input array of 4 images contain features. int num_data = input[0].rows * input[0].cols; int num_queries = input[0].rows * input[0].cols; temp[0] = input[0].clone(); temp[1] = input[1].clone(); temp[2] = input[2].clone(); temp[3] = input[3].clone(); temp[0] = temp[0].reshape(0, num_data); transpose(temp[0], temp[0]); temp[1] = temp[1].reshape(0, num_data); transpose(temp[1], temp[1]); temp[2] = temp[2].reshape(0, num_data); transpose(temp[2], temp[2]); temp[3] = temp[3].reshape(0, num_data); transpose(temp[3], temp[3]); vconcat(temp[0],temp[1],featu

linux - Event notification from kernel space to user space -

how notify user space application whenever event occurs in kernel space? a hardware generates interrupt when data arrives @ gpio. data copied kernel buffer. @ point, want driver notify application can call read function copy data form kernel buffer user space buffer. i thought of using epoll method, epoll indicates whether device ready read from. want that, epoll indicate whenever kernel buffer full. and, there way modify behavior of poll_wait() function in driver? (had replied in chat session seems should in answer putting here more detail.) what poll_wait add driver list of file descriptors being waited user space program. pattern is: user program calls poll/select/epoll_ctl core kernel calls driver's poll entry point driver calls poll_wait add wait queue list of waitqueues (unless gpio data readable, indicate via return value) later, when device interrupts, call wake_up on wait queue, unblocks process if it's (still) waiting in poll/select cal

PHP Login Code not working properly any suggestions? -

i have been working on login page , code has not been working, have tips or ideas on should do. when echo num_rows displays 0, instead of number of rows in database. $email = mysqli_real_escape_string($dbc, trim($_post['email'])); $password = mysqli_real_escape_string($dbc, trim($_post['password'])); //look email , password in database $query = "select * users email = '$email' , password = md5('$password')"; $data = mysqli_query($dbc, $query); $count = mysqli_num_rows($data); echo "num of rows: " . $count . "<br/>"; change password statement , query this. it'll solve problem $password = md5($_post['password']); $query = "select * users email = '$email' , password = '$password'";

Can I create a model for XML in Swagger UI? -

i looking swaggerui option document rest service. service supports both xml , json formats. i can see in pets demo can specify schema json objects using json schema. however, can't see way specify xml schema, using xsd or dtd. possible? you can find information xml models here . need i'm looking way annotations in java.

c# - Maintain state of checkboxlist inside gridview asp.net -

i have checkboxlist(with 4 listitems) in 1 of columns of gridview.it not populated database.i want maintain state of listitems(checked or unchecked) when navigate page of gridview.i have tried setting enableviewstate="true" gridview , checkboxlist doesnt work. here's html mark-up: <asp:gridview id="grdunits" runat="server" autogeneratecolumns="false" allowpaging="true" pagesize="20" onrowdatabound="grdunit_rowdatabound" onpageindexchanging="grdunit_pageindexchanging" rowstyle-backcolor="white" alternatingrowstyle-backcolor="lightblue" borderstyle="solid" height="426px" width="1500px"> <pagersettings mode="numeric" /> <columns> <asp:boundfield datafield="sukey&quo

regex - Inline Regular Expressions in JavaScript -

i trying replace occurrences of character in string. works when use regexp() object create regular expression : var str = "a-b-c-d"; var regex = new regexp('\-','g'); str.replace(regex,'@'); so works , "a@b@c@d". what if want use inline regular expression , say: str.replace("/\-/g",'@') it not work. how do without using regexp(); remove quotes ( regex literal not string literal ): str.replace(/\-/g,'@')

c# - Combobox of toolstrip doesn't have selected value -

Image
i try put combobox in toolstrip menu .i put doesn't have selectedvalue !!!why ? but when put standard combobox has . see msdn remarks here . toolstripcombobox combobox optimized hosting in toolstrip. subset of hosted control's properties , events exposed @ toolstripcombobox level, underlying combobox control accessible through combobox property . update : get combobox control using toolstripcombobox1.combobox property. code example: toolstripcombobox1.combobox.datasource = new object[] { "one", "two", "three" }; toolstripcombobox1.combobox.selectedindex = 2; string selvalue = toolstripcombobox1.combobox.selectedvalue.tostring(); // selvalue gets "three"

javascript - Apply CSS to disabled button -

Image
i want view disabled button as: the 1 marked red disabled button , green 1 enabled. i trying apply css same follows: $(document).ready(function () { $('#btnsearch').attr("disabled", true); $("#btnsearch").css({ 'background': "#grey" }); }); but not showing mentioned in image. its looking me this: which css attribute need use disabled buttons above (marked in red)? jsfiddle: http://jsfiddle.net/54qjx/ try out prop() $(document).ready(function () { $('#btnsearch').prop("disabled", true); $("#btnsearch").css({ 'background': "gray" }); }); @beargrylls check updated fiddle demo , working per requirement.

ember.js - Architecture for a web2py + ember + websockets application -

i trying add quasi-real-time layer ember web application via websockets . thinking following setup: frontend client <--> web2py server (rest api) <---> ------ ^ | db | |---> websockets server <--> bg services <--> ------ whenever frontend logging in web2py server, providing rest api access data needed frontend, must connect "websockets server". server used bg services provide quasi-real-time data connected frontends. the bg services background processes extracting complex data database, without request coming frontend, , pushing data connected clients, whenever ready. i have questions have answered myself (i wrong here, please correct me): a1: how know connected clients? guess websockets server knows clients connected a2: how push messages frontends? send message websockets server, specifying group must distributed. a3: how organize "websocket groups"? desig

javascript - jquery change button text from save to edit 2 ways -

i newbie in programming , wanna ask how change button 2 way. <button type="button" id="button">save</button> <script> $(document).ready(function() { $('#button').click(function(){ $('#button').text("edit"); }); }); initial when click turn "edit" how click "save" when clicking. thank you write small toggle function: $('#button').on('click', function() { $(this).text(function(_, value) { return value == 'save' ? 'edit' : 'save'; }); });

gideros - Dispatch Touch END event until user touches the screen in Lua -

i want touches_ends event dispatched until user touches screen, how ever dispatched once when touch removed, example, want player running continuously while user not touching screen , need else when user touches screen. please? i don't know gideros, use events store lua variable indicates touch-state. example, when touches_begin event fired, set global variable named _touching true. when touches_end event fired, set global variable false. assuming code running in loop, have player walk when global _touching variable set false , else when variable evaluates true. also, after little bit of googling, noticed touches_move , touches_cancel event , end event called touches_end (for sprite library), might want check on those: http://docs.giderosmobile.com/reference/gideros/sprite/event.touches_move http://docs.giderosmobile.com/reference/gideros/sprite/event.touches_cancel hopefully on way. edit - global variables considered bad in lua, in case, out big deal.

java - Can't get output from Runtime.exec() -

i have written code execute command on shell through java: string filename="/home/abhijeet/sample.txt"; process contigcount_p; string command_to_count="grep \">\" "+filename+" | wc -l"; system.out.println("command counting contigs "+command_to_count); contigcount_p=runtime.getruntime().exec(command_to_count); contigcount_p.wait(); as pipe symbols being used not able execute command successfully.as per last question 's discussion have wrapped variables in shell: runtime.getruntime().exec(new string[]{"sh", "-c", "grep \">\" "+filename+" | wc -l"}); which worked me executes command on shell , still when try read output using buffered reader : bufferedreader reader = new bufferedreader(new inputstreamreader(contigcount_p.getinputstream())); string line=" "; while((line=reade

java - Date format and the hour is always 12:00:00.000 -

this question has answer here: converting iso 8601-compliant string java.util.date 24 answers i got problem date format yyyy-mm-dd't'hh:mm:ss.sss'z' , when parse date time set 12:00:00.000 . this date formater: dateformat xmldateformatwithms = new simpledateformat("yyyy-mm-dd't'hh:mm:ss.sss'z'"); you seem need 24-hours hour format. need: "yyyy-mm-dd't'hh:mm:ss.sss'z'" with capital hh specify need 24-hours format.

java - JPA: join tables but after that still makes sequence of queries -

i'm sorry if silly or not complete. want make 1 query, joining tables @ once. @namedquery(name="user.findbylogin", query="select u user u " + "left outer join fetch u.userinfo ui " + "left outer join fetch u.freeevents fe " + "left outer join fetch u.paidevents pe " + "left outer join fetch fe.action fea " + "left outer join fetch pe.action pea " + "where u.login = :login") and works (no errors, no warnings, sql generated), , sql fine, , appropriate data retrieved in mysql console. after makes many requests find actions id, , looks hibernate doesn't know had fetched needed data or have no idea it. other similar joins 2 tables valid , work expected. way, freeevent , paidevent @inheritance(strategy=inheritancetype.single_table), differs "rate_type" column. tried both eager , lazy fetch, , hiber

ruby on rails - Nokogiri XML to hash using attibute names -

i'm new rails , i'm looking parse xml pubmed eutil's api hash attributes want. here have far: def pubmed_search new if params[:search_terms].present? require 'nokogiri' require 'open-uri' @search_terms = params[:search_terms].split.join("+") uid_url = "http://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?db=pubmed&term="+@search_terms uid_doc = nokogiri::html(open(uid_url)) @uid = uid_doc.xpath("//id").map {|uid| uid.text}.join(",") detail_url = "http://eutils.ncbi.nlm.nih.gov/entrez/eutils/esummary.fcgi?db=pubmed&id="+@uid detail_doc = nokogiri::html(open(detail_url)) @details = @detail_doc.xpath("//item[@name='title']|//item[@name='fulljournalname']|//item[@name='author']").map{|article| article.text} render :new else render :new end this gives me values want (authors, title, journal name) comes out in 1 giant array

php array. unable to find value from the key -

please me figure out error find value key. value printed when using string not variable same value. in advance code: print_r($essid_data); print_r($essid_data['criticalboot']); print_r($myssid); print_r($essid_data[$myssid]); output: array ( [criticalboot] => array ( [0] => ccmp [1] => psk ) ) array ( [0] => ccmp [1] => psk ) criticalboot undefined index: criticalboot try trim() first before feeding index. like: $myssid = trim($myssid); print_r($essid_data[$myssid]);

angularjs - Restangular put method with extra route don't send data -

i'm wondering what's wrong snippet: (my goal if send put request user/14/account data update of course) .controller('useraccountctrl', ['$rootscope', '$scope', '$state', 'user','user','restangular', function($rootscope, $scope, $state, user, user, restangular) { $scope.user = restangular.one('user',14).get().$object; $scope.errors = null; $scope.save = function(){ $scope.user.one('account').put(); }; } ]); i've got call user/14/account without data :( update this seems work var user = restangular.one('user',14).one('account');

java - org.apache.cxf.interceptor.Fault: Unmarshalling Error: Illegal character (NULL, unicode 0) encountered: not valid in any content -

i using cxf webservice uses local transport , accessing webservice java application. webservice reading file , sending through webservice call. using byte size 512. suppose file size 1200. first 2 attempt of retrieving file success , last chunk getting org.apache.cxf.interceptor.fault: unmarshalling error: illegal character (null, unicode 0) encountered: not valid in content. here chunk represents 512 bytes. converting bytes string , returning web service.in last chunk 16 byte value filled , remaining filled zeros. appreciated. using cxf webservice 2.7.5, jdk1.7 ,redhat linux. stack trace: org.apache.cxf.interceptor.fault: unmarshalling error: illegal character (null, unicode 0) encountered: not valid in content @ [row,col {unknown-source}]: [2,1] @ org.apache.cxf.jaxb.jaxbencoderdecoder.unmarshall(jaxbencoderdecoder.java:808) @ org.apache.cxf.jaxb.jaxbencoderdecoder.unmarshall(jaxbencoderdecoder.java:629) @ org.apache.cxf.jaxb.io.datareaderimpl.rea

Create a fake .a file for iOS simiulator -

i've static library included in project library not have support i386 arch. so, possible create fake .a file can use run on simulator. don't want methods/feature of static lib executed when run in device. static library use bluetooth communication. there direct or work around done.

PHP List Directories Recursively Issue -

Image
i'm trying list php files in specified directory , recursively check sub-directories until finds no more, there numerous levels. the function have below works fine exception recurses down 1 level. i've spent hours trying see i'm going wrong, i'm calling scanfiles() when finds new directory seems work 1 level down , stop, appreciated. updated: function scanfiles($pparentdirectory) { $vfilearray = scandir($pparentdirectory); $vdirectories = array(); foreach ($vfilearray $vkey => $vvalue) { if (!in_array($vvalue, array('.', '..')) && (strpos($vvalue, '.php') || is_dir($vvalue))) { if (!is_dir($vvalue)) $vdirectories[] = $vvalue; else { $vdirectory = $vvalue; $vsubfiles = scanfiles($vdirectory); foreach ($vsubfiles $vkey => $vvalue) $vdirectories[] = $vdirectory.director

How to find a phrase in text file print out the result PHP? -

i used code find word in .txt file: <?php $lines = file('testxml.txt'); $what = array ( 'type="abbreviated">', 'type="international">'); foreach ( $lines $num => $line ) { foreach ( $what $needle ) { $pos = strripos ( $line, $needle ); if ( $pos !== false ) { echo "line #<b>{$num}</b> : " . htmlspecialchars($line) . "<br />\n"; } } } ?> and output is: line #1 : <message id="nobill_54050898532262207218"> line #4 : <destination messageid="54050898532262207218"> line #6 : <number type="abbreviated">218</number> line #11 : <number type="international">66830270995</number> but want output : line #6 : 218 line #11 : 66830270995 how should ? complete text file: <message id="nobill_54050898532262207218">

c# - Send a value by socket and read the value by reader.ReadInt32() changes value -

i trying send value socket .so have 2 parts in project client , server . the client sends value server using code : system.io.binarywriter binarywriter = new system.io.binarywriter(networkstream); binarywriter.write(1); binarywriter.write(2); binarywriter.flush(); so in other part need read 2 values mean 1 , 2 ; so in server part have code : static void listeners() { socket socketforclient = tcplistener.acceptsocket(); if (socketforclient.connected) { networkstream networkstream = new networkstream(socketforclient); while (true) { list<int> variables = new list<int>(); using (var reader = new binaryreader(networkstream)) { (int = 0; < 2; i++) { int t = reader.readint32(); variables.add(t);

javascript - AngularJS UI-Bootstrap Modal -

below angular code not getting errors, model opens modalinstancectrl functions cancel() , ok() not want work, if right out controller have on angularjs ui-bootstrap ( http://angular-ui.github.io/bootstrap/#/modal ) directives website seems work. i using same html in example on website except have extracted inline template own file, working. package versions: bootstrap 3.1.1, angularjs 1.2.18, ui bootstrap 0.11.0 i think issue here include controller maybe not doing correctly controller: this.modalinstancectrl, main app app.js: 'use strict' angular.module('myapp', ['ui.bootstrap', myappcontrollers]); controllers controllers.js: 'use strict'; var myapp = angular.module('myappcontrollers', []); myapp.controller('modalctrl', ['$scope', '$modal', '$log', function($scope, $modal, $log) { $scope.open = function (size) { var modalinstance = $modal.open({ templateurl: 't

java - Storing timestamp with milliseconds in Oracle -

i know how retrieve timestamp milliseconds: to_char(systimestamp ,'yyyy-mm-dd hh24:mi:ss,ff9') can please advise, timestamp data type sufficient store date milliseconds or can use varchar2? trying insert value java. yes, timestamp allows precision down nanoseconds if want it. if need milliseconds, want timestamp(3) column. use java.sql.timestamp (which again goes down nanoseconds, if need to) on java side. note should avoid doing to_char conversion if possible - perform string conversions need client-side; fetch data timestamp, , send timestamp.

Shell Command to delete all files other than .cpp files -

i want delete files in directory not .cpp files. i need command like: rm except .cpp files edit based on suggestion not parse ls , can loop yourself: for f in *; if [[ $f != *.cpp ]]; rm "$f"; fi; done otherwise, work: ls | grep -v ".cpp$" | xargs rm if want recursively can use: find . -type f -not -iname "*.cpp" | xargs rm

Msi generated via Wix, Reporting ngen progress -

i'm running ngen i've included in wvx files generates msi. however, running installer in logging mode not feed if ngen had executed. there way confirm msi installed has ngened stuff? check ngen.log file located in %windir%\microsoft.net\framework64 (on 64 bit windows .net 4.5) , see if there entries in timestamps similar when ran msi. more info here

android - How to call FragmentStatePagerAdapter from fragment -

i have 2 fragments- list fragment , detail fragment. when click on item of list fragment, should redirect me detail fragment. in detail page should use view pager. worked using pager adapter. should use fragment state pager adapter. how call adapter fragment. tried using it...but return empty container. any suggestions appreciated.. in adavance...

php - starts with numbers ends in a letter -

ok need found out away find out if url being requested starting 5 digits , ends letter 13373w i know if this (\d+) is matches numbers (digits) once had w on end of string no longer works. i wondering correct way - bigger , more people join, move 6 numbers , on, letter should @ end. any here welcomed. the answer found use code dispatch_get("^/(\d+[a-z])", array($redi, 'pet')); stupid me more research of showed me this... the regular expression should be: /\d+[a-z]$

javascript - Node http response returning user password to angular -

Image
i using mean stack , trying set basic authentication. authentication works fine. process goes this: angular posts user details "/login". passport doing authentication , redirecting either "/login/success" or "/login/failure" both routes return different simple json depending on result either: res.json({success:true,user:req.session.passport.user}); or return res.json({success:false}); now, when console.log result angular right json. problem in config object still see user details in config object (username , password) posted initially. i not sure if normal or not i'd return simple json , no additional data client. this i'm getting in client. can see username , password in config object. here little bit more code: angular html form <form action="" ng-submit="submit()"> <div class="form-group"> <input ng-model="user.username&

scala - Constructor parameter names and class member names -

i understand how scala deals constructor parameters, i.e. generating getter val , getter/setter var. have found quite few discussions name clashes between constructor parameters , class members. for names w/o val & var, expect if they're prefixed this. , class members instead should used. that's not case. class a(val a: int) { def m = println("a.a: " + a) } class b(a: int) extends a(2 * a) { override def m = { super.m println("@a: " + a) println("this.a: " + this.a) // @a, not a.a } } object testapp extends app { val b = new b(10) b.m println(b.a); // a.a } output: a.a: 20 @a: 10 this.a: 10 20 i feel it's weird there design reason behind it? as wrote in question scala generates getter val , when declare val parameter in a class, has method m , field a , inherited b class. have a parameter in b class, doubled , passed argument super constructor of a . understand what's going o

c# - AutoComplete TextBox is not populating other fields -

i having trouble getting textbox autocompleteextender populate other fields after selection has been made. if try same thing dropdownlist (changing control names appropriate point ddl instead of textbox) works perfectly. from below sections of code can see may doing wrong? have spent days trying work! aspx <asp:textbox runat="server" id="top_site_numtextbox" size="6" autopostback="true" appenddatabounditems="true" datatextfield="site_num" datavaluefield="site_num" datasourceid="sqldatasourcesite" onselectedindexchanged="top_site_numtextbox_selectedindexchanged" text='<%# bind("top_site_num") %>' /> <asp:autocompleteextender runat="server" behaviorid="autocompleteex" id="autocomplete1" targetcontrolid="top_site_numtextbox" servicepath="webservice.asmx&quo

My eclipse is not creating android activity and xml layout file -

i have updated sdk , adt rev 23. since eclipse stopped creating acivity , xml files. have tried still no success. please me resolve issue. i have same problem think new version has problems . have create new xml file , java class separately , refer class xml

cross domain - Reverse Proxy of SugarCRM PHP on IIS -

i know nothing php or sugarcrm yet i've had both thrown @ me , task of reverse proxying instance of sugarcrm running on iis. i have reverse proxy setup using arr , url rewrite on iis forwards requests sugarcrm instance. a call follows: sugarproxy/sugarcrm => proxy => sugarserver/sugarcrm i'm hoping home/login page returned permanent redirect sugarserver/sugarcrm/. i'm suspecting php not allowing request host/referrer doesn't match sugarserver. i'm not sure. how set php config allow sugarproxy valid host/referrer? or if isn't problem how else solve it. thanks i've solved this, in way. sugarcrm redirecting url trailing slash, missed. now i'm letting doe , using url rewrite/arr rewrite redirect sugarproxy/sugarcrm/ , letting proxy it's things. seems ok now.

javascript dialog box is not appearing on button click using js,ajax,php -

hi have dialog box should open on button click , display message 'it works' inside dialog box. dont know why after button click dialog box not appearing.thank you. here js code: function getaddwidget() { $.ajax({ type: "post", url: "ajax/dashboard.php", datatype : 'json', cache: false, data: {'aktion' : 'add-new-widget'}, success: function(data){ $('#addwidget').html(data.html); }, error: function(data){ alert('error'); //$('#news').html(data.html); } }); } $(function() { $( "#dialog" ).dialog({ autoopen: false, show: { effect: "blind", duration: 1000 }, hide: { effect: "explode", duration: 1000 } }); $('#addwidget .butt-rahmen').live('click', functi

cocos2d iphone - iAd reducing FPS? -

does iad banner reduces fps? indeed, since added iad fsp shit. 59 game , it's variable 35-50 fps. any ideas please because game not playable banner. thank help. you should implement iad logic in uinavigationcontroller subclass set in appdelegate . @ mine code like: appdelegate.m - (bool)application:(uiapplication *)application didfinishlaunchingwithoptions:(nsdictionary *)launchoptions { // create main window window_ = [[uiwindow alloc] initwithframe:[[uiscreen mainscreen] bounds]]; ccglview *glview = [ccglview viewwithframe:[window_ bounds] pixelformat:keaglcolorformatrgb565 depthformat:0 preservebackbuffer:no sharegroup:nil multisampling:no numberofsamples:0]; // enable multiple touches [glview setmultipletouchenabled:yes]; director_ =

Jquery reset form no erase fields -

i need erase or empty input fields of form use no works : <script> jquery(document).ready(function() { jquery("#contact_form").get(0).reset() }); </script> <form id="contact_form" name="form" method="post" action=""> <input name="c_name" type="text" title="insert personal name" value="personal name" /> </form> the script must erase content of input text , no show text personal name , case it´s no works , no reset form i dont know if exists error think must works thank´s , regards you cannot reset form input value defined using inline attribute, use .val() demo $("#contact_form input[name=c_name]").val(''); or add button, , reset form on click event of it. demo $("button").click(function(){ $("#contact_form")[0].reset(); }); note : reset() changes value of input inital value (in case rese

cordova - Are 2 footers possible in phonegap, Jquery mobile -

are 2 footers possible in phonegap, jquery mobile. second footer should top of first 1 @ bottom of page. use navbar instead of 2 footer 2 footer not possible. <div id="footer" data-role="footer" data-position="fixed" data-tap-toggle="false"> <div data-role="navbar"> <ul> <li><a href="#">one</a></li> <li><a href="#">two</a></li> <li><a href="#">three</a></li> </ul> </div><!-- /navbar --> <h1>footer</h1> </div> refer fiddle demo

How can I use "git add --patch" in PhpStorm -

i in process of migrating our old environment svn + eclipse git + phpstorm. read many tutorials git , found git add --patch command. possible use in phpstorm through gui? i tried manually using terminal window inside of phpstorm, when use vcs | commit changes window, add rest of lines staging area , commit hunks. afaik not available: http://youtrack.jetbrains.com/issue/idea-63201 please follow ticket (star/vote/comment) notified on progress.

wix - MSI : Upgrading 32-Bit application to 64-Bit -

our company uses wix installers, , upgrading our application 32-bit 64-bit. every new version, provide upgrade path previous ones. todo list : binaries should reside in "c:\program files" folder instead of "c:\program files (x86)". registry entries should reside in hkey_local_machine\software\%company% instead of hkey_local_machine\software\wow6432node\%company% log files, configuration files, , custom files/registry entries needs moved on new 64-bit locations. considered special aspect of upgrade, inquiring community regarding know-how. presumably you'll continue have 32bit msi 32bit customers. i'd approach msi , reuse many fragments possible. directory table , componentids different , i'd give different upgradecode guid. in majorupgrade i'd search products having 32bit upgradecode , 62bit upgradecode , remove both when found. i'd make sure need this. example if deploy .net app no native dependencies ( iis, winform

sql - Reason for using trunc function on dates in Oracle -

i working in project on oracle database. have observed in application code dates never used directly. instead, used in conjunction trunc function (trunc(sysdate), trunc(event_date), etc.) can explain reason behind using trunc function instead of using date directly? a date in oracle has not date part, time part. can lead surprising results when querying data, e.g. query with v_data(pk, dt) ( select 1, to_date('2014-06-25 09:00:00', 'yyyy-mm-dd hh24:mi:ss') dual union select 2, to_date('2014-06-26 09:00:00', 'yyyy-mm-dd hh24:mi:ss') dual union select 3, to_date('2014-06-27 09:00:00', 'yyyy-mm-dd hh24:mi:ss') dual) select * v_data dt = date '2014-06-25' will return no rows, since you're comparing 2014-06-25 @ midnight. the usual workaround use trunc() rid of time part: with v_data(pk, dt) ( select 1, to_date('2014-06-25 09:00:00', 'yyyy-mm-dd hh24:mi:ss') dual union select 2

php - Sql string query not working -

i'm building sql queries in yii framework. so far working fine until need compare variable string. here function query: public function countcanceled() { $week = person_event::model()->weekbydate(); $week_id = $week->id; $datalogin = mysqli_connect( /*connect working fine*/); $sql = "select id tbl_event week_id=$week_id , status_id='canceled'"; $query = mysqli_query($datalogin, $sql); $numrows = mysqli_num_rows($query); return $numrows; } now , have 1 event canceled status, , ran same query in mysql server , result of 1 given, why in yii doesn't work? (tried switch "=" "like" , made no difference) p.s yes , in particular case use built in yii's queries , have other, more complicated queries need compare string. thanks, mark. what type of status_id if char data space padded full length. can change varchar , compare. , can use 'canceled%' ps. sorry not

Embed an external Android application into a view/layout -

Image
is possible embed external android application's main activity 1 of own application's views or layouts ? i know how launch app via explicit intent, takes whole screen. want able place launched application app's layout along other widgets: is possible embed external android application's main activity 1 of own application's views or layouts ? not @ time.

angularjs - Froogaloop Vimeo 'finish' event in a Angular directive -

i have problem triggering vimeo "finish" event in angular directive. vimeo video loading , play , pause functions working correctly. my html code <vimeo control-boolean="isplaying" vid="{{videoslist[id].code}}" pid="1"></vimeo> <button ng-click="prevvid()">prev</button> <button ng-if="isplaying" ng-click="status()">pause</button> <button ng-if="!isplaying" ng-click="status()">play</button> <button ng-click="nextvid()">next</button> <div class="videoinfo"> <h2>{{videoslist[id].title}}</h2> <p>{{videoslist[id].discription}}</p> </div> my angularjs directive directive('vimeo', function($sce) { return { restrict: 'ea', replace: true, scope: { //assumes true means video playing controlboolean: '=' }, t

sql - Incorrect Summing Value -

i'm trying join table onto mapping table. mapping table has geographical data in , idea @ detail first i.e. postalcode , mapp, if postal code has not been provided @ zone: id region country description zone county city postal_code 9324 australasia australia tasmania 70 western shore 7000 9325 australasia australia tasmania 70 western shore 7004 9326 australasia australia tasmania 70 western shore 7005 9327 australasia australia tasmania 70 western shore 7007 9328 australasia australia tasmania 70 western shore 7008 9329 australasia australia tasmania 70 western shore 7009 9330 australasia australia tasmania 70 western shore 7010 9331 australasia australia tasmania 70 western shore 7011 9332 australasia australia tasmania 70 western shore 7012 9333 australasia australia tasmania 70 eastern shore 7015 9334