Posts

Showing posts from April, 2013

animation - Bone Vertex Skinning transformation -

Image
i trying implement skeletal animation in opengl. @ stage, trying have bone system deform mesh. believe problem how create matrix bone::getmatrix() . background: each bone has offset it's parent, , if bone not have parent offset instead world position of entire skeleton. collection of bones comprise skeleton. currently, testing purposes, have 3 bones in skeleton deforming skinned mesh. again, issue when deforming mesh, visual result not produce desired effect. code: glm::mat4 bone::getmatrix(){ bone* parent = getparent(); glm::mat4 rot = glm::mat4(1.0f); glm::mat4 trans= glm::mat4(1.0f); glm::vec3 orient = getorientation(); //create rotation matrix; rot *= glm::rotate(orient.x,1.0f,0.0f,0.0f); rot *= glm::rotate(orient.y,0.0f,1.0f,0.0f); rot *= glm::rotate(orient.z,0.0f,0.0f,1.0f); //create translation matrix if(parent != nullptr){ glm::vec3 off = offset; trans = glm::translate(off.x,off.y,off.z);

iphone - Make 1 UIViewController Landscape Mode -

this question has answer here: force uiviewcontroller show in landscape mode 3 answers my ios app built in portrait format , want keep way. there 1 screen in landscape only, not portrait can't figure how it. is there advised? much appreciated at first should set orientation on supported interface orientation in xcode project summary. in appdelegate: - (nsuinteger) application: (uiapplication*) application supportedinterfaceorientationsforwindow: (uiwindow*) window { nsuinteger orientations = uiinterfaceorientationmaskall; if (self.window.rootviewcontroller) { uiviewcontroller* rootviewcontroller = self.window.rootviewcontroller; uiviewcontroller* presented; if ([rootviewcontroller iskindofclass: [uinavigationcontroller class]]) { presented = [[(uinavigationcontroller*) rootviewcontroller vie

jquery - store data name equal each class name -

i have html structure below , have store each container inner div text val data, i'm coding below js, works fine feel not smart, because these code kind doing samething store data name equal class name, have type , check typo... possible more simple samething?? <div class="container1"> <div class="aq">text</div> <div class="be">text</div> <div class="co">text</div> <div class="dp">text</div> ... </div> <div class="container1"> <div class="aq">text</div> <div class="be">text</div> <div class="co">text</div> <div class="dp">text</div> ... </div> <div class="container2"> <div class="aa">text</div> <div class="bd">text</div> <div class="cs"

multiple devise authentication realms in a rails application: which is the setting that allows for that? -

