Posts

Showing posts from June, 2010

udp - Java: Display Clients IP and port numbers -

hello i've written small udp server program. know code display hosts ip easy following code: system.out.println("listening port: " + serversocket.getlocalport()); system.out.println("ip: " + myip.gethostaddress()); is there way of displaying ip , port number of client connected server? when receive udp datagrampacket can retrieve distant ip packet originated datagrampacket.getaddress() edit if wish string representation of ip address, use datagrampacket.getaddress().tostring() . example: datagrampacket p = new datagrampacket(buffer, buffer.length); ds.receive(p); // receive data here... system.out.println("received data packet :"+p.getaddress().tostring());

Eclipse CDT does not find either Cygwin or MinGW toolchain -

Image
i having hard times configure eclipse juno c/c++. windows user, have installed cygwin , mingw , , cdt under eclipse. configured path variable correctly, though still not have new toolchain in eclipse c/c++ new project. these eclipse details: eclipse java ee ide web developers. version: juno release build id: 20120614-1722 also, see image of installed component of eclipse. enclosed outout windows command line: c:\>echo %path% c:\program files\common files\microsoft shared\windows live;c:\program files (x8 6)\common files\microsoft shared\windows live;c:\windows\system32;c:\windows;c:\ windows\system32\wbem;c:\windows\system32\windowspowershell\v1.0\;c:\program fil es (x86)\ati technologies\ati.ace\core-static;c:\program files\miktex 2.9\miktex \bin\x64\;c:\program files\matlab\r2011b\runtime\win64;c:\program files\matlab\r 2011b\bin;c:\program files (x86)\windows live\shared;c:\program files\java\jdk\b in;c:\program files (x86)\java\jre\bin;c:\program files (x86)\android\and...

php - Prevent request timing out - large POST data -

in ios app, post new question, make http post request http://api.mysite.com/questions . post data larger or smaller depending on whether image attached question or not. small (sized around 100-200kb) images posted server without problem. however, larger photos (~1mb), device's camera cause request time out due large size of image. please can tell me how can make sure image uploaded without problem, doesn't seem happen many other apps. is problem server or ios code itself? edit---- on server, once request has been received, php writes image data file. blob image data: $filepath = $this->debug == true ? "../cityw/img/questions/{$qid}/attachment.png" :"../i/questions/$qid/attachment.png"; if (!file_exists($this->debug == true ? "../cityw/img/questions/{$qid}" : "../i/questions/{$qid}")) { mkdir($this->debug == true ? "../cityw/img/questions/{$qid}" : "../i/questions/{$qid}"); } $fh = fopen($filepath, 'w...

.net - WCF Security across multiple services -

Image
we moving our old .net 1.1 remoted system .net 4.0 wcf architecture. part of system desktop client app using call 300+ functions sit on our middle tier. we consolidating these remotable functions 9 services need way verify user has first performed "login" function before other subsequent wcf calls. since login happens on 1 of these services, not sure if there way "federate" across services. (all hosted on same machine, same domain.) exposing services on net.tcp goal of allowing wshttp binding external clients in long run. (not sure if different binding might help) what i've come host singleton holds authentication info. when user login verified , submitted "security store" return guid client send subsequent wcf calls. and each wcf call validate against singleton "security store". so question is... can use native wcf accomplish same goal? this table secect binding about security, wcf has several types auth, securitymode ask particu...

mirroring - Creating an official github mirror -

how create github mirror external git repository, such appears "real mirror", e.g., in https://github.com/mirrors ? so far, set mirror using: cd /path/to/bare/repository git remote add --mirror github git@github.com:user/repo.git and configure post receive hook git push --quiet github . way, however, github not recognize mirror. any ideas how github way, such "mirrorred from" appears underneath repostiory name? based on communicating github's support team, found github offers no direct mechanism user mirror repositories in fashion. however, 1 can ask github install service repositories part of organization. github configures existing repository such mirror , pulls in interval function of number of overall mirrors have. edit : stuart points out, github no longer accepts requests mirroring arbitrary repositories. remaining option solution posted in question, i.e., creating post-receive hook automatically push github repository.

c# - Need a better design for a "callback dispatcher" component -

