Posts

Showing posts from June, 2015

Text Search in WPF ListView not working properly with selectionmode extended -

i have wpf listview selection mode set extended (and need keep extended other funationality). have enabled text search on listview using textsearch options. now consider have following 5 items in listview : apple ball ==> current selected item. cat dog elephant at stage, if press key "e" on keyboard, text search works , item "elephant" gets selected. however, if press "shift + e", items ball elephant gets selected, i.e. shift key used extended selection , not capital letter e. however, since doing search using keyboard, shouldn't item "elephant" selected , shift key should used capital e , not extended selection? can somehow achieve this?

Javascript radio button issue -

im trying validate gender radio buttons. works if not selected, when 1 selected still says "gender not selected"..does know how around this? i have.. if (!gendermaleradiobutton.checked || !genderfemaleradiobutton.checked) { errormessage = errormessage + "gender not selected\n"; } //displays error messages if (errormessage) { alert(errormessage); } //if information valid, submission success. else if(!errormessage) { alert("submission successful, thank " + firstname.value); } you saying "if male button not pressed or female button not pressed, display error message." change first line if(!gendermaleradiobutton.checked && !genderfemaleradiobutton.checked) , makes "if male button not pressed , female button not pressed, display error message."

ios - UISearchDisplayController does not entirely cover a child view controller -

Image
i have root view controller composes search bar on top , child table view controller on bottom. used composition instead of assigning search bar table view's header these reasons: i didn't want index overlap search bar (like contacts app). i wanted search bar sticky. is, doesn't move when scroll table view (again contacts app). my table view had header. since search bar in root view controller, instantiate search display controller in root view controller also. there 2 problems search ui seek advice: the translucent gray overlay not cover entire child table view. leaves top portion of header , index visible. likewise, search results table not cover entirety of child table view. know how manually change frame of results table view, doing fixes ... gray translucent overlay's frame not linked results table view frame. no property access overlay. 1) idle 2) enter search bar 3) start typing #import "contactsrootviewcontroller.h" #impo

Changing probability in java -

