Posts

Showing posts from June, 2013

android - How to create ExpandableListView -

i want create expandablelistview. contains 2 rows, row children textviews & imagebutton & toggle button. on click of imagebutton childviews should displayed particular selected row. how should expandablelistview? my problem have set 2 rows in 1 line , should keep in loop.. how should expandablelistview.? every row has again 2 rows. dynamically adding... done tablelayout, not getting proper result per requirement. so people suggested in forum, better use listview instead of tablelayout.. can please me..? you can use layout inflaters set many rows want. don't have dynamically, think.

maven - mvn clean install, mvn install:install-file order? -

i learning maven , trying understand order of things. understand, mvn clean install builds repository default jars, install produces .zip need later. i want use custom jars call mvn install:install-file , when run before install , cannot find symbol errors. assuming custom jars (which don't contain these classes) overwrites default jars? can't find these classes anywhere on filesystem, assuming packaged in 1 of default jars. how can around this? also, order should things? want final .zip, includes custom jars? mvn install -- builds , packages source code , copies ( installs ) artifact local repository $user_home/.m2/repository it's hard what's happening there without looking @ command typed in, , error trace received. said, install-file copy artifact local repo @ appropriate hierarchy. it's nothing more that. correct syntax be: mvn install:install-file -dfile=<path-to-file> -dgroupid=<group-id> \ -dartifactid=<artifact-...

Retrieving BIO information in LastFM API and PHP -

i'm trying artist bio information lastfm api i'm having trouble. i'm using php , curl request that's returning result xml. if use url gets sent curl , load in browser show's desired. however, result returned curl in php script missing properties of xml. for example: artist->bio->summary there no content. you can replicate i'm doing ill copy basic concepts here: open in browser: http://ws.audioscrobbler.com/2.0/artist/cher/info.xml copy , paste php file , open: $url = 'http://ws.audioscrobbler.com/2.0/artist/cher/info.xml'; $ch = curl_init(); curl_setopt($ch, curlopt_url, $url); curl_setopt($ch, curlopt_returntransfer, 1); curl_setopt($ch, curlopt_timeout, 20); curl_setopt($ch, curlopt_header, 0); curl_setopt($ch, curlopt_ssl_verifypeer, false); $retdata = curl_exec($ch); curl_close($ch); echo '<pre>'; echo $retdata; echo '</pre>'; you'll see returned results similar missing content in c...

How to use new freebase api (api search) in java? -

i cant understand api. have downloaded (maven) google-api-services-freebase , test have tried code: jsonhttprequestinitializer initializer = new googlekeyinitializer("my key"); httptransport httptransport = new nethttptransport(); jsonfactory jsonfactory = new jacksonfactory(); freebase freebase = freebase.builder(httptransport, jsonfactory).setjsonhttprequestinitializer(initializer).build(); now want this: https://www.googleapis.com/freebase/v1/search?query=cardiff&lang=en&type=university and next, want parse json output. please, method in freebase object?. see freebase.mqlread , freebase.text cant find method similar api search (http://wiki.freebase.com/wiki/apisearch). unfortunately, java api client doesn't support freebase search yet. here's how search using apache httpclient instead. httpclient httpclient = new defaulthttpclien...

java - Running REST with cxf-jax rs -

jun 05, 2012 8:55:57 pm org.apache.catalina.core.aprlifecyclelistener init info: apr based apache tomcat native library allows optimal performance in production environments not found on java.library.path: /usr/java/jdk1.7.0_04/jre/lib/i386/server:/usr/java/jdk1.7.0_04/jre/lib/i386:/usr/java/jdk1.7.0_04/jre/../lib/i386:/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.3/jre/lib/i386/client:/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.3/jre/lib/i386::/usr/java/packages/lib/i386:/lib:/usr/lib jun 05, 2012 8:55:57 pm org.apache.tomcat.util.digester.setpropertiesrule begin warning: [setpropertiesrule]{server/service/engine/host/context} setting property 'source' 'org.eclipse.jst.jee.server:web' did not find matching property. jun 05, 2012 8:55:58 pm org.apache.coyote.abstractprotocol init info: initializing protocolhandler ["http-bio-8080"] jun 05, 2012 8:55:58 pm org.apache.coyote.abstractprotocol init info: initializing protocolhandler ["ajp-bio-8009"] jun 05, 2012 8...

sonarqube - Sonar can be accessed locally but not accessed elsewhere -

just tried install standalone sonar 2.0.5 in win xp. setting : ip : 127.0.0.1 port : 9000 webcontext : / it can accessed locally. when tried access other computer, cant accessed. tried change setting port 8080 ( tomcat port ) , shutdown tomcat. still not accessible. tomcat ( port 8080, if running ) accessible via network. windows firewall off. any idea why happens? you've configured sonar bind local loopback address. try changing ip address "0.0.0.0". see following more details: difference between 0.0.0.0 , 127.0.0.1

Android NDK & FFMPEG build -

Image
i'm trying build ffmpeg library android application using ndk. have downloaded source code it's website , think build (it's first try working ndk , ffmpeg). have created build.sh file i'm using execute command line on mac os x. have few questions... first things know need android.mk file can use builded library in application,but don't know how reasons told above. after run build.sh android folder few folders , libraries. first question is, how can build android.mk file need...and maybe if can explain me why need it. my second question need libraries ffmpeg able use them app, after build can't see them in source tree. know have enable them in build.sh , think did,but can't see them. kind of information build file helpful me understand how configure it. here how looks : #!/bin/bash ###################################################### # usage: # put script in top of ffmpeg source tree # ./build_android # generates binary following archite...

ruby on rails - How to DRY scope methods used in two different classes? -

i using ruby on rails 3.2.2 , retrieve / scope associated objects "specifying" / "filtering on" attribute value on associated objects. is, @ time using following code: class article < activerecord::base def self.search_by_title(search) where('articles.title ?', "%#{search}%") end end class articleassociation < activerecord::base def self.search_by_article_title(search) joins(:article).where('articles.title ?', "%#{search}%") end end in above code where('articles.title ?', "%#{search}%") clause repeated twice , thought may improved dry principle: is possible use the article.search_by_title method directly in the articleassociation.search_by_article_title method? typical use cases are: articleassociation.search_by_article_title("sample string") article.search_by_title("sample string") unless change code structure completely, no. you hacking...

copy image on windows using php script without modifying creation date -

i created small php script categorize picture folder/date in windows. working great, files goes place changes "created date", wich want keep intact. i use simple php copy() function. i've use touch() + filectime still cannot change creation date of file any idea ? from php.net: it's worth noting copy() sets destination file's last modified time/date. what problem of using this? clearstatcache(); $oldstamp = filemtime("file.txt"); copy("file.txt","newfolder/file.txt"); touch("newfolder/file.txt",$oldstamp);

javascript - Require.js load timeout for jquery/underscore/backbone/parse modules -

uncaught error: load timeout modules: order!libs/jquery/jquery-min order!libs/underscore/underscore-min order!libs/parse/parse-min libs/jquery/jquery-min libs/underscore/underscore-min libs/parse/parse-min backbone http://requirejs.org/docs/errors.html#timeout i have no 404 requests under network tab of chrome, , have no script errors, outside of common bugs/fixes problem (according requirejs.org). when @ network, see scripts loaded in following order: require.js main.js app.js <-- required main.js order.js <-- used in main.js require next 4 scripts (which aren't amd) jquery-min.js <-- required main.js underscore-min.js <-- required main.js backbone-min.js <-- required main.js parse-min.js <-- required main.js router.js login.js text.js this seems right me. below code main.js , app.js , , router.js . main.js: // author: thomas davis <thomasalwyndavis@gmail.com> // filename: main.js // require.js allows configure shortcut alias /...

c# - How to do a proper left join in Entity Framework -

this should simple problem solve, reason entity framework makes hard me. need simple left join... i have 2 tables. example, user table: user_id | name | fk_group_id and group table group_id | groupname in raw sql: select * users u left join groups g on u.fk_group_id = g.group_id groupname = 'my group' super easy in sql. when search answers on how entity framework, there's 1 thing immidiately goes through mind... wtf...!?!? super large constructed, weird formatted "queries" performed , i'm confused need , not... so i'm hoping me specific problem. how 1 rewrite above sql query in (linq?) entity framework. currently have this: var bla = (from m in myent.users // join attempt.. join mp in myent.groups on m equals mp.group_id n n.group_name == "something" select m); even if working, don't see how suppose make life easier.. oo anyway, hope can me out :-) umm, don't hav...

ruby on rails - Calling modals from before_filters -

i have asked similar, more concrete. i'm making login using twitter bootstrap modals , want write before save or create filter users (i don't know better), working this: def before_save if devise_error_messages //stay in modal , show errors or notice else //call modal congratulations text end end how can call devise_error_messages method models or how should this? then, how can call js filters?

