Posts

Showing posts from March, 2010

c# - What is the best way of automating Windows Service deployment? -

i have created windows service using c# in visual studio 2010. did lot of research automating installation process. got lots of advice none did work me. windows service have created has lots of dependencies , client have no ui interaction during installation. have created setup project includes dependencies within installer. process involved: create build windows service push setup file (.msi) remote location call .msi , install service silently without user interaction. what did far: created powershell script push files remote location execute powershell script , install service please keep in mind powershell script sc create "servicename" binpath="somepath" is used installing service project directory not installing .msi file created using setup project these 2 vast different things. if don't understand don't answer please. possible solutions: use ( http://www.msbuildextensionpack.com/help/4.0.5.0/html/258a18b7-2cf7-330b-e6fe-

displaying numbers underneath a mask in python -

background hey everybody, i'm attempting code basic letter game in python. in game, computer moderator picks word out of list of possible words. each player (computer ai , human) shown series of blanks, 1 each letter of word. each player guesses letter , position, , told 1 of following: that letter belongs in position (the best outcome) that letter in word, not in position that letter not in of remaining blank spaces when word has been revealed, player guess letters correctly wins point. computer moderator picks word , starts again. first player 5 points wins game. in basic game, both players share same set of blanks they're filling in, players benefit each other's work. question i'm using mask display secret word series of dashes, in order indicate player number of letters in word. i want display numerical value underneath each dash, in order make easy player select character in word he/she guess. so, in case of 4 letter word, mask display this:

Sending an email using a php contact form -

i trying create contact form using php. when click send email appears have sent recipient never receives it. maybe need set smtp server unsure how this. in advance in form.html have <form action="mail.php" method="post"> <p>name</p> <input type="text" name="name"> <p>email</p> <input type="text" name="email"> <p>phone</p> <input type="text" name="phone"> <p>request phone call:</p> yes:<input type="checkbox" value="yes" name="call"><br /> no:<input type="checkbox" value="no" name="call"><br /> <p>website</p> <input type="text" name="website"> <p>priority</p> <select name="priority" size="1"> <option value="low">low</option> <option value="n

android - How to debug a nexus 10? Needs usb charger but need usb connected to debug -

has found solution debug galaxy nexus gets power? i can debug , use nexus 10 while plugged computer. can charge nexus 10 when plugged wall. it charges usb suppose short of rooting device , using adb connect ip address? do make cables? there ways send more amps through usb slot? usb hub work? something, anything? nightmare i see you're leaning towards hardware solution, answer more of workaround using: assume of debugging on emulators, if need know what's crashing app on nexus 10, maybe can try acra stack trace. found useful cannot test devices , versions, plus ide on vm without usb support... call "poor man's debugging". more on post: android - how send crash reports

asp.net mvc 3 - Paging in MVC Telerik Grid not Working -

i working on project display graduated , current student on page. rendered information on client side using telerik grid. page has 2 radio button - 1 radio button displaying graduated students , other displaying current students. every time user click on 1 of radio button, not post. there more current graduate students. when user access last page current student , click on graduate radio button, not show graduate students. telerik page did not update expected. undergrad page has 23 pages while graduate 1 has 18. accessing graduate page still on page 23 though have 18 pages. i follow example , added .pageable(paging => paging.enabled((bool)viewdata["paging"]).pageto(1)) it not go page one. i not figure out how make paging work properly. result, created 2 session variables, have values true or false, , redirected user same page setting grad , undergrad students flag false or true. if user came in first time, grad students flag set false, , page not redir

How to always center a flexible square in viewport with pure CSS? -

i know question: height equal dynamic width (css fluid layout) but want more!! want flexible container has aspect ratio of square max-height , max-width of 100% of page (the window element) , on top of vertically , horizontally centered. like this: // container matches height of window // container-height = 100%; container-width = absolute-container-height -page/browser-window- - ####### - - #cont-# - - #ainer# - - ####### - --------------------- // container matches width of window // container-width = 100%; container-height = absolute-container-width --page--- - - - - -#######- -#######- -#######- -#######- - - - - --------- is possible achieve pure css (and better cross-browser)? edit: know there calc() css3, due poor mobile browser-support , don't want use it. edit2: seems like, didn't make myself clear enough. need height , width of wrapper match height or width of window, depending on s

Android Actionbar compatibility alternate xml for pre-honeycomb -

