Posts

Showing posts from August, 2014

php - How can I set "allowDiskUse" option in aggregation method -

php - How can I set "allowDiskUse" option in aggregation method - how can set allowdiskuse alternative in aggregation method in php? have tried next without success: $out = $dbnew->$a->aggregate( array('$match' => $filter_array), array('$sort' => $sorting), array('$skip' => $start), array('$allowdiskuse' => true)); you providing options in wrong place. need utilize this: public array mongocollection::aggregate ( array $pipeline [, array $options ] ) and providing pipeline list of arrays, doing: public array mongocollection::aggregate ( array $op [, array $op [, array $... ]] ) take in mind need @ to the lowest degree 1.5.0 version of php driver. so define pipeline , options: $pipeline = array( array('$match' => $filter_array), array('$sort' => $sorting), ... ); $options = array("allowdiskuse" => true); and utilize it: $out = $d

php - How to delete memcached key set by another web server -

php - How to delete memcached key set by another web server - consider 2 memcached servers, mc1 , mc2 , 2 web servers, web1 , web2 , using php memcached library. $mc = new memcached(); $mc->addserver(mc1); $mc->addserver(mc2); from web1 next code executes: $mc->set('abc', 'val'); // key set mc1 later on, web2 : $mc->delete('abc'); from understand on how memcached library works, web2 wouldn't know web1 has set key. how can 1 accomplish this? right i'm iterating through servers , issue delete on each. i'm thinking there might improve way this. with multiply servers architecture memcached access (set/get/delete) keys on servers based on hash of key. so, yes - web2 not know deleting on web1. not problem in situation. memcache delete key right server placed before. please read question: using multiple memcache servers in pool php memcached

javascript - Animation of swing div is being affected by other divs -

javascript - Animation of swing div is being affected by other divs - i'm using trying implement swinging effect on hover , working when add together different effects other elements, effect getting affected! <!-- code brakes swing--> <div id="abc"> <a href="#" title="social cause" onmouseout="mm_swapimgrestore()" onmouseover="mm_swapimage('litter','','images/abc2.png',1)"><img src="images/abc1.jpg" width="203" height="311" id="litter"></a> </div> css: #litter { position: absolute; left: 483px; top: 0px; width: 203px; height: 380px; z-index: 1; } js function mm_swapimgrestore() { //v3.0 var i, x, = document.mm_sr; (i = 0; && < a.length && (x = a[i]) && x.osrc; i++) x.src = x.osrc; } function mm_swapimage() { //v3.0 var i, j = 0, x, = mm_swapimag

asp.net mvc 4 - How to Show QR Code in RDLC report -

asp.net mvc 4 - How to Show QR Code in RDLC report - i used qrencoder (nuget- bundle qrcode.net) generating qr code in mvc 4. question how can show qrcode in rdlc study dynamically. searched through many websites didn't got feasible solution. one way to: create handler in .net dynamically generate qr code based on querystring parameters , homecoming png. setup rdlc have image externally referenced. when generating study need set allow external references pass url handler/image in dataset beingness sent study , have path image in report. when study generated generate , show qr code. asp.net-mvc-4 rdlc qr-code

hadoop2 - Hadoop changing IP adresses -

hadoop2 - Hadoop changing IP adresses - i have installed hadoop 2.2.0 (mini-cluster) in ubuntu 14.04. there 3 nodes, 1 master , 2 slaves. during installation had type ip adresses of nodes /etc/hosts. nodes ip adresses dynamically, have edit /etc/hosts files on nodes in every machine start. do have thought eliminate editing hosts files? thanks! regards, norbi i recomend dhcp static (or manual) ip configuration nodes. because many other apache related solutions may problem in future (i.e. if install apache zookeper). also, can create troubles if nodes alter ip while hadoop running. if still persist on that, recommend writting script runs networks looking hostnames , ips (nmap). after that, updating /etc/hosts. solution quite instable, since can create troubles if changes while hadoop cluster , running. reference: http://hadoop-common.472056.n3.nabble.com/hadoop-conf-for-dynamically-changing-ips-td676599.html hadoop hadoop2

android - Desfire EV1 Card using NXP SDK -

