Posts

Showing posts from March, 2012

How to copy a text from java code in cygwin? -

i need value of selected item , copy java application in cygwin. my problem don't know how copy text java application in cygwin. this portion of code: private void jcombobox1actionperformed(java.awt.event.actionevent evt) { string cmmd = "moshell"+jcombobox1.getselecteditem() /*i need here :how write text (cmmd) in cygwin?*/ } i'm debutant in programming. can me resolve problem. thank you. if understand question, same way write text console, // need here :how write text (cmmd) in cygwin? string cmmd = "moshell"+jcombobox1.getselecteditem(); system.out.println(cmmd);

ios - Array of NSLocalizedStrings in Swift -

i attempting convert code swift stumbling code add nslocalizedstring s array property. defined array array of string s. i'm attempting add objects using += documentation states, receiving error could not find overload '+=' accepts supplied arguments . i'm sure it's simple mistake, i've tried few different combinations (appending as string[] end, or after var name, or appending = [] declaration, etc) , cannot work. appreciate explanation of what's going on. //property: var localizedtitles: string[] //in init: localizedtitles += [nslocalizedstring("my string", tablename: nil, bundle: nil, value: "my string", comment: "")] i see 3 problems / comments: for reason bundle parameter nslocalizedstring not optional. have provide actual bundle. you must initialize array before trying append it. you can define array array of strings since nslocalizedstring returns. try (i added newlines make more readable in fo

php - Install WordPress blog along with laravel website -

i have website written laravel php framework on apache server , want start blog along website. in laravel moved files of 'public' folder root folder visitors see site when visit root address ( e.g. example.com , not example.com/public ) now every url of site controlling laravel routes , can't setup , use wordpress blog. want put blog in example.com/blog address. create blog folder on public directory . unzip wordprees installer in blog folder . if hit url example.com/blog can see wordpress installer . configure blog.

www.localhost.com/magento and Index of /magento page shows up -

i trying install magento. actually, beginner of magento beginner of stackoverflow too. i following guide book.. , downloaded magento sample file.. , unzipped file @ c:/xampp/htdocs/magento also modified host file.. whenever trying enter www.localhost.com/magento index of magento page shows up.like ftp server. how can open m g e n t o file guide book.. i not use xammp don't know how it's directory structure looks like, but: looks installing magento in subdirectory, right? if so, have edit .htaccess. change redirectbase name of subdirectory. here should /magento/ , if redirectbase line in .htaccess commented out delete # @ beginning of line.

objective c - OpenGL ES drawing with and without CCRenderTexture -

i know can draw opengl graphics ccrendertexture: ccrendertexture *rt = [ccrendertexture rendertexturewithwidth:texturewidth height:textureheight]; [rt beginwithclear:1, 1, 1, 1]; // opengl drawing ...... ccglenablevertexattribs(kccvertexattribflag_position | kccvertexattribflag_color); glvertexattribpointer(kccvertexattrib_position, 2, gl_float, gl_false, 0, vertices); glvertexattribpointer(kccvertexattrib_color, 4, gl_float, gl_false, 0, colors); glblendfunc(cc_blend_src, cc_blend_dst); gldrawarrays(gl_triangle_strip, 0, (glsizei)nvertices); [rt end]; without ccrendertexture, seems ok, too: // opengl drawing ...... ccglenablevertexattribs(kccvertexattribflag_position | kccvertexattribflag_color); glvertexattribpointer(kccvertexattrib_position, 2, gl_float, gl_false, 0, vertices); glvertexattribpointer(kccvertexattrib_color, 4, gl_float, gl_false, 0, colors); glblendfunc(cc_blend_src, cc_blend_dst); gldrawarrays(gl_triangle_strip, 0, (glsizei)nvertices); what difference o

intel x86 assembly code compile on windows platform -

i have written following sample code x86 processor. working fine o2 compiler option in visual studio withouto2 option not working, please let me know if there issue here. sample code reference. .386 .model flat,c _text segment align 4 public hs_l_mls_1 l_mls_1 proc push ebp mov ebp, esp push ebx push esi push edi mov eax, dword ptr[ebp+8] ; load lv stack movsx edx, word ptr[ebp+12] ; load v stack imul edx shrd eax, edx, 15 xor edx, edx pop edi pop esi pop ebx mov esp, ebp pop ebp ret l_mls_1 endp _text ends end thanks ajith