symfony - SonataAdminBundle Security roles -

i'm trying secure admin in sonataadminbundle i add sonatauserbundle fosuserbundle login. can add users, groups , roles in security.yml role_hierarchy: role_admin: role_admin role_it: role_it role_super_admin: [role_admin, role_it] access_control: - { path: ^/sonata/login$, role: is_authenticated_anonymously } - { path: ^/sonata/logout$, role: is_authenticated_anonymously } - { path: ^/sonata/login-check$, role: is_authenticated_anonymously } - { path: ^/sonata, role: [role_admin] } - { path: ^/sonata/api/monolog, role: [role_it] } i have connected access sonata but every user can access route /sonata/api/monolog if don't have role_it how can securize admin , how can display link if user can acces it use acl security handler. resources: sonataadminbundle security

php - I need to know session_start has used before? -

i have big stack of code. need use session_start() function always. if hasn't used session_start() not run each other. example: <?php if(session_start() == "used") { // not run } else { session_start(); } ?> do mean, u want check if session has been started? can here check if php session has started if(session_id() == '') { // session isn't started }

javascript - Click Handler for lists in JS? -

each of li's have class of 'galleryimage', inside span class 'delete'. when user clicks on span delete want js something, following code doesn't seem fire, whats wrong it? $('.galleryimage .delete').click(function() { alert("handler .click() called."); }); try this: $('body').on('click', '.galleryimage .delete', function() { alert("handler .click() called."); }); with jquery > 1.7 your question doesn't clarify that, element on you're trying add event dynamic (added document page after page load) or exists in @ page load. assume elements added document after page load. note to add events added dom after page load need delegate event can done .on() in jquery. use of .on() $(container).on(eventname, target, handlerfunction);