this question has answer here: weighted randomness in java 7 answers i have been trying write program simple fighting simulator , task have ask user percentage of low, medium, , high attacks in fighting round. so example, user inputs low = 50%, medium = 30%, , high = 20%. question stems here. how make in 1 round program print low 50% of time, medium 30% of time, , high 20% of time? without giving exact java code, here need do: create set of intervals. in case, [0, 0.5> , [0.5, 0.8> ; [0.8, 1.0> . generate random number between 0 , 1 see interval falls in. fall first interval 50% of time, second interval 30% of time, , third interval 20% of time you can figure out here? afterthought: in case, values user inputs add 100%. in general may not true; compute "apparent intervals" first, , scale them maximum of 1. let's user entere

inheritance - Java: Return an object that extends an abstract class which takes arguments -

i've got interface public interface { public anabstractclass k(); //abstract class constructor takes 2 arguments } for implementation of interface's method want return generic object extends abstractclass , give 2 argument constructor to clarify want achieve. in class implements i: public anabstractclass k() { //return new implementing abstractclass object abstractclassobject(arg1,arg2) } constructors not inherited, subclasses of anabstractclass won't have two-argument constructor. if subclass does have two-argument constructor, there nothing stopping creating instance of subclass using two-argument constructor , returning it: public abstract class anabstractclass { public anabstractclass(string foo, string bar) { system.out.format("created (%s, %s)\n", foo, bar); } } public class baseclass extends anabstractclass { public baseclass(string foo, string bar) { super(foo, bar); } } public interface {

css3 - Lighten parent's (unknown) background-color in child -

is there way in less or (css3 in general) access parent's background-color without knowing it? something like: .child-class { background-color: lighten(parent-background-color, 30%); } a less variable obvious approach in case don't know parent's background-color can dynamically styled. anybody got in trick box out? edit: have @ scotts's answer clever solution need. that cannot done in pure css. reason these types of references lead 'circular' situations. or situations dom has looped on multiple times determine final value. both these situations css avoids. now, if main goal define 'pallette' of sorts , have colors work together, should css expansion tools "sass" or "less". let define colors , change them , other useful comparison things. have @ tools if want such flexibility. cannot however, direct comparison ask, since reduce css in end. this can done using javascript, , more using jquery. wont clutte

java - How can I send and acquire an object from a connector in Mule Studio? -

i need send , acquire java object custom connector expecting: // inside myconnector.java @processor public object dosomething(@default(#[payload]) final object data) {...} i'm trying send instance of fakedata class. can verify works when send object using mule's functionaltestcase class: <!-- inside mule-config.xml --> <flow name="do_something"> <myconnector:do-something document-ref="#[payload]"/> </flow> public class flowbuilder extends functionaltestcase { public void run() { object payload = new fakedata(); flow flow = lookupflowconstruct("do_something"); muleevent event = functionaltestcase.gettestevent(payload); muleevent responseevent= flow.process(event); } } i can't figure out how send fakedata object , receive object in regular mule flow using mule studio. can me out? ------- update -------- i invoking flow using http front end. flow looks this:

linux - open a tab and running a script using gnome-terminal --tab option on Ubuntu -

i in project directory. $ pwd /home/karthik/projects i following cmdline. gnome-terminal --tab --working-directory="/home/karthik/mininet" -e "sudo ./my_topo.sh" i expect above command following 1) open tab 2) go working directory `/home/karthik/mininet` 3) execute script `my_topo.sh` instead seems following. 1) open terminal. 2) go working directory `/home/karthik/mininet` 3) execute script `my_topo.sh` also on related note,how open tab sudo privileges don't have type in password? i tried doing following wid= xprop -root | grep "_net_active_window(window)"| awk '{print $5}'; xdotool windowfocus $wid; xdotool key ctrl+shift+t $wid this open new tab how execute following commands in new tab instead of old one. cd /home/karthik/mininet; sudo ./my_topo.sh try bash script: #!/bin/sh gnome-terminal -x sudo ./home/karthik/mininet/my_topo.sh

ruby on rails - Does shallow nesting work for resources nesting 2 levels deep? -

i have comments belonging answers, , answers belonging questions. i know shouldn't nesting 2 levels deep, shallow nesting work this? shallow resources :questions resources :comments resources :answers end end would allow paths executable? shallow nesting specifically designed resources nesting 2 levels deep. read guide, 2.7.2 shallow nesting (scroll down bit), , @ examples , generated routes tables. decide if works you.

xilinx - Connecting ports by name in VHDL, UCF-style -