from client application sending request/transaction (containing operation perform (and parameters) + transactionid) remote queue. remote server dequeue request @ point , takes time process it. once done processing it, sends reponse on client queue (containing applicative response + transactionid) ... totally "disconnected" communication mode, way client can map response request via transactionid. message response dequeued on client side, , matched original request (based on transactionid). what doing right when client post request server queue, adds callback dictionnary keeping transactionid , callback (delegate). dictionary<int, object> mapping transactionid callback call result of operation. the callbacks/delegates stored object due fact depending of request, callback delegate signature different (for example response may return list<string> whereas response may return int ). when client queue dequeues response, knows type of response (and therefore corr...

position - CSS Positioning -

i´v problem on site psr how can make footer under content div automaticaly the content , footer relative positioned. another question: how can make footer same size header_bg ? – pushing footer down same content help. top:541px; i assume empty p tags push footer down, try deleting , implementing css.

c# - ScatterView item orientation and PrimarySurfaceDevice.Tilt -

i'm working in visual c# 2010 express wpf develop application microsoft surface table, , cannot life of me find simple solution problem. when using scatterview control without setting custom template scatterview items, control throws new scatterviewitems onto screen @ random orientations , positions. this, like. i developing program on vertical screen, on scatterviewitems randomly thrown, except upright, , never thrown on updide-down. getting @ control knows screen vertical , keeps items starting out upside down. however, when transfer program device horizontal screen, items thrown out randomly , upside down original app orientation. again the scatterview control reading interactivesurface.primarysurfacedevice.tilt (or it) , compensating. how make stop doing this? i want items continue appear in scatterview if screen vertical. can trick scatterview thinking it's vertical still? can turn feature off? avoid making own template scatterviewitems. thanks! set orientation...

Google Plus Equivalent to Facebook Like Box -

i have been testing out facebook box , wondering if there google plus feature it. mutch appreciated. you looking google+ page badge. documentation google please visit: google+ badge

xml - Well-known namespace prefixes -

dr macro says : in practice rare namespace prefixes clash because namespaces known , defined conventional prefix unique among set of namespaces combined (again, more general case of willy-nilly combination of unexpected stuff doesn't happen). nevertheless, i'd pick namespace prefix isn't in common use. guess google intended prefix(es), know of list of conventional prefixes, ideally measure of how common/obscure are? the important thing namespaces prefix arbitrary , can changed. isn't prefix standardized, namespace url, , won't conflict because use domain registration system prevent conflicts.

c++ - (Qt) How to implement editorOpened(index) and editorClosed(index) signals in a view -

i've coded myself corner sort of data abstraction scheme , it's resulted in needing editoropened(qmodelindex) , editorclosed(qmodelindex) signals in views (qtableview exclusively). the reason being data classes have automatic behavior needs block/disabled during editing, re-enabled afterwards. at first thought try custom delegates ran problems couple reasons: 1 being seems bit excessive use custom delegate providing same behavior every single item, in other words seems ought done items view itself. second problem being delegates seem const prevents me setting internal handle data object within delegate. looking @ view methods, found qabstractitemview::edit , qabstractitemview::closeeditor perfect candidates re-implementing opened() , closed() signals, need index/handle specific item being edited, don't think can obtain within methods... at point have no idea else do. i'd appreciate tips or pointers in right direction! reading i solved on own... i found qabstr...

algorithm - What is the fastest implementation of ColdFusion's listFindNoCase function in Javascript? -

i've grown spoiled coldfusion's lists, , have run across situation or 2 comma delimited list shows in javascript. there equivalent of listfindnocase('string','list') , or performant way implement in javascript? oh, , should able handle list items commas, like: ( "smith, john" , "doe, jane" , "etc..." ) that's tripping me up. you can use indexof combined .tolowercase() var list = '"smith, john" , "doe, jane" , "etc..."'; if(list.tolowercase().indexof('"smith, john"')) if need exact match, "smith" when "smithson" exists, pad strings delimiter. example, let's delimiter semi-colon (because have commas in string), pad left , right sides of string so: ";smith, john;doe, jane;" also pad search value, if you're looking smith, value become: ";smith;" .tolowercase().indexof() return -1 (not found). ";smith, john;...

php - Retrieving and formatting all hasMany records in column of a MySQL result -

i'm not sure if possible straight mysql query (without manipulating data after), have been pondering on something... say have 1 table, authors, , books. authors can have many books, , indicated author_id column in books table. is there way perform query that: 1) retrieves single author record, column name 'books' holds array of book records, belonging author. 2) same result, authors in database. any input on whether possible or not, , methods appreciated! update here's example of desired output of first query: stdclass object ( [id] => 1 [name] => test author [age] => 28 [books] => array ( [0] => stdclass object ( [title] => book 1 [id] => 1 ) [1] => stdclass object ( [title] => book 2 [id] => 2 ) ) ) 1) yes, group_concat() can (although don't best way d o it). 2) yes, group by author

Ruby on Rails Controller action is a private method -

i getting private method `new' called reminder:class the application trace app/controllers/reminders_controller.rb:27:in `new' the new action follows def new @reminder = @current_user.reminders.build() @title = "new reminder" respond_to |format| format.html # new.html.erb format.json { render json: @reminder } end end the reminder model has follows class reminder < activerecord::base belongs_to :user belongs_to :assignment attr_accessible :datetime, :sent_at, :status, :send_time statuses = ["not sent", "sending", "sent", "canceled"] validates_presence_of :sent_at, :status, :user_id, :assignment_id before_save :round_tine def round_time self.send_time = time.at(t.to_i/(15*60)*(15*60)) end end i don't know how method private. in advance! update: added method model. error still occurs. put mailer class name remindermailer not reminder. that's problem rails not able distinguish between 2 classes , identify...

Auto incremental variable name eclipse -

is there way in eclipse auto-increment each variable name? for example int mint; int mint2; int mint3; int mint4; and etc. chances if need many similarly-named variables, you'd better off different data structure, array.

python - A simple webkit window limited to one URL -

i want create python script run gtk window webkit session limited 1 url. i.e. fluid or old mozilla prism. also, need support cookies , https. something this answer perfect need block access others url different original. i'm asking python example, examples in other languages useful or examples other toolkits different gtk. pd: don't know if title or not question, feel free of enhance :) connect webview 's navigation-policy-decision-requested signal , call policy_decision.ignore() if url not 1 wish allow.

uitabbarcontroller - iOS - Portrait Locked Tab Controller App Won't Allow Landscaped Movie Player -

i have app purely tab bar controller 5 tabs (views). want views portrait only. however, app allow video clips played , uses mpmovieplayerviewcontroller so. can't player rotate landscape! i have tried following (along lot of other things): subclassing mpmovieplayerviewcontroller , overriding shouldautorotatetointerfaceorientation method class. allowing app have landscape orientation, attempt lock tab views portrait (doesn't lock them, allows them go landscape don't want). i have scoured stackoverflow , google days now! familiar issue , how movie player rotate??? try implementing uiviewcontroller containment . designate viewcontroller of tab showing movie in parent (or container) viewcontroller. you want override shouldautorotatetointerfaceorientation in subclass allow landscape, sounds have done. in parent view controller , tabbarcontroller want make sure forwarding autorotate methods subclass. can check putting nslog in subclasses implementation of shouldautorotate...

c++ - Getting data from two different arrays for the same index -

i created array this: string mobs [5] = {"skeleton", "dragon", "imp", "demon", "vampire"}; int mobhp[5] = {10, 11, 12, 13, 14, 15}; i created random number generator getting mob number want, failed. supposing, generated number 4, how equate or equalize string mob number 5, , mob hp number 5? if have function returns random number between 0 , 4 (array indexes) code like: // since using raw arrays need store length int array_length = 5 // function returns random number between int randomindex = myrandomnumberfunction(array_length) // select array using index calculated before std::string selectedmobname = mobs[randomindex] int selectmobhp = mobhp[randomindex] however better way achieve using modern c++ practices create monster class , use in vector so: #include <vector> #include <string> #include <iostream> // use class accessors here sake // of brevity , simplicity we'll use struct struct monster { monster...

actionscript 3 - I cant remove child of this movie clip upon clicking the back button to go function goHomePage (evt:Event):void{ -

help. need remove newcontainer(this movie clip) after clicking button go homepage. loads homepage , newcontainer still there. :( did go wrong? import flash.events.mouseevent; import flash.events.event; import fl.motion.motionevent; import flash.net.urlvariables; import flash.display.movieclip; import flashx.textlayout.elements.configuration; var ctr:int = 0; var now:date = new date(); var myurl:string = "http://localhost:8888/eventspictures/getdata.php"; var scriptloader:urlloader = new urlloader(); var scriptrequest:urlrequest = new urlrequest(); var newcontainer:movieclip; scriptrequest.url = myurl + "?ck=" + now.gettime(); scriptloader.addeventlistener(event.complete, handleloadsuccess); scriptloader.addeventlistener(ioerrorevent.io_error, handleerror); scriptrequest.method = urlrequestmethod.post; scriptloader.load(scriptrequest); function handleloadsuccess(evt:event):void { (var j:number = 0; j <4; j++) { var newcontainer:movieclip = new con(); newcontaine...

c# - Most efficient way for reading IMDB movies list -

i reading imdb movies listing text file on harddrive (originally available imdb site @ ftp://ftp.fu-berlin.de/pub/misc/movies/database/movies.list.gz ). it takes around 5 minutes on machine (basic info: win7 x64bit, 16gb ram, 500 gb sata hardisk 7200 rpm) read file line line using code below. i have 2 questions: is there way can optimize code improve read time? data access don't need sequential won't mind reading data top bottom / bottom top or order matter long read 1 line @ time. wondering there way read in multiple directions improve read time? the application windows console application. update: many responses correctly pointed out writing console takes substantial time. considering displaying of data on windows console desirable not mandatory. //code block string file = @"d:\movies.list"; filestream fs = new filestream(file, filemode.open, fileaccess.read, fileshare.none, 8, fileoptions.none); using (streamreader sr = new streamreader(fs)) { while (sr....

php - Defining multiple streams and adding fields to each of them in PyroCMS -

i new pyrocms , willing build job site wherein there'll 2 main users namely, employers , job seekers. in order allow them register on site, i'm using streams api pyrocms build forms. these users part of 2 different modules namely employer module , job seeker module. in details.php file, under install() function, want create multiple streams(database tables). following code helps add stream: $this->streams->streams->add_stream(); the following code helps define fields added stream: $this->streams->fields->add_fields($fields); my concern how add multiple streams above ones , add fields each of them? in other words, how syntax $this->streams->fields->add_fields($fields); know stream add fields to? have @ fields driver documentation streams api. fields , streams separate entities, no required association between two. when adding field can assign stream this: $field = array( 'name' => 'question', 'slug' => ...

android - How to show the button in dropdown event? -

hai have button , dropdown.when change dropdown hide button working fine.event after want show button.how this. once hide cannot view button.i need hide dropdown change function other time want show button. code <html> <head> <script src="http://code.jquery.com/jquery-latest.js"></script> <script src="http://code.jquery.com/jquery-1.7.2.js"></script> </head> <script type="text/javascript"> $(document).ready(function() { $("select").change(function(){ $("#myheader").hide(); }); }); </script> <body> <select id="header"> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> </select> <input type="button" id="myheader" style="width:20%;background-color:blue" /> </body> </html> try this: $("select...

jquery or javascript to sort attributes of a html object before regex -

as follow on previous question using jquery find .each on .attr() regex , i sort attributes alphabetically before running them through .each(). final output add child divs in order of attributes. <div id="myelement" extra1="a" stuff="z" extra9="c" more="y" extra5="b" /div> when parse through code below, outputs values b,c,a , need sort elements first order extra1, extra5, extra9, more, stuff run through .each()+regex values come out a,b,c var el = $('#myelement'); var attributes = el[0].attributes; $.each(attributes,function(i,attr){ var name = attr.nodename; var val = attr.nodevalue; var regex = /^extra\d$/; if(name.match(regex)) { $(parentdiv).append("<div id="+val+" /div>"); } });​ thx in advance art per this mdn doc , attributes collection map, not array not have defined order. if wanted sorted, first have put in array, sort , .each() on sorted array. or, collect resu...

xquery - Using Nested Loop -

code nested loop: xquery version "1.0"; let $message := (1, 2) $s in $message let $message1 := count($message) $i in ((1 $message1)) return <results> <count>{$i}</count> </results> by using nested loop, i'm getting sequence double. how result single time using nested loop. i don't see why you're using loop in first place. if want message count: xquery version "1.0"; let $message := (1, 2) let $i := count( $message ) return <results> <count>{$i}</count> </results>

javascript - Get word under mouse pointer -

according ( get word under cursor using javascript )link can word under mouse pointer.it's fine english language. change (for arabic language) <p>سÙ„اÙ… بÙ‡ همه</p> word: <span id="word"></span> <script type="text/javascript"> $(function() { // wrap words in spans $('p').each(function() { var $this = $(this); $this.html($this.text().replace(/[^\x00-\x80]+/g, "<span>$1</span>")); }); // bind each span $('p span').hover( function() { $('#word').text($(this).css('background-color','#ffff66').text()); }, function() { $('#word').text(''); $(this).css('background-color',''); } ); }); but return '$1' each word. please help! you need parentheses appear in original regular expression. in regular expression notation, parentheses form "match group" substituted in " $1 " in replace string. $this.html($this.t...

css - How to set a background image in full size of a div that doesn't fill page -

Image
i need put image in background of div @ center position of it, like: what i've tried is: <div id="container"> ... </div <div id="background"> <img src="images/bg.png"/> </div> with css: div#container { margin: 0 auto; width: 52em; } div#bg img { z-index: -999; width: 100%; height: 100%; position: absolute; top: 22%; } in browser, screen size, put 22% , ok, if try on screen different size background img isn't in center of div. can do? can someonehelp me? give position:relative; in container div..it should work.. , background div(with position:absolute; ) should child of container div..then u'll div overlapping property

ruby - selenium-webdriver and wait for page to load -

i'm trying write simple test. problem is, want wait until page loaded completly. @ moment i'm waiting until elements presen, not want. possible make this: driver = selenium::webdriver.for :chrome driver.navigate.to url driver.wait_for_page_to_load "30000" with java isn't problem, how make ruby? this how selenium docs () suggest: require 'rubygems' require 'selenium-webdriver' driver = selenium::webdriver.for :firefox driver.get "http://google.com" element = driver.find_element :name => "q" element.send_keys "cheese!" element.submit puts "page title #{driver.title}" wait = selenium::webdriver::wait.new(:timeout => 10) wait.until { driver.title.downcase.start_with? "cheese!" } puts "page title #{driver.title}" driver.quit if not option can try suggestion this post though require javascript on top of ruby/rails. it seems wait.until being/has been phased out. new suggested p...

extjs - Setting Checbox values in checkboxselectionmodel -

i want grid checkbox in rows 1 in link http://gwt-ext.com/demo/#checkboxselectiongrid after saving selected records, want set checbox selected earlier. how can done? grid.getselectionmodel().select() should work http://docs.sencha.com/ext-js/4-0/#!/api/ext.selection.checkboxmodel-method-select just pass array of record or indexes want select. seems problem?

c# - MonoMac Console Application Returns Only First Character of nvarchar(max) -

i have console application run on mac os x through mono. although executes correctly on windows os, returns first character of nvarchar(max) variable. here c# code: sqlconnection myconnection = new sqlconnection(variables.connectionstring()); sqlcommand mycommand = new sqlcommand("indexpagedetailsget", myconnection); mycommand.commandtype = commandtype.storedprocedure; sqlparameter parameterindexpageid = new sqlparameter("@indexpageid", sqldbtype.int); parameterindexpageid.value = indexpageid; mycommand.parameters.add(parameterindexpageid); sqlparameter parameterindexpagetext = new sqlparameter("@indexpagetext", sqldbtype.nvarchar, -1); parameterindexpagetext.direction = parameterdirection.output; mycommand.parameters.add(parameterindexpagetext); myconnection.open(); mycommand.executenonquery(); myconnection.close(); return (string)parameterindexpagetext.value; // returns first character and here stored procedure: alter procedure [dbo].[indexpagedetail...

ios - If I use Storyboards will I still have to create xibs for backwards compatibility? -

this general ios 5+/4 question: if make app using storyboards, won't work on pre ios 5 devices (iphone/ipod touch). apple requires app targeted ios 5+ must still compatible ios 4. so basically, i'm better off starting out non-storyboard app (ie xib)? put way, if i'll end having create xibs anyways, why use storyboards begin with? while storyboards pretty , can organize layout, still seems more work in end. or missing something? yes correct, cannot use storyboard on pre ios 5. if thinking of supporting ios 4.3 better work xibs begining

visual studio 2010 - geting the best of the best -

im new c# programing , doing console application friend creating 3 question test. need name of top 5 users , display grade, don't know do. please me thanks. codes: string name, yn; int points = 0; do{ console.writeline("please enter fullname here:"); name = console.readline(); console.writeline(" "); console.writeline("hello " + name + " welcome simple test."); console.writeline(" "); console.writeline("1) 5 + 6?"); console.writeline(" a)10"); console.writeline(" b)30"); console.writeline(" c)11"); console.write("answer: "); string qans1 = "c"; string myans1 = console.readline().toupper(); console.clear(); if (myans1 == qans1) { point++; } console.writeline("2) first letter of apple?"); console.writeline(" a)a"); console.writeline(" b)c"); console.writeline(" c)a"); console.write("answer: "); string qans2 = "a"; ...

Messaging system MYSQL, issue with getting latest reply -

i have table with message_id, to_id, from_id, message i made threaded messaging system. have 5 people talking 1 member. as member see member 1 says hi, member 2 says hello ( want latest reply hello ) member 1 says hi, member 3 says hi, member 1 says welcome ( want welcome ) member 2 says hi (i want hi ) now, i'm provided 1 of id's sessionid of member1. how go showing scenario 2 (member1) have left latest reply. i can select * messages to_id=$session_id order message_id desc limit 1 but show incoming messages. need show last of incoming , outgoing messages. what query suggest? :\ maybe alteration table if there's no efficient way? first time i've ever setup messaging system, advice welcome. select * messages to_id = $session_id or from_id = $session_id order message_id desc limit 1

c# - storing cache of pages at different location instead of default -

i want implement concept of caching on asp.net web application. not mvc application. have learned how caching of pages (aspx) <%@ outputcache duration="10" varybyparam="none" location="serverandclient" %> it catching page. want store cache in folder @ different location instead of default. dont know hoe that. , other page folder different. there way this? thanks in advance by default, when use [outputcache] attribute, content cached in 3 locations: web server, proxy servers, , web browser. can control content cached modifying location property of [outputcache] attribute. you can set location property 1 of following values: · any · client · downstream · server · none · serverandclient

What is windows system path?-About Devcpp Opencv -

i've looked through older questions , using google, can't find asnwe problem. i have been trying devcpp work opencv2.1. configured cmake , generated files. compiled mingw32-make command through windows 7 cmd. whichever way tried link stuff devcpp, it's never worked. keeps giving me cv::freecast(void) error. i have seen people talking setting things system path. system path ? thanks in advance. you have tell windows opencv libraries when asked. there 2 options: not tell windows .dll , put them in same folder project tell windows .dll adding them system path here in "compile using visual studio" point 3 can see how it.

vb.net - Visual Basic System Information -

i want make button , display system information windows.how can it?how can call info?thank much. is possible make this? http://s18.postimage.org/7zn5adst3/memory.jpg private sub button1_click(byval sender system.object, byval e system.eventargs) handles button1.click shell("msinfo32.exe", appwinstyle.normalfocus) end sub

asp.net - LinqDataSource Exception -

ho catch sqlexecption linq data source: <asp:linqdatasource id="linq_tipo" runat="server" contexttypename="linq_clinica_veterinaria" entitytypename="" tablename="tb_tipo_animals"> </asp:linqdatasource> what event, can that, before application_error() raised? catch exception this: protected void linq_tipo_updating(object sender, linqdatasourceupdateeventargs e) { if (e.sqlexception != null) { //handle exception e.exceptionhandled = true;//set true have handled exception } } similarly, can handle inserted, deleted, selecting , other events.

c# - Castle ComponentRegistration error following upgrade to v3.0.0 -

i have inherited code base makes use of castle windsor ioc container, have been forced upgrade version v2.5.2 3.0.0 due compatibility issue. following upgrade v3.0.0, following extension method in 1 of our test classes fails build following error: the type 'tinterface' must reference type in order use parameter 'tservice' in generic type or method 'castle.microkernel.registration.componentregistration' public static class containerextensions { /// <summary> /// sets registration expectation on mocked container. /// </summary> /// <typeparam name="tinterface">the type of interface.</typeparam> /// <typeparam name="timplementation">the type of implementation.</typeparam> /// <param name="container">the container.</param> public static void setregistrationexpectation<tinterface, timplementation>(this iwindsorcontainer container) timplementation : tinterface { predicate<ienume...

How to open Only mail clients in Android -

i refereed answer android open emailclient programatically programmatically in stackoverflow open mail client, if try in phone, not showing gmail or other email client, instead showing skype, bluetooth options. kindly me how remove these options. if have specific email address trying let user send message to, use action_sendto intent mailto:xxxx@yyy.com uri (where replace xxxx@yyy.com actual email address). otherwise, want not idea. users may wish share data via number of mechanisms, of not email clients. please let users choose how share data .

javascript - Make form validation return true? -

here validation code: function validateenquiryform() { var x = document.forms["enquiry"]["name"].value; if(x == null || x == "" || x == "name") { $('#name').removeclass('custom').addclass('error'); $('.name-error').show(); //return false; } else if(x !== null || x !== "" || x !== "name") { $('#name').removeclass('error').addclass('custom'); $('.name-error').hide(); } var x = document.forms["enquiry"]["phone"].value; if(x == null || x == "" || x == "phone number") { $('#phone').removeclass('custom').addclass('error'); $('.phone-error').show(); //return false; } else if(x !== null || x !== "" || x !== "phone number") { $('#phone').removeclass('error').addclass('custom'); $('.phone-error').hide(); } var x = document.forms["enquiry"]...