vim - Where is my .vimrc file? -

i have been using vim , , save settings. problem having cannot find .vimrc file, , not in standard /home/user/.vimrc location. how might find file? you need create it. in installations i've used hasn't been created default. you create ~/.vimrc .

tumblr mobile not working with prettify.js -

so wired in prettify.js , prettify.css new tumblr blog. works out great in chrome, ie, , firefox astonished when went android phone , code inside ... looks atrocity. i go digging figured before spend hours trying solve problem else fixed see if ol' stack buddies have on matter. aquamoogle.tumblr.com any solutions appreciated , if none posted i'll toss solution end of weekend. clarification edit viewing post through tumblr android application. don't think has phone version because bound ask it's motorola droid bionic running android 2.3.4 alrighty, since nobody came along 1 i'll throw answer out there. tumblr application after decompiling off apk not use standard web frame. means javascript execution not embedded in view mobile application. sucks know... possible solution use straight css formatting alas doesn't work in mobile version css sheets overridden mobile style sheets more compact formatting. so 1 goes down "unsolvable...

php - Drupal 7 AJAX Call via hook_menu -

so, trying new pane on ubercart checkout page update whenever chooses new shipping option. far can occur every time refresh page after choosing new shipping option. next step working via ajax. my problem ajax commands not firing ajax callback. div not being updated. right have simple text. later, add actual form information need, whole other issue. however, can't test case work. i working on new feature ubercart fedex module drupal. have been working on time no avail. have tried many different things, none work. to clear... know ajax call firing. can attach success ajax $.get call , console output , drupal variable set. div replace code not working. other pieces puzzle work. i ajax call , return javascript. can attach success function on ajax call in js , console output on success. javascript not issue. // implements hook_menu() function uc_fedex_menu() { $items = array(); $items['uc_fedex_jquery_callback/%'] = array( 'title' => 'my cust...

jQuery Mobile List Within a LIst -

i want create list within list item on jquery mobile here's code: https://gist.github.com/2886812 eveything works out except top , bottom list items cut off , this: http://imgur.com/em37y i don't know if want possible. i'm novice. in advance. take @ http://jsfiddle.net/7wzbr/

xml - Changing the background color of textbox java UiBinder -