i using actiobarcompat sample in application , trying implement search pre 3.0 devices. <menu xmlns:android="http://schemas.android.com/apk/res/android" > <item android:id="@+id/menu_search" android:orderincategory="1" android:title="@string/menu_search" android:icon="@drawable/ic_home" android:showasaction="collapseactionview|ifroom" android:actionviewclass="android.widget.searchview" /> </menu> on honeycomb+ works fine, searchview widget appears in actionbar. trying have second menu xml can fall old search activity way of doing it. however, there no such thing menu-v11 folder menu folder menu-v11 because version started supporting this. my question is, using actionbar compatibility sample, there way declaratively add alternate button pre-honeycomb? can please more specific trying achieve? it it's calling different activities depending on api vers

random - Trick the randomizer in C -

i want random numbers between 1 10. works, when it's in loop, don't random numbers. int randomnum; srand ( (unsigned int)time(null) ); randomnum = rand() % 10; i've been spending hours here , in google looking solution, looks no 1 solved (or maybe didn't search enough). value randomizer depends on seconds (not miliseconds or else, in other programming language) , that's why numbers not random. in addition, don't want download package c because run code in university labs, , won't allow it. is there creative solution problem? maybe mathematic functions? to illustrate sidoh's answer. #include <stdlib.h> #include <stdio.h> #include <time.h> int main(int argc, char** argv) { int i; srand ( (unsigned int)time(null) ); (i = 0; < 100; i++) { printf("%d ", 1 + (rand() % 10)); } putchar('\n'); return 0; } this produced following results 1 time seed using time( )

jstl - Error in EL Expression -

i trying use fn:length , c:when <c:when test="${fn:trim(${properties.num2display})== null}"> <c:set var="counter" value="3"/> condition 1 </c:when> gives me error : contains invalid expression(s): javax.el.elexception: error parsing: ${fn:trim(${properties.num2display})== null} what correct way write expression inside fn:trim ? try this: <c:when test="${not empty fn:trim(properties.num2display)}"> <c:set var="counter" value="3"/> condition 1 </c:when>

node.js - How to reload current page in Express.js? -

i'm current in /id/1234 page, , click post /add button, after want reload /id/1234 in experss.js: res.redirect(**how /id/1234 dynamicly, since in /id/1235, /id/1236 page same post /add action?**) thanks. i'd add in version 4.x of express can use res.redirect('back'); to automatically redirect page request came from. equivilant of res.redirect(req.get('referer')); that mentioned in peter lyons answer see also: http://expressjs.com/api.html#res.redirect

javascript - knockout.js not loading properly -

i'm trying use knockout.js on localhost doesn't appear loading/working , can't figure out what's going on. upon loading text appears none of knockout functionality there. it's text , can't modify anything. i opened console , i'm getting following error in reference knockout.js in chrome error uncaught typeerror: cannot read property 'nodetype' of null knockout.js:12 y knockout.js:12 l.b.da knockout.js:58 (anonymous function) in firefox error [00:26:57.685] typeerror: f null @ http://localhost/knockout_test/knockout.js:49 i tried 3 different versions of knockout , result in same error. i'm trying out airline meals example knockout website. have 4 files in same folder. wasn't sure if needed jquery in there included too meals.html meal_info.js knockout.js jquery.js this meal_info.js // class represent row in seat reservations grid function seatreservation(name, initialmeal) { var self = this; self.name = nam

php - Need help zozo (ZOZO TOWN) api details -

i creating api japan affiliate store using amazon, rakutan, , zozo using php. got amazon , rakutan api details. no resource found in zozo(zozo town). 1 sucessfully done api. please guide me. where web services home page zozo? there not resource zozo affiliate because zozo affiliate has been closed last year. http://kirei.biglobe.ne.jp/news/detail/20121111105027_fsn2012-11-11-zozotown-affiliate-close-

video effect using javascript -

can 1 please tell me how video effect shown on this page? has 100% width, responsive , uses javascript. if have code samples great. the site using html5 video tag. here's source, rendered google chrome: <video loop="loop" poster="/video/features/main.jpg" style="width: 1263px; height: 711px; top: -186.5px; left: 0px;"> <source src="/video/features/main.webm" type="video/webm"> <source src="/video/features/main.mp4" type="video/mp4"> </video> the tag, evidently available in html5 compatible browsers, can play video files. that's it's doing in case. the first source primary video source, , mp4 fallback in case first video format isn't supported. loop property allows set loop playing video, , poster image show until user plays or seeks. take @ mdn page .

java - Why am I getting an error as I try to call paintComponent? -

