Posts

android - ChildFragmentManager + ViewPager + Animation = not good -

Image
my app build on many fagments , change fragments horizontal slide animation. fragments contain viewpager fragmentstatepageradapter. in process of restoring fragments backstack see black page of adapter. looks childfragmentmanager in fragmentstatepageradapter destroed soon. how fix that? it 's simple done setoffscreenpagelimit(numberoffragment want retain).

python - Pandas groupby: compute (relative) sizes and save in original dataframe -

Image
my database structure such have units, belong several groups , have different variables (i focus on one, x, question). have year-based records. database looks like unitid, groupid, year, x 0 1 1, 1990, 5 1 2 1, 1990, 2 2 2 1, 1991, 3 3 3 2, 1990, 10 etc. measure "intensity" variable, going number of units per group , year, , put database. so far, doing asd = df.drop_duplicates(cols=['unitid', 'year']) groups = asd.groupby(['year', 'groupid']) intensity = groups.size() and intensity looks like year groupid 1961 2000 4 2030 3 2040 1 2221 1 2300 2 however, don't know how put them old dataframe. can access them through intensity[0] , intensity.loc() gives locindexer not callable error. secondly, nice if scale intensity. instead of "units per group-year", "units per group-year, scaled average/max units...

javascript - include socket.io server into my html -

i have run nodeserver , client sucessfully. want connect server proxy. here node client: <html> <head> <script src="http://localhost:8000/socket.io/socket.io.js"></script> <script src="http://code.jquery.com/jquery-1.6.2.min.js"></script> <script> var name = ''; var socket = io.connect('http://localhost:8000'); // @ document read (runs ones). $(document).ready(function(){ // on click of button (jquery thing) // things inside clause happen when // button clicked. $("button").click(function(){ // simple logging $("p#log").html('sent message: ' + $("input#msg").val()); // send message on inputbox server socket.emit('chat', $("input#msg").val() ); // server recieve message, // maybe processing, // broadcast again...

ios - Read and Write the MetaData contents as a File in Documents Directory -

nsarray *paths = nssearchpathfordirectoriesindomains(nsdocumentdirectory, nsuserdomainmask, yes); nsstring *documentsdirectory = [paths objectatindex:0]; nsstring* arraytext = [metadataarray componentsjoinedbystring: @"\n"]; nsstring *path = [documentsdirectory stringbyappendingpathcomponent:@"employeedata.txt"]; [arraytext writetofile:path atomically:yes]; metadata array first object : {filesize:"9385033" labels:{viewed,starred,restricted,trashed,hidden} originalfilename:"chamak challo - ra.one (2011) [mp3-320kbps-cbr].mp3" mimetype:"audio/mpeg" title:"chamak challo - ra.one (2011) [mp3-320kbps-cbr].mp3" parents:[1] md5checksum:"51d598c750102dd4bca09addf4d8212d" quotabytesused:"9385033" lastmodifyingusername:"shadow.hibrise" copyable?:1 headrevisionid?:"0b7v4x9xjauwjr3dzm1fqwlpheefozgyyyzr2nudtlzhmb2fnpq" kind:"drive#file" writerscanshar...

How to run Multiple Process in C# -

seniors, beginner , new in c# after php. my question how execute multiple function same time in c# e.g class void main() { call functiona(argument) call functionb(argument) call functionc(argument) // these function should start @ same time } my first function public void functiona(argument) { richtextbox1.appendtext(starttime); } my second function public void functionb(argument) { richtextbox1.appendtext(starttime); } my third function public void functionc(argument) { richtextbox1.appendtext(starttime); } your / guideline save time. the easiest option use task class. msdn nails it, copying (with minor edits) relevant bit here action action1 = () => { // code here }; action action2 = () => { // code here }; task t1 = new task(action1); task t2 = new task(action2); t1.start(); t2.start();

javascript - Is it possible to get all elements which have a specific value into any type of attribute? -

i want elements in html dom, have attribute specific value. for example - <ul style="width:150px;" id="radiobutton1"> <li style="width:150px;"><input type="radio" name="radiobutton1"><label>option 1</label></li> <li style="width:150px;"><input type="radio" name="radiobutton1"><label>option 2</label></li> <li style="width:150px;"><input type="radio" name="radiobutton1"><label>option 3</label> </li> </ul> i want elements contains "radiobutton1" in attribute. means want select ul , 3 radiobuttons . note: above html used ul-li structure, real scenario it's different. please don't give answer in favor of ul-li . want global solution. there selector exist select type of attribute? is possible select elements in approach? bunch of i...

android - MultiAutoCompleteTextView custom adapter with custom object instead of String Object -

this code working fine want when pass arraylist<string> adapter. when add object adapter, in multiautocompletetextview set object full name instead of object full name. want first_name jgetdata object. public class myautocomplete extends multiautocompletetextview implements onitemclicklistener { private final string tag = "chipsmultiautocompletetextview"; private handler mhandler = new handler() { public void handlemessage(message paramanonymousmessage) { if (paramanonymousmessage.what == 0) { mhandler.removemessages(0); string str = gettext().tostring().trim(); log.e("handler", "yes"); if (str.length() >= 2) { if(gettext().tostring().contains(",")) // check comman in string { string chips[] = gettext().tostring().trim().split(","); ...