i've simple rails application; has devise authentication mechanism. i've added activeadmin, brings devise based authentication mechanism. there other question , answers merging 2 models. question setting makes 2 authentication realms distinct. example. perform login in admin page: localhost:3000/admin here user model adminuser. then try move regular (non active-admin) page: localhost:3000/documents here user model user. here, if test current_user variable, nil , not instance of adminuser . is: 2 authentication areas (i used word realm don't know if correct) kept distinct. i've searched in activeamdin initializer, couldn't find setting contains information of creating distinct 'authentication realm'. update 1 (and possible answer): they not distinct. if test current_admin_user, contains , adminuser instance. you have 2 models user , adminuser associated 2 separate db tables, right? do have separate aa , user model rout

perl - is LWP::Simple faster than the full LWP? -

i'm use lwp::simple perl module, understand reduced version of full lwp module. use blindly because suggested use while back. benefit of using on full package, faster , easier use? lwp::simple not faster lwp::useragent since uses lwp::useragent. it's simpler interface.

ElasticSearch grouping facets -

i have document such structure: { id: 312256, name: "somename", filterblocks: [{ id: 0 filtertypeid: 4 filteritems: [ 1190 ] }, { id: 0 filtertypeid: 3 filteritems: [ 353 ] }, { id: 234 filtertypeid: 1 filteritems: [ 6342 ] } ] } for each distinct combination of filterblocks.id+filterblocks.filtertypeid need n size facets on filteritems field. try use query like: { "query": { "match_all": {} }, "facets": { "filterblocks": { "terms": { "field": "filterblocks.filteritems" } } } } but of course n facets without grouping filterblocks.id+filterblocks.filtertypeid what' need modify in que

html - Javascript - Change element's src in specified element -

in html have lot od divs names(yes, names, not ids) respectively p001, p002, p003... this: <div id="pole" name="p001"><img src=""></div> <div id="pole" name="p002"><img src=""></div> <div id="pole" name="p003"><img src=""></div> etc... in javascript have defined variable called 'pos' contains number, now: "284" , function should change img src "player.png". tried 2 ways , none of these work: document.getelementsbyname('p'+pos).innerhtml='<img src="player.png">'; and document.getelementsbyname('p'+pos).getelementsbytagname("img").src="player.png"; how change img src in specified div? getelementsbyname returns list of elements, not single element, try: document.getelementsbyname('p'+pos)[0]. getelementsbytagname("

python - Efficiently recalculating the gradient of a numpy array with unknown dimensionality -

i have n-dimensional numpy array s . every iteration, 1 value in array change. i have second array, g stores gradient of s , calculated numpy's gradient() function. currently, code unnecessarily recalculates of g every time update s , unnecessary, 1 value in s has changed, , should have recalculate 1+d*2 values in g , d number of dimensions in s . this easier problem solve if knew dimensionality of arrays, solutions have come in absence of knowledge have been quite inefficient (not substantially better recalculating of g ). is there efficient way recalculate necessary values in g ? edit: adding attempt, requested the function returns vector indicating gradient of s @ coords in each dimension. calculates without calculating gradient of s @ every point, problem not seem efficient. it looks similar in ways answers posted, maybe there quite inefficient it? the idea following: iterate through each dimension, creating slice vector in dimension. each of the

java - How can you add multiple button listeners all at once? -

scroll down answer. question doesn't matter , code confusing. is there function allow me fetch id labels can loop button listener easily? have in main "container" xml houses fragments line of code: public static final map<string, integer> rmap = createmapr(); // map of widget id's in r private static map<string, integer> createmapr() { map<string, integer> result = new hashmap<string, integer>(); (field f : r.id.class.getdeclaredfields()) { string key = f.getname(); integer value = 0; try { value = f.getint(f); } catch (illegalargumentexception e) { e.printstacktrace(); } catch (illegalaccessexception e) { e.printstacktrace(); } result.put(key, value); } return collections.unmodifiablemap(result); } and 1 of fragments pick rmap, , cross labels have specified. i'm doing because have few buttons , specifying

regex - How to extract a string that both matches some pattern and rests between two other strings -

sorry if duplicate.. it's not clear me what's available on how perform specific task.. my goal find filename of zipped file inside html code. filename inside <a href=...> html block, it's easy human find. here's code reproduce i'm looking at: # character vector 2 strings html file string.examples <- c("anes time series cumulative data file</b><br /><a href=\"../cdf/cdf.htm\"> study page</a>&nbsp; | &nbsp;<a href=\"../cdf/cdf_errata.htm\">errata</a>&nbsp; | &nbsp;<a href=\"../data/cdf/anes_cdf.zip\" onclick=\"javascript: _gaq.push(['_trackpageview','/downloads/cdf-ascii']);\">download ascii data files <img src=\"../../images/zip.jpg\" border=\"0\" width=\"23\" height=\"13\" /></a>&nbsp; | &nbsp;<a href=\"../data/cdf/anes_cdfpor.zip\" onclick=\"java

javascript - How to highlight a row in a list of data with bootstrap's table table-hover class -

i using bootstrap's table class (in particular class="table table-hover") on list of data (using knockout databinding in single page application)- <table id="tblallcert" border="0" class="table table-hover" width="100%"> <tbody data-bind="foreach: allcertificates"> <tr id="allcertrow" style="cursor: pointer" data-bind="a: console.log($data), click: $parent.selectthing, css: { 'highlight': $parent.isselected() == $data } "> <td> <b><span data-bind=" text: clientname"></span>&nbsp;(<span data-bind=" text: clientnumber"></span>)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span data-bind=" text: borrowbasecount"></span>&nbsp;loan(s)&

javascript - Is my understanding of closure wrong? -

i have read lot of example , question in stackoverflow closure,but feel i'm not able understand it, here get: function testclosure (s1,s2){ return function(s3){ return s1 +' '+ s2 +' '+s3; } } var t1 = testclosure("test","test2"); console.log(t1("test3")); //test test2 test3 t1 holding function , scope chain of testclosure(); t1 returning anonymous function itself. when t1 called puts inner function on testclosure(); accept last argument. s1,s2,s3 lookup through scope chain , return. is understanding wrong? you execute testclosure . testclosure creates , returns new function. since function created inside of function, closure created , added new function's scope chain. closure has access arguments passed testclosure @ time of creation. variable t1 assigned returned function value. you call t1 , pass in argument. inside of t1 reference arguments part of closure. t1 cannot find v

c# to f# - How to convert between F# and C# tuples? -

i writing f# interop class used c#. thought f# had implicit conversion .net tuple<> type (similar ienumerable treated seq), wrote following code: type myclass() = member this.mymethod (t: tuple<int, int>) = let meaningoflife (t : int * int) = 42 meaningoflife t this code fails compile following error: error fs0001: expression expected have type int * int here has type tuple then how convert tuples between c# , f# (and back)? if you're targeting .net 4.0 , above, don't need specify object tuple. f# tuples automatically compiled tuple. can use: type myclass() = member this.mymethod (t: int * int) = let meaningoflife (t : int * int) = 42 meaningoflife t and should work fine c#.

java - Converting arraylist to string -

i have multiple line string taken user input. broke string arraylist str.split("\\s ") , changed particular word if occurred, want merge words in arraylist replaced word in , form string again in multiple line pattern only. i'm not getting how this. please help. using standard java (assuming arraylist called words ) stringbuilder sb = new stringbuilder(); (string current : words) sb.append(current).append(" "); string s = sb.tostring().trim(); if have guava library can use joiner: string s = joiner.on(" ").join(words) both of these work if type of words string[] . if want preserve line structure, suggest following approach: first break input string lines using .split("\n") . then, split each lines words using .split("\\s") . here's how code should like: public string convert(string input, string wordtoreplace, string replacement) { stringbuilder result = new stringbuilder(); string[] lines =

symfony 1.4 - Oops! An Error Occurred The server returned a "500 Internal Server Error" on new actions crated -

i error enter 1 of actions on project. oops! error occurred server returned "500 internal server error". broken only on 1 page (action) happens. recent action created. strange thing happens on server. locally on windows server page works normally. the php internal logs on server returns no errors. the error occurs if remove code in action , if clear cache 'php symfony cc'. if set permissions 'php symfony project:permissions'. if combine of previous solutions in different order. here action code: public function executeexportpoststoproject(sfwebrequest $request) { echo 'why?? show me please!'; } on same module there 20 other actions decleared same way. i'm going crazy. tryed check server configuration symfony. no warnings. symfony version 1.4.5. i'm stuck! don't know do. seems file name of view case sensitive under linux. on windows hadn't same problem. on linux reasons new files created on window

Change application name on Android home screen -

is possible change dynamically (for example defined user) application's name shows in android home screen? i give name application on android market, show name, defined user, in android home screen. the value shows in play market comes androidmanifest.xml. you can externalize value in strings.xml file - don't think there way change values during runtime. good luck.

c# - Creating and showing forms at timed intervals -

i trying create , show forms @ timed interval. form contains picturebox , displays animated gif. @ each interval previous gif(s) closed , new ones created , displayed. able work single forms/gifs, if try show more 1 form @ time, run problems. here structure of have attempted: private void m_intervalcountdown_oncountdowncompleted(object sender, eventargs e) { //the timed event has fired prepareanddisplaynextforms(); } private void prepareanddisplaynextforms() { closepreviousforms(); //i loop through list of gifs , call: system.drawing.image img = system.drawing.image.fromfile(m_filepath); form_gif formgif = new form_gif(img); //i add each form_gif created concurentdictionary displaygifs(); } private void closepreviousforms() { //i loop through list containing forms, , call: myform.close(); myform.picturebox.dispose(); myform.dispose(); //it turns out have use invoke on form here close it, //though haven't exp

idl programming language - idl strange symbols in file -

i've written several idl programs analyse data. keep simple programs read in time varying data , calculate fourier spectrum. spectrum written file using code: openw,3,filename printf,3,[transpose(freq),transpose(power)],format='(e,e)' close,3 the file read program using code: rdfloat,filename,freq,power,/double the rdfloat procedure can found here: http://idlastro.gsfc.nasa.gov/ the error when trying read file is: "input conversion error. unit: 101" when delve in file being read, notice several types of unrecognised characters. dont know if these result of writing file or thing else related number of files being created (over 300 files) these symbols/characters in place of single number: < dle> < dc1> < dc2> < dc3> < dc4> < can> < nak> < em> < soh> < syn> example of appears in file being read, note not consecutive lines. 7.7346< dle>18165493007e+01 8.4796811549010105

android - touch listener takes precedence over listscroll listener -

i have got horizontal list swipe dismiss working except swipe dismiss takes precendence on scrolling ie if swipe left right on slightest angle think im trying swipe dismiss item instead of scrolling list along. think easiest approach have other way around have no idea how change or if there better way i've modified lucas rocha's twowayview , roman nurik/tim roes swipedismissundolist i'm not sure if code should looking can tell it's relevant. mainactivity listview = (twowayview) findviewbyid(r.id.listview1); //need add in emptyview , list view show , gone them when emtpy/full imageadapter = new imageadapter(this, products,emptyview,listview); listview.setadapter(imageadapter); vswipedismisslist.ondismisscallback callback = new vswipedismisslist.ondismisscallback() { @override public vswipedismisslist.undoable ondismiss(abslistview listview, final int position) { // delete item adapter (sample code):

html - My elements are not going on the same line - using "display:inline" -

please take @ code , tell me i'm doing wrong? want "hi" go right of table. i've tried putting "float:left" on elements , on each individually. <div style="display:inline"> <h1>heading</h1> <ul> <li><h4>reason 1</h4></li> <li><h4>reason 2</h4></li> <li><h4>reason 3</h4></li> <li><h4>reason 4</h4></li> <li><h4>reason 5</h4></li> </ul> <h1>hi</h1> </div> display property not inherited child elements. have specify li specifically, or else default display of list-item used li <div> <h1>heading</h1> <ul> <li style="display:inline"><h4>reason 1</h4></li> <li style="display:inline"><h4>reason 2</h4></li> <li style="display:inline"><h4>reason 3</h4>&l

node.js 8080 port isn't listening -

i'm following node.js tutorial in here, http://net.tutsplus.com/tutorials/javascript-ajax/learning-serverside-javascript-with-node-js/ this code, var sys = require("sys"), http = require("http"); http.createserver(function(request, response) { response.sendheader(200, {"content-type": "text/html"}); response.write("hello world!"); response.close(); }).listen(8080); sys.puts("server running @ http://localhost:8080/"); in here, says run url, server's ip:8080/ but if this, it shows, cannot connect url. i opened 8080 port in server. =========================== i'm assuming screwed codeigniter url helper... the tutorial may using incorrect or deprecated method. replace response.sendheader(200, {"content-type": "text/html"}); with response.writehead(200, {"content-type": "text/html"}); and response.close(); with

android - How can I add an ImageView to an ArrayAdapter? -

Image
how add imageviews arrayadapter show them in listview? tried making adapter arrayadapter<imageview> , didn't work. here's code: package com.example.picscroller; import java.util.arraylist; import java.util.list; import android.app.activity; import android.os.bundle; import android.view.menu; import android.view.view; import android.widget.arrayadapter; import android.widget.button; import android.widget.imageview; import android.widget.listview; public class mainactivity extends activity { @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); listview list = (listview)findviewbyid(r.id.list); arrayadapter<imageview> myarrayadapter = new arrayadapter<imageview>(this, android.r.layout.simple_list_item_1); list.setadapter(myarrayadapter); list.settextfilterenabled(true); final button addbutton = (button) findviewbyid(r.id.addbutton);

jquery - why does this iterate the div twice? -

so i've created erb block iterates through coordinates each image tag ('.tagged'), , displays '.tagged' each image @ given coordinates. in particular case block iterates through 2 images, , .tagged shows on both images instead of 1 tag per respected image. because of .each() method? <div class="container"> <% if @new_manual.present? %> <% @new_manual.steps.each |step| %> <% i_connection = contact.find(step.input_contact) %> <span class="i_connection" data-pos-x="<%= i_connection.pos_x %>" data-pos-y="<%= i_connection.pos_y %>" data-pos-width="<%= i_connection.pos_width %>" data-pos-height="<%= i_connection.pos_height %>"> </span> <br> <div class="image_panel"> <%= image_tag(i_connection.image.image.url(:large)) %> <div class='planetmap'></div> </div> <script type="text/j

cross domain - How would RESTful API for Parse work for HTML application? -

parse backend-as-service platform offers restful api data storage , query. seems appealing front-end or mobile developer , allows them focus on business logic without worry troublesome back-end technologies. the restful endpoint looks this: https://api.parse.com/1/classes/gamescore if want use on site, awesomehtmlsite.com, wouldn't request blocked cross domain restrictions? same hold true javascript api . can explain me how can utilize restful api or javascript api? responses calls parse javascript api include following header: access-control-allow-origin:* this allows used cross-domain. should able follow javascript guide/api parse provides, without worrying cross-domain issues.

iphone - How to customize back barbutton on EKEventViewcontroller -

it tried following code segment customize bar button own button. had no effect looked default button. ekeventviewcontroller*eventview = [[ekeventviewcontroller alloc] initwithnibname:nil bundle:nil]; eventview.event = closestevent; eventview.allowsediting = no; uibutton* leftbutton = [uibutton buttonwithtype:uibuttontypecustom]; [leftbutton setimage:[uiimage imagenamed:@"closebutton.png"] forstate:uicontrolstatenormal]; leftbutton.frame = cgrectmake(0, 0, 25, 25); [leftbutton addtarget:nil action:nil forcontrolevents:uicontroleventtouchupinside]; self.navigationitem.backbarbuttonitem = [[uibarbuttonitem alloc] initwithcustomview:leftbutton]; [self.navigationcontroller pushviewcontroller:eventview animated:yes]; i tried put ekeventviewcontroller child view of view controller had no clue how right. either way i'd customize button. update, tried this: eventview.navigationitem.leftbarbuttonitem = [[uibarbuttonitem alloc] init

ios6 - How to show navigation on map iPhone? -

in app want show navigation based on 2 coordinates,currently using mkmapview show route.is possible show navigation on mkmapview? if how can implemented,suggest me example code. any appreciated. thanks in advance. in ios 6.1 , earlier, mapkit framework not provide mechanism show directions on mkmapview . 3 options: you can request directions maps app . it's inelegant solution (to leave app), works. you consider using google maps sdk ios , provides api requesting directions. see directions , google maps ios sdk video. if you're registered apple developer, should check out mapkit framework enhancements in ios 7. (unfortunately, while it's in beta, precluded discussing details here.)

does not show the expected result when use __get() in php -

<?php class classname { public $attribute; function __get($name) { return 'here:'.$this->$name; } function __set ($name, $value) { $this->$name = $value; } } $a = new classname(); $a->attribute = 5; echo $a->attribute; when run above script, shows:5 question: echo $a->attribute; line of code invoke function __get($name) , right? why not show: here:5 ? the magic __get , __set , __call called if property properties or methods undefined or unaccessible calling scope, or undefined. to make work have remove public reference attribute or make protected or private. class classname { protected $attribute; function __get($name) { return 'here:'.$this->$name; } function __set ($name, $value) { $this->$name = $value; } } $a = new classname(); $a->attribute = 5; // calling __set echo $a->attribute; // calling __get

git - List all commits in a topic branch -

Image
i have feature branch concisely named feature has 100 commits related feature of sorts. these commits merged master branch on time. want list commits on branch can re-add feature other project. basically want have commit ids green dots on graph below. how can in git other going gitk or similar tool , hand-collecting relevant commit ids? despite answer given , accepted suggest more automatic way doing (but work if did not merge master feature ): considering following history: --a---b---c---d---e---f---g (master) \ / / h---j-------k (feature) basically want perform git log b..feature . git log --format='%h' feature..master | tail -1 | \ xargs -i '{}' git log '{}'^..feature git log --format='%h' feature..master | tail -1 find commit master done right after created feature branch - c and ancestor of c - b ancestor of first commit h of feature branch. then xargs -i '{}' git log &

Is it safe to replace android-support-v4.jar shipped with libraries with the latest -

from time time, google release latest version of android-support-v4.jar most of time, there quite number of 3rd party libraries depend on jar file. they shipped own version of android-support-v4.jar. actionbarsherlock android-viewpagerindicator slidingmenu pinnedheaderlistview i wondering, safe me, merely replace shipped old android-support-v4.jar, latest android-support-v4.jar released google? i tested. seems work basic test. i'm not sure there catches behind. the best answer probably, there's no way sure. if google didn't accidentally add bug, work. if did, things may break. or if library depended on old bug google fixed. chances you'll safe, can never sure without testing.

floating point - Convert real to IEEE double-precision std_logic_vector(63 downto 0) -

Image
this shouldn't difficult. i want read raw 64-bit ieee 754 double-precision floating-point data file, , use in std_logic_vector(63 downto 0) . i'm using modelsim altera 10.1b. i tried read raw binary data 64-bit vector: type double_file file of std_logic_vector(63 downto 0); file infile1: double_file open read_mode "input1.bin"; variable input1 : std_logic_vector(63 downto 0) := (others => '0'); read(infile1, input1); but doesn't work. apparently modelsim tries interpret each byte of input data std_logic ( 'u' , 'z' , '-' , etc.). i can however, read data real variables: type real_file file of real; file infile1: real_file open read_mode "input1.bin"; variable input1 : real; read(infile1, input1); but @ point, cannot figure out how convert real variable std_logic_vector(63 downto 0) . pretty of google results "you can't this; real isn't synthesizable". understand -

Control Instructions in C -

i not understanding loop statement , expression following it. please me understand. #include<stdio.h> int main() { int x = 1; int y = 1; for( ; y ; printf("%d %d\n",x,y)) y = x++ <= 5; return 0; } and output got 2 1 3 1 4 1 5 1 6 1 7 0 y = x++ <= 5; ==> y = (x++ <= 5); ==> first compare x 5 check whether x small or equals 5 or not. result of (x++ <= 5) either 1 , 0 assigned y , as x becomes > 5 , (x++ <= 5) becomes 0 y = 0 , condition false , loop break,

html - Cannot scroll in modal on mobile device -

my website has ajax interaction brings full-bleed modal suppose scroll scrolls. go www.morningharwood.com/works click on project go project the project modal open up. unfortunately scrolling no work on touch. note page scrolls fine if press , drag on projects' hero image. does know prevent scrolling on mobile touch?

java - Sort two arrayLists concurrently -

say have 2 arraylists: name: [four, three, one, two] num: [4, 3, 1, 2] if do: arrays.sort(num), have: name: [four, three, one, two] num: [1, 2, 3, 4] is there way can possibly sort on num , have reflected in name well, might end with: name: [one, two, three, four] num: [1, 2, 3, 4] ? please me out. thought of comparators , objects, barely know them @ all. you should somehow associate name , num fields 1 class , have list of instances of specific class. in class, provide compareto() method checks on numerical values. if sort instances, name fields in order desire well. class entity implements comparable<entity> { string name; int num; entity(string name, int num) { this.name = name; this.num = num; } @override public int compareto(entity o) { if (this.num > o.num) return 1; else if (this.num < o.num) return -1; return 0; } } test code this: public

mysql - compatibility Query for to_number() -

in query using to_number() in oracle. how write compatibility query oracle , mysql databases. select col1 table condition order to_number(col2); here col2 varchar2 datatype. suppose used order by command in query must use converting function i.e to_number(col2) ,this function not available in mysql.so please give correct solution above problem create custom function in mysql db name to_number takes same parameter , returns integer . can use cast function inside custom function delimiter $$ drop function if exists to_number$$ create function to_number (number varchar(10)) returns int (11) begin return (cast(number signed)); end$$ delimiter ; create custom/userdefined function to_number name can use query both in oracle , mysql

javascript - google maps api, directions from 2 points -

i have problem google map's api. have add site map show position of user , route point prefixed. 1) can't give "origin" of request, variable pos geolocalization. 2) can't give auto zoom coorect distance looking @ 2 marker. this code: var directionsservice = new google.maps.directionsservice(); var directionsdisplay = new google.maps.directionsrenderer(); var request = { travelmode: google.maps.directionstravelmode.driving }; //initializing map var initialize = function() { // taking address of school var address = document.getelementbyid('address').firstchild.nodevalue; var city = document.getelementbyid("city").firstchild.nodevalue; var comun = document.getelementbyid("comun").firstchild.nodevalue; var search = address + " " + city + " " + comun; // initializing geocoder , searcing address in search var geocoder = new google.maps.geocoder(); geocoder.geocode( {'address'

html - autocomplete = 'off' is not working on firefox -

i facing browser issue: i created 2 login pages of same domain. www.example.com/login.cfm www.example.com/newlogin.cfm i put form name different 2 forms in these 2 page. put autocomplete = 'off' second form , text fields within form.(but on first form ). now if save username , password @ time of login www.testdomain.com/login.cfm in browser, list of usernames auto populating in username field of second login page if auto complete off. need block security reasons. there way this? using firefox v21. put hidden empty text field between username , password <input type="text" name="username"> <!-- disables autocomplete --><input type="text" style="display:none"> <input type="password" name="password">

android - Get different events on setCompoundDrawables with differnet drawables -

i have edittext in i'm setting drawables right of edittext . i'm switching drawables different scenarios. have cleartext , refreshicon drawables. these both changing correctly i'm not able separate events both of drawables . here i'm doing clearing text edittext : string value = ""; final drawable x = getresources().getdrawable(r.drawable.clear_text); x.setbounds(0, 0, x.getintrinsicwidth(), x.getintrinsicheight()); geturl.setcompounddrawables(null, null, value.equals("") ? null : x, null); geturl.setontouchlistener(new ontouchlistener() { @override public boolean ontouch(view v, motionevent event) { if (geturl.getcompounddrawables()[2] == null) { return false; } if (event.getaction() != motionevent.action_up) { return false; } if (event.getx() > geturl.getwidth() - geturl.getpaddingright()

java - Failed to read schema document Schema Cloudfoundry -

i'm developing app java , spring , i'm trying upload appfog. the application working , it's working in appfog, in eclipse i'm getting annoying error in applicationcontext.xml file. according documentation in appfog have set this: spring - appfog documentation snippet of applicationcontext.xml <beans xmlns="http://www.springframework.org/schema/beans" xmlns:aop="http://www.springframework.org/schema/aop" xmlns:context="http://www.springframework.org/schema/context" xmlns:jee="http://www.springframework.org/schema/jee" xmlns:tx="http://www.springframework.org/schema/tx" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:cloud="http://schema.cloudfoundry.org/spring" xsi:schemalocation="http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.1.xsd http://www.springframework.org/schema/bean

javascript - Functions are not being assigned to another function's prototype in Chrome -

the following code works in firefox not in chrome? if comment out line 15 prevent error on line 7 (cannot find this.update()), code continues execute properly. cannot see why first set of definitions different first. if (typeof regionupdater == "undefined") { function regionupdater(param1, param2, param3) { this.parama = param1; this.paramb = param2; this.paramc = param3; this.update(); } regionupdater.prototype.update = function() { alert("hi there"); }; } var ru = new regionupdater("1", 2, "3"); function lolupdater(param1, param2, param3) { this.parama = param1; this.paramb = param2; this.paramc = param3; this.update(); } lolupdater.prototype.update = function() { alert("hi there"); }; var lu = new lolupdater(1, 2, 3); i've got jsfiddle setup here: http://jsfiddle.net/xhbz8/2/ edit: idea i've been able come chrome has sort of speculati

android - Automatically removing unreferenced strings from strings.xml -

in android app have lot of strings in strings.xml never used because removed code modules referenced them. there automatic way in eclipse or using other tool remove strings? for in $(lint . | grep 'the resource r.string.* appears unused' | perl -ne 'print "$1\n" if /r.string.(.*) appears/'); perl -pi -e 's/.*<string name="'$i'".*\n//' res/values*/strings.xml; done

c - Why does 5/7 print 0? -

i started learning c, , learnt / sign division operator. experimenting, , wondering why 5/7 printf number 0. here program: #include<stdio.h> main() { int n; n = 5/7; printf("%d", n); } thank you! this because of integer division. 5/7 makes 0.71.. , , integer part of number 0 , hence prints 0 . solve problem use float type (or double type) variables constants example try: float f = 5.0 / 7.0; print variable f format string %f

html - Div inline-block elements not filling width properly -

Image
i'm make website i'm getting stuck on css. reason, there's space between video slideshow , side bar. can tell me why is? below picture of web browser displays when given code. <html> <head> <link href="stylesheet.css" rel="stylesheet" type="text/css"> </head> <body> <div id='header'> <p>header</p> </div> <div id='picture_gallery'> <p>picture gallery</p> </div> <div id='nav_bar'> <p>nav bar</p> </div> <div id='vision_statement'> <p>vision statement</p> </div> <div id='video_slideshow'> <p>video slideshow</p> </div> <div id='sidebar'> <p>side bar</p> </div> <div id='footer'> <p>footer</p&g

How do I strip a string given a list of unwanted characters? Python -

is there way pass in list instead of char str.strip() in python? have been doing way: unwanted = [c c in '!@#$%^&*(fghjkmn'] s = 'ffffofob*&%ar**^' u in unwanted: s = s.strip(u) print s desired output, output correct there should sort of more elegant way how i'm coding above: ofob*&%ar strip , friends take string representing set of characters, can skip loop: >>> s = 'ffffofob*&%ar**^' >>> s.strip('!@#$%^&*(fghjkmn') 'ofob*&%ar' (the downside of things fn.rstrip(".png") seems work many filenames, doesn't work)

visual studio 2010 - C# Multilanguage messagebox -

i messagebox show information according language slected user. change button , label text according lanugage button click. how can make messagebox display different info based on language button click? example if have button , when click it, proper messagebox displayed, messagebox displayed in different languages different user choice. have text in resource. bellow code. private void btnlngenglish_click(object sender, eventargs e) { cultureinfo ci = new cultureinfo("en-us"); assembly = assembly.load("read_display"); resourcemanager rm = new resourcemanager("read_display.language.languageres", a); button7.text = rm.getstring("file", ci); button4.text = rm.getstring("timecount", ci); button6.text = rm.getstring("daterange", ci); button3.text = rm.getstring("specdate", ci); button1.text = rm.getstring("phrasesearch", ci); button5

javascript - Magento - Adobe Edge animation not working -

i'm trying include adobe edge animation within managed page it's not working. in firebug, see errors: typeerror: not function [stopper sur une erreur] ...ymbol.bindtriggeraction(compid,symbolname,"default timeline",0,function(sym,e){}... cartonedge_actions.js (ligne 4) in theme's page.xml file, have declared edge-generated javascripts follows: <action method="addjs"><script>devoption/carton_edgepreload.js</script></action> <action method="addjs"><script>devoption/carton_edge.js</script></action> <action method="addjs"><script>devoption/carton_edgeactions.js</script></action> i've found cause of problem: images refered in carton_edge.js file not found. that's because image directory calculated script using site's base url ending index.php. a solution override image directory in script full path images directory. you'll

c# - Screen distortion with win forms csharp for 64 bit -

i have used split container inside tabpage. it's working fine everywhere except laptop has win7 i5. checked in other win 7 laptops works fine. problem when restore window , maximize split container not resize leaving blank space. i figured out problem may : 1. problem 64 - bit machines 2. resize event of tab control not getting called. 3. have explicitly resized on mdi form , problem seems solved . takes time , resizing can seen. should seamless. 4. temporary solution. plz on it i got solution problem not container or control. limitation of 64 bit machines. if have nested controls resize event of deepest children not called if 15-16 levels deep. need override onsizechanged event of forms or control. refer site if 1 facing same problem http://social.msdn.microsoft.com/forums/windows/en-us/f06b8980-a38d-441f-8a5d-aa28c52f60c0/nested-usercontrols-on-x64-resizing-problem

c# - how to use Bingmaps in windowsphone7 with visual studio 2012 -

i'm trying use bing maps control on windows phone 7 silverlight application , i've tried follow sites: http://www.jeffblankenburg.com/2009/12/30/day-30-bing-maps-in-silverlight/ shows error: the tag 'map' not exist in xml namespace 'clr-namespace:microsoft.maps.mapcontrol;assembly=microsoft.maps.mapcontrol'. am doing wrong? make sure have added microsoft.phone.controls.maps assembly project references. in phoneapplicationpage add following attribute: xmlns:maps="clr-namespace:microsoft.phone.controls.maps;assembly=microsoft.phone.controls.maps" and use map control in page following: <maps:map />

excel - Delete cell if it contains < 3 characters -

as title suggests, i'd delete cell (delete text) if number of characters in cells < 3. for example row1 row2 sn dwd 124 411 1 123 32 231 01 23 here, i'd "sn", "1", "32", "01" , "23" made blank cells. assuming mean excel sub clearcellswithlessthan3chars() dim cell range each cell in activesheet.usedrange if (len(cell.text) < 3) cell.clear end if next end sub

cordova - AngularJS and Phonegap Cross Origin Access -

recently created phonegap app mobile devices, using angularjs javascript framework. i have php backend serving restful json data, build in laravel php framework. the phonegap app requests data php server $http service in angularjs, , works on mobile phone. now wanted make phonegap app available on website temporarily instead of in app. moved phonegap project webserver, here doesnt work @ all. these errors when trying use webapp in own browser. "origin http://somewebsite.com not allowed access-control-allow-origin.". i tried add config parameters angularjs such as: delete $httpprovider.defaults.headers.common['x-requested-with']; but nothing seems help. i find kinda weird worked phonegap app on phone , in iphone emulator, doesnt work on new webserver domain. anyone know do? the safest way use jsonp . in laravel like: response::json(array('name' => 'steve', 'state' => 'ca'))->setcallback(

java - WebSphere, the same context root for multiple war's -

i have task deploy 2 war files on websphere using scripting tool, problem 2 wars should have same context root's: /app/web/start and /app/web/report the context root these wars "/app" but websphere default throws error context root exists, maybe can suggest ways solve it? thanks /app/web/start , /app/web/report not same context roots. you can define composite context roots in application.xml : <context-root>/app/web/start</context-root> or use apache frontend, proxypass: proxypass /app/web/start/ http://localhost:9080/app1/web/start/ proxypass /app/web/report/ http://localhost:9080/app2/web/report/

c# - How to dereference a string that might be null in LINQ -

let's need compare object other objects stored in table called indexes in db. need compare object's x property, string, might null . i have trim comparedobject's x property before comparing. tried following: list<guid> ids = datacontext.indexes.where(ci => (comparedobject.x != null && ci.x != null ? ci.x == comparedobject.x.trim() : (ci.x == null || ci.x == string.empty) && (comparedobject.x == null || comparedobject.x == string.empty))).select(ci => ci.id).tolist(); and though comparedobjects.x null still throws null reference exception comparedobject.x.trim() expression. i assume happens due linq conversion? is there prettier way trim x property without having assign comparedobject.x empty string in case it's null before query ? edit: i'd elaborate - query reduced simplicity here, comparing 6 other properties. i'd keep in 1 query , not separate 2 queries diffe