Posts

unicode - Writing UTF16 file with std::fstream -

is possible imbue std::fstream std::string containing utf-8 encoding can streamed utf-16 file? i tried following using utf8-to-utf16 facet, result file still utf-8: std::fstream utf16_stream("test.txt", std::ios_base::trunc | std::ios_base::out); utf16_stream.imbue(std::locale(std::locale(), new codecvt_utf8_utf16<wchar_t, std::codecvt_mode(std::generate_header | std::little_endian)>); std::string utf8_string = "\x54\\xe2\x83\xac\x73\x74"; utf16_stream << utf8_string; references codecvt_utf8_utf16 facet seem indicate can used read , write utf-8 files, not utf-16 - correct, , if so, there simple way want do? file streams (by virtue of requirements of std::basic_filebuf §22.4.1.4.2[locale.codecvt.virtuals]/3 ) not support n:m character encoding conversions case utf8 internal / utf16 external. you'd have build utf-16 string, e.g. using wstring_convert , reinterpret sequence of bytes, , output using...

asp.net - How to fill the text box with value of a column of a GridView row -

Image
in grid have following columns <columns> <asp:templatefield headertext="select pay"> <itemtemplate> <asp:checkbox id="chkselect" runat="server" oncheckedchanged="chkselect_oncheckedchanged" autopostback="true" /> </itemtemplate> </asp:templatefield> <asp:boundfield datafield="reference" headertext="invoice" headerstyle-horizontalalign="center" itemstyle-horizontalalign="center"> </asp:boundfield> <asp:boundfield datafield="chargeddate" headertext="date of charge" headerstyle-horizontalalign="center" itemstyle-horizontalalign="center" dataformatstring="{0:mm-dd-yyyy}"> </asp:boundfield> <asp:boundfield datafield="amount" headertext="amount" headerstyle-...

UTF8 encoding without BOM - PowerShell -

i have bat file encode csv files. problem there 1 character @ begining of file once encoding have been done (bom byte guess). character bothers me cause after encoding, use file generate database. here line encoding (inside bat file): powershell -command "&{ param($path); (get-content $path) | out-file $path -encoding utf8 }" csvs\\pass.csv is there way encode file without bom (if problem)?? thanks! i found solution. change line this: powershell -command "&{ param($path); $utf8nobomencoding = new-object system.text.utf8encoding($false); $myfile = get-content $path; [system.io.file]::writealllines($path, $myfile, $utf8nobomencoding) }" csvs\\pass.csv

Ckeditor using and integration in node.js web page -

how integral ckeditor nodejs page? added ckeditor integration codes server.js file.but isnt work. this q offers solutions node.js (sails.js) wysiwyg editor - images @ least integrating http://sailsjs.org/ per q.

Android: change button color programmatically with defined drawable -

i have: public button[] getbuttons(int buttoncount, list<string> buttonheaders, context activity) { button[] result = new button[buttoncount]; (int = 0; < buttoncount; i++) { result[i] = new button(activity); result[i].setid(i); result[i].settext(buttonheaders.get(i)); result[i].setbackgroundresource(r.drawable.buttons_shape); result[i].setbackgroundcolor(randomcolor(activity)); result[i].settextcolor(activity.getresources().getcolor(r.color.white)); result[i].setwidth(360); result[i].setheight(100); } return result; } but in drawable is: <solid android:color="@color/white"/> <corners android:bottomrightradius="10dp" android:bottomleftradius="10dp" android:topleftradius="10dp" android:toprightradius="10dp"/> but define program color, because color random, , when change background retur...

java - what is difference between declaring variable out of main method and inside main method? -

when reading book java , saw 1 example written this. , wondering can declare variable in outside of main method ? difference between declaring variable outside , inside main method? " static" 's role in here ? please 1 explain me? new in java. public class printstuff { static int an_integer = 0; public static void main(string[] args) { int an_integer = 2; string[] some_strings = {"shoes", "suit", "tie" }; an_integer = an_integer - 1; some_strings[an_integer] = some_strings[an_integer] +"+++"; (int = 0; < some_strings.length; i++) system.out.println(some_strings[printstuff.an_integer]); } } best regards. 1) inside vs outside: if declare object inside method, visible in method. basically, if put brackets around it, it's visible/accessible within these brackets. if declare object outside method (inside class), dep...

sql - blank value istead in a mutiply subquery -

i have sql in sybase cumulative value of of quetity mulitiplied price gives blank values when want show real values. here code : select pmu.idval, pmu.idint, pmu.idnumecrppal, pmu.idsensope, pmu.dtecr, pmu.qteecr, pmu.prixacquis, (select sum(p1.qteecr) casimir.dbo.pmu p1 p1.idnumecrppal < pmu.idnumecrppal , p1.idint = pmu.idint) qcp, (select sum(p2.qteecr * p2.prixacquis) casimir.dbo.pmu p2 p2.idnumecrppal < pmu.idnumecrppal , p2.idint = pmu.idint) prup casimir.dbo.pmu pmu idint = 1733 order idnumecrppal here result: idval * idint * idnumecrppal * qteecr * prixacquis * qcp prup 650 1733 1074292 69 0.00 {null} {null} 650 1733 1165538 6 0.00 69 0.00 650 1733 1618644 7 0.00 75 0.00 650 1733 1934483 10 0.00 82 0.00 650 1733 1934484 ...