Posts

listview - Android PopupMenu opening on wrong positions -

i have listview each item has button opens popupmenu options. most of time, these menus open @ wrong positions (sometimes open on correct positions), these random opens not consistent. clicked on blue test3 clicked on blue test1 choosing option in menu manipulate correct item on position tried open menu my code: settings.setonclicklistener(new view.onclicklistener() { @override public void onclick(view v) { popupmenu popup = new popupmenu(context, settings); popup.getmenuinflater().inflate(r.menu.notes_menu, popup.getmenu()); popup.setonmenuitemclicklistener(new popupmenu.onmenuitemclicklistener() { public boolean onmenuitemclick(menuitem item) { string itemtitle = item.gettitle().tostring(); switch (itemtitle) { case "add pictures": //adding pictures case "delete...

apache - Rewrite API URL with .htaccess after removing .php -

i'm making little rest api in php i'm trying rewrite url .htaccess i'm trying rewrite url this localhost/api/object_attributes/1/1 to localhost/api/object/1/attributes/1 in .htaccess made condition remove .php second 1 not working. <ifmodule mod_rewrite.c> options +followsymlinks rewriteengine on rewriterule ^api/ api.php rewriterule ^api/object/1/attributes/1 /object_attributes/1/1 </ifmodule> i searched on web didn't find solution , no errors / redirections. that second rewrite rule working on not make sense in eyes. there no object found under path in http server. i assume looking 1 of following 2 approaches. 1 not getting clear description, term "i want rewrite ... ..." ambiguous. rewriteengine on rewriterule ^/?api/object/(\d+)/attributes/(\d+) /api.php?object=$1&attributes=$2 [end,qsa] rewriteengine on rewriterule ^/?api/object_attributes/(\d+)/(\d+) /api.php?object=$1&attributes=$2...

vba - Loop through columns names : For variable = A to Z -

is possible loop on column letters? for col = z column(col:col).select selection.copy next or oblige use function transform letters numbers? to convert formulas values: dim cols range, c string set cols = usedrange.columns each c in split("n q t") ' add rest of column letters cols(c).value = cols(c).value ' or .value2 if no dates or currencies in range next if every third column column n , approach can be: dim col range, long set col = usedrange.columns("n") = 1 17 ' repeat 17 times col.value = col.value set col = col.offset(, 3) next

Data sync from different SQL Server versions databases -

so have sql server 7.0 database must not upgraded, gets data read , written in it, , created sql server 2008 r2 database same structure, want synchronize data between both, whatever addition, deletion or modification happens on ss7.0 happens in ss2008 r2, , vice versa, there way so? i'm not asking ready answer, want trail follow, tips , such, far managed export copy of data bcp, can't each time in advance.

freetype2 - Setting Character Size in FreeType -

i'm bit confused setting character width , height fields of character size object ( example described in freetype tutorial ) error = ft_set_char_size( face, /* handle face object */ 0, /* char_width in 1/64th of points */ 16*64, /* char_height in 1/64th of points */ 300, /* horizontal device resolution */ 300 ); /* vertical device resolution */ why char_width , char_height specified? shouldn't depend on actual glyph? example characters "w" , "l" have different widths , height. also, not rendering screen (i plan use raster font data other esoteric purpose) sufficient use ft_set_pixel_sizes instead?

Why can't I pipe a password into mysql non-interactively? -

i want run mysql client, giving password non-interactively. the standard solution this mysql -u root -e "foo" -p < password_file but situation this produce_password | mysql -u root -p here, mysql prompts password, though data being piped in. (yes, produce_password emitting data; echo foo | mysql behaves same way.) the internet seems think above should work, fact doesn't. workaround be produce_password > password_file mysql -u root -p < password_file rm password_file but let's don't want (e.g. policy demands password never written disk) how can make mysql take password input process without prompting, file? i don't know how explain this, when pipe something, stdout of first program forwarded stdin of second program. somehow confuse this, command line or whatever. can pipe mysql, of course, whatever pipe handled after you've authenticated yourself. the solution mysql -u root -p$(produce_password) this generate...

python - Converting MultiDict to proper JSON -

the multidict (immutablemultidict) receive posting form using flask (python) is immutablemultidict([ ('disabled', 'false'), ('disabled', 'false'), ('debet', '11'), ('debet', '21'), ('date', '2016-11-17'), ('kredit', '12'), ('kredit', '22'), ('record', '1901'), ('record', '1902'), ('description', 'sales of inventory') ]) the form post looks like <form method="post" action="/post"> <input name="description" value="sales of inventory" /> <input name="date" value="2016-11-17" /> <div class="group"> <input name="record" value="1901" /> <input name="debet" value="11" /> <input name="kredit...