i want change background color of textbox indicator being validated. <ui:style> .textboxcolor { background-color: #ff6eb4; } </ui:style> and then if(firstname.equals("")) { txtfirstname.setstylename("textboxcolor"); } this not giving expected result. how can achieve change in color? kind regards if i'm not mistaken, css names declared in uibinder converted on compilation - setting style textboxcolor won't work, because there won't style name. if add external css file (maybe more descriptive name, say... .validated ), setstylename() work.

Javascript objects & methods: what can see what, and why? -

i've got set that, in stylised form, this: (function () { var db = { com: { edit: changed [...] {...} 324: { unmod: "xyz" } } }; var report = { mymethod: function () { var x = db.com[324].unmod; } }; })(); the error message i'm getting db.com undefined . seems me report.mymethod cannot "see" db.com . right? one factor might db.com created looping through ajax data this: (i = 0; < length1; i++) { cat = o.cat[i]; length2 = cat.com.length; // loop through comments (j = 0; j < length2; j++) { com = cat.com[j]; // create db object this[com.cnum] = { unmod: com.unmod }; } } is issue 1 of closure? the relevant part of ajax data this "cat"...

JavaScript or HTML5 to display image as 3D Canvas -

is there way achieve effect (3d canvas view) displaying image within website? click here view image effect there javascript library or maybe html5 canvas solution or can done via php? thanks! edit: more explicit effect want touch library i'm looking for: check type of displaying images without making images myself. want automate process , display simple images types in website link. you three.js , javascript 3d library can configured output canvas, webgl or svg. download library , through examples , you'll find pretty close want do. essentially, need create cube , use image material.

java - Magnolia doesnt see custom servlet -

i'm having big trouble magnolia servlet, far i've tried can think of. regarding magnolia documentation can set servlet definition in module definition instead of web.xml (which sounds more neat idea expanding) so placed code in xml module <servlets> <servlet> <name>jcaptcha</name> <class>com.octo.captcha.module.servlet.image.simpleimagecaptchaservlet</class> <mappings> <mapping>/jcaptcha.jpg</mapping> </mappings> </servlet> </servlets> and created bypass node (config.server.filters.bypasses.jcaptcha.xml) filter <?xml version="1.0" encoding="utf-8"?> <sv:node sv:name="jcaptcha" xmlns:sv="http://www.jcp.org/jcr/sv/1.0" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance"> <sv:property sv:name="jcr:primarytype" sv:type="name"> <sv:value...

ipad - HTML5 offline capabilities in a sub directory -

i'm trying setup ipad app work offline. able work told put app in multiple sub directories. when did , update cache manifest file new destinations of files kept getting error site wouldn't work because wasn't connected internet. tried multiple paths , looked different ideas have come empty handed. way offline mode working site inside sub directories? thanks. this shouldn't make difference. make sure urls in manifest relative , end manifest with: network: * furthermore make sure don't forget add images, libraries etc. cached url's manifest. caps can make difference. open console of developer tools in chrome see what's being cached , breaks loading appcache. also make sure there no iframes (ie. like-buttons) on homepage(page includes manifest attribute in html-tag) always cached. little trick: if want fallback you're homepage place manifest attribute in invisible iframe on homepage of app. way have total control on what's c...

layout - BlackBerry Scroll view -

i had created screen layout positioning each component using sublayout , tell relative x, y positions. the problem when selecting choice objectchoicefield or when adding new text field programatically whole layout draws again causes scrollview jumps top user interacted, causing pain him. is problem use sublayout positioning? if how can create complex layout in blackberry without sublayout? you haven't posted code, it's bit difficult pinpoint problem. sounds vertical scroll position going 0 whenever modify set of fields contained vfm. can read current scroll position before modifying child fields, , explicitly set after doing layout logic.

ruby - ActiveSupport::Notifications access payload from inside block -

i found out activesupport::notifications . think it's great tool monitor applications. i using outside of rails monitor sinatra app , it's working great. however use lot, instrument custom queries , somehow notify result of query: my_input = "some_query" activesupport::notifications.instrument("myapp.create", :input => my_input) #stuff result = search_for my_input #stuff result end now can subscribe , can query executed (which available in payload hash). see result in subscriber. so there way add custom value payload while executing block? just stumbled upon question when looking same thing. you can pass in block variable, represent payload you, , can fill while you're in block my_input = "some_query" activesupport::notifications.instrument("myapp.create", :input => my_input) |instrument| #stuff result = search_for my_input instrument[:my_result] = result #stuff result end in subscr...

wix - TextStyle and no effect of coloring the text -

i have defined textstyle as <textstyle id="subheadingfont" facename="tahoma" size="9" bold="yes" blue="255" italic="yes" green="0" red="0" /> and later used in control this <control id="password" type="edit" x="20" y="195" width="150" height="18" property="wixui_sa.password" indirect="yes" text="{\subheadingfont}" tooltip="password dude"/> on ui don't text in blue, pointers did wrong here? it seems not possible change color of "edit" control ref: http://msdn.microsoft.com/en-us/library/aa372074(v=vs.85).aspx this column specifies text color displayed text control. other types of controls use default text color.

javascript - xhr response: connection closed -

i wrote flickr search engine makes call either public feed or flickrapi depending on selected drop down box. examples of jsonp function calls returned: a) jsonflickrapi({"photos":{"page":1, "pages":201, "perpage":100, "total":"20042", "photo":[{"id":"5101738723"... b) jsonflickrfeed({ "title": "recent uploads tagged red","link": "http://www.flickr.com/photos/tags/red/","description": "", .... the strange thing is in local install ( xampp ) both work fine , images when host exact same code on above domain jsonflickrapi doesn't work. notice (by looking @ firebug) jsonflickrapi response header says connection close also, firebug doesn't show me response tab when submit request jsonflickrapi here code: function makecall(uri) { xmlhttp = new xmlhttprequest(); xmlhttp.onreadystatechange = callback; xm...

objective c - iOS Core-Graphics: Using CGContext setters to render a sharp pdf -

Image
i'm working on pdf renderer using cgpdf , catiledlayer in ios , except fonts it's if vectors close , kind of fuzzy i'm not wearing glasses. solution i'm looking , i'd love make grey pixels near edge black. guessing possible cgcontextset"whatever"() method. here photo illustrate. currently rendering as... adobe reader app rendering as... and looks sharp, if know method uses (or how similar) i'll ecstatic but i'm trying work around turn grey pixels black. like... again using cgcontext setter methods , noticing changes, not documentation clear on each does, explanation or insight solutions appreciated. in advance. it looks adobe's renderer aligning bottoms of glyphs whole pixels, yours not. these 2 messages on quartz-dev mailing list ( one , two ) suggest should try changing settings subpixel positioning , subpixel quantization, using following functions: cgcontextsetallowsfontsubpixelpositioning cgcontextsetsh...

android - What is the type of parameter used in distanceTo()? -

in distanceto() method parameter used?i know location parameter used, question if making app has calculate distance particular location particular landmark, enter in parameter set of distanceto() function, know latitude , longitude of place, distanceto() function accepts 1 parameter. you need use distancebetween() method if know latitude , longitude of place. take @ docs .

java - EclipseLink JPA Object is not a known entity type -

i have strange problem eclipselink , object want persist. have 1 object (keypointlistimpl) stores object keypointimpl in list. persisting keypointimpl objects works great if try persist keypointlistimpl object java.lang.illegalargumentexception says object keypointimpl isn't known entity type. here keypointimpl code: @entity @table(name="keypoints") public class keypointimpl implements keypoint { @id @generatedvalue(strategy = generationtype.identity) private int id; @enumerated(enumtype.string) private detectortype keypointtype; private float x; private float y; private float size; private float angle; private float response; private int octave; private int classid; ... } here keypointlistimpl code: @entity @table(name="keypointlists") public class keypointlistimpl implements keypointlist { @id @generatedvalue(strategy = generationtype.identity) private int id; @onetoone(cascade={ca...

ios5.1 - Find Xcode 4 Binary -

i'm trying build little app cydia submission ... can't find actual .app. under products section in xcode, .app marked in red (wich means doesn't exists). in project folder, there no folder named build or something. how can build app? (xcode 4.3.2, ios 5.1) nevermind. found answer: shift+cmd+2 open organizer, click "projects" tab, pick project left bar, click small arrow right "derived data" label open folder. here navigate /build/products/debug-iphonesimulator , there is.

css - Background image not showing up in IE9 -

other browers chrome shows fine. ie9 shows gradients no images. code css body { background: url('../images/adventure/background.png') background: url('../images/adventure/background.png'), -moz-linear-gradient(top, rgba(255,255,255,0) 0%, rgba(255,255,255,0.4) 40%, rgba(149,147,160,1) 100%); /* ff3.6+ */ background: url('../images/adventure/background.png'), -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(255,255,255,0)), color-stop(40%,rgba(255,255,255,0.4)), color-stop(100%,rgba(149,147,160,1))); /* chrome,safari4+ */ background: url('../images/adventure/background.png'), -webkit-linear-gradient(top, rgba(255,255,255,0) 0%,rgba(255,255,255,0.4) 40%,rgba(149,147,160,1) 100%); /* chrome10+,safari5.1+ */ background: url('../images/adventure/background.png'), -o-linear-gradient(top, rgba(255,255,255,0) 0%,rgba(255,255,255,0.4) 40%,rgba(149,147,160,1) 100%); /* opera 11.10+ */ background: url('../images/adventure...

linq - How to grasp all C# functional features? -

i'm using lambdas in c# lot (linq of many flavours, typed helpers in asp.net mvc, automapper api etc), can't start use c# functional features in own code, because can't figure out cool things can them. use them intuitively of time. is there reference or quick (but full) guide this. i'm not looking msdn reference, quick explanation of c# functional features whole. if can narrowed down list few links blog posts -- acceptable too. update after question closed : seems long explanation no clear, i'll try narrow down: need list of concepts can use write own code (not consume other's apis). acceplted answer need, thanks. here nice codeproject article explains functional features introduced in c#. has easy understand examples each feature: functional programming in c# the article provides explanations , examples functions , first-class values: function types - delegates, generic function types, predicates, actions function values - storing , pas...

iis 7 - redirect subdomain within IIS7.5 using https -

i have setup wildcard on iis 7.5 site. trying force users e.g. https://store1.mydomain.com or https://store2.mydomain.com i have been able find examples redirecting www. can out? you can use url rewrite module force user switch ssl, regardless of host name or url users uses enter site. use following rule: <rule name="force https" enabled="false" stopprocessing="true"> <match url="(.*)" /> <conditions logicalgrouping="matchall"> <add input="{https}" negate="true" pattern="^on$" /> </conditions> <action type="redirect" url="https://{http_host}{request_uri}" appendquerystring="false" redirecttype="permanent" /> </rule> hope need.

unable to execute statements in sequential order while calling one function from another function in javascript -

while designing webpage, have done javascript validations, in js file, i'm trying call 1 function function. first called when click on button. in first function, i'm trying set text label , called second function, second function called first , text set label. sequence missing. don't know, why statements not executed in sequence...if know, please tell me solution. <script> function first(){ labelvalue = document.getelementbyid("getlabel"); labelvalue.innerhtml = "firsttext"; second(); } function second(){ labelvalue.text = "secondtext"; } here, can't set text 'labelvalue' i.e., "firsttext" before second() called. set after second() called. function first(){ labelvalue = document.getelementbyid("getlabel"); labelvalue.innerhtml = "firsttext"; image = document.getelementbyid("getimage"); image.src = "hello.jpg...

Generic selection using jquery validate -

as relative jquery novice please bear me if there simple solution problem. using jquery validate works beautifully when selecting unique id eg. $("#myform").validate({ debug: false, rules: { field1: "required" }, messages: { field1: "required" }, submithandler: function(form) { $.post('formaction.php', $("#myform").serialize(), function(data) { $('#results').html(data); }); } }); i need extend work generically number of automatically generated forms myform1, myform2 etc. can validate via common class selector $("myform") , apply submithander specific form ( myform1 , myform2 , etc.) eg: $(".myform").validate({ debug: false, rules: { field1: "required" }, messages: { field2: "required" }, submithandler: function(form) { $.post('form...

jquery - how to make the autocomplete suggestions appear in a dropdown menu and not as a normal list as text below the search box -

i have created autocomplete component datasoucre ia localhost solr.everything works fine,but need suggestions come in format of drop down menu box,but in case showing normal list , no drop down appears. heres code, <%@ page language="java" contenttype="text/html; charset=iso-8859-1" pageencoding="iso-8859-1"%> <%@ taglib prefix="f" uri="http://java.sun.com/jsf/core"%> <%@ taglib prefix="h" uri="http://java.sun.com/jsf/html"%> <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> <%@ taglib prefix="rich" uri="http://richfaces.org/rich" %> <%@ taglib prefix="a4j" uri="http://richfaces.org/a4j"%> <!doctype html public "-//w3c//dtd html 4.01 transitional//en" "http://www.w3.org/tr/html4/loose.dtd"> <html> <head> <meta http-equiv="content-type" content=...

IOS - Call an instance method of a class from another class button -

i have instance methods implemented in class 2d painting; , image rendered view declared in paintviewcontroller. these methods (like clearimage, changebrushcolor) working if call them code generated buttons inside same class. but want use uikit make graphic, buttons ecc , empty view paint in. i've tried ways call instance methods other classes none of them seems working.. can explain me step step how this? these ways i've tried: in paintviewcontroller.m #import "paint.h" call erase method this - (ibaction)erasebutton:(id)sender { paint *newinstance = [[paint alloc]init]; [newinstance clearimage]; } it method called not working.. (if put nslog inside method prints stuff) i @class paint inside paintviewcontroller.h , set property in interface @property (strong, nonatomic) paint *paint; , inside ibaction write [self.class clearimage]; this not working @ all. if read question correctly, need implement delegate method. co...

How to access a DetailsView's ItemTemplate's TextBox in code behind? ASP.Net C# -

i have detailsview 1 of field converted templatefield able manipulate insertitemtemplate contains textbox (cf: code below). problem cannot access textbox properties in code behind... , don't :( here aspx code (portion of it): <asp:detailsview id="_detailsview" clientidmode="static" runat="server" height="50px" width="125px" allowpaging="true" autogeneraterows="false" datakeynames="iduniv" datasourceid="entityds" onmodechanging="_onmodechanging"> <fields> <asp:templatefield headertext="dateupdateuniv" sortexpression="dateupdateuniv" convertemptystringtonull="false"> <insertitemtemplate> <asp:textbox id="textboxinsertitem" runat="server" text='<%# bind("dateupdateuniv") %>'></asp:textbox> ...

algorithm - C programming language, shortest path -

i'm writing code find shortest distance between 2 points. code working perfect till now. mean finds distance , path should pass. need print information, should make print function. way works that: example initial point 4 , final 13. i should come algorithm check intermediate points. let's between 4 & 13 there point : 7 4--7--13 need check every point between them like: 4--6--7--9--13 more specific check if there point between 4-6 , 6-7 , 7-9 , 9-13. next in next iteration may formed list like: 4--2--6--7--5--9--17--13 let's there not intermediate value between them. , should print. appreciate help, suggestion may give me the warshall-floyd algorithm (used op), has version able determine path in addition distance between nodes of graph: floyd-warshall algorithm path-reconstruction however, must noted not best possible algorithm solve shortest-path problem .

asp classic - VBscript search sAMAccountName from CN -

i've written script pulls samaccountname of specified user ad via vbscript, seems work within own ou group. due permissions restriction within company? or due i'm not seeing in code? dim result result = getsamaccountname("samuel j link") msgbox result function getsamaccountname(name) dim adocommand, adoconnection, strbase, strfilter, strattributes dim objrootdse, strdnsdomain, strquery, adorecordset, strsam, objuser set adocommand = createobject("adodb.command") set adoconnection = createobject("adodb.connection") adoconnection.provider = "adsdsoobject" adoconnection.open "active directory provider" set adocommand.activeconnection = adoconnection set objrootdse = getobject("ldap://rootdse") strdnsdomain = objrootdse.get("defaultnamingcontext") msgbox strdnsdomain strbase = "<ldap://" & strdnsdomain & ">" 'be sure passed var usersel referenced strfilter = ...

php - Ckeditor shows extra space at the beginning and end of the p tags -

Image
i using ckeditor small web project, when edit content or create new content, automatically add white space after opening of p tag , text, when remove space , save content works when edit again, add space again, how remove it. think space between opening of p tag , text should not matter, shows spaces while retrieve content database , mess design. how solve this? here image trying say: i think it's setting: oldish resource, think still applies, depending on version using probably: there seem settings adding breaks , indents (your problem guess) opening p tag: this.dataprocessor.writer.setrules( 'p', { indent : false, breakbeforeopen : true, breakafteropen : false, breakbeforeclose : false, breakafterclose : true }); source : http://cksource.com/forums/viewtopic.php?t=18067 (but there quite ot...

ruby - what does nil mean/represent here? -

following simple statements in irb shell. nil in output mean ? why accompany print statement in if block ? irb(main):062:0> if(x==20 && y==30) irb(main):063:1> print("if statement working !") irb(main):064:1> else irb(main):065:1* print("else statement working !!") irb(main):066:1> end if statement working !=> nil # nil represent here ? in ruby, expressions return values, if it's nil . blocks , methods return value of last expression evaluated. there many ways use effectively. example, reason explicit return s not used. also, can this: print if x == 20 && y == 30 'if statement working!' else 'else statement working!' end regarding example: in addition printing string instructed, irb display value received if-else blocks. since print returns nil , both branches return same value.

css - Two column blocks with image and text -

i'm looking create in this image. each block have image (a square image) , text. anyone has clue how design it? prefer css solution. thanks! as others have commented, question bit vague. however, have done quick mashup on jdfiddle . pattern background can achieved css3 patterns although not compatible older browsers. have used border-radius css create rounded corners in boxes. have @ , should give idea on how go doing won one. recommend looking @ w3schools links submitted on above above comments.

iphone - Having problems splitting up UIImageView into smaller images -

Image
i'm trying take uiimageview , resize image , display it. want break image smaller pieces , display them. the resized image displays correctly appears "split up" images big; i'm thinking coming original (slightly bigger) image. following screenshot shows resized image on left , column of split images left hand side. the fact resized image displaying correctly , smaller ones aren't has me confused. ideas appreciated - or alternative. here code: - (void)viewdidload { [super viewdidload]; // additional setup after loading view, typically nib. width = imgoriginal.frame.size.width; height = imgoriginal.frame.size.height; whratio = width/height; [self getoriginalimageinfo]; [self resizeimage]; resizedimage = [self resizeimage]; } -(void) getoriginalimageinfo { lblwidth.text = [nsstring stringwithformat:@"%0.2f", width]; lblheight.text = [nsstring stringwithformat:@"%0.2f", height]; lblwhratio.t...

How do I map a small object graph using Entity Framework Code First 4.1? -

i have small object graph i'm using: public struct address { public string addressline1 { get; set; } public string addressline2 { get; set; } etc... } public class user { public address homeaddress { get; set; } public address workaddress { get; set; } public string firstname { get; set; } etc... } using entity framework 4.1, how map structure 1 table they're mapped columns like: homeaddressline1 homeaddressline2 workaddressline1 workaddressline2 firstname lastname etc... ef doesn't support structures. must use class address , map complex type: public class address { public string addressline1 { get; set; } public string addressline2 { get; set; } } public class user { public int id { get; set; } public address homeaddress { get; set; } public address workaddress { get; set; } public string firstname { get; set; } } public class context : dbcontext { protected override void onmodelcreating(dbm...

Need help to Create new Google Spreadsheet -

i want creating new spreadsheet in http://docs.google.com account, using c#. possible create new spreadsheet.please show syntax or valuable information me create spreadsheet. you have use documents list api create new spreadsheet. documentation has complete c# samples: https://developers.google.com/google-apps/documents-list/#creating_or_uploading_spreadsheets

asp.net mvc 3 - Ajax.BeginForm check if request was redirected -

how determine if async request form ajax form redirected? in case request redirected login page if user's session closed. i tried check arguments of oncomplete, onsuccess , onbegin events (onfailure not called) no 1 helped. currently have entire login page embaded in div of current page in case of session closing. the way see how awoid - code this: function onsuccesspost(a,b,c) { if (a.indexof("<!doctype html>") == 0) { window.location = window.location; } // ... } but solution seems bit ugly. any ideas? don't redirect controller actions invoked through ajax. use json: public actionresult foo() { var url = url.action("bar", "baz"); return json(new { location = url }, jsonrequestbehavior.allowget); } and in ajax success callback: success: function(result) { window.location.href = result.location; } obviously if intend redirect client side after ajax request, kills benefit ajax. invoke...

interop - How to marshall pointer to array in C# -

i have c++ method int** argument pointer int array. how can marshall c#? you can try inspiration method signature: void mymethod([marshalas(unmanagedtype.lparray, sizeconst=10)] int[] ar); (the array 10 in length)

web services - Connect MS Dynamics CRM 2011 from java -

i trying connect ms dynamics crm 2011 java. after lots of searching came across 1 link in ms forums gives code snippet invoke ms dynamics crm 2011 ws java. consuming crm rest service java however, not provide details other account creation step. using code snippet able create accounts. however, want use same rest web service retrieve accounts, create new case request, add case request account, etc. based on .net examples available online trying use service.createaccountquery() method retrieve accounts. however, while .net examples uses linq setup search criteria, clueless how specify subpath string in java retrieve existing accounts name/city/country etc. appreciate help. instead of "account act..." line , below, use like: // retrieve accounts user has read access to. string fetch1 = @"<fetch mapping=""logical""> <entity name=""account""> <all-attrib...

objective c - How to detect that UIScrollView is scrolling or that is is dragging -

i need know on continuous basis when uiscrollview scrolling or dragging. implement these 2 delegate methods.. - (void)scrollviewdidscroll:(uiscrollview *)sender{ //executes when scroll scrollview } - (void)scrollviewwillbegindragging:(uiscrollview *)scrollview { // execute when drag scrollview }

c - Get struct's size passed as void to function -

i'm changing codes in database library. way works send void pointer, size of call query , using query calculate size of structure. problem receive struct params function fails before/in middle of first fetch. after need clear structure, dont have size. know best way send size of structure param, have thousands , thousands programs compiled, library 1996, need find way calculate structure size if type void. one idea had calculate position of next element not in structure 0x000010 0x000042 [int|char[30]|int|int][int] so size 32, because 0x00042-0x000010 32. is there way know when got out of structure. the prototype of function is int getdata(char* fields, void* mystruct) i need find out structure size. sorry if missed information, code huge , unfortunately cannot post here. no, in general there's no way, given void * , figure out you're after. thing can compare against null , of course doesn't here. note there's nothing in ...

Splitting XML node based on delimiter 'OR' in SQL server -

i have xml needs splitted based on 'or' . if have 2 or's splitting 2+1 nodes shown below in [xml2] [xml1] <rules> <rule text="when familycode = 'abc' , (pricedifferentiatorcode in ('def', 'ghi') or ( pricedifferentiatorcode = 'jkl' , namedifferentiatorcode = 'mno' ) or (pricedifferentiatorcode = 'xyz' , namedifferentiatorcode = 'mno')) 'dummyvalue'" /> </rules> [xml2] <rules> <rule ruletext="when familycode = 'abc' , pricedifferentiatorcode in ('def', 'ghi') 'dummyvalue'" /> <rule ruletext="when familycode = 'abc' , pricedifferentiatorcode = 'jkl' , namedifferentiatorcode = 'mno' 'dummyvalue'" /> <rule ruletext="when familycode = 'abc' , pricedifferentiatorcode = 'xyz' , namedifferentiatorcode = 'mno' 'dummyvalue'" /> </...

selenium - schedule execution by testNG in Eclipse -

i want selenium(java) test scripts scheduled execution every night 11.00pm. how can in eclipse .i using testng run scripts. i suggest use simple tool called jenkins achieve trying do. excellent solution running scheduled tasks such running selenium test scripts.

html - Is it compulsory for a split button to have a Em-Class, with an attribute, unSelectable=On? -

i writing this, continuation previous posts... where click on following object(button), values displayed in selenium(webdriver)? how click in specific part of button using selenium, list of options displayed? as wanted automate mouse click event testing on split button using selenium, upon clicking on 1 particular part of button, finding that, 'that particular part' present in em-class, in turn has button/link, nothing upon click... this em class has attribute, unselectable=on....is attribute necessary split button functionality?? can given off?? first of did not understand why in first place em class has attribute unclickable="on" . i suggest change value **unselectable="off"** , @ happen. let me know if errors generated.