Posts

android - Force app to read from layout-ar -

i asking if there way force android application read arabic layout folders , arabic values folder whatever device language ? you can force different locale this: protected static void setlocale(final context ctx, final string lang) { final locale loc = new locale(lang); locale.setdefault(loc); final configuration cfg = new configuration(); cfg.locale = loc; ctx.getresources().updateconfiguration(cfg, null); } in case, use so setlocale(getapplicationcontext(), "ar") this take values "ar" folders (drawables-ar, values-ar, layout-ar, ...)

gcc - How to statically build ffmpeg with librtmp without root on centos 7? -

i forked stvs's batch build script here . added lines rtmp ? why it's not working , error got *** building ffmpeg *** error: librtmp not found if check config.log file gcc -d_isoc99_source -d_file_offset_bits=64 -d_largefile_source -d_posix_c_source=200112 -d_xopen_source=600 -i/usr/tmp/tmp/ffmpeg-static-test/target/include -i/usr/tmp/tmp/ffmpeg-static-test/target/include -static --static -std=c99 -fomit-frame-pointer -pthread -i/usr/tmp/tmp/ffmpeg-static-test/target/include/opus -i/usr/tmp/tmp/ffmpeg-static-test/target/include -wl,-z,relro -l/usr/tmp/tmp/ffmpeg-static-test/target/lib -c -o /var/tmp/ffconf.ciizes8o.o /var/tmp/ffconf.bbyd2amo.c gcc -l/usr/tmp/tmp/ffmpeg-static-test/target/lib -lm -l/usr/tmp/tmp/ffmpeg-static-test/target/lib -lm -static -wl,--as-needed -i/usr/tmp/tmp/ffmpeg-static-test/target/include -wl,-z,relro -l/usr/tmp/tmp/ffmpeg-static-test/target/lib -o /var/tmp/ffconf.govexkqq /var/tmp/ffconf.ciizes8o.o -lrtmp -lssl -lcrypto -ldl -lz -l/usr/tmp/...

Django form with label directly in the Field, but disappear on typing -

i achieve same effect google login page label of text field shown in field itself. when characters typed in filed, label automatically disappeared. i know how achieve similar effect html + java script, like: <input type="text" name="" id="" value="email" class="gray" onclick="if(this.value=='email') {this.value='';this.classname='black'}" onblur="if(this.value=='') {this.value='email';this.classname='gray'}" /> but django form same effect? know can specify initial in charfield, won't disappear on typing. forms.charfield(max_length=100, label=_("email"), initial='xxx') there html5 prop called placeholdertext. here blogpost how use django forms. django html5 input placeholders excerpt: class myform(form): name = forms.charfield(widget=forms.textinput({ "placeholder": "joe recruiter" })) ...

c - WinUSB Bulk IN transfer fails on transfer size greater than maximum packet size -

i using winusb on windows host side communicate winusb usb device. usb device full speed device. able device handle , out , in data transfers. i facing issue bulk in transfer on fs winusb device. when loop of data pc device , pc, sizes 1 64 working fine. when transfer 65 bytes, first 64 bytes able read in pc. last byte missing. can facing same kind of issue or can suggest solution? regards, nisheedh first should read out maximum_transfer_size . sending, winusb "divides buffer appropriately sized chunks, if necessary" ( source ). also check remarks of winusb_readpipe : if data returned device greater maximum transfer length, winusb divides request smaller requests of maximum transfer length , submits them serially . if transfer length not multiple of endpoint's maximum packet size (retrievable through winusb_pipe_information structure's maximumpacketsize member), winusb increases size of transfer next multiple of maximumpacketsize...

html - How to vertically align radio buttons with text on the same line? -

i wrote html below display 2 radio buttons , text. <input id="radio1" type="radio" checked="checked"/>create application name <br/> <input id="radio2" type="radio"/> create source name my issue radio buttons , text not aligning properly. radio buttons displaying little bit below text. how align radio buttons , text on same line proper alignment? demo vertical-align: middle: aligns vertical midpoint of box baseline of parent box plus half x-height of parent. the problem seems caused fact browsers commonly add random uneven margins radio buttons , checkboxes. use inline style, weird true: <input type="radio" style="vertical-align: middle; margin: 0px;"> label <br/> <br/> <input type="radio" style="vertical-align: middle; margin: 0px;"> label <br/> <br/> <input type="radi...

android - Updating fragment view after AsyncTask finishes returns nullPointerException -

i developing app uses 3 fragments, (which actual pages). 1 fragment used listener, , on 2 others data being downloaded, , set textviews. working fine, until thought cool if fragment view update/refresh after async finished. problem throws me nullpointer exceptions, every time try updating fragment. btw. think might taking wrong approach type of fragments management, working, , want small cool feature, thought maybe don't need rewrite whole program. so mine mainactivity.java public class mainactivity extends fragmentactivity { //some uninportant initalizations @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); // create adapter return fragment each of 3 // primary sections of app. msectionspageradapter = new sectionspageradapter( getsupportfragmentmanager()); // set viewpager sections adapter. mviewpager = (viewpager) findviewbyid(r.id.page...

quartus - Error (10170): Verilog HDL syntax error at filename near text "input"; expecting ";" -

working 2014 version of quartus ii software (web edition), receive error 10170 when compiling following code: module shifter16 (a, h_sel, h) input [15:0]a; input h_sel; output [15:0]h; reg [15:0] h; @ (a or h_sel) begin if (h_sel) h={a[14:0],1'b0}; else h={a[15],a[15:1]}; end endmodule error received: error (10170): verilog hdl syntax error @ shifter16.v(2) near text "input"; expecting ";" you need semicolon @ end of first line: module shifter16 (a, h_sel, h);