java - Reading URIs with spaces in Turtle using Jena? -

i'm trying read rdf turtle file (shown below), i'm having 2 problems. first, there problem whitespace in rdf or turtle? somtimes, have problem reading uris l ike <i/o performance> . problem disappears when remove spaces, giving <ioperformance> . in file below, have problem <standard(m1) - small(default)> . here code loading file , listing subject, predicate, , object of each triple. stmtiterator iter = model.liststatements(); while (iter.hasnext()) { statement stmt = iter.nextstatement(); resource subject = stmt.getsubject(); // sujeito property predicate = stmt.getpredicate(); // predicado rdfnode object = stmt.getobject(); // objeto system.out.println((subject.getlocalname()); system.out.println((predicate.getlocalname().tostring()); system.out.println(stringutils.substringbetween(object.tostring(),"", "^")); } @prefix dc: <http://purl.org/dc/eleme

mysql - Displaying N - parent N - Child menu Django -

here stucked piece of code let me explain want display items this chocolate hot chocolate white chocolate salted caramel hot chocolate peppermint hot chocolate espresso beverage caffe americano caffe latte caffe moche cappuccino frappuccino b c d here using django view , template displaying in mysql table have inserted these records 4 column 1.id 2.name 3.slug 4.parent in display above eg chocolate id 1 , parent 0 hot chocolate id 2 , parent 1 white chocolate id 3 , parent 1 salted caramel hot chocolate id 4 , parent 3 espresso beverage id 6 , parent 0 hope understood my html code {% cat in user %} {% if cat.parent = 0%} <ul id="listmenu" style="list-style-type:none; margin-left:-50"> <li class="listparent"><p style="font-size:15px;"><a href="#" style="text-

mysql - creating entry into ladp directory using python -

i trying create entry ldap using python gives me error {'info': 'no global superior knowledge', 'desc': 'server unwilling perform'} following code this import ldap import ldap.modlist modlist fname="dayanand" lname="dayanand" username="dayanand" employee_num='102' domain="gmail.com" base_dn="xyz" l = ldap.initialize("ldap://localhost") l.simple_bind_s("cn=admin,dc=somnath,dc=zankar,dc=org","zankar") user_dn = "cn=admin,dc=somnath,dc=org" user_attrs = {} #user_attrs['objectclass'] = \ # ['top', 'person', 'organizationalperson', 'user'] user_attrs['cn'] = fname + ' ' + lname #user_attrs['userprincipalname'] = username + '@' + domain #user_attrs['samaccountname'] = username user_attrs['givenname'] = fname user_attrs['sn'] = lname user_attrs['displa

castle windsor - How to register an interface for interceptions -

i want register interface like: iinterceptingaware , classes implement interface interceptor class used. public class interceptorclass : iinterceptor { public void intercept(iinvocation invocation) { // work } } public class foo : iinterceptingaware { } public class bar : iinterceptingaware { } how setup castle windsor this? using (var container = new windsorcontainer()) { container.register( component.for<myinterceptorclass>(), classes.fromthisassembly() .basedon<iinterceptingaware>() .withservicedefaultinterfaces() .configurefor<iinterceptingaware>(c => c.interceptors<myinterceptorclass>()) ); var foo = container.resolve<foo>(); foo.test(); var bar = container.resolve<ibar>(); bar.test(); } console.readline(); keep in mind interceptor requires @ least virtual methods on target class, better target class should implement interface in or

Google bot crawling on AngularJS site with HTML5 Mode routes -

we have angularjs site using html5 routes. did test "fetch google" runs. results bit confusing: on fetching tab, see our site looks on view source, front end bindings {{ }}, , not html rendered on rendering tab, our site looks fine, no {{ }} variables, seems google bot fetched , rendered site fine, maybe in line this, http://googlewebmastercentral.blogspot.ae/2014/05/rendering-pages-with-fetch-as-google.html . however, prepared google not able crawl our site, have added , google bot revisits our page “?_escaped_fragment_=". followed this, https://developers.google.com/webmasters/ajax-crawling/docs/getting-started (section "3. handle pages without hash fragments"). in our nginx config have this: if ($args ~ "_escaped_fragment_=") { serve static html snapshots } , , indeed works fine, if pass _escaped_fragment_= ourselves. however, google bot never tried crawl our site param, never crawled snapshot. missing something? should add a

c# - Is there any subtle difference between inline initializing a list with or without '()'? -

e.g. there technical difference between invoking: list<string> list = new list<t> () { "one", "two", "tree" }; // () and list<string> list = new list<t> { "one", "two", "tree" }; // without () ? the result same. interested if there technical difference in way of invocation or convenience .net c# shortcut. there no difference. parenthesis not required when using collection initializer default constructor. however, if want use constructor cannot omit parenthesis. some code refactoring tools resharper indicate showing parenthesis redundant. collection initializers not limited "built-in" .net types. type implementing ienumerable , providing suitable add method can use collection initializer.

python - centering text using .format the right way? -

i want this: ============================= thread: 1 starting ============================== the way achieve .format method found is: print("{:=^79}".format(' thread: ' + self.thread_id + ' starting ')) is there better way this? since bit hard read , kinda goes against whole .format principle of having string on left , values on right. as @felix lahmer has pointed out, can use center : >>> ' thread: {} starting '.format(42).center(79, '=') '============================= thread: 42 starting =============================' or nest format . >>> '{:=^79}'.format(' thread: {} starting '.format(42)) '============================= thread: 42 starting ============================='

javascript - Display text after empty RSS feed -

i new php , hoping can help. have been able rss feed , running pulling different code on internet. trying achieve is, if rss feed empty, display message "there no current warnings" if there items in rss feed, display item, along div below set hidden. <!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" dir="ltr" lang="en"> <head> <title>weather warnings queensland - issued bureau of meteorology</title></head> <link type="text/css" href="rss-style.css" rel="stylesheet"> </head> <script type="text/javascript"> window.setinterval (blinkit, 500); var color = "#0000ff"; function blinkit () { var blink = document.getelementbyid ("blink"); color = (col

ruby on rails 3.1 - PostgreSQL -must appear in the GROUP BY clause or be used in an aggregate function -

i getting error in pg production mode, working fine in sqlite3 development mode. activerecord::statementinvalid in managementcontroller#index pg::error: error: column "estates.id" must appear in group clause or used in aggregate function line 1: select "estates".* "estates" "estates"."mgmt" = ... ^ : select "estates".* "estates" "estates"."mgmt" = 'mazzey' group user_id @myestate = estate.where(:mgmt => current_user.company).group(:user_id).all if user_id primary key need upgrade postgresql; newer versions correctly handle grouping primary key. if user_id neither unique nor primary key 'estates' relation in question, query doesn't make sense, since postgresql has no way know which value return each column of estates multiple rows share same user_id . must use aggregate function expresses want, min , max , avg , string_agg , array_a

html - Use anchors and :target for navigation. How to show first layer by default -

i'm trying use anchors , css navigation. if user clicked on menu link, anchor target section should displayed, others should hidden. here layout i'm using: <nav> <ul> <li><a href="#page1">page #1</a></li> <li><a href="#page2">page #2</a></li> <li><a href="#page3">page #3</a></li> </ul> </nav> <div> <section id="page1"> <h2>page #1</h2> </section> <section id="page2"> <h2>page #2</h2> </section> <section id="page3"> <h2>page #3</h2> </section> </div> here css i'm using: section:not(:target) { display: none; } section:target { display: block; } everything works perfect, how show first pa

postgresql 9.3 - Multiple seq scans on the same filters -

i wanted ask why execution of simple query optimizer decide execute seq scan twice using same filter appending results @ end? select count(*) customers c ((name not null) , (flag = 4) , (birth_date < now())); postgresql version 9.3.4 output of explain analyze: aggregate (cost=4444780.90..4444780.91 rows=1 width=0) (actual time=50654.137..50654.137 rows=1 loops=1) -> append (cost=0.00..4444776.28 rows=1847 width=0) (actual time=50654.128..50654.128 rows=0 loops=1) -> seq scan on customers c (cost=0.00..4439681.76 rows=1845 width=0) (actual time=50614.774..50614.774 rows=0 loops=1) filter: ((name not null) , (flag = 4) , (birth_date < now())) -> seq scan on customers c (cost=0.00..5094.52 rows=2 width=0) (actual time=39.349..39.349 rows=0 loops=1) filter: ((name not null) , (flag = 4) , (birth_date < now())) total runtime: 50654.245 ms borys, better write postgresl mailinglist: pgsql-general@p

c# - Asp Net Gridview sort disapears when row edit -

when click on line update gridview sort of disappears , returns initial state. can be? below transcribe code: private string getsortdirection(string column) { // default, set sort direction ascending. string sortdirection = "asc"; // retrieve last column sorted. string sortexpression = viewstate["sortexpression"] string; if (sortexpression != null) { // check if same column being sorted. // otherwise, default value can returned. if (sortexpression == column) { string lastdirection = viewstate["sortdirection"] string; if ((lastdirection != null) && (lastdirection == "asc")) { sortdirection = "desc"; } } } // save new values in viewstate. viewstate["sortdirection"] = sortdirection; vi

Working with multiple Large Files in Python -

i have around 60 files each contains around 900000 lines each line 17 tab separated float numbers. per each line need calculation using corresponding lines 60 files, because of huge sizes (each file size 400 mb) , limited computation resources, takes long time. know there solution fast? it depends on how process them. if have enough memory can read files first , change them python data structures. can calculations. if files don't fit memory easiest way use distributed computing mechanism (hadoop or other lighter alternatives). another smaller improvements use fadvice linux function call how using file (sequential reading or random access), tells operating system how optimize file access. if calculations fit common libraries numpy numexpr has lot of optimizations can use them (this can if computations use not-optimized algorithms process them).

facebook - How to get the fb and g+ email programmatically in ios? -

i have integrated fb , g+ login ios app. , if phone sign in fb automatically log in when click fb button. want send email of user in fb , g+ server separately. can tell me how can email fb , g+ both. thank you you won't user data (profile, birthday, email, etc.) without requesting specific permission user. it's matter of following sdk guide really. you can request user's information making me request. , can in 2 ways: using fbrequestconnection startwithgraphpath:completionhandler: method, did in requesting permissions section, , setting path me. using fbrequestconnection startformewithcompletionhandler: method, make me request directly. https://developers.facebook.com/docs/ios/graph it's hard stuff need go through developer. following how others did code you. reading through sdk guide make understand better.

c# - Accessing container properties from child list -

i have container class called paymentplan, holds basic payment summary info. holds list of expectedpayments. basic oop type question, brain appears have gone sleep - have property in expectedpayment class needs interrogate property on paymentplan class determine result. i'm storing reference paymentplan property on expectedpayment class, however, has public getter, , following ddd, feel bit of code smell. there better way achieve want? i've removed necessary bits example: public class paymentplan { private readonly list<expectedpayment> _payments; public paymentplan(list<expectedpayment> payments) { ... other stuff //todo: fix smell _payments = payments; _payments.foreach(p => p.plan = this); } ... other properties } and expectedpayment class: public class expectedpayment { public expectedpayment(... args removed example) { } //todo: attempting avoid public setter have no con

eclipse - DLL Call From Java Returns an UnsatisfiedLinkError -

edit: problem solved i created new project , imported source files. (after trying many options project configuration wrong.) seems had confused load , loadlibrary functions. load requires absolute path including file postfix, e.g.: static { system.load("c:/windows/system32/jnpout32.dll");} when trying call jnpout32.dll ( http://www.hytherion.com/beattidp/comput/pport.htm ) java in eclipse (windows 7, java se1.7) receive error: exception in thread "main" java.lang.unsatisfiedlinkerror: eegtrigger.ioport.out32(ss)v @ eegtrigger.ioport.out32(native method) @ eegtrigger.pport.setalldatabits(pport.java:53) @ eegtrigger.pport.<init>(pport.java:19) @ eegtrigger.eegtrigger.main(eegtrigger.java:11) the dll file located in system32, in src folder, , in c:\users[user]\appdata\local (as indicated system.getenv()) in classpath under user entries, file loaded jnpout32.dll - \[project]\src\[project]\ and visible under referenced libraries in package expl

javascript - XSLT transformation using browser -

i need transform xml data html using xslt transformation. have predefined xslt files work in ie10, not in chrome or firefox. firefox doesn't work @ all. chrome there xslt files work fine same xml data, , there others doesn't work. need know whether there limitations/specification xslt files cross browser xslt files. example have 2 xslt files 1. whole content in <xsl:template match='/'> tag (works chrome) 2. whole content in different tags, of them <xsl:variable> tags, others <xsl:template> (doesn't work chrome) here do //load xsl , xml files paths , make transformation loadxmlfile(xslpath, function (loadedxsl) { loadxmlfile(xmlpath, function (loadedxml) { var output = transformxml(loadedxml, loadedxsl, null); }, function (errmsg) { alert(errmsg); }); }, function (errmsg) { alert(errmsg); });

css - bootstrap tab-pane not growing -

Image
i'm trying create panel 3 tabs. each tab this: <div class="tab-pane alert alert-info" id="step-by-step"> <form data-toggle="validator" role="form" id="add_bike"> <div class="form-group col-xs-12 col-sm-12 col-md-8 col-lg-6"> <label for="year">year</label> i have strange problem, if add "col-xs-12 col-sm-12 col-md-8 col-lg-6" classes panel background won't match form height, http://jsfiddle.net/yxunr/8/ while it's fine if remove responsive classes http://jsfiddle.net/9p3s9/1/ i've checked html , apparently it's good, wouldn't force min-height on these panels, have idea how fix this? (i've tried assign background , removing alert alert-info tab-pane, won't grow anyway. for reason adding <div class="row"></div> after form fixes this http://jsfiddle.net/yxunr/20/

javascript - Google Maps nor clickable neither pannable on Magento Homapage -

i have put google maps on magento website. google maps appears on homepage, , markers displayed. problem map nor clickable neither pannable. cannot click , cannot pan. on property listing page, clickable, , pannable, without problem. link home page (where doesn't work): http://spacedookie.com/ link listing page (where works well): http://spacedookie.com/index.php/villa-1050.html i don't know why showing on listing page. don't want there. want achieve show map , properties listing on homepage, there not clickable. please me solve problem. update : gerard de visser. can pan map, marker not clickable. i renamed div element id "map_canvas" "map_canvas_listings" , removed other javascript codes google maps, implemented someone-else on client's website, , problem solved. duplicate codes conflicting. problem is, when click marker, info window doesn't appear. have implemented same google maps on local host , info window appears without issue

java - What code should i use to make the font-size adjust to the size of any device, in eclipse using Libgdx? -

as title says have small problem fot-size in eclipse. created font using "bmfont", , implemented in game, when tested on smaller device way big, there code can use make adjust automatically. im using libgdx ,any appreciated. my code @override public void show() { stage = new stage(); gdx.input.setinputprocessor(stage); atlas = new textureatlas("ui/button.pack"); skin = new skin(atlas); table = new table(skin); table.setbounds(0, 0, gdx.graphics.getwidth(), gdx.graphics.getheight()); white = new bitmapfont(gdx.files.internal("font/white.fnt"), false); black = new bitmapfont(gdx.files.internal("font/black.fnt"), false); //maakt buttons textbuttonstyle textbuttonstyle = new textbuttonstyle(); textbuttonstyle.up = skin.getdrawable("button.up"); textbuttonstyle.down = skin.getdrawable("button.down"); textbuttonstyle.pressedoffsetx = 1; textbuttonstyle.pressedoffset

phpunit - Mismatch when converting unix timestamp to date -

i have database (in csv) unix timestamps. try convert them in libreoffice calc human readable date. ok... except one-day-lag. for example, timestamp -518144400 (in e2 cell). function : =e2/86400+dateval("1/1/1970"). obtain 19572,9583333333 correspond 1953-07-31. on-line calculator confirm result. what problem ? right answer 1953-08-01. first, thought timestamps contained mistake. but, in this php calendar , if paste -518144400 parameter in url, works. on-line calendar associate timestamp (what think is) right answer. i don't understand happens. missed ? 1 solution adding +1 in function correct. i'm not satisfied, i'd understand... it depends on conversion time zone, mean -518144400 (timestamp) equal 1953-07-31 in gmt while 1953-08-01 in other time zone time relative gtm +1 or more .

python - how to pass command line argument in fabric -

i new in fabric. trying pass 2 command after function of fabfile.py trying that fab fabfile.py taska /idep/etl/config.xml , lbs here taska function. but not working. throws error "no such file or directory: 'taska'". how can pass arguments? i'm trying forwarding port remote machine. this documented here . after setup task take arguments, akin this: fab taska:'/idep/etl/config.xml,lbs' note : if using fabfile named fabfile.py fab command assumes this, , not need specification (which did w/o using -f flag) also note : can specify hosts act on, via cli, -h --hosts flags to better handle on these sorts of things should go through tutorial .

playframework - Calling Akka actor from Play controller -

i have been playing distributed worker pattern , i'm running issue pushing work web request. the example project has frontend: val mediator = distributedpubsubextension(context.system).mediator def receive = { case work => log.info("frontend received: " + work.tostring()) implicit val timeout = timeout(5.seconds) (mediator ? send("/user/master/active", work, localaffinity = false)) map { case master.ack(_) => ok } recover { case _ => notok } pipeto sender } and workproducer: override def prestart(): unit = scheduler.scheduleonce(5.seconds, self, tick) def receive = { case tick => n += 1 log.info("produced work: {}", n) val work = work(nextworkid(), n) frontend ! work context.become(waitaccepted(work), discardold = false) } this works fine, when send directly frontend play framework controller: def multiply(num: long) = action { implicit r

javascript - Local Storage turns wrong or null value -

i'm trying set value in local storage. this: if (localstorage) { var event = localstorage.getitem("event"); if (event != "undefined" || event != "null") { console.log(event) } else { localstorage.setitem("event", "event name"); console.log('test'); } } i can't save value in local storage first time. it's not returns in else condition. returns null exist check condition. can help? if doesn't exist, null returned, not string "null" , change to: if (event != null) { console.log(event) } else { localstorage.setitem("event", "event name"); console.log('test'); } from w3 docs : the getitem(key) method must return current value associated given key. if given key not exist in list associated object method must return null.

string combine and split algorithm -

i using redis storing data, datas combinated sequences of values, sequece combined separator : , several string values, example: value1:value2:value3 the problem values may contain : in them, first thought escaping : :: in values, , combine them, , can split them solo : . but not perfect, because {'abc', 'aaa:', 'bbb'} escaped {'abc', 'aaa::', 'bbb'} , combined abc:aaa:::bbb , it's unresolveable. stupid question, i'm stuck, how solve problem, or better suggestion ? i instead suggest enclosing values while inserting using special identifier towards beginning , end of string each , combining them. e.g : {'%abc%', '%aaa:%', '%bbb%'} so whenever want split them again can split them using separator , replace prepended , appended value per convention original string. hope helps!

android - Why image is not displayed into list view? -

this code image not displayed list view how can solve problem?i set uri value bitmap.so problem?changed array , error solved bt still image not displayed list view. mainactivity.java public class mainactivity extends activity { listview lv; context context; arraylist prgmname; bitmap bitmap; //bitmap=getbitmapfromurl("http://content6.flixster.com/movie/11/17/75/11177548_pro.jpg"); public static string [] prgmnamelist={"let c","c++","java","jsp","microsoft .net","android","php","jquery","javascript"}; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); bitmap=getbitmapfromurl("http://content6.flixster.com/movie/11/17/75/11177548_pro.jpg"); context=this; bitmap [] prgmimages ={bitmap,bitmap,bitmap,bitmap,bitmap,bi

php - Automatically login user to PHPMyAdmin -

i'm writing webhosting control panel our organization, , able automatically login user phpmyadmin. user logs in out control panel user clicks "manage databases" user gets redirected phpmyadmin , automatically logged in what best way this? of course don't want save our users' control panel account passwords in our database in plain text. i don't think there way without knowing set of username , password. in end phpmyadmin middleware connect session database. as far know, phpmyadmin not have own user table. tries login database credentials provided. if successful, stores credentials in cookies, although encrypted. that's why phpmyadmin asks blowfish secret in config file, store credentials more securely. what closest can want built-in phpmyadmin, see http://wiki.phpmyadmin.net/pma/auth_types on single sign-on. auth_type signon feature allow phpmyadmin integrate single sign-on (sso) systems. administrators can configure phpm

c# - gridview.databind() not getting refreshed -

i have gridview : <asp:templatefield> <headertemplate> <asp:label id="lblheaderdesc" runat="server" cssclass="highlights_header" text="description"> </asp:label> </headertemplate> <itemtemplate> <asp:label id="lbldesc" runat="server" cssclass="reportlabel" text='<%# bind("progdesc") %>'></asp:label> </itemtemplate> </asp:templatefield> <asp:templatefield> <headertemplate> <asp:label id="lblheaderstartdate

delphi - Stale data returned when re-running a query with an empty result -

i using uib in delphi 2010 application. reuse tuibquery component across several executions different parameters. when parameter-value returns empty dataset access fields returns stale data. here pseudocode representation/extract of do: // open query set of parameter values q.params.bynameasinteger[aparamname] := 1; q.open; // parameter value data returned, access first record: := q.fields.bynameasinteger[afieldname]; q.close; // open query different set of parameter values q.params.bynameasinteger[aparamname] := 2; q.open; // parameter value there no data on db. j := q.fields.bynameasinteger[afieldname]; q.close; what after last open() is q.eof = true q.bof = true = j // non-null value so know result set empty, still returns value afieldname queried when resultset not empty old parameter-valie when accessing field name. i rather have give null (or 0 access asinteger()) field. my workaround test eof=bof=true , there more elegant way? in real code 2 open() call

javascript - jQuery multiple data decoding on server side -

scenario: i have jquery.ajax call submitting 3 arrays server saving database. need decode combined data object being transferred server 3 arrays. the server runs in php if scenario ambiguous, asking, how split $input 3 arrays again. (this on php side.) expected results: breaking object 3 seperate arrays processing. current results: internal server error when start process first array. note before code: still learning, please tips/pointer welcomed. code: jquery.ajax jquery.ajax({ url: "save_all.php", type: "post", datatype: 'json', data: { grades: json.stringify($scope.grades), commutators: json.stringify($scope.commutators), sgrades: json.stringify($scope.sgrades)}, success: function (data) { console.log(data); }, error: function (data) { console.log(data); } }); save_all.php <?php $input = json_decode(file_get_contents("php://input"), true);

javascript - How to remove Google Web Elements from google new Iframe? -

how remove google web elements google news of iframe. <iframe frameborder=0 marginwidth=0 marginheight=0 border=0 style="border:0;margin:0;width:275px;height:300px;" src="http://www.google.com/uds/modules/elements/newsshow/iframe.html?rsz=large&format=275x300&hl=en&q=google&element=true" scrolling="no" allowtransparency="true"></iframe> use div wrapper, position: relative; then, set position: absolute; iframe , , set negative position left. http://jsfiddle.net/3yx9f/ html: <div class="frame-wrap"> <iframe frameborder=0 marginwidth=0 marginheight=0 border=0 style="border:0;margin:0;width:800px;height:300px;" src="http://www.google.com/uds/modules/elements/newsshow/iframe.html?rsz=large&format=275x300&hl=en&q=google&element=true" scrolling="no" allowtransparency="true" class="gnews"></iframe> </div&

node.js - jade template conditional class nodejs expressjs -

i have jade template file header , uses bootstrap markup. depending on page user on, navigation bar needs add class .active nav item. best way avoiding long code this. header.jade if nav=='home' li.active a(href="/") home else li a(href='/') home if nav=='about' li.active a(href='/about') else li a(href='/about') route router.get('/about', function(req, res) { res.render('about', { nav:'about' }); }); notice how if there many more links in header, longer. there better method add class 'active' page being viewed? thanks tyler you create mixin handles rendering of list item. way logic code not have repeated: mixin header-item(name, url) if name.tolowercase() == nav li.active a(href=url)= name else li a(href=url)= name +header-item('home', '/') +header-item('about', '/about')

javascript - Google Maps auto search on page load -

Image
i using google maps api v3 on webpage , when page loads, search box gets pre-populated search term choose. need search maps using term. can't seem find way using google's api, thought perhaps simulate 'enter' key press using code: var e = jquery.event("keydown"); e.which = 13; $("#pac-input").trigger(e); ( #pac-input id of <input> tag on map) however doesn't seem work. so how can force search on page load? edit: search box i'm talking the first thing have think not event has triggered, it's more important know when trigger events. the predictions loaded asynchronously, must wait until available. there not fire event when predictions available, may observe domnodeinserted -event of body(the dropdown inserted there) , check if nodes have classname 'pac-item' (it's classname of items in dropdown). then these events must triggered on input: keydown keycode:40 (to move first prediction in d