Posts

Showing posts from May, 2012

android - How to know Typing Status in XMPP openfire using Smack -

i developing chat application using openfire xmpp server. can text chat between 2 user. want know typing status when 1 typing message. created class :- public class typingstatus implements chatstatelistener { @override public void processmessage(chat arg0, message arg1) { // todo auto-generated method stub } @override public void statechanged(chat arg0, chatstate arg1) { // todo auto-generated method stub system.out.println(arg0.getparticipant() + " " + arg1.name()); } } but confuse how work? know need packet can in listener. unable find packet. please 1 suggest, how work? and difference between smack , asmack? thank you! to enable chatstatelistener need create custom messagelistener class public class messagelistenerimpl implements messagelistener,chatstatelistener { @override public void processmessage(chat arg0, message arg1) { system.out.println("received message: ...

How to pass schema as parameter to a stored procedure in sql server? -

i have stored procedure select list of data based on 2 tables. first table fixed one: co.country . second table can 1 of number of tables. name of table same: location . but, schema of tables different: abd.location, cga.location, gbn.location. the user select schema application, schema chosen passed stored procedure parameter. but there's error when parse stored procedure while creating it. is there anyway pass schema name parameter? use dynamicsql try this create procedure proc_name @schema varchar(25) declare @query varchar(1000) set @query='select * from' +@schema +'.location' execute(@query)

ios - Drop Pin in MapView using Custom Addresses -

i created map view in app. want user able add several addresses drop pins @ locations. want user able remove these pins. does know can find tutorial, or start? have no experience mapviews... try this...... - (void)showpins { activity.hidden=yes; [activity stopanimating]; double lat; double lng; (int ijk=0; ijk<arraylocationlist.count; ijk++) { /*set lat , long here*/ lat=[[[[arraylocationlist objectatindex:ijk]objectforkey:@"location"] objectforkey:@"lat"] doublevalue]; lng=[[[[arraylocationlist objectatindex:ijk]objectforkey:@"location"] objectforkey:@"lng"] doublevalue]; cllocationcoordinate2d geos = cllocationcoordinate2dmake(lat, lng); mkplacemark* marker = [[mkplacemark alloc] initwithcoordinate:geos addressdictionary:nil]; [mapvieww addannotation:marker]; } cllocationcoordinate2d coord1 = {.latitude = lat, .longitude =lng}; ...

javascript - Jasmine - Two spies for the same method -

i'm new jasmine , wanted know if can create 2 spies same method. here i'm trying. describe('something', function () { beforeeach(function () { myspy = jasmine.createspyobj('myspy', 'functionininterest'); myspy.functionininterest.andcallfake(function (cb) {cb(something);}); } //some test cases describe('here action!', function () { myspy = jasmine.createspyobj('myspy', 'functionininterest'); myspy.functionininterest.andcallfake(function (cb) {cb(somethingelse);}); //some test cases depends on somethingelse }); }); testcases before here action! depend on myspy.functionininterest.andcallfake(function (cb) {cb(something);}); test cases inside here action! depend on myspy.functionininterest.andcallfake(function (cb) {cb(somethingelse);}); note: both have same name how can achieve this? in advance! instead of describe('here action!', functi...

java - Spring security- org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.filterChains' -

hi trying implement spring security in project following tutorial http://www.baeldung.com/2011/10/31/securing-a-restful-web-service-with-spring-security-3-1-part-3/#config , getting following exception while running program- org.springframework.beans.factory.beancreationexception: error creating bean name 'org.springframework.security.filterchains': initialization of bean failed; nested exception java.lang.nosuchfielderror: null @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.docreatebean(abstractautowirecapablebeanfactory.java:532) my web.xml looks like- <?xml version="1.0" encoding="utf-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" xsi:schemalocation=" http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/w...

python - whats the diff bw self.browse and self.pool.get in openerp development? -

i have been working on developing module in openerp-7.0. have been using python , eclipse ide development. wanted know difference bw self.browse , self.pool.get in openerp development . plz reply me possible. thanks. best wishes hopes suggestion self.pool.get used singleton instance of orm model registry pool database in use. self.browse method of orm model return browse record. as rough analogy, think of self.pool.get getting database cursor , self.browse sql select of records id. note if pass browse integer single browse record, if pass list of ids list of browse records.

ASP.NET MVC 4 getting error "Exception has been thrown by the target of an invocation" -

i'm using composite keys in below model class of mvc , same thing.i did in ms sql server database having 2 columns both pk,fk getting error in initializesimplemembershipattribute class "exception has been thrown target of invocation" please me how create. model class [table("webpages_usersinroles")] public partial class usersinroles { [column(order = 0)] public int roleid { get; set; } public virtual newroles roles { get; set; } [column(order = 1)] public int userid { get; set; } public virtual userprofile userprofiles { get; set; } } why doing that? dont need define yourself. if use accountcontroller , if use websecurity role table created in simplemembershipinitializer filter. , need use built in functionality provided simplemembership provider. in short, dont need define table imo reason having these problems.

javascript - get the value of alert and post to php -

i have code below, if click on link, alert (linkhref) appear, question is, how post (linkhref) on php (sample.php) $_post['']; thanks, <script language="javascript" type="text/javascript"> $(document).ready(function() { $('.linklist').click(function(){ var linkhref=$(this).attr('href'); alert (linkhref); $.post("sample.php", { href: linkhref } ); }); }); </script> html: < href="files/my_file.zip" class="linklist" name="test">test insert < /a> the line href: linkhref in $.post() data posted sample.php , in sample.php, as: $href = $_post['href'];

find vs in operation in string python -

i need find pattern string , found can use in or find also. suggest me 1 better/fast on string. need not find index of pattern find can return index of pattern. temp = "5.9" temp_1 = "1:5.9" >>> temp.find(":") -1 >>> if ":" not in temp: print "no" no use in , faster. dh@d:~$ python -m timeit 'temp = "1:5.9";temp.find(":")' 10000000 loops, best of 3: 0.139 usec per loop dh@d:~$ python -m timeit 'temp = "1:5.9";":" in temp' 10000000 loops, best of 3: 0.0412 usec per loop

c++ - I want to know which a signal is arrived when system call() is interrupted -

my application has 2 threads. each threads recevive data server via each sockets. threads wait return epoll_wait(). epoll_wait() returns -1 , errno eintr. eintr means system call() interrupted signal. added process eintr. not know signal arrived , why signal arrived. wonder it. method 1. i created thread. sigset_t smaskofsignal; sigset_t soldmaskofsignal; sigfillset(&smaskofsignal); sigprocmask(sig_unblock, &smaskofsignal, &soldmaskofsignal) while(1) { sigwait(&smaskofsignal, &sarrivedsignal); fprintf(stdout, "%d(%s) signal caught\n", sarrivedsignal, strsignal(sarrivedsignal)); } i not c...

xml - explanation on duplicate attribute -

i have code on sample xslt , not make part exactly. want understand portion seq_no[/*/*/seq_no[@num = following::seq_no/@num]] . idea? <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/xsl/transform"> <xsl:output omit-xml-declaration="yes" indent="yes"/> <xsl:strip-space elements="*"/> <xsl:template match="node()|@*"> <xsl:copy> <xsl:apply-templates select="node()|@*"/> </xsl:copy> </xsl:template> <xsl:template match="seq_no[/*/*/seq_no[@num = following::seq_no/@num]]"> <seq_no num="[{count(preceding::seq_no)+1}]{.}"> <xsl:apply-templates/> </seq_no> </xsl:template> </xsl:stylesheet> and input <xml> <staff> <seq_no num="0">0</seq_no> <name>xyz</na...

javascript - know the image user is viewing in slimbox2.js -

i have image gallery uses slimbox2.js i want know image user viewing @ given time. how viewing image? (note user need not click on every single image view, once clicks single image , slideshow loads can use mouse clicks or arrow keys browse through images in gallery) example: the user clicks on first image in gallery. can add click event listener , event, record user viewed first image. happens if user selects click next button in slimbox2 , view next image. the user viewed second image don't know, user viewed it. how can capture event? another approach thought of image slimbox2 loads it's view, there event triggered @ moment? you can url of image using jquery.. jquery("#lbimage").css("background-image").tostring().replace('url(','').replace(")","")

openID login (on localhost) at google app engine -

Image
i've written openid login google app engine. static { openidproviders = new hashmap<string, string>(); openidproviders.put("google", "https://www.google.com/accounts/o8/id"); openidproviders.put("yahoo", "yahoo.com"); } @override public void doget(httpservletrequest req, httpservletresponse resp) throws ioexception { userservice userservice = userservicefactory.getuserservice(); user user = userservice.getcurrentuser(); // or req.getuserprincipal() set<string> attributes = new hashset(); resp.setcontenttype("text/html"); printwriter out = resp.getwriter(); if (user != null) { out.println("hello <i>" + user.getnickname() + "</i>!"); out.println("[<a href=\"" + userservice.createlogouturl(req.getrequesturi())+ "\">sign out</a>]...

c# - Web API action selection based on Accept header -

queue long introduction... i have resource defined at http://my-awesome-product.com/api/widgets/3 which represents widget id of 3. in web api define controller serve resource follows: public class widgetscontroller : apicontroller { public widget get(int id) { return new widget(...); } } now, widget class potentially quite big, , wanting save bandwidth database web server, , web server client, create several dto classes contain restricted number of fields of overall widget . example: public class widgetsummary { public int id { get; set; } public string code { get; set; } public string description { get; set; } public decimal price { get; set; } } public class fullwidgetforediting { public int id { get; set; } public string code { get; set; } public string description { get; set; } public decimal weight { get; set; } public decimal price { get; set; } public color color { get; set; } public decimal width...

jQuery ON error. No error when using LIVE -

this question has answer here: turning live() on() in jquery 5 answers jquery live vs on 2 answers this current, want change .live .on not working.. $('#searchstring').live('keydown',function(e) { if (e.which == 13) { if (!$("#searchstring").val()) { alert("inget postnummer eller ort angiven!"); return false; } } }); $('#searchstring').on('keydown',function(e) { if (e.which == 13) { if (!$("#searchstring").val()) { alert("inget postnummer eller ort angiven!"); return false; } } }); this on version in event delegation model of on() target element selector passed second argument on() method. $(document).on('keydown', '#searchstr...

iOS: UITextField not able to load -

i have simple viewcontroller uitextfield . hooked iboutlet . however, while loading, keep getting following error, [uitextfield isequaltostring:]: unrecognized selector sent instance 0x9860ad0 i not using variable in source code @ all. not sure whats going wrong. can me? make sure name of uitextfield not coincide other ivar in class. also, if comparing uitextfield's text value something, might have missed write uitextfield.text

c# - the process cannot access the file as its being used by another process -

have been struggling error ages. below code question ( int32 counter = 0; counter < x.rows.count; counter++) { using (filestream bitmapfile = new filestream(@"c:/someolddir/file1.txt", filemode.open, fileaccess.read, fileshare.readwrite)) { using (bitmap uploadedbitmap = new bitmap(bitmapfile)) { using (system.drawing.image uploadedbitmapresized = extensionhelpers.resize(uploadedbitmap, 800, 600, rotatefliptype.rotatenoneflipnone)) { uploadedbitmapresized.save(@"c:/somenewdir/file1.txt",system.drawing.imaging.imageformat.jpeg); } } } /*errror occurss on line */ file.setcreationtime(@"c:/somenewdir/file1.txt",somedatetimevariable); } the problem having code works fine first 30 or 40 images in collection when 50 or 60 error saying fil...

UNIX sequential execution of files -

i want sequentially execute .sqls in directory in unix . suppose directory name /export/home/me when list files in directory using ls shows a.sql b.sql c.sql now , need write shell script go directory , loop through .sqls in directory , execute them sequentially .please suggest if sequential, mean sorted alphabetically, this, #!/bin/sh in `ls folder/*.sql | sort ` # think shell lists file sorted alphabetically default mysql -u user_name -ppassword database_name < done but, when executing list of sql files, need think of order, example, if design is,employees , departments, if first sql file creates employees table , second sql file creates foreign key departments table, before executing third sql file creates departments table, run trouble. its best have create/insert statments of database objects/data in 1 sql file in right order.

Recursive uploading files using FtpWebRequest , BackgroundWorker in C# -

using ftpwebrequest class , assign backgroundworker upload file. , working want upload files directory , sub-directory. i have created component called - "ftpuploading" in define private void function "ftpuploading_dowork" and same should calling windows form application... if single file in directory working file if there more 1 file , sub-directory... not work. private void ftpuploading_dowork(object sender, doworkeventargs e) { backgroundworker bw = sender backgroundworker; ftpsettings ftpdet = e.argument ftpsettings; string uploadpath = string.format("{0}/{1}{2}", ftpdet.host, ftpdet.targetfolder == "" ? "" : ftpdet.targetfolder + "/", path.getfilename(ftpdet.sourcefile)); if (!uploadpath.tolower().startswith("ftp://")) uploadpath = "ftp://" + uploadpath; ftpwebrequest request = (ftpwebrequest)webrequest.crea...

osx - Mac Daemon for ActiveMQ -

i have tried setting activemq daemon have been unsuccessful far. can't seem load activemq . not sure more can make work? can start activemq running command /library/activemq/bin/macosx/activemq start in plist <?xml version="1.0" encoding="utf-8"?> <!doctype plist public "-//apple computer//dtd plist 1.0//en" "http://www.apple.com/dtds/propertylist-1.0.dtd"> <plist version="1.0"> <dict> <key>runatload</key> <true/> <key>keepalive</key> <true/> <key>label</key> <string>com.apache.activemq</string> <key>programarguments</key> <array> <string>/library/activemq/bin/macosx/activemq</string> <string>start</string> <string>;</string> <string>--stop-cmd</string> <string>/library/activemq/bin/maco...

web scraping - Facebook Meta tags parsing -

if add link website facebook, acts if doesn't have open graph meta tags , shows link. have meta tags on page. in fact, after go https://developers.facebook.com/tools/debug , enter link there shows scraping done fine. then, if post link again, link displays correctly. why happen? can think of 1 alternative - facebook has workers scrape links posted, if first time link encountered. once scraped, other posts same links displayed scraped data. debug scraper has priority input data instead of workers. is case?

Retrieve values from dynamically added selects using Jquery in PHP -

i wanted chain 3 selects , got working using code. http://jsfiddle.net/fjffj/1/ <div id="filter"> <a id="clone" href="#">+</a> <a id="remove" href="#">-</a> </div> <div id="template"> <select class="pais"> <option value="1">argentina</option> <option value="2">chile</option> </select> <select class="provincia"> <option value="1" class="1">san juan</option> <option value="2" class="1">mendoza</option> <option value="3" class="2">la serena</option> <option value="4" class="2">santiago</option> </select...

cordova - How to get result in android phonegap plugin -

i'm trying create phonegap plugin android, i'm getting result when i'm trying perform validation, i'm not able fetch errors appropriately. when sending result have option decide if result ok or error, have return new pluginresult(pluginresult.status.ok,"login successful"); return new pluginresult(pluginresult.status.error,"login failed");

Simple Python - Error in Programming -

i've been stuck on issue on 2 hours, homework please don't give me direct answer point me in right direction. so... program designed input "speed limit", input "current speed" , give print response of either "speed ok" (if below or equal speed limit) , "slow down!" (if speeding). when input following data, required on task: speed limit of 50. current speed of 50, 45, 55, 52, , 50. the answer should read - speed limit: 50 current speed: 50 speed ok current speed: 45 speed ok current speed: 55 slow down! current speed: 52 slow down! current speed: 50 speed ok current speed:(white space) instead - current speed: 50 speed ok current speed: 45 *then program stops.* my program reads - limit = int(input("speed limit: ")) speed = int(input("current speed: ")) if speed <= limit: print("speed ok") speed = int(input("current speed: ")) false = speed > limit while false: print(...

codeigniter - Strange error with PHP str_replace &$count argument -

in codeigniter controller have statement: $txt = str_replace($t, $bracketted_var, $txt, &$count); $count variable passed reference , i'm using it's changed value later in program. discovered on new installation php/5.3.3-7 calling controller gives me in firefox response: the connection server reset while page loading without log entry in apache access log. in error log noticed 2 entries: [mon aug 26 12:12:28 2013] [notice] child pid 32048 exit signal segmentation fault (11) [mon aug 26 12:12:28 2013] [notice] child pid 32082 exit signal segmentation fault (11) i tried couple of other browsers , androind , iphone without getting web page content. the statement wasn't in function called. looks kind of syntax error arise during parsing php file. searching solution discovered str_replace statement doesn't give error: $txt = str_replace($t, $bracketted_var, $txt, $count); i did temporarily make change other parts of controller working. need use ch...

php - MongoDB conifg issues at lampp ubuntu 13.04 -

i installing mongodb on ubuntu 13.04 . installed , configured in php.ini file. os 32-bit version. when start lamp show following error. warning: php startup: unable load dynamic library '/opt/lampp/lib/php/extensions/no-debug-non-zts-20090626/mongo.so' - /opt/lampp/lib/php/extensions/no-debug-non-zts-20090626/mongo.so: undefined symbol: zend_new_interned_string in unknown on line 0 how solve this? it's possible compiled extension against different version of php binary you're attempting load it. assuming followed pecl install instructions , suggest confirm have single copy of php installed on system, , configurations consistent web , cli environments. below previous threads , bug reports hint error ("undefined symbol: zend_new_interned_string") being php/extension mismatch: http://www.linuxquestions.org/questions/programming-9/php-gearman-undefined-symbol-zend_new_interned_string-in-unknown-on-line-0-a-941003/ https://github.c...

html5 - jQuery can't change class of all spans inside a div -

in following example, how can change class of <span> inside particular h2 <div> , while leaving 1 clicked unchanged? <!doctype html> <html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"> <title>side bar voting thingy</title> <style type="text/css"> .hide { display: none; } .no-like { color: blue; } </style> <script type="text/javascript" src="http://localhost/site/scripts/jquerycore.js"></script> <script type="text/javascript"> $(function() { $(".like").click(function() { var haslike = $(this).data("id"); var data = 'id='+haslike; console.log($(this).data('id')); if(haslike) { // ajax call $.ajax({ type:"get", url:"demo.php", data:data, ...

javascript - Calling images in another directory -

i'm not sure fancy jargon stuff im sorry if dont use right terminology. im working script images located in subdirectory html located. this snippet of code: eval("document.hm.src=\"hm" + wrong_guesses + ".gif\""); in world of html image path like: games/word/hm01.gif how modify line of javascript reflect images in subdirectory? i'm lost , i'm sure it's simple i'm not programmer, lightly tweak stuff :\ it : eval("document.hm.src=\"games/word/hm" + wrong_guesses + ".gif\""); . hope helps.

php - Convert Mysql query to cakephp conditions -

i want convert query cakephp select l.* , ( ( ( acos( sin( ( $lat * pi( ) /180 ) ) * sin( ( l.lat * pi( ) /180 ) ) + cos( ( $lat * pi( ) /180 ) ) * cos( ( l.lat * pi( ) /180 ) ) * cos( ( ( $lng - l.long ) * pi( ) /180 ) ) ) ) *180 / pi( ) ) *60 * 1.1515 * 1.609344 ) `distance` hosts l having `distance` <= 50 order `distance` asc help me please ..... more helpfull if can add in contiions array like $this->paginate = array('conditions' => $conditions , 'order' => array('host.distance' => 'asc') ); you try redefine virtual field before calli...

sql - rails order by time with reversed 24 hour periods -

i have model stores events each have start time. the start time handled rails time, stored in postgres datetime (i'm assuming) , rails ignores date , stores 2000-01-01... the problem have ordering events start after midnight show afterwards , not before. how can sort them differently , split events in 24 hour period first morning 12 hour events show after second half of evening events. (if makes since) any ideas? c=event.last c.event_items.order(:time_start) which order \"event_items\".time_start asc" +-----+----------+-----------+-------------------------+---------+-------------------------+-------------------------+ | id | event_id | artist_id | time_start | area_id | created_at | updated_at | +-----+----------+-----------+-------------------------+---------+-------------------------+-------------------------+ | 155 | 63 | 111 | 2000-01-01 00:40:00 utc | | 2013-08-24 21:21:57 utc | 2013-08...

Any way to assign a variable (not an object property) another variable's value by reference in JavaScript? -

so, here's need: var = 5; var b = a; = 6; alert(b) // want alert 6 not 5 i've seen questions how variable assignment work in javascript? , answers https://stackoverflow.com/a/509614/1117796 , posts http://hpyblg.wordpress.com/2010/05/30/simulating-pointers-in-javascript/ . not want use objects/hashes/dictionaries or whatever else want call them. want done plain variables containing plain primitive values. php assignment reference: $b = &$a; . @ possible? comes near it? no isin't possible pass simple values reference in javascript. however javascript flexible language , possibly implement similar using object.defineproperty providing setters , getters work same variable. work global variables however, there's no way mimic behaviour. instance, since can't reference execution scope of functions, not able emulate concept variables declared inside functions.

mysql - Copy values from one field to another within a subset -

i'm trying create query i'm stuck. context on website users have different fields on profile. 1 of these fields checkbox newsletter. going make second newsletter. every user subscribed newsletter automatically subscribed second , have option unsubscribe. user not subscribed original newsletter should not receive second newsletter either. table fields stored in table "profile_field". table has 3 columns fid => field id (this can profile name, address, newsletter, ...) uid => user id value so every user need copy value of field1 field2 the query far update profile_values copy set value = (select value ( select value profile_values original fid = 12 ) temp ) fid=37 ; now gives me error: error 1242 (21000): subquery returns more 1 row i understand why have this. it's because in subquery don't take account field returns multiple results because of different users. in other words don'...

go - how to make second development based on levigo -

i made second development on levigo , when finished , try install on system following command: go install github.com/andremouche/levigo/ it reports following error: # github.com/andremouche/levigo /home/fun/software/go/go/pkg/tool/linux_amd64/6c: unknown flag -fvw does know how fix it? your go command differs go tool chain. check if right version of go tool in path of shell or try reinstalling go. the go tool calls tools compiler (e.g. 6g ) , linker. if go tool version not correspond version of these tools, said tools may called parameters don't yet know or don't know anymore . check version using these commands: $ go version $ go tool 6g -v they both should report same version string. see this , this post related problems.

javascript - Increment width from right to left -

i want increment width right left. <div dir="rtl" id="progress"> <dt id='dt'></dt> <dd id='dd'></dd> </div> the main goal make progress bar move right left when use arabic language in website (default direction of arabic language right left). i tried attribute dir wrote, didn't fix problem. have idea, change html. that's not correct thing do, because website supports english & arabic; , don't want change html, want change style or javascript code. you can mirror progress div, giving x scale of -1.

typo3 - Canonical tag for tt_news should pointing from couple domain to only one -

i'm usign tt_news publishing news on sites. have 3 domains using same news content, , generate canonical tags news point 1 (main) domain. have following typoscript, generates canonical tags 3 different urls. [globalvar = gp:tx_ttnews|tt_news > 0] page.headerdata.1422 = text page.headerdata.1422 { typolink.parameter.data = tsfe:id typolink.forceabsoluteurl = 1 typolink.returnlast = url typolink.additionalparams.cobject = coa typolink.additionalparams.cobject { 10 = text 10.datawrap = &tx_ttnews[tt_news]={gp:tx_ttnews|tt_news} 10.if.istrue.data = gp:tx_ttnews|tt_news 20 = text 20.datawrap = &tx_ttnews[cat]={gp:tx_ttnews|cat} 20.if.istrue.data = gp:tx_ttnews|cat } wrap = <link href="|" rel="canonical"> } [end] any sugestions? i remove "forceabsoluteurl" , add baseurl in wrap on own. [globalvar = gp:tx_ttnews|tt_news > 0] page.headerdata.1422...

download - Applescript: Wait for an action/event to complete -

i writing script download free/non-free applications itunes store. each download , taking 5 10 seconds. for example: repeat 1000 times download_app() end repeat on download_app() download stuff .... delay 10 end download_app for downloading 1 application 1000 times, taking big amount of time , want optimize timing. instead of using delay 10, there other way ? is there way downloading status / busy status of itunes? please suggest. advanced thanks rahman i don't have specific solution, following code may provide useful example: tell application "system events" tell application process "safari" repeat if (accessibility description of (get properties of button 1 of text field 1 of splitter group 1 of group 2 of tool bar 1 of window 1)) not contain "stop" exit repeat end repeat end tell end tell this code pauses script until webpage has finished loading. entering infinite loop ,...

in app billing - google inapp details in android -

i working on google inapp, below code want information of inapp product, how compare arraylist object string,it shows error on loop "cannot convert element type object string" arraylist skulist = new arraylist(); skulist.add("premiumupgrade"); skulist.add("gas"); bundle queryskus = new bundle(); queryskus.putstringarraylist("item_id_list", skulist); bundle skudetails = mservice.getskudetails(3, getpackagename(),"inapp", queryskus); int response = skudetails.getint("response_code"); if (response == 0) { arraylist responselist = skudetails.getstringarraylist("details_list"); (string thisresponse : responselist) { jsonobject object = new jsonobject(thisresponse); string sku = object.getstring("productid"); string price = object.getstring("price...

Type-level sets in Haskell / Agda -

i've seen in latest versions of ghc there's support type-level lists. however, need work type-level sets application, , implement type-level set library based on type-level lists. don't know start :( is there library supporting type-level sets in haskell? you can use hset property hlist 's hlist package: {-# language flexibleinstances #-} import data.hlist class (hlist l, hset l) => thisisset l -- here have @l@ @hlist@ _and_ @hset@. test :: l -- ok: instance thisisset hnil test = hnil -- , this: instance thisisset (hcons hzero hnil) test = hcons hzero hnil -- , (hzero != hsucc hzero): instance thisisset (hcons hzero (hcons (hsucc hzero) hnil)) test = hcons hzero (hcons (hsucc hzero) hnil) -- error since hsucc hzero == hsucc hzero: instance thisisset (hcons (hsucc hzero) (hcons (hsucc hzero) hnil)) test = hcons (hsucc hzero) (hcons (hsucc hzero) hnil) for working other types need write heq instances them.

c++ - Migrate from 32bi to 64bit - OpenCV/MinGW/Eclipse -

i'm working opencv couple of months under windows 32bit,with eclipse , mingw. after many hours, program go through build, link without errors, when start crashes... favorite "dont send" window..... source: #include <opencv.hpp> #include <windows.h> #include <iostream> using namespace std; using namespace cv; int main() { mat img(mat::zeros(100, 100, cv_8u)); //imshow("window", img); cout << "hello world!" << endl; system("pause"); return 0; } while imshow comented, there no problem, when try use imshow or waitkey, compiles, crashes ... build commands: g++ "-iw:\\software\\opencv\\build\\include" "-iw:\\software\\opencv\\build\\include\\opencv" "-iw:\\software\\opencv\\build\\include\\opencv2" -o3 -g3 -wall -wextra -c -fmessage-length=0 -o "src\\helloworld.o" "..\\src\\helloworld.cpp...

alertdialog - Pop up Alert box when deadline is coming in wpf -

Image
in wpf application have startdate , enddate of event, implement pop alert box show warning message automatically when enddate coming (say 5 days before enddate). in screenshot when click clientdeadlines (itemtab header in wpf), alert box comes out. how can achieve function? samples appreciate. in advance. in wpf can use dispatchertimer in system.windows.threading.. dispatchertimer timer = new dispatchertimer(); datetime mydeadline = new datetime(); public void inittimer() { // checks every minute timer.interval = new timespan(0, 1, 0); timer.tick += timer_tick; timer.start(); } void timer_tick(object sender, eventargs e) { if ((mydeadline - datetime.now).totaldays <= 5) messagebox.show("your alert message"); } edit : want display alert message everytime user clicks clientdeadlines subscribe selectionchanged event in tabcontrol. <tabcontrol selectionchanged="ta...

iphone - Cocos2D CCLabelTTF diplays solid rectangle -

i need implement debug layer in ios application getting feedback testers. found this solution on github want: transparent layer on top of application, can print debug info. the cocos2d-debug-layer uses cclabelttf display debug messages. i have inserted api code , works expected. problem messages appear solid rectangle, while appear correctly. i have tried change cclabelttf ’s color, , has effect, changes text , background color also. if don’t change color (leave defaults), prints white rectangle. i have found cclabelttf ’s background cannot changed . cannot set background transparent. i use cocosdebuglayer this: initializing in gamescene.m : +(id) scene { ccscene *scene = [ccscene node]; seraphingame *layer = [seraphingame node]; [scene addchild: layer]; //add debug layer cocosdebuglayer *debuglayer = [cocosdebuglayer node]; [scene addchild:debuglayer z:10000]; [[nsnotificationcenter defaultcenter] postnotificationname:@"logmess...

iPhone displays plain and html in newsletter email -

i've set multipart mime email containing area text- , 1 area html-version of newsletter. works fine excepting iphone. displaying text version first followed html version. dont have ideas why ... :-/ here php: $to = $_post['email']; $subject = 'test'; $bound_text = 'boundary42'; $headers = "from: sender@sender.net\r\n"; $headers .= "mime-version: 1.0\r\n" . "content-type: multipart/mixed; boundary=\"$bound_text\""; $message = file_get_contents('mime.file'); mail($to, $subject, $message, $headers); the file content: mime-version: 1.0 content-type: multipart/mixed; boundary=boundary42 message multiple parts in mime format. --boundary42 content-type: text/plain; charset=utf-8 content-transfer-encoding: 7bit text goes here --boundary42 content-type: text/html; charset=utf-8 content-transfer-encoding: 7bit <!doctype html public "-//w3c//dtd xhtml 1.0 transitional //en"...

c++11 - Which type to declare to avoid copy and make sure returned value is moved -

suppose that i have function a f() ; i want initialize local variable a return value of f ; i don't want rely on rvo; what best option (and why) avoid return value of f being copied when a may have modified i know a not modified options: a) a = f(); b) a&& = f(); c) const a& = f(); d) const a&& = f(); edit: i say: b) c) because both use references , avoid copy (which avoided rvo well, not guaranteed). how come see option a) suggested of time? i guess heart of question is: a) has same effect c), why not use c) instead of a), make things explicit , independent on compiler? so how come see option a) suggested of time? because 4 options return value exact same way. thing changes way bind variable returned temporary. a) declares variable a of type a , move-initializes temporary. not assignment, initialization. move constructor elided popular compiler, provided don't explicitly disallow it, means pr...

ruby on rails - Sort MongoDB documents by their distance to a given point -

i have mongodb collection. each document in collection has x,y coordinations representing position on grid. given point (x',y') retrieve top k documents position closest (x',y') euclidean distance. i'm using mongodb rails app. calculation on db if it's possible. how can it? if store coordinates array [x, y], need create geospatial index ("2d") on field. to query index: db.runcommand({geonear: <collection>, near: [x, y], limit: k}) if on mongodb 2.4, preferred way use geojson format (i.e. {type: "point", coordinates: [x, y]}) , "2dsphere" index, legacy format supported. to query index: db.runcommand({geonear: <collection>, near: {type: "point", coordinates:[x, y]}, limit: k}) the geonear command returns results ordered distance. here documentation: 2d index - http://docs.mongodb.org/manual/core/2d/ 2dsphere index (2.4) - http://docs.mongodb.org/manual/core/2dsphere/

ios - Querying for ipod library podcasts, and sorting them by author/title -

i´v got these 2 methods fetches contents of ipod library me. still not proficient use of these classes. example podcast title of podcast in library, if want set predicate , query individual podcasts author/podcast title how that. /* delegate * set media type */ - (mpmediapropertypredicate *)mediatypetofetchfromipodlibrary: (abstracttvc *) sender; { mpmediapropertypredicate *abpredicate = [mpmediapropertypredicate predicatewithvalue:[nsnumber numberwithint:mpmediatypepodcast] forproperty:mpmediaitempropertymediatype]; return abpredicate; } /* overriden abstract method subclass * */ - (mpmediaquery *)setmediaqueryoptions: (mpmediaquery*)abquery withpredicate: (mpmediapropertypredicate*) abpredicate { [abquery addfilterpredicate:abpredicate]; //[abquery setgroupingtype:mpmediagroupingalbum]; [abquery setgroupingtype:mpmediagroupingpodcasttitle]; return abquery; }

java.lang.IllegalStateException: Shutdown in progress in XMemcachedClient.shutdown -

i getting exception in xmemcached related code. can me fix expcetion? thank advanced! exception in thread "thread-9" java.lang.illegalstateexception: shutdown in progress @ java.lang.applicationshutdownhooks.remove(applicationshutdownhooks.java:82) @ java.lang.runtime.removeshutdownhook(runtime.java:239) @ com.google.code.yanf4j.core.impl.abstractcontroller.stop(abstractcontroller.java:476) @ net.rubyeye.xmemcached.xmemcachedclient.shutdown(xmemcachedclient.java:2482) @ net.rubyeye.xmemcached.xmemcachedclient$1.run(xmemcachedclient.java:650) ... more memcachedclient client = lowcardinalitymemcachedclientsingleton.getprimaryclient(); try { if(client.isshutdown() != true){ client.shutdown(); } else{ logger.debug("client shutdown"); } } catch (ioexception e) { logger.debug("shutdown memcachedclient fail", e); } long starttime = system.currenttimemillis();...

svg - customized bargraph's background in rapheal -

Image
i new in svg , raphael javascript. i creating bar graphs raphael.the bar graphs having "stripped" background. bar graphs being rendered in "path" of "svg".according me achieve exact , feel there 2 ways: 1)i have code path's background. or 2)i need provide background image should repeat through out path. i not code first approach. so,here second approach: "r1" bar graph being created @ $("#first_graph"). want customize background of bar graph.to achieve selected path responsible graph section , setting background fron pattern. script part: r1.hbarchart(0, 0, 650, 90, [base_array_1, calc_array_1], {colors: ["#278bd1","#052f4d"],stacked: true}).hover(fin, fout); $("#first_graph").find("path:odd").attr({ fill: "url(#image)", }); pattern part.... declared @ html: <svg id='pattern' xmlns="http://www.w3.org/2000/svg" version="1.1"...

hadoop - Getting null pointer exception when running Nutch crawler 2.2 with Hbase -

when run nutch command: ~/nutch/runtime/deploy$ bin/nutch crawl urls -dir /user/dlequoc/urls -depth 2 -topn 5, got following exception: ======================================================= 13/08/26 16:30:15 info mapred.jobclient: map 100% reduce 0% 13/08/26 16:30:29 info mapred.jobclient: task id : attempt_201308261546_0004_r_000000_0, status : failed java.lang.nullpointerexception @ org.apache.avro.util.utf8.(utf8.java:37) @ org.apache.nutch.crawl.generatorreducer.setup(generatorreducer.java:100) @ org.apache.hadoop.mapreduce.reducer.run(reducer.java:174) @ org.apache.hadoop.mapred.reducetask.runnewreducer(reducetask.java:649) @ org.apache.hadoop.mapred.reducetask.run(reducetask.java:417) @ org.apache.hadoop.mapred.child$4.run(child.java:255) @ java.security.accesscontroller.doprivileged(native method) @ javax.security.auth.subject.doas(subject.java:396) @ org.apache.hadoop.security.usergroupinformation.doas(usergroupinfor...