Posts

mysql - how to change the date format as it not the same with the database -

as coding show @ textbox 18/02/2012 (for example). in database 02/18/2012. txtreqdate.text = calendar.selectionstart.tostring("dd/mm/yyyy") cbotermcode.focus() calendar.visible = false but when want retrieve related data date using coding below : sqlcbo2 = "select distinct gear_code gear est_start_date='" & txtreqdate.text & "'" it invalid date. cannot change date format in database. if change code txtreqdate.text = calendar.selectionstart.tostring("dd/mm/yyyy") txtreqdate.text = calendar.selectionstart.toshortdatestring appear 02/18/2012 @ textbox data appear want 18/02/2012 appear @ textbox. you make use of str_to_date function parse data , transform date value. use (correct syntactical error): where should put it. example?? sqlcbo2 = "select distinct gear_code gear est_start_date=str_to_date('" & txtreqdate.text & "','%d/%m/%y')"

c# - Like button javascript loading -

i have website quotes(platon,aristotel etc..).all of quotes displayed on 1 site, pulled database.i have method automaticly creates button each of these quotes when web site gets loaded: system.web.ui.htmlcontrols.htmlcontainercontrol fbiframe = new system.web.ui.htmlcontrols.htmlgenericcontrol("iframe"); fbiframe.attributes["scrolling"] = "no"; fbiframe.attributes["frameborder"] = "0"; fbiframe.attributes["style"] = "border:none; overflow:hidden; width:250px; height:21px;"; fbiframe.attributes["allowtransparency"] = "true"; fbiframe.attributes["src"] = "//www.facebook.com/plugins/like.php?href=" + httputility.urlencode("http://www.example.com/like/" + quote[0]) + "&send=false&layout=button_count&width=250&show_faces=false&act...

asp.net mvc - RouteHandler for Static Content -

we want route static content (js, css, images - png, gif, jpeg, jpg) of our application routehandler. we'll best practices speeding web sites . adding etags, cache control, expires, etc our static content. how can that? you should in iis. but if want have total control on (can't find reason though!), can add catch route last route. like: routes.maproute( "static", "{*path}", new { controller = "home", action = "static"}); then add action control handle it: public actionresult static(string path) { //path after / //use server.mappath load //add headers response, etc return file(); } but bad in opinion. obvious thing taking path url , map server. happens if path /../../windows/... ? nothing, don't it.

c# - How to set property value using Expressions? -

this question has answer here: how set value property selector expression<func<t,tresult>> 5 answers given following method: public static void setpropertyvalue(object target, string propname, object value) { var propinfo = target.gettype().getproperty(propname, bindingflags.instance | bindingflags.public | bindingflags.nonpublic | bindingflags.declaredonly); if (propinfo == null) throw new argumentoutofrangeexception("propname", "property not found on target"); else propinfo.setvalue(target, value, null); } how go writing it's expression enabled equivalent without needing pass in parameter target? why instead of setting property directly can hear say. example suppose have following class property has public getter private setter: public class customer { public strin...

how to get correct position after filtering the Listview in android application -

in app, when user types in search box list gets filtered position of list items gets changed. , due changed position when user clicks on list item, results in unwanted activity. because have set events list items according position. there parameter of list items/row remains same after getting list filtered?

parsing - How to parse dhcpd.conf files with python and bicop? -

i want edit files (dhcpd.conf, dns files) python. looking option , found bicop library. try do: from bicop import parse parse("/home/tigov/dhcp/dhcpd.conf") and got: traceback (most recent call last): file "<stdin>", line 1, in <module> file "/usr/local/lib/python2.6/dist-packages/bicop/config.py", line 83, in parse return _parse(tokenizer, dictclass=dictclass) file "/usr/local/lib/python2.6/dist-packages/bicop/config.py", line 141, in _parse raise parseerror, (input.infile, input.lineno, "unexpected end of file") bicop.config.parseerror: none[1]: unexpected end of file any ideas have do, or "bicop how to"? or maybe library this? (iscpy library doesn't work me) , sorry, english weak. it looks examples bicop don't work. parse accepts string input. try this: from bicop import parse parse(open("/home/tigov/dhcp/dhcpd.conf").read())

Checksum field in PostgreSQL to content comparison -

i have field in table large content (text or binary data). if want know if text equals one, can use checksum compare 2 texts. can define field unique avoid repeated content too. my doubt if create checksum field, comparison speed up, postgresql (without need programmer intervention) or need manually? edit: better, create checksum text field, use checksum or 2 ways same thing? there no default "checksum" large columns in postgresql, have implement 1 yourself. reply comment hash indexes provide fast performance equality checks. , updated automatically. not integrated in postgresql (yet), use discouraged - read manual . and cannot query values , use them in application instance. checksum column, need add index performance if table big , maintain column. use trigger before insert or update that. so, hash index may or may not you. @a.h.'s idea fits problem ...