i have vhdl entity defined this: entity realentity port( clk_50mhz: in std_logic; led : out std_logic_vector(3 downto 0) ); end realentity; if have ucf entries led<0>..led<3> , clk_50mhz , can compile entity directly. however, don't have 50 mhz clock on board, have use clock manager chip. i'm using xilinx tools has wizard add dcm core, , wrap in vhdl entity easy use: entity dcm port( clk_32mhz: in std_logic; clk_50mhz: out std_logic ); end dcm; where clk_32mhz exists in ucf. to connect these two, using third entity used toplevel one: entity main port( clk_32mhz : in std_logic; led : out std_logic_vector(3 downto 0) ); end main; architecture arch of main signal clk_50mhz : std_logic; component dcm port( clk_32mhz : in std_logic; clk_50mhz : out std_logic ); end component; component realentity port(clk_50mhz : in std_logic; led : out std_logic_vec

javascript - Execute this Strange function -

i working on project , on how execute function in javascript. i not familiar seeing '$' in code before function in js that. should write in console if using js engine such chrome of phantomjs execute function. <script language="javascript"> $(function () { $(".cb-js-cc").on('click', function () { $.ajax({ type: "post", url: "overview.aspx/cc", data: "{ reservationversionid: " + $('.js_reservationversionid').val() + "}", contenttype: "application/json; charset=utf-8", datatype: "json", success: function (msg) { if (msg && msg.d) { alert(msg.d); } } }); }); }); </script> the use of $(function () { ... } ) shorthand notation $(document).ready(function () { ... }); . function automatically ex

c++ - How to create an inverted triangle using only loops/control statements and two cout statements: one that outputs '#' and one that outputs '\n' -

the output supposed follows: ######## ###### #### ## i have solved issue dropping 2 cout statements constraint: #include <iostream> void main(){ int starthash = 8; for(int row = 1; row <= 4; row++){ for(int hashnum = 1; hashnum <= starthash; hashnum++){ std::cout << "#"; } std::cout << "\n "; if(row == 2) std::cout << " "; if(row == 3) std:: cout << " "; if(row == 4) std:: cout << " "; starthash -= 2; } system("pause"); } however, @ point can't figure out how make shape without being able output space, since cout starts @ far left , moves right. appreciated. notice how spaces in ifs getting longer: if(row == 2) std::cout << " "; if(row == 3) std:: cout << " "; if(row == 4) std:: cout << " "; it seems there pattern there, see if can find it. ;-) (seeing how h

wso2esb - WSO2 ESB - java.lang.ClassNotFoundException: org.apache.synapse.core.axis2.Axis2MessageContext -

i having mediator receives message, generated vfs poller. trying figure out file name act on differently. code pulls filename works, getting classnotfoundexception (see below). gave restart wso2 1 or more times in order class loaded successfully. running wso2 esb 4.8.0 on ubuntu 12.04 8gb ram , 4gb max java heap. thanks, krassimir public boolean mediate(messagecontext context) { ... string filename = ((map) ((axis2messagecontext) context).getaxis2messagecontext() .getproperty("transport_headers")).get("file_name").tostring(); ... caused by: java.lang.classnotfoundexception: org.apache.synapse.core.axis2.axis2messagecontext @ org.eclipse.osgi.internal.loader.bundleloader.findclassinternal(bundleloader.java:501) @ org.eclipse.osgi.internal.loader.bundleloader.findclass(bundleloader.java:421) @ org.eclipse.osgi.internal.loader.bundleloader.findclass(bundleloader.java:412) @ org.eclipse.osgi.internal.baseadaptor.defaultcla

javascript - jPanelMenu and scrolling not working together -

update - solution i found solution... , super simple! just add following css: body { overflow-x: visible; } it seems conflict arises when overflow-x set hidden on body jpanelmenu. i running jpanelmenu , jrespond (jpanelmenu active on smaller screens jrespond, on larger screens menu fixed , not use jpanelmenu) . all working fine when try use kind of js apply css on page scroll, doesn't work while jpanelmenu active. i want add floating menu button open jpanelmenu once user scrolls past header, needs active when jpanelmenu active. here 1 of scroll snippets have been using: jquery(window).scroll(function() { var scroll = $(window).scrolltop(); if (scroll >= 200) { $("#scroll-trigger").addclass("show"); } else { $("#scroll-trigger").removeclass("show"); } }); this works on own, number of other different ways write out scroll method. when jpanelmenu on, scroll code ren

mysql - SQL Query does not return intended values -

i working on database client of mine , on 1 of pages (written in php , html) need display of information on clients, when run following query (supposed select of rows in table 'families') returns total of 0 rows. when should return of rows in table select families.id fam_id, families.last_name fam_surname, families.address_1 fam_address_1, families.address_2 fam_address_2, families.city_id fam_city, families.phone fam_phone, families.mobile fam_mobile, families.email fam_email, families.f_d_worker_1 fam_fdw_1, families.f_d_worker_2 fam_fdw_2, families.status_id fam_status_id, families.trans_date fam_trans_date, families.entry_date fam_entry_date, families.exit_date fam_exit_date, families.eligible_date fam_eligible_date, families.active_date fam_active_date, families.lga_loc_id fam_lga_id, families.facs_loc_id fam_facs_id, families.ind_status_id fam_indig_id, families.referral_id fam_ref_id, families.active_status fam_act_status, families.comm_org_id fam_com_org, city.id

php - Show records from MySQL Database -

i have php page supposed list of employees positions.. <!doctype html public "-//w3c//dtd html 4.01//en" "http://www.w3.org/tr/html4/strict.dtd"> <html> <head> <title>view records</title> </head> <body> <?php // connect database include('connection.php'); ?> <?php // results database $result = "select employees.id, concat( fname, lname ) fullname, employees.hphone, employees.cphone, employees.email, position.pos\n" . "from employees\n" . "inner join position on employees.posid = position.id\n" . "order employees.id asc limit 0, 30 "; or die(mysql_error()); // display data in table echo "<p><b>view all</b> | <a href='view-paginated.php?page=1'>view paginated</a></p>"; echo "<table border='1' cellpadding='10'>"; echo &qu

bash - How to capture the event of changing a file in a folder? -

will there event generated when contents of folder in unix changed(removed, added or edited), , can event captured trigger script? if you're using linux, can use inotify subsystem catch sort thing. there inotify bindings python, perl, , forth, or can use inotifywait program (part of inotify-tools package) in shell scripts. for example, if run inotifywait -m /tmp , watch /tmp changes. if create file, see: /tmp/ create foo /tmp/ open foo /tmp/ attrib foo /tmp/ close_write,close foo and if delete file, see: /tmp/ delete foo you can write shell script reads these notifications inotifywait , acts on them accordingly.

java - JScrollPane holding a JPanel is buggy -

recently started making map editor game , came across couple of issues i've kind of have fixed. current problem right have jframe (main interface). within jframe have jscrollpane holds client(a jpanel). since can't post picture post link of image. image of gui: http://i.imgur.com/ypnalys.png this add client(jpanel) jscrollpane. //======== mainscrollpane ======== { client.setpreferredsize(client.getsize()); mainscrollpane.setpreferredsize(client.getsize()); mainscrollpane.setviewportview(client); mainscrollpane.add(client); this client.java|the mapeditor class little large post here feel free ask snippets or anymore information. import java.awt.graphics; import java.awt.graphics2d; import java.awt.event.mouseevent; import java.awt.event.mouselistener; import java.awt.event.mousemotionlistener; import javax.swing.jpanel; public class client extends jpanel implements runnable, mouselistener, mousemotionlistener

javascript - How to trigger keyboard events in HTML? -

hello i'm making app need obtain keyboard access use left arrow key , right arrow key of keyboard, app html5 , javascript, it's pretty easy robot class of java, question is... there way javascript ? you this: $(document).keydown(function(event){ var key = event.which; switch(key) { case 37: // key left. call function key left work break; case 38: // key up. call function key work break; case 39: // key right. call function key right work break; case 40: // key down. call function key down work break; } }); these keycode arrow values: left 37 38 right 39 down 40 edit: if want programically press certian key through javascript can th

security - How can two clients on a network (A&B) negotiate a random number N, such that neither A nor B can know the value of N beforehand? -

the scenario: suppose 2 clients , b connected on network. , b playing strategy game. both , b have information of current state of game , both know circumstances when game won, lost or drawn. both players making move @ same time , inform other it. now assume move of player reaches player b, before b has send off move. now, theoretically, player b change move in favor win game. how can exchange of moves changed, such player b cannot cheat described above? the described task above equivalent negotiate random number n between 2 clients , b, such neither nor b can force n specific number. does know solution problem? the scenario describing can solved use of cryptographic commitment scheme ; such protocol can used negotiate random number having both parties commit random number, xor numbers together. number of such schemes exist, different properties regard binding (that is, how easy 1 of parties change value committed to) , concealing (that is, how easy 1 of pa

css - Non clickable icons in a div within a div -

any ideas how social icons clickable? know if remove main #artistheader icons become clickable, #artistheader has header bg image. <!--begin artist header--> <div id="artistheader"> <div id="artistimage"><img src="../images/ykmfull.png" alt="ykm"></div> <div id="artistname"><center><img src="../images/ykmname.png" alt="ykm"></center></div> <div id="artistsocial"><center> <a href="https://www.facebook.com/youngkingscompany" target="_blank"><img src="../images/fb.png" alt="fb" width="50" border="0"></a><a href="http://www.twitter.com/youngkingsmula" target="_blank"><img src="../images/twitter.png" alt="tw" width="50"></a><img src="../images/insta.png" alt="insta

javascript - Style.display block/none problems -

i planning on making personal project javascript until encountered problem. have table that's "invisible" css " style.display=none " when try make "visible" "uncaught typeerror: cannot read property 'style' of null". javascript code below: function attack(){ document.getelementbyid("list").style.display="block"; document.getelementbyid("message").innerhtml=""; } function fire(){ var y=document.getelementbyid("message"); var x=document.getelementbyid("demo"); var z=document.getelementbyid("att"); x.innerhtml=3; } function disappear(){ document.getelementbyid("list").style.display="none"; document.getelementbyid("message").innerhtml="<center>wild slayerzach has appeared.</center>"; } html below: <body onload="disappea

c# - how to improve the performance of streamwriter -

i'm working on smart device compact framework 3.0 i'm using streamwriter class write data on file. file size 256kb it's taking 60 seconds save file. here code: using (streamwriter sw = new streamwriter(tmppath, true)) { sw.autoflush = true; sw.writeline(_rm.getstring("key")); sw.writeline(rm.getstring("key1") + "\t" + controller.time.tostring("yyyy-mm-ddhh:mm:ss")); sw.writeline(rm.getstring("name") + "\t" + controller.systemname); sw.writeline(rm.getstring("systemname") + "\t" + stctrlname); sw.writeline(rm.getstring("systemid") + "\t" + stctrlid); sw.writeline(); controller.getversion(out major, out minor, out revision, out build); sw.writeline(rm.getstring("build") + string.format("\t{0}.{1}.{2}", major, minor, build)); sw.writeline(optionssection(systeminfo.moduletype.control)); sw.writeline();

MYSQL where clause join a string search -

very hard me describe this, i'll show want trying to albums_lookup has structure lookup | id where lookup in format uid/title my query select `id` `albums_lookup` `lookup` = (select `id` `users` `username` = 'someusername') + '/sometitle' as can tell, have username, need first id of user, append text '/sometitle' in clause you should use concat , join : select id albums_lookup al inner join users u on concat(al.lookup, '/sometitle') = u.id u.username = 'someusername';

python - what is the efficient way of handling pycassa multiget for 1 million rowkeys -

i complete newbie in cassandra. right have managed code working problem scenario on relatively small set of data. however when try multiget on 1 million rowkeys fails message "retried 6 times. last failure timeout: timed out" . e.g: colfam.multiget([rowkey1,...........,rowkey_million]) basically column family trying query has 1 million records 28 columns each. here running 2-node cassandra cluster on single ubuntu virtual-box system config as ram: 3gb processor: 1cpu so how manage handle multiget on many rowkeys efficiently , bulk insert of same cassandra column family?? thanks in advance :) :) i responded on pycassa mailing list (please try not post in multiple places), i'll copy answer else sees this: multiget expensive operation cassandra. each row in multiget can require couple of disk seeks cassandra. pycassa automatically splits query smaller chunks, still expensive. if you're trying read whole column family, use get_range()

python - django rest framework , order_by a JSON from serializers.py file -

i'm working django rest framework , want make order json how can make order_by django rest framework serializers.py file have in serializers.py class establecimientoserializer(serializers.modelserializer): class meta: model = establecimiento depth = 1 fields = ('nombre','ciudad',) order_by = ( ('nombre',) ) i have order_by nothing json what correct way order in json serializers.py? i have in views.py class establecimientoviewset(viewsets.modelviewset): queryset = establecimiento.objects.order_by('nombre') serializer_class = establecimientoserializer filter_backends = (filters.djangofilterbackend,) filter_fields = ('categoria','categoria__titulo',) then order_by not work because have filter, how can make filter work order_by? there's easy way, override explicitly add ordering line: class establecimientoviewset(viewsets.modelviewset):

Jquery validation for different type of date format -

http://jsfiddle.net/q2q9t/ i trying validate input using jquery supporting different types of date formats (formats accepted mm/dd/yyyy or mm-dd-yyyy or mm.dd.yyyy ) ^(?:(?:(?:0?[13578]|1[02])(\/|-|\.)31)\1|(?:(?:0?[1,3-9]|1[0-2])(\/|-|\.)(?:29|30)\2))(?:(?:1[6-9]|[2-9]\d)?\d{2})$|^(?:0?2(\/|-|\.)29\3(?:(?:(?:1[6-9]|[2-9]\d)?(?:0[48]|[2468][048]|[13579][26])|(?:(?:16|[2468][048]|[3579][26])00))))$|^(?:(?:0?[1-9])|(?:1[0-2]))(\/|-|\.)(?:0?[1-9]|1\d|2[0-8])\4(?:(?:1[6-9]|[2-9]\d)?\d{2})$ but not work.. can please me? you need define filter regular expression able perform .test() edit: replace double quotations " slashe / validate expression: the following modified version of code works. try here $(document).ready(function () { $('.validate-date').change(function (e) { var valid_date = $(this).val(); var filter = new regexp(/^(?:(?:(?:0?[13578]|1[02])(\/|-|\.)31)\1|(?:(?:0?[1,3-9]|1[0-2])(\/|-|\.)(?:29|30)\2))(?:(?:1[6-9]|[2

android - Change multiple fragments from ONE ActionTab -

i have tried multiple times add two fragments 1 action tab .when press action tab "search" want load 1 fragment when swipe go 2nd fragment under action tab.please find below code used. mainactivity.java package com.example.swipetabs; import com.tabs.*; import android.os.bundle; import android.app.actionbar; import android.app.actionbar.tab; import android.app.actionbar.tablistener; import android.app.activity; import android.app.fragmenttransaction; import android.support.v4.app.fragment; import android.support.v4.app.fragmentactivity; import android.support.v4.app.fragmentmanager; import android.support.v4.app.fragmentpageradapter; import android.support.v4.view.viewpager; import android.view.menu; import android.widget.imageview; import com.comparenow.*; public class mainactivity extends fragmentactivity implements tablistener { actionbar action_bar; viewpager viewpager; imageview creditcards; fragment fragement; fragment fragement1; fragm

ios - How to make UITableview exact height? -

i have following issue having 1 button on main view if click on button add subview on main view tableview here code fnsettingsviewcontroller *fnsettings = [[fnsettingsviewcontroller alloc]initwithnibname:@"fnsettingsviewcontroller" bundle:nil]; fnsettings.delegate=self; [fnsettings.view setframe:cgrectmake(0, 30, self.view.frame.size.width,250)]; [self.view addsubview:fnsettings.view]; after click on button subview tableview rest of them having whitespace. then how remove remaining whitespace. please known me. before allocate value tableview knows cells count right? try code: float height=[arraytablevalues count]*height of single cell; tableview.frame=cgrectmake(0,30,self.view.frame.size.width,height);

How many way to sync data between android app and server? -

i planning android application , want synchronize data between app , server @ first step after user installed app make contact list. i want know how many way , understand how work. searched google not understand , do. know nothing android , i'm building first app. looking ward answers. thank you. following helpful, please have - sync data between android app , webserver you can use android sync adapter - transferring data using sync adapters

matrix - locating the grids in which a dataset falls into and extracting this data in matlab -

i have 2 sets of data. 1 set of data matrix containing different samples in each row , information regarding each sample in columns, 1 of these columns contains longitude data , 1 contains latitude data sample. other dataset consists of 3 grids. 1 grid contains latitude of data, second grid contains longitude of data , third grid, data 1° latitude longitude grid. what find out data in second dataset corresponds data in second dataset. mean this, if sample falls particular grid of second dataset, data in grid needs extracted , needs known sample data applies. so in grid between latitudes 60 , 59, , longitudes 100 , 101 sample x falls. data in gridded dataset 10 particular grid. know 10 (the data in grid) applies sample x. in end have grid data corresponds sample in new matrix act partner sample dataset (ie. if sample x in row 40 in matrix 10 in row 40), or alternatively added same dataset new column. keeping in mind samples fall same grid. i'm inexperienced in matlab, ha

javascript - about 24 hours and 12 hours -

this question has answer here: jquery - change 1-24 hour 1-12 hour using .gethours() method? 2 answers i want change hours 12hrs not 24hrs. this code : $(document).ready(function() { var monthnames = ["january", "february", "march", "april", "may", "june", "july", "august", "september", "october", "november", "december"]; var daynames = ["sunday", "monday", "tuesday", "wednesday", "thursday", "friday", "saturday"]; var newdate = new date(); newdate.setdate(newdate.getdate()); $('#date').html(daynames[newdate.getday()] + " " + newdate.getdate() + ' ' + monthnames[newdate.getmonth()] + ' ' + newdate.getfullyear()); setint

scala - Define scalaVersion setting for RootProject under git in SBT -

in project, want use code github. dependency defined in build.scala follows: object buildsettings { val buildversion = "1.0-snapshot" val buildscalaversion = "2.9.1" val buildname = "pageanalyzer" val buildsettings = defaults.defaultsettings ++ seq ( organization := buildorganization, version := buildversion, scalaversion := buildscalaversion, name := buildname ) } object pageanalyzerbuild extends build { lazy val root = project ( "root", file ("."), settings = buildsettings.buildsettings ) dependson (depproject) val depproject = rootproject(uri("git://github.com/me/some.git")) } for reasons, have build root project scala 2.9.x . in sbt 0.13 , depproject build 2.10.x , dependency cannot build. root project tries some_2.9.1 , some_2.10 built. change scalaversion 2.10.x works fine. have build root project 2.9.x. there way define scalaversion dep

android - How to access an element of an ArrayList inside Parcelable object? -

i've been running difficulties while trying implement parcelable number of objects. far have project class of string , integer variables , object called parcelableproject contains single project class. difficulty starts when tried creating parcelable class name of allprojects, class contains single array list made of parcelableproject objects. i have method move projects through intent: public void addproject(parcelableproject p){ intent = new intent(this.getactivity(), projectsfragment.class); arraylist<parcelableproject> data = new arraylist<parcelableproject>(); data.add(p); i.putparcelablearraylistextra("projects", data); } furthermore, in projectsfragment try access arraylist data via: intent = getactivity().getintent(); bundle data=i.getextras(); arraylist projects= data.getparcelable("projects"); parcelableproject pproj=projects.get(0); but gives me "cannot conver

c - mingw ld cannot find some library which is exist in the search path -

i'm using vim+mingw, somehow, terminal still window command. google it, , using mintty. when run vim, hang forever until type c-c. find this page ,and wana try winpty. when compile , comes out: $ make linking ../build/console.exe c:\mingw32\bin\ld.exe: cannot find -lpthread c:\mingw32\bin\ld.exe: cannot find -luser32 c:\mingw32\bin\ld.exe: cannot find -lkernel32 c:\mingw32\bin\ld.exe: cannot find -ladvapi32 c:\mingw32\bin\ld.exe: cannot find -lshell32 collect2: ld returned 1 exit status make: *** [../build/console.exe] error 1 then try gcc -lpthread --verbose , able find pthread.a. try ld -lpthread --verbose ,the output ================================================== attempt open /mingw/mingw32/lib/libpthread.dll.a failed attempt open /mingw/mingw32/lib/pthread.dll.a failed attempt open /mingw/mingw32/lib/libpthread.a failed attempt open /mingw/mingw32/lib/pthread.lib failed attempt open /mingw/mingw32/lib/libpthread.dll failed attempt open /mingw/mingw32/lib/pth

iphone - Save changed data to database -

in app taking data server in json format , making changes in data.i able download , save data in app.but unable post data server. using sqlite , asihttp operation.i want save data on server on submit button click. any saving data server.thanks the best way achieve want create php based api on server, call api post data containing payload want save. once have post data on server can use php parse out information , inject local database. tutorial... to call php api in objective c source on ios suggest using afnetworking nice networking framework ios: afnetworking (this has been updated version 2.0, , framework has changed slightly, in example i've linked 1.x version , class exists in version). you can use afhttpclient class. assuming instance of afhttpclient called: afhttpclient *client; then use this: first create dictionary containing php api parameters, e.g. api command, , data want pass server: nsdictionary *params = @{@"cmd":@"up

android - notifyDataSetChanged() not working for custom adapter -

i have went through many similar question still not getting answer. i using custom adapter having arraylist listview when there change on seek bar arraylist modified , want show changes on listview, doig in following 2 ways lv = (listview) findviewbyid(r.id.lv_showcontactlist); customadapter = new contactlistviewadapter(this); customadapter.setlist(contactlist); lv.setadapter(customadapter); contactlist_temp = new arraylist<contactbean>(contactlist); attempt 1) public void onprogresschanged(seekbar seekbar, int progress, boolean fromuser) { (contactbean object : contactlist_temp) { int sal = integer.parseint(object.getsalary()); if (sal > progress) { contactlist.remove(object); } } customadapter.notifydatasetchanged(); contactlist.clear(); contactlist.addall(contactlist_temp); } attempt 2) public void onprogresschanged(seekbar seekbar, int progress, boolean fromuser) {

CSV file attachment gets not sending with email in Android -

i creating app generated .csv file.now sent file using email, mail received not getting file attachment.my code follows. please me getting wrong. i have tried link stackoverflow similar button export; file csvdirectory= new file(environment.getexternalstoragedirectory(),"csvfiles"); if(!csvdirectory.exists()) {`enter code here` csvdirectory.mkdirs(); } final file csv= new file(csvdirectory, "firstcsv.csv"); try{ if(!csv.exists()) { csv.createnewfile(); } path=csv.getpath(); export.setonclicklistener(new onclicklistener() { @override public void onclick(view v) { sendmail(); } }); public void sendmail() { file f= new file(path); u1=uri.fromfile(f); intent sendintent = new intent(intent.action_send); sendintent.putextra(intent.extra_su

mercurial - Detect is file is versioned -

for example have hg versioned project in path: c:\src\sample_project now, lets project have subfolders, , lets i'm editing file inside project c:\src\sample_project\docs\index.rst . having path of file c:\src\sample_project\docs\index.rst easiest , effective way check if file versioned hg, either using windows shell commands, hg.exe or tortoise (thg.exe)? what stated way, there cleaner 1 imo. can use: hg status -u lists unknown ( read: not tracked ) files in repository.

html - Issue with jQuery countdown timer -

i'm working timers when click button timer starts 5 seconds , fadesout when comes 0. tried couldnt , here fiddle i've tried: http://jsfiddle.net/gnrum/937/ <div id="hidemsg" style="display:none;"> box close in <span>5</span> seconds..</div> <input id="take" type="button" value="click me" > jquery code : $("#take").live("click", function () { $('#hidemsg').show(); var sec = $('#hidemsg span').text() var timer = setinterval(function () { $('#hidemsg span').text(--sec); if (sec == 0) { $('#hidemsg').fadeout('fast'); clearinterval(timer); } }, 1000); }); it's working first click, when click 2 time count starts 0,-1,-2,. not clear intervals. help? try re-initialize $('#hidemsg span') . $('#hidemsg span').text('5'); http://jsfiddl