android - Desfire EV1 Card using NXP SDK - my agency got first prototype desfire card anticipated go production (50k employee agency). i'm trying connect to, authenticate , read particular file. when nowadays android device, ondesfirecarddetected fired. connect tag (desfire object), authenticate passing agency's master , app key , providing appid. next step seek read particular file within application. don't see method accepts fileid??? see command 'read(int inoofbytes)', javadoc states, "inoofbytes - number of bytes read", where???. however, when run application , set in arbitrary value parameter (e.g. say, 1), exception thrown stating, "file not found". basically, how read particular fileid within application desfire card using sdk??? so after consulting nxp lastly couple of days, turns out limitation lite version. told ability available in advanced version of post, not available. android nfc rfid

ios - Building combinations using recursion rather than using iteration -

ios - Building combinations using recursion rather than using iteration - i trying customise combination method found in solution given here: combinations of different nsarray objects utilises recursion, instead of solution given, using iteration. reason why trying customise function increment performance of function starts slowing downwards when arrays start getting larger , there many combinations compute. any advice on how done? i think you'd have combine iteration , recursion. if want varying number of arrays came this... first pass @ iterative method. - (nsarray *)combinearrays:(nsarray *)arrays { // arrays array of arrays of elements want combine. nsmutablearray *combinations = [nsmutablearray array]; for(nsarray *array in arrays) { nsmutablearray *temp = [nsmutablearray array]; (id element in array) { if (combinations.count == 0) { // first level of array elements first array [tem

javascript - Event for select-dropdown menu closing -

javascript - Event for select-dropdown menu closing - is there javascript event for closing of expanded dropdown (select-element)? the blur event does fire when element loses focus, seems independently of dropdown. change event fire when client selects options instead of clicking somewhere else. try "change" event. fired when select value list. javascript events

javascript - Sibling directive/controller related lists (and master/detail) in Angular -

javascript - Sibling directive/controller related lists (and master/detail) in Angular - i have approximately 4 main pairs of related directives, simultaneously displayed in angularjs ui. speaking, each pair includes parent list directive on top associated detail editor directive beneath it, shown in diagram: each right-hand list has many-to-one relationship active left-hand selection, , related info must displayed. how should drive related list (the left-to-right association) refreshes? currently, each master-detail directive-pair, or "stack", share service. service holds itemstate.active (active detail record) , itemstate.headers (query master results list). activity in either master or detail panel phone call service, straight impact service state. then, master/detail association operated via simple declarative angular watches on mutual positionservice.state ; no controller code required. expect using service single point of truth here create easy me

apache - .htaccess rewrite issue with no slash -

apache - .htaccess rewrite issue with no slash - i've searched awhile , can't find solution issue, maybe i'm not searching right thing, anyways, here's what's happening. i have next mod_rewrites in .htaccess file. rewrites work perfectly, if not have trailing slash, show's variable automatically in url. please see illustration below clear understanding. url sample if come in http://website.com/test/ , (notice trailing slash) page url remain exact same , load content perfectly! but, if forget trailing slash, ie: http://website.com/test , page url alter http://website.com/test/?var1=test . (now notice had left out trailing slash begin with) content still loads , works fine, url "ugly" now. i hope made clear, if have questions, please sense free ask. give thanks you! .htaccess code options +followsymlinks rewriteengine on rewritecond %{https} off rewriterule (.*) https://%{http_host}%{request_uri} [r,l] rewri

c++ - Inserting values from Vector to Map -