my class named ui extends roundbutton follows : public class roundbutton extends jbutton { public roundbutton(string label) { super(label); this.setcontentareafilled(false); dimension size = this.getpreferredsize(); size.height = size.width = math.max(size.height, size.width); this.setpreferredsize(size); } @override protected void paintcomponent(graphics g) { if(!gamestate.getifcomplete()) { // if game not complete or has started this.setborder(null); g.setcolor(color.black); g.fillrect(0, 0, this.getsize().width, this.getsize().height); if(this.getmodel().isarmed()) { g.setcolor(color.red); }else { g.setcolor(color.green); } g.filloval(0,0,this.getsize().width-1,this.getsize().height-1); super.paintcomponent(g); }else { this.setborder(null); g.setcolor(co

android - How to use google Map Api2 along-with-other-fragments-in-an-app -

am trying create , app 1 activity multiple fragment. using android.support.v4.* build fragment. each item have created far extending fragment, want use google map api2 in application, all tutoril found far adding "supportmapfragment" element layout file. "<fragment class="com.google.android.gms.maps.supportmapfragment" android:layout_width="match_parent" android:layout_height="match_parent"/>" but cannot use way because nested fragment not supporting, how can use google map api2 fragment in application use mapview suggested in comments public class interactivemapswidget extends fragment { private mapview mmapview; private googlemap mmap; public void oncreate(bundle savedinstancestate) { super.onactivitycreated(savedinstancestate); log.i(tag, "on created"); activity activity = getactivity(); if (activity != null) {

leiningen - Compojure Example from Clojure in Action Not Working -

i working on compojure example clojure in action page 232 (ns compojure-test.core (:gen-class) (:use compojure)) (defroutes hello (get "/" (html [:h1 "hello world"])) (any "*" [404 "page not found"])) (run-server {:port 8080} "/*" (servlet hello)) but when attempt run it: $ lein run exception in thread "main" java.lang.classnotfoundexception: compojure-test.core @ java.net.urlclassloader$1.run(urlclassloader.java:202) @ java.security.accesscontroller.doprivileged(native method) ... it appears statement (:use compojure) i have heard there major change between recent versions of compojure. ma doing wrong in setting compojure app? there tutorial online me , running? you might want try changing use statement to: (:use compojure.core) that should it. i created boilerplate template while compojure has working example can see here . even better, if you're using leiningen - should - c

java - ArrayList get all the elements -

in function, once if statement becomes true, returns value , "kicks" me out of function. i'm trying rest of elements of arraylist, know ones i'm not going access it. question is, how can rest of elements array? for(node a:state.children) { state.value = math.max(state.value,min_value(a, alpha, beta)); alpha = math.max(alpha,state.value); if(beta <=alpha) { system.out.println("the elements going skipped are: " + a.label); return state.value; } } how can make copy of last elements of array not going used because of return statement have arraylist hold unskipped values. that, add else block existing if block. in else block add element temp arraylist. iterate through temp arraylist unskipped values. arraylist<node> templist = new arraylist<node>(); for(node a:state.children) { state.value = math.max(state.value,min_value(a, alpha, beta)); alpha = math.max(alpha,state.value); if(bet

asp.net - Too many redirects on AppHarbor -

i started getting error on application in appharbor. on localhost there no problem. firefox has detected server redirecting request address in way never complete. i have added code in app_code directory, not sure if causing problem or not. has had problems this? ideas? yes problem app_code. turned off custom errors. , giving app_code not allowed because application precompiled... solved disabling precompile option in apphb application settings.

ggplot2 - R adding a datatable to a ggplot graph using viewPorts : Scaling the Grob -

Image
i'm trying add data-table graph made in ggplot (similar excel functionality flexibility change axis on) i've had few goes @ , keep hitting problem scaling attempt 1) was library(grid) library(gridextra) library(ggplot2) xta=data.frame(f=rnorm(37,mean=400,sd=50)) xta$n=0 for(i in 1:37){xta$n[i]<-paste(sample(letters,4),collapse='')} xta$c=0 for(i in 1:37){xta$c[i]<-sample((1:6),1)} rect=data.frame(xmi=seq(0.5,36.5,1),xma=seq(1.5,37.5,1),ymi=0,yma=10) xta=cbind(xta,rect) = ggplot(data=xta,aes(x=n,y=f,fill=c)) + geom_bar(stat='identity') b = ggplot(data=xta,aes(x=n,y=5,label=round(f,1))) + geom_text(size=4) + geom_rect(aes(xmin=xmi,xmax=xma,ymin=ymi,ymax=yma),alpha=0,color='black') z = theme(axis.text=element_blank(),panel.background=element_rect(fill='white'),axis.ticks=element_blank(),axis.title=element_blank()) b=b+z la=grid.layout(nrow=2,ncol=1,heights=c(0.15,2),default.units=c('null','null')) grid.show.layout(la) g

Can't get HBase Stand-alone mode to start -

i going through hbase quickstart guide ( http://hbase.apache.org/book/quickstart.html ), , running lots of problems getting through first step. i using mint linux 13 under virtualbox win7 host. i downloaded hbase 0.94.6.1, unzipped file on home path, configured loopback address. fine writing /tmp testing purposes, did not modify /conf/hbase-site.xml. start-hbase.sh: 45: [: false: unexpected operator localhost: starting zookeeper, logging /home/askldjd/hbase-0.94.6.1/bin/../logs/hbase-askldjd-zookeeper-test-hadoop.out starting master, logging /home/askldjd/hbase-0.94.6.1/bin/../logs/hbase-askldjd-master-test-hadoop.out not start zk @ requested port of 2181. zk started @ port: 2182. aborting clients (e.g. shell) not able find zk quorum. localhost: starting regionserver, logging /home/askldjd/hbase-0.94.6.1/bin/../logs/hbase-askldjd-regionserver-test-hadoop.out if type ./bin/hbase shell, , enter status, here's get. 13/04/05 01:47:06 error client.hconnectionmanager$hcon

php - Paypal Express Checkout Error in CodeIgniter, Gocart(Method Specified is not Supported) -

i new codeigniter , paypal. working on gocart(an open source ecommerce solution built on codeigniter). try work on paypal api integrated in it, showing error follows : [ack] => failure [l_errorcode0] => 81002 [l_shortmessage0] => unspecified method [l_longmessage0] => method specified not supported [l_severitycode0] => error below code : paypal_expres.php function __construct() { $this->api_username ='username'; $this->api_password = 'password'; $this->api_signature ='signature'; $this->return_url = 'www.example.com'; $this->cancel_url = 'www.example.com'; $this->currency = 'usd'; $this->host = "api-3t.sandbox.paypal.com"; $this->gate = ' https://www.sandbox.paypal.com/cgi-bin/webscr ?'; } public function doexpresscheckout($amount, $desc, $invoice='') { $data = array( 'paymentaction' =>'sale', 'amt' =>

ios - How to resize and transform labels? -

my application requires user enter few details displayed via view using labels. as user can enter variable length of text, while label had fixed length , breadth, used code following adjust label size: cgsize maximumlabelsize = cgsizemake(296,9999); cgsize expectedlabelsize = [yourstring sizewithfont:yourlabel.font constrainedtosize:maximumlabelsize linebreakmode:yourlabel.linebreakmode]; //adjust label the new height. cgrect newframe = yourlabel.frame; newframe.size.height = expectedlabelsize.height; yourlabel.frame = newframe; the problem these modifications have many labels 1 after other. when change length of 1 label, following labels need transformed/moved new locations. is there way can change size , location of labels dynamically, while ensuring final presentation in case of fixed length labels? int h=10; // initial height want for(int k=0;k&l

Flat files within a zipfile in Python -

i doing: z = zipfile.zipfile('myzip.zip', 'w') z.write('/some/path/mytxt1.txt') z.write('/some/other/path/mytxt2.txt') z.close() this preserving file paths within zip. want desired files sit flat in zip file. how can this? zipfile.write() takes second argument, arcname . set os.path.basename() of first argument remove path: def zip_write(zip, filename): zip.write(filename, os.path.basename(filename)) z = zipfile.zipfile('myzip.zip', 'w') zip_write(z, '/some/path/mytxt1.txt') zip_write(z, '/some/other/path/mytxt2.txt') z.close()

how to create my queru in spring roo -

i beginner. i try created custom finder. , used "repository jpa " command. repository: @roojparepository(domaintype = speaker.class) public interface speakerrepository { @query("select u speaker u username = :un") public list<speaker> findllallspeakersnamed(@param("un") string lastname); } service: public class speakerserviceimpl implements speakerservice { @autowired speakerrepository speakerrepository; public list<speaker> findllallspeakersnamed(string lastname) { return speakerrepository.findllallspeakersnamed(lastname); } } and controller: @requestmapping("/findaspeaker/**") @controller public class findaspeaker { @autowired speakerserviceimpl speakerserviceimpl; @requestmapping(method = requestmethod.post, value = "{id}") public void post(@pathvariable long id, modelmap modelmap, httpservletrequest request, httpservletresponse response) { } @request

python - Starting django-socketio in production -

i installed django-socketio because seems best way implement chat myself. problem have when run python manage.py runserver_socketio host:port runs , can't close terminal or stop working, how can around that? i solved same issue command nohup. so start server nohup python manage.py runserver_socketio host:port & (& start in backgroud). result stored in nohup.out file...

codenameone - Rotation of text and Image -

i want make rotation of text , image. possible codename one? if yes please let me know how it's done code sample lines of code. this depends on trying do. there 2 ways: draw on square mutable image , use method rotate rotated version. if targeting ios/android can use rotate affine transform on graphics class while drawing , invoke resetaffine() when finished.

javascript - How to prevent the auto Scroll Event while loading new HTML contents? -

i using window.scroll() function appending more html contents div holder while scrolling . loading 10..10 each on each scroll event. after loading first 10 contents, document size increasing , accordingly browser automatically scrolls , calling loadcontent function , appending new contents without doing scroll manually.how can prevent mechanism.i need load further contents when user scrolls button. $(function(){ var loading = true; $(window).scroll(function(){ if ( loading && $(window).scrolltop() + $(window).height() > $(document).height() - 100 ){ loading = false; loadcontents(); loading = true; } }); )}; is there other better way perform infinite scrolling functionality? usually boolean flag you're doing how handle this. though data filled in using ajax , that's loading changed. values loading seems reverse also. $(function(){ var loading = false; $(window).scroll(function(){ if ( !loading &

java - how to to retrive data in jsp from MySQL using Liferay? -

i want retrieve data , insert data in mysql. i m providing 3 file 1 java file , 2 jsp file edit.jsp , view.jsp edit , view data respectively. i have created table using servicebuilder , have put portal-ext.properties in classes folder, tell me perfect method? m doing correct way? i want first insert data , want retrieve data database. i m inserting data through following jsp file - edit.jsp <%@ taglib uri="http://java.sun.com/portlet" prefix="portlet" %> <jsp:usebean class="java.lang.string" id="addnameurl" scope="request" /> <jsp:usebean class="java.lang.string" id="area" scope="request"/> <jsp:usebean class="java.lang.string" id="email" scope="request"/> <jsp:usebean class="java.lang.string" id="subject" scope="request"/> <jsp:usebean class="java.lang.string" id="compnay" sco

Add legend with color and range in R -

Image
the following example code produces color dot graph according values of a : a <- sample(1:100) rbpal <- colorramppalette(c('red','blue')) b <- rbpal(10)[as.numeric(cut(a,breaks = 10))] plot(a,col=b,pch=16) i add legend graph indicating range of values colors refer to. like: "#c60038" - [20.7 - 30.7] "#5500aa" - [60.4 - 70.3] (the above color code colored dots). you can save cut() levels separate variable function levels() . function gsub() can replace , - , ( [ . in function legend() provide position of legend, variable cuts use labels, col=rbpal(10) use same 10 colors in legend , pch=16 make filled dots. cuts<-levels(cut(a,breaks = 10)) cuts<-gsub(","," - ",cuts) cuts<-gsub("\\(","[",cuts) cuts [1] "[0.901 - 10.8]" "[10.8 - 20.7]" "[20.7 - 30.7]" "[30.7 - 40.6]" "[40.6 - 50.5]" "[50.5 - 60.4]"

ios - how to check a mutable string contains a string value or not in iphone? -

i have beeen storing string values mutablearray store in nsuserdefaults.like way ` nsmutablearray *arrayobj = [nsmutablearray arraywitharray:[[nsuserdefaults standarduserdefaults] objectforkey:@"emoved"]]; for(int = 0 ; i<[searcharray count]; i++) { nslog(@"%@",searcharray); nsdictionary *dictionarydate = [searcharray objectatindex:i]; nsstring *memeid=[[dictionarydate objectforkey:@"id"]description]; if([dictionarydate objectforkey:@"dateofinfo"]) { if ([arrayobj containsobject:memeid]) { } else { [arrayobj addobject:memeid]; } } } [[nsuserdefaults standarduserdefaults] setobject:arrayobj forkey:@"emoved"]; ` when printng need add value @ once .but when priting value seing same value added array multiple times.is there wrong in approach can point ou

ruby on rails - wrong number of arguments (4 for 1..3) -

i'm struggling understand why happen destroy method since on controller , routes ok! if passed through way please give me hint? routes resources :users, :as => "" resources :sections, :only => [:new, :create, :destroy, :index] end controller def destroy @section = section.find(params[:id]) @section.destroy redirect_to sections_url flash[:notice] = "section deleted" end view <%= render :partial => "section", :collection => @sections %> partial <%= link_to section.name, section_path(current_user, section) %> <%= button_to 'remove', current_user, section, :data => { :confirm => 'confirm?' }, :class=> "buttom", method: :delete %> that error means function takes 1 3 arguments, gave 4 arguments. please see row number in error , function, open documentation , how use function. functions works differently instance methods , class met

iphone - media queries not applying inside the iframe of a mobile application -

i have strange issue when loading site within iframe of mobile application. having website 7 pages. when browse website url in iphone's safari. content in pages rendering perfect. if load website in iframe inside mobile application android renders website correctly inside iframe of mobile application . in iphone 3 of pages content overflowed , can't see full page. media queries listed below. way using bootstrap framework website. @media (min-width: 768px) , (max-width: 979px) { // css goes here } @media (min-width: 768px) { // css goes here } @media (max-width: 767px) { // css goes here } @media (min-width: 1200px) { // css goes here } @media (min-width: 768px) , (max-width: 979px) { // css goes here } @media (max-width: 767px) { // css goes here } @media (max-width: 480px) { // css goes here } @media (max-width

django - Lighttpd - Cannot start, can't bind port, permission denied -

i have installed lighttpd in parallel apache (using port 80). starting lighttpd gives me error starting lighttpd: 2013-04-05 15:56:17: (network.c.379) can't bind port: 81 permission denied changes made in lighttpd.conf: server.port = 81 server.use-ipv6 = "disable" what missing here? using centos 6.3 netstat -ltp result: active internet connections (only servers) proto recv-q send-q local address foreign address state pid/program name tcp 0 0 localhost:smux *:* listen 1947/snmpd tcp 0 0 *:mysql *:* listen 15673/mysqld tcp 0 0 *:57071 *:* listen 1683/rpc.statd tcp 0 0 *:sunrpc *:* listen 1665/rpcbind tcp 0 0 *:ndmp *:*

Dotnetnuke 7 with Visual Studio 2010 -

i'm starting develop dotnetnuke , downloaded package "dotnetnuke_community_07.00.05_source" . package contains 2 solutions: "dotnetnuke_community_source.sln" , "dotnetnuke_community_unittests_source.sln" . apparently, these solution files can opened using visual studio 2012 . have installed operating system windows xp , visual studio 2010. is there way open solutions visual studio 2010?. to develop dotnetnuke don't need open dnn solution, should start looking @ module development templates. my latest templates vs2012, can use older version here https://christoctemplate.codeplex.com/releases/view/93348 basically, develop dnn, create custom extensions (modules/skins) , install them. need open dnn solution itself.

jquery - Parse external XML (rss) with javascript? -

i want parse rss without php: <rss version="2.0"> <channel> <item> <title>test</title> <link>http://www.test.com</link> <image> <url>http://foo.bar/test.jpg</url> </image> <description> <![cdata[description text here!<br><a href="http://www.test.se" target="_blank" rel="external" data-ajax="false">link!</a></div>]]> </description> </item> </channel> </rss> can accomplish without php? i'm complete newbie in jquery/javascript.. the xml here: http://hundkartan.se/karta/kartdata/cron_webbutiker_mob.xml i'm going use in phonegap it's external feed. my advice use json javascript. can convert xml json file external script (like xml2json ). json natively supported javascript access member simple. example obtain link

javascript - How to remove an certain element in iFrame -

this question has answer here: jquery/javascript: accessing contents of iframe 11 answers i've got website has iframe in it. iframe linked external page. want remove elements in external website (the website has html coding) using javascript (other methods ok too) without clicking on "remove" buttons or anything, should automatically remove element when webpage , iframe loads, no 1 can see it. example, want remove website's logo , contents. i've tried lots of methods don't work in iframe. unfortunately cannot access elements in iframe if iframe linked external site, there no workaround using javascript.

objective c - iOS Facebook SDK Post a picture on a Page where i have admin rights -

i'm having problem while trying post picture on fb page i'm admin. picture uploaded on own account instead of page. here's code i'm using this: - (void)apigraphuserphotospost:(uiimage*)img withmessage:(nsstring*)message { nsuserdefaults *defaults = [nsuserdefaults standarduserdefaults]; nsuinteger c; (c = 0; c < [gfbpagearray count]; c++) { if ([[[gfbpagearray objectatindex:c] objectforkey:@"name"] isequaltostring:[defaults objectforkey:@"fbpostas"]]) break; } params = [nsmutabledictionary dictionarywithobjectsandkeys: img, @"picture", message, @"message", [[gfbpagearray objectatindex:c] objectforkey:@"access_token"], @"access_token",nil]; [[self facebook] requestwithgraphpath:[nsstring stringwithformat:@"/%@/photos", [[gfbpagearray objectatindex:c] objectforkey:@"id"]] andparams

java - SWT problems with saving data in the data base -

i trying make editable table using swt, while have trouble save dates modified in database using toplink: if (referenceviewid.equalsignorecase(tistableviewpart.id)) { //todo yuchen : register , save objects in db system.out.println("test"); final iviewpart viewpart = workbenchpage.findview(tistableviewpart.id); final tistableviewpart vdv = (tistableviewpart) viewpart; workingunitmasterdataimpl sessionuow = new workingunitmasterdataimpl(); object test = vdv.getlocalcomposite().gettableviewer().getelementat(1); sessionuow.registerobject(test); try { sessionuow.commitandresume(); } catch (exception e) { // todo auto-generated catch block e.printstacktrace(); } } by using object test = vdv.getlocalcomposite().gettableviewer().getelementat(1); i can object of first colomne of table, use sessionuow.registerobject(test); to save change. have id

javascript - How to determine whether a DOJO Checkbox is checked or not? -

<input id="test" type="checkbox" value="test" data-dojo-type="dijit.form.checkbox"> how check above dojo checkbox checked or not in javascript function. you can use javascript function checked on id, like: if (test.checked == 1){ alert("checked") ; } else{ alert("unchecked") ; } here .checked return "1" in case checkbox checked. please try in javascript , let me know in case of concern.

Issue with selenium IDE, "[error] testCase.debugContext.currentCommand() is undefined" -

i seeing error in script hasn't changed - selenium version has. error happens me @ endwhile loop executes 10+ times. face error. [error] testcase.debugcontext.currentcommand() undefined [error] unexpected exception: filename -> chrome://selenium-ide/content/selenium-runner.js, linenumber -> 157 after getting these errors, selenium hangs , have close , reopen. is there way resolve error ? or way error not face again. kindly help. this keeps happening firefox 36.0.4, , vanilla selenium ide without plugins. you need download previous version of firefox compatible current selenium release.

unit testing - Can google test handle multithreaded test output on windows -

i hit problem boost unit running on windows output multiple threads not atomic, corrupts output xml confuses ci system if put tests or messages in threads other main thread. i can't see boost unit option control this, wondering if google test can make worth switching google test instead (searching wiki didn't find me anything). or there other approach should use (it's useful when running test command line on linux see output. don't want break windows ci)? gtest's output mutex-protected, multi-threading doesn't produce garbled output. the function work addtestpartresult . @ line 3713, can see lock being applied: internal::mutexlock lock(&mutex_); and @ 3732 result printed in call: impl_->gettestpartresultreporterforcurrentthread()->reporttestpartresult(result);

How can I get the Python module termios to work in Cygwin? -

i want run urwid in windows downloaded , installed cygwin (default packages only). tried hello world example: import urwid txt = urwid.text(u"hello world") fill = urwid.filler(txt, 'top') loop = urwid.mainloop(fill) loop.run() but complains termios : $ python test.py traceback (most recent call last): file "test.py", line 1, in <module> import urwid file "c:\python27\lib\site-packages\urwid-1.1.1-py2.7-win-amd64.egg\urwid\__init__.py", line 40, in <module> urwid.graphics import (bigtext, linebox, bargraphmeta, bargrapherror, file "c:\python27\lib\site-packages\urwid-1.1.1-py2.7-win-amd64.egg\urwid\graphics.py", line 30, in <module> urwid.display_common import attrspec file "c:\python27\lib\site-packages\urwid-1.1.1-py2.7-win-amd64.egg\urwid\display_common.py", line 23, in <module> import termios importerror: no module named termios i went installer , installed package

java - Analyse JasperReports export output -

again - jasperreports... so, we've got reports charts , tables similar this: jan | feb | mar | ... | dec | sum ----+-----+-----+-----+-----+---- 5 | 1 | 9 | 120 | 20 | 155 (numbers represent amounts of vehicles) beneath these tables there multiple tables consist of data above table in deeper detail (in drill down manner). we export these reports pdf , serve them in web application downloadable documents. needed data calculated in specialized java factories. per report there 1 factory serves list dumb data objects. these objects contain aggregated numbers displayed in charts , tables. additionally numbers hyperlinks. forward servlet offers xls export contains detailed data each vehicle. of course, each hyperlink has bunch of parameters servlet. what want have: a full automated test following: check data integrity of each table (is number in sum column sum of each column before) check data integrity of detailed tables in respect superior table (sum of jan

logging - How do i output a log in Android? -

i have seen million different log functions , log.i , log.v , log.d . i want output simple string on log times in code see if working ok debugging. what clean way that? there different type of log. i = info v = verbose d = debug e = error example: log.d("tag","the string youd like"); log.v("tag","the string youd like"); log.e("tag","the string youd like"); log.i("tag","the string youd like");

tomcat - Chat Server Load Balancing -

i've read the document on clustering , load balancing apache tomcat servers, i'm confused on how work communication. let's i'm creating chat app allows users talk 1 through server. if 2 users on same server, that's great, if 1 user on 1 server , other on another? how servers communicate? i guess point using multiple servers reduce load, if users communicate via server , each user on separate server, 2 servers become each other's client , load not decrease. my point it's same amount of data into/out of each server, how work when there 1 million users? you're looking @ 2 different requirements: load balancing: expose single network address multiple web (or other protocol) servers. communicating state (the messages) between multiple servers. the first requirement straightforward: use hardware or software load balancer, or use single apache web server in front of multiple java servers. the second requirement issue. let's th

php if statement ignores condition -

i'm trying check if user countries , not ip address, enter if following statement checks $country ignors ip check condition if($country == "usa" || $country == "can" && $ipc != "1x.1x.1x.1x" && $ipc != "2x.2x.2x.2x"){ if(($country == "usa" || $country == "can") && $ipc != "1x.1x.1x.1x" && $ipc != "2x.2x.2x.2x") you want use ( ) around || condition php evaluates correctly this in math, use of order of operations.

.net - set datetimepicker in c# windows -

how can set date , time datetimepicker stored in database , in " 2013-04-04 04:27:16.000 " format the column in database ' datetime ' format. if have datetime string: var converter = typedescriptor.getconverter(typeof(datetime)); var result = converter.convertfrom(datetimestring); datetime value = (datetime)result; datetimepicker.value = value; or use datetime.parse or tryparse or can database datetime datetime? dt =row.field<datetime?>(columnname); if(dt.hasvalue) datetimepicker.value = dt.getvalueordefault(); where row datarow got database

Keep the true ARRAY OBJECT between Javascript -to- PHP via Ajax? -

i want post javascript array object via ajax php. @ php end, still want use object true array. below approach far still not successful in terms of using incoming object array @ php side. can parse string . javascript: var myobj = { fred: { apples: 2, oranges: 4, bananas: 7, melons: 0 }, mary: { apples: 0, oranges: 10, bananas: 0, melons: 0 }, sarah: { apples: 0, oranges: 0, bananas: 0, melons: 5 } } then, javascript/jquery send via ajax: $.ajax({ type: "post", url: "ajax.php", datatype: "json", data: { "data" : json.stringify(myobj) } }).success(function( response ) { alert(response); }); then parse @ php: $data = json_decode( $_post["data"] ); echo json_encode( $data["fred"] ); echo json_encode( $data["fred"]["apples"] ); echo json_encode( $data["fred"]->apples ); echo json_encode( $data[1] ); any of above echo returns blanks, browser.

monads - Convert [IO Int] to IO [Int] in Haskell? -

i have code fits need: f :: [io int] -> io [int] f [] = return [] f (x:xs) = <- x <- f xs return (a:as) but thougth there predefined way (msum ?) but can't see how. any welcome. thx yes, it's available in standard library under name sequence . has more general type f : monad m => [m a] -> m [a] , since works monad , not io . you find searching type [io a] -> io [a] on hoogle .

iis - Configuration location for asp.net version of a website -

after crash had reinstall windows server. we have >1000 websites combinations of asp.net versions on our machine (1.1 , 2 , 4) . i looked inside iis metabase version of asp.net version of websites it's not there. know data stored ? (it's server crash cannot aspnet_regiis -lk ) thanks avi

javascript - Facebook UI,Popup shows An error occurred. Please try later -

ok,i made code,and shows error occurred. please try later when popup comes,and in colsole says : undefined @ "function callback(response) { console.log(response); }" here's code: <script> function posttofeed() { // call api var obj = { method: 'feed', link: 'https://apps.facebook.com/assault_combat/takegift', picture: 'https://flyandsmash.herokuapp.com/images/gift.png', name: 'take gift assault combat', caption: 'https://apps.facebook.com/assault_combat/', actions: [ {'name': 'get gift', 'link': 'https://apps.facebook.com/assault_combat/takegift'} ], description: 'action links awesome.' }; function callback(response) { console.log(response); } fb.ui(obj, callback); } </script> and btw,when type "fb.init , stuff,it says error on too... (i have imported div fb roots , stuff) always use asynchronous

asp.net - Ajax htmlEditorExtender - Unrecognized element sanitizer -

hi i've downloaded latest version of ajax toolkit microsoft , i'm trying setup sanitizer htmleditorextender, keep getting following error when trying build site: "unrecognized element 'sanitizer.'" following guide on ajax site i've tried add following: <compilation debug="true" strict="false" explicit="true" targetframework="4.0"> <sanitizer defaultprovider="antixsssanitizerprovider"> <providers> <add name="antixsssanitizerprovider" type="ajaxcontroltoolkit.sanitizer.antixsssanitizerprovider"></add> </providers> </sanitizer> <assemblies> <add assembly="system.design, version=4.0.0.0, culture=neutral, publickeytoken=b03f5f7f11d50a3a"/> <add assembly="system.web.extensions.design, version=4.0.0.0, culture=neutral, publickeytoken=31bf3856ad364e35"/> <ad