c++ - Inserting values from Vector to Map - i got issues trying set values of vector in new map (mamap) if explain me contain itemiterator or how do... map<std::string,employee*> entreprise::convertivectormap() const { map<std::string,employee*> mamap; vector<employee*>::const_iterator itemiterator; for(itemiterator = vector_employe.begin(); itemiterator != vector_employe.end(); itemiterator++) { mamap.insert(std::pair<string,employee*>(itemiterator->getnom(),itemiterator)); } } your map of <std::string, employee*> , trying add together iterator sec element of pair . need dereference iterator employee pointer. mamap.insert(std::pair<string,employee*>((*itemiterator)->getnom(), *itemiterator)); or save dereferencing same iterator twice, utilize range based for loop. @captainobvlious mentions, can utilize std::make_pair add together map . for(auto const employee: vector_employe) {

c# - Error in reading JSON file -

c# - Error in reading JSON file - i need parse/read json file. class="snippet-code-html lang-html prettyprint-override"> [{"children":[],"id":"dam/photo/volvo/v70/2001/oem/2001_volvo_v70_wagon_xc_i_oem_1","site":"dam","authornames":["volvo cars of north america, inc."],"captiontranscript":"2001 volvo v70 xc awd 4dr wagon ","type":"photos","subtype":"interior","shottypeabbreviation":"i","photosrcs":["/volvo/v70/2001/oem/2001_volvo_v70_wagon_xc_i_oem_1_396.jpg","/volvo/v70/2001/oem/2001_volvo_v70_wagon_xc_i_oem_1_196.jpg","/volvo/v70/2001/oem/2001_volvo_v70_wagon_xc_i_oem_1_400.jpg","/volvo/v70/2001/oem/2001_volvo_v70_wagon_xc_i_oem_1_300.jpg","/volvo/v70/2001/oem/2001_volvo_v70_wagon_xc_i_oem_1_98.jpg","/volvo/v70/2001/oem/2001_volvo_v70_wagon_xc_

java - Scanner specifics -

java - Scanner specifics - i making programme grades external file, find sum , average of them, , display that. in addition, programme stops when reaches zero. question when test if next number not zero, skips number , hence not utilize number in calculation. current approach is: while ((current = infile.nextint()) != 0) { system.out.println(current); sum += current; numberofscores++; } setting next int variable @ same time tested. while way works, there certainly must easier way done. there? thanks in advance help --cheers i'm little confused prompt- looking simplify approach, or able go on past zero? either way, approach here little risky. begs programme crashes. i'd recommend among these lines, ensure there int. while(infile.hasnextint()){ int tmp = infile.nextint(); system.out.println(tmp); sum += tmp; numberofscores++; } if want, add together in code skip on 0s. java java.

client - Connect to VPN Server from only my Android App NOT the whole device -

client - Connect to VPN Server from only my Android App NOT the whole device - i have set vpn server in amazon ec2 server using softether (https://www.softether.org/) , want route traffic android app through server. but solutions have seen far utilize vpn service class http://developer.android.com/reference/android/net/vpnservice.html, creates vpn tunnel whole device , not application. want other apps running on phone utilize net normal while traffic app routed through ec2 server. also way if app wants start vpn connection, connection terminated there can 1 connection , no simultaneous ones. is there anyway this? grateful suggestions. cheers! android client vpn

Android 5 turn off Interruptions filtration -

Android 5 turn off Interruptions filtration - just tested app on new android 5.0 , found have bug in switching ringer mode via sound manager. after set ringer_mode_silent comes "allow priority interruptions" mode , it's ok, it's how described in what's new document. after set ringer_mode_normal phone doesn't come "always interrupt" , not expected behavior. user can miss phone call because of it. does find solution/work around problem? how can turn off filtration mode? update found code in android src. settings global.zen_mode. , code should alter on set normal_mode looks correct, doesn't work in emulator , nexus rom. had seek set via settings.global.putint, got error permissions. have no thought how prepare =( made bug report: https://code.google.com/p/android/issues/detail?id=78158&thanks=78158&ts=1414182304 and in preview tracker https://code.google.com/p/android-developer-preview/issues/detail?id=1780&thanks=17

bash - how to make this password generator generate random length password -

bash - how to make this password generator generate random length password - im new bash scripting , need help this. have password generator script , generates 8 character long password. i've been trying create generate random length couldn't it. can bash scripting knowledge give me suggestion on how this? here script if [ $# -eq 0 ]; num=("0" "1" "2" "3" "4" "5" "7" "8" "9") special=("@" "#" "$" "%" "*" "-" "+") upper=(a b c d e f g h j k l m n o p q r s t u v w x y z) lower=(a b c d e f g h j k l m n o p q r s t u v w x y z) length=(0 1 2 3 4 5 7 8) length2=${#length[*]} #${lower[$((random%length2))]) lower2=${#lower[*]} #${lower[$((random%lower2))]} upper2=${#upper[*]} #${upper[$((random%upper2))]} num2=${#num[*]} #${num[$((random%num2))]} special2=${#special[*]} #${special[$((random%special2))]} ab

c# - How to link a data source with dot42? -

c# - How to link a data source with dot42? - i started using dot42 write simple android apps in c#. when doing c# project simple add together , link sql database it. for reason, not simple dot42. doing wrong? there isn't much documentation online , google search did not bring anything. thanks reading question. c# android dot42

polymer - Dynamically-generated paper-dropdown-menu initial selection issue -

polymer - Dynamically-generated paper-dropdown-menu initial selection issue - so i'm trying dynamically generate paper-dropdown-menu populated ajax info source, working great using code below: <polymer-element name="my-element" attributes="selected"> <template> <core-ajax auto url="/api/items/" response="{{items}}" handleas="json"></core-ajax> <paper-dropdown-menu selected="{{selected}}"> <template repeat="{{items}}"> <paper-item name="{{id}}" label="{{name}}"></paper-item> </template> </paper-dropdown-menu> </template> but if set initial selected item either value of published attribute, or value set in 'ready' callback, dropdown menu item not selected when items loaded: <script> polymer({ publish: { selected: null } }); </script> &l

html - How do I get bubble effects in bootstrap? -

html - How do I get bubble effects in bootstrap? - how bubble effects in bootstrap site has, https://ginger.io/ i using bootstrap , want box says "i'm individual living chronic status looking stronger connection provider, , improve care." having problem figuring out how. as stated in comment, if don't know how this, should train before start swinging hammer. specific question: bubble white h3 border-radius of 10px , set against grayness background. can utilize block level element, though, not h3. here's codepen example: http://codepen.io/erquhart/pen/kbcex html css twitter-bootstrap

php - set different rates for different products like silver gold woocomerce -

php - set different rates for different products like silver gold woocomerce - in woo commerce there no such thing available set different prices product adds show total cost of product. illustration in silver rates silver / kg different , manufacturing rates each product different. so each product on product page want mention total prices of single product mentioning rates set each thing: illustration (to shown on product page) - silver coin 8gm - 400 rs (these rates on basis of cost/gm . here 50.0/gm ) manufacturing cost- 110 rs total prices : 510 rs also after shopping , have apply shipping charges in cart , depending upon area etc. not problem me. need solve problem multiple rates single product ? solutions? php wordpress wordpress-plugin woocommerce

c# - How to Integrate NodeJs in Existing .Net MVC application Using EdgeJs? -

c# - How to Integrate NodeJs in Existing .Net MVC application Using EdgeJs? - can 1 suggest way integrate nodejs in .net mvc application? using next code: public class startup { public async task<object> invoke(dynamic input) { departmentrep person = new departmentrep(new mvcappusingedgejsmongodbcontext()); var department= person.getalldepartments(); //var section = "hello"; homecoming department; } } public class departmentcontroller : controller { departmentrepository departmentrepository = new departmentrepository(new mvcappusingedgejsmongodbcontext()); string connectionstring = configurationmanager.appsettings["connectionstring"].tostring(); public viewresult index() { // var clrmethod = edge.func("departmentrep.cs"); var getdata = edge.func("./departmentrep.dll"); // homecoming view(clrmethod); homecomi

xml - How to map an array to fixed fields using Biztalk mapper -

xml - How to map an array to fixed fields using Biztalk mapper - i need remap array of objects this: <root> <listofobjs> <obj> <attr1>0000</attr1> <attr2>hello!</attr2> </obj> <obj> <attr1>1111</attr1> <attr2>hello1!</attr2> </obj> </listofobjs> </root> to output this: <root> <obj1_attr1>0000</obj1_attr1> <obj1_attr2>hello!</obj1_attr2> <obj2_attr1>1111</obj2_attr1> <obj2_attr2>hello1!</obj2_attr2> </root> so in xsd schema have this: schema input <xs:element name="root"> <xs:complextype> <xs:sequence> <xs:element nam

Using tuples in a linked list in python -

Using tuples in a linked list in python - my teacher wants recreate dict class in python using tuples , linkedlists (for collisions). 1 of methods used homecoming value given key. know how in tuple ( find key @ location[0] , homecoming location[1]) have no thought how in case of collision. suggestions? if more info needed please allow me know it sounds have sort of hash shortlist of possibilities, so, hash key small-ish number, e.g. 0-256 (as example, might hash 63). can go straight info @ index 63. because might have more 1 item hashes 63, entry 63 contain list of (key,value) pairs, have search 1 1 - effectively, you've reduced search area 255/256th of total list. optionally, when collisions particular key exceeds threshold, repeat process - mydict[63][92], 1 time again reducing problem size same factor. repeat indefinitely. python linked-list

objective c - UITextField on UIScrollView (iOS 8.x only) -

objective c - UITextField on UIScrollView (iOS 8.x only) - i have view subclass of uiscrollview , uitextfield on uiscrollview . i'll refer subclass of uiscrollview 'cuscrollview'. the purpose of cuscrollview when user input text, button has title of text added on cuscrollview . offset of uitextfield move @ right of lastly added button. this how cuscrollview like. below ios 8.x, works perfectly; doesn't on ios 8.x. when uitextfield resigned first responder, cuscrollview 's contentsize reset cuscrollview 's frame width. i found work around. overrided setcontentsize: , set contentsize whatever want. is bug? or kind of auto layout mistake? first of don't mix auto layout setting frame's manually. if perform error in autlayout. objective-c uiscrollview ios8 uitextfield autolayout

where in the sources of Wireshark I can see the calls to the pcap? -

where in the sources of Wireshark I can see the calls to the pcap? - i want find place in code wireshark takes packets arrive driver. i guess done using libpcap or other api capturing packet. looked @ source code didn't find phone call function libpcap . so searching place wireshark communicates pcap interface or driver directly. want know functions called (especially linux). thanks most of calls in dumpcap.c, capture-pcap-util-unix.c, capture-pcap-util.c, , capture-wpcap.c. wireshark pcap libpcap

css - Center Nav menu using floating -

css - Center Nav menu using floating - hi tried center navigation menu using floating css element didn't work. have advices? <header> <div id="top-banner"> <img src="images/headerlines.png" alt="lines"> </div> <div id="logo"> <img src="images/logo.png" alt="logo"> </div> <nav> <ul class="nav"> <li><a href="text.html">about</a></li> <li><a href="tables.html">price</a></li> <li><a href="forms.html">contact us</a></li> </ul> </nav> </header> css .nav li{ width:960px; list-style:none; float:left; } .nav { display:block; text-align:center; width:320px; text-decoration:none; } sorry guys, first time posting question on stackoverflow. you can :) class="sni

excel vba - Update data validation using VBA when cell is selected? -

excel vba - Update data validation using VBA when cell is selected? - i have vba-code updates info validation list in cell. sub setdatavalidationlist(r range, s string) dim dv validation set dv = r.validation dv .delete .add type:=xlvalidatelist, alertstyle:=xlvalidalertstop, operator:=xlbetween, formula1:=s end end sub i want info validation list date whenever cell selected. know can run subroutine above in worksheet_change event. there event cell_select? or way can emulate event this. vba excel-vba

ruby - Duplicate data in kibana from logstash -

ruby - Duplicate data in kibana from logstash - i'm trying display mongo info i've been collecting using logstash using mongostat tool. displays things suffix "b", "k", "g" signify byte, kilobyte, gigabyte, fine if i'm reading output, want throw kibana , display in graphical format see trends. i've done several other log files , fine. when utilize grok filter fine i've added ruby filter , info seems duplicated in fields other logstash generated fields , new field created in ruby filter. here relevant parts of conf file: input { file { path => "/var/log/mongodb/mongostat.log" type => "mongostat" start_position => "end" } } filter { if [type] == "mongostat" { grok { patterns_dir => "/opt/logstash/patterns" match => ["message","###a bunch of filtering know works###"] add_tag => "mongosta

ios - UITableView Header and footer indent during edit mode -

ios - UITableView Header and footer indent during edit mode - i have uitableview 3 cell prototypes in storyboard, utilize 1 cell in header section, 1 normal table rows , table footer. -(uiview *)tableview:(uitableview *)tableview viewforheaderinsection:(nsinteger)section{ static nsstring *cellidentifier = @"header"; uitableviewcell *cell = [tableview dequeuereusablecellwithidentifier:cellidentifier]; //some personalization homecoming cell; } my problem whenever come in in edit mode of tableview header , footer moving left, cell current editing. - (void) setediting:(bool)editing animated:(bool)animated { [super setediting:editing animated:animated]; [self.tableview setediting:editing animated:animated]; } - (bool)tableview:(uitableview *)tableview caneditrowatindexpath:(nsindexpath *)indexpath{ homecoming yes; } in edit mode: any solution or hints? neither lastly xcode update fixed it. thank you solved. had creat

.htaccess - htaccess Cancel Rewrite Rule for Some Keywords -

.htaccess - htaccess Cancel Rewrite Rule for Some Keywords - i wanted redirect domain.com/a-page-name domain.com/index.php?sayfa=a-page-name , used next code: options +followsymlinks rewriteengine on rewriterule ^([a-za-z0-9\-]+)$ index.php?sayfa=$1 [l,nc] but don't want redirect domain.com/pictures, domain.com/sources how can this? you can that: rewriteengine on rewritecond %{request_uri} !^/(?:pictures|sources)$ rewriterule ^([a-za-z0-9\-]+)$ index.php?sayfa=$1 [l,nc] .htaccess mod-rewrite

pattern matching - Scala: Dynamic selection criteria as a method argument -

pattern matching - Scala: Dynamic selection criteria as a method argument - my intention create function in scala accepts kind of dynamic query (similar case expressions in pattern matching) , returns matching instances within list . suppose list consists of instances of case class person has few properties different types. function should able take dynamic combination of values of fields, , homecoming matching person s. looking clean solution. 1 possible ways utilize such function pass object anonymous type query (the "pattern"): def find(?): list<person> = { ? } val matches = find(new { val name = "name"; val gender = gender.male }) ideally, develop clean way of passing conditions, instead of concrete values, it's not essential. since learning scala, not aware of techniques implement such thing. in c#, used anonymous type (similar sec line of code above) , dynamic parameters accomplish similar. clean , elegant solution in scala?

javascript - How to launch Chrome packaged app by clicking on a button in a html page -

javascript - How to launch Chrome packaged app by clicking on a button in a html page - i have created chrome packaged app , when execute next line in command prompt, launches packaged app: "c:\program files (x86)\google\chrome\application\chrome.exe" --load-and-launch-app="chrome-app-path-goes-here" how can launch chrome app clicking on button in html page? javascript or jquery way of doing this? yes, it's possible. requirements: specifically whitelisting domain in manifest knowing app's id (you can pin development) having app installed. take @ externally_connectable : docs, example. what can send message app, wake event page. there, can open app's window usual. javascript jquery html google-chrome-app

Toad development suite installation 9.7.2 commercial time taken? -

Toad development suite installation 9.7.2 commercial time taken? - i installing toad dev suite oracle 9.7.2 , screen stuck on 'preparing configuration files, may take several minutes.' been more 45 minutes , screen still there. dont know if installation going on or stuck. i have test several versions of toad , if takes more hr 1 screen whole day wasted. has 1 done installation ? , how much time screen take ? installation toad oracle9i

javascript - adding new field to to my html page using JS and checking for auto complete in .XML.PHP file -

javascript - adding new field to to my html page using JS and checking for auto complete in .XML.PHP file - want add together 1 more auto-complete input field have no ides how it. adding new field to html page using js , checking auto finish in .xml.php file this .js file (function(){ var window=window, document=document, scan=gui.app.scan, sys=gui.system, u=gui.util, d=gui.dom, e=gui.event, w=gui.widget, form, formname='gblform-unit', autos={}, reqd={ fields:['unitid'], types:{ 'unitid':'alphanum' } }; /** * set field required if exists * @private * @param {string} id id of field * @returns {void} */ function setrequired(id){ if (d.get(id)){ reqd.fields.push(id); } } handles onload event window function onload(){

cordova - How to fetch calender event from phone in phonegap? -

cordova - How to fetch calender event from phone in phonegap? - i new phonegap.i want fetch calender events phone.but in alert "[]" document.addeventlistener("deviceready",ondeviceready, false); function ondeviceready() { window.plugins.calendar.listeventsinrange("10/10/2013","11/11/2015",success,error); } function success (message) { alert("success: " +json.stringify(message)); } function error(err) { alert("error :"+ err); } cordova calendar phonegap-plugins

android - Tie the line to the end of ListView -

android - Tie the line to the end of ListView - in eclipse looks good, on device between line , listview have big distance. how remove distance between list , line? here xml layout: <?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="@drawable/gradient" android:orientation="vertical" > <textview android:id="@+id/reminder" android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="center" /> <view android:layout_width="match_parent" android:layout_height="6dp" android:background="@drawable/line_top" android:layout_marginlef

autocomplete - Javascript intellisense in ACE editor -

autocomplete - Javascript intellisense in ACE editor - tl;dr i need intelligent autocompletion/intellisense javascript in ace editor. explanation i creating online ide javascript using ace editor. there library or open-source project allows intelligent autocompletion javascript. javascript dynamic language, intellisense integration trivial such languages (typescript back upwards this). ace editor supports basic autocompletition (like sublime text) using enablebasicautocompletion . i need intelligent autocompletion, engine parses javascript in backend in realtime , provides suggestions. any help regarding issue appreciated. thanks. try tern extension ace https://github.com/angelozerr/tern.ace/ update: improve version @ https://github.com/sevin7676/ace.tern demo http://sevin7676.github.io/ace.tern/demo.html javascript autocomplete intellisense ace-editor

html - Right position of DIVs in a pure CSS text chat simulation -

html - Right position of DIVs in a pure CSS text chat simulation - i trying create appearance of text chat using pure css. kind of text chat 1 person's texts represented speech bubbles on left of screen, , other persons speech bubbles on right side of screen. i'm there, , i've created jsfiddle example. there 2 problems. the big problem bubbles pointer on right side, representing person on right, needs aligned on right side. can't find way them align without floating them, , if float them, overlap other bubbles , create mess. how class bubble-right stick right side? the sec issue i'm using display: inline-block; makes bubbles wide text. had set white-space: pre-line; in containing div in order bubbles stack properly. unfortunately, creating space. tried putting in line-height declarations prevent this, doesn't seem have helped. how bubbles stack , alternate vertically without making whitespace don't need? here css: .bubble-dialog {

macros - How do I write universal swift code for both iOS and OS X. In cocoa I could use #ifdef, what do I do now? -

macros - How do I write universal swift code for both iOS and OS X. In cocoa I could use #ifdef, what do I do now? - for our project used 1 source file both platforms: ios , os x. right migrating swift. unfortunately there files need import cocoa and on ios import uikit previously did #ifdef __mac_os_x_version_max_allowed #import <cocoa/cocoa.h> #else #import <uikit/uikit.h> #endif do know how can done in swift? don't write each class twice because there no macros anymore. thanks in advance jack use: #if os(osx) import cocoa #elseif os(ios) import uikit #endif macros swift import preprocessor conditional-compilation

multithreading - Java's Queue cannot specify limited size, so what's difference between "add" and "offer" -

multithreading - Java's Queue cannot specify limited size, so what's difference between "add" and "offer" - java's queue:the difference between "add" , "offer" if queue has been full, "add" cause exception, , "offer" homecoming false. but question is "when queue can full"? seems there no size-fixed queue in standard java, , queue has no method specify size. if go on add/offer element queue, queue extended automatically. if true, what's difference between "add" , "offer" when utilize it. if not true, how specify max size of queue. the interface allows implementations limited size. not require implementations have size bound forcing implementations have setsize method. see instance arrayblockingqueue(int capacity) . so if go on add/offer element queue, queue extended automatically. no, queue implementation not required grow automatically. jav

java - Figure out Odd Even or Zero by entering the value -

java - Figure out Odd Even or Zero by entering the value - my teacher asked me question , confused how write out code. understood had do, couldn't write in java. question that: design , implement application determines , prints number of odd , 0 digits. input user/keyboard. don't know how start. can help me here reply , explanation that?(without using string) give thanks much time. application? it's 3 lines: int odds = str.replaceall("[^13579]", "").length(); int evens = str.replaceall("[^2468]", "").length(); int zeroes = str.replaceall("[^0]", "").length(); if input not string, create one: long number; string str = number + ""; java

html - 3 DIVs next to each other with middle filling the void -

html - 3 DIVs next to each other with middle filling the void - hello inquire how set 3 div next each other while middle 1 filling void between first , 3rd div. i to have dynamic buttons in first nad 3rd div , need middle div fill space between div 1 , three. i brefer pure css / html (no javascript) here try: http://jsfiddle.net/4smx3627/ #wrapper{ height: 30px; } #first{ height: 100%; background-color:red; float: left; display: inline-block; } #second{ height: 100%; background-color:green; display: inline-block; } #third{ height: 100%; background-color:yellow; float: right; display: inline-block; } thank much advice. there many ways accomplish this. modern way accurately reflects description "flexbox", may need careful of browser support. if you're interested in latest browser versions, it's option. here's example jsfiddle http://jsfiddle.net/sxx65mhq/ html <div class="co

sql - Dynamically concatenating multiple columns in a sequence -

sql - Dynamically concatenating multiple columns in a sequence - i have requirement in have concatenate fields based on sequence given in table along respect lengths. eg.. input: table a: (below fields , respective values, not fields have values) kschl - zic0 (key) kotabnr - 521 (key) matnr kunnr--> 1234567890 lifnr vkorg--> a234 prctr kunre--> 4355325363 lifre--> 88390234 table b: (it contains same fields in table , have sequence number in concatenation should happen. length field(len) have corresponding field lengths(pipe delimited) should considered in concatenation) kschl - zic0 (key) kotabnr - 521 (key) matnr kunnr--> 1 lifnr vkorg--> 3 prctr kunre--> 2 lifre--> 4 len 10|10|4|10 expected result: kschl - zic0 (key) kotabnr - 521 (key) matnr kunnr 1234567890 lifnr vkorg a234 prctr kunre 4355325363 lifre

jquery - Can I write form tags in other form tags? -

jquery - Can I write form tags in other form tags? - can write form tag in other form tag? requirement implement file upload. here using underscore js template , maintain items 1 form. after adding upload code within form not able finish file upload functionality. please have code below code. <script type="text/template"><div class="container"></br></br> <% _.each(forms, function(form){ %> <form id="<%= formid(form) %>" name="<%= formcaption(form) %>"> <%_.each(form.layout.grid, function(grid){ _.each(grid.columns, function(column){ var dclayoutinfo = datacontrollayoutinfo(column); var dcinfo = datacontrolinfo(form.datacontrols,dclayoutinfo.datacontrol); var datacontrols = formdatacontrols(form) _.each(datacontrols, function(datacontrol){ if(dcinfo.id == datacontrol.id){%> <div

autocomplete - How to Customize the View of AutoCompleteTextView in Android? -

autocomplete - How to Customize the View of AutoCompleteTextView in Android? - i have autocompleteview user can search other users. user custom object consists of id, name. autocompleteview controller usersadapter. usersadapter handles setting view of user object in suggestion. how set autocompleteview search on user name? mean, autocomplete should work based on username. you should utilize addtextchangedlistener on autocompletetextview. after, utilize 1 of 3 methods provided phone call function treat list contains usernames. here illustration : recherche.addtextchangedlistener(new textwatcher() { @override public void beforetextchanged(charsequence charsequence, int i, int i2, int i3) { } @override public void ontextchanged(charsequence charsequence, int i, int i2, int i3) { if (charsequence.length() > 1) searchsuggestions(charsequence); } @override

javascript - Confusion with making a dropdown menu clickable for mobile users -

javascript - Confusion with making a dropdown menu clickable for mobile users - hey i'm having problem getting drop downwards menu clickable. working fine in hover state want clickable mobile users. please see code help appreciated. want maintain hover state people using pc want click working mobiles. many sam class="snippet-code-js lang-js prettyprint-override"> $(document).ready(function() { $('.topnav').click(function() { $('.sub-nav').toggleclass('visible'); }); }); class="snippet-code-css lang-css prettyprint-override"> .subnav ul.sub-nav{ display: none; } .subnav ul.visible { display: block; } #headernav .tile:hover a{ background-color:#fff; border-radius: 0 0 5px 5px; -webkit-box-shadow: -1px -1px 4px 2px rgba(0,0,0,0.51); -moz-box-shadow: -1px -1px 4px 2px rgba(0,0,0,0.51); box-shadow: -1px -1px 4px 2px rgba(0,0,0,0.51); -webkit-transition:0.5s ease-in; -m

java - ImageButton with JPEG source causes InflateException -

java - ImageButton with JPEG source causes InflateException - i have 15 imagebuttons src attribute set jpeg picture: <imagebutton android:id="@+id/button01" android:layout_width="fill_parent" android:layout_height="match_parent" android:layout_weight="0.2" android:padding="5dp" android:scaletype="fitcenter" android:adjustviewbounds="true" android:background="@drawable/button_state" android:src="@drawable/agri_b" /> when run application inflateexception error. tried alter activity class fragmentactivity class nil changed. guess wrong jpeg image size. largest image has 217 kb size. here error get: 10-18 12:27:32.538: e/androidruntime(30713): fatal exception: main 10-18 12:27:32.538: e/androidruntime(30713): process: com.example.traceyourexpense, pid: 30713 10-18 12:27:32.538: e/androidruntime(3