Posts

Showing posts from July, 2015

grails - Gradle Geb saucelabs plugin -

i'm following example http://www.gebish.org/manual/0.9.2/sauce-labs.html#gradle_geb_saucelabs_plugin unable working. build.gradle script follows: buildscript { repositories { jcenter() } dependencies { classpath "org.grails:grails-gradle-plugin:2.0.0" classpath 'org.gebish:geb-gradle:0.9.2' } } version "0.1" group "example" apply plugin: "grails" apply plugin: "geb-saucelabs" repositories { grails.central() //creates maven repo grails central repository (core libraries , plugins) maven { url "http://repository-saucelabs.forge.cloudbees.com/release" } } grails { grailsversion = '2.3.5' groovyversion = '2.1.9' springloadedversion '1.1.3' } dependencies { bootstrap "org.grails.plugins:tomcat:7.0.50" // no container deployed default, add compile 'org.grails.plugins:resources:1.2' // example of adding grails plugin sauceconnect ...

sql server - Except Operator T-SQL -

task: display c_id , c_name customers have @ least 1 purchase in 2 of months not in 3 months. first month = november second month = december third month = january select c_id, c_name books month(order_date) = 11 intersect select c_id, c_name books month(order_date) = 12 except select c_id, c_name books month(order_date) = 1 the current code have negates 3rd month doesn't fulfill task asking select 2 months interchangeably. rule is: no count, no subquery, no join(s) i managed come this. select c_id,c_name books month(order_date) = 1 intersect select c_id,c_name books month(order_date) = 11 union select c_id,c_name books month(order_date) = 1 intersect select c_id,c_name books month(order_date) = 12 union select c_id,c_name books month(order_date) = 12 intersect select c_id,c_name books month(order_date) = 11 except select c_id,c_name books month(order_date) = 1 intersect select c_id,c_name books month(order_date) = 11 intersect select c_id,c_name books ...

java - Listview With Asynctask get no response from server -

i want send cus_id postparamname web server. according cus_id want fetch data server , listview. i have no error in code...but code still not able fetch data server.. plz @ code...i have been working on code since last 2 days. not able find mistake point1.java public class points1 extends listactivity implements fetchdatalistener { sessionmanager session; textview tvcuspoints1, tvcuspoints2, tvcusname; textview bus_name; textview cus_points; @override protected void oncreate(bundle savedinstancestate) { // todo auto-generated method stub super.oncreate(savedinstancestate); setcontentview(r.layout.points); initview(); } private void initview() { session = new sessionmanager(getapplicationcontext()); // user data session hashmap<string, string> user = session.getuserdetails(); // id string cus_id = user.get(sessionmanager.key_id); arraylist<namevaluepair> postparamname = new arraylist...

c# - Retrieving selected enum from dropdown list -

i binding enumeration dropdown list in asp.net 4.0 c# enumernation is: public enum frequency { [description("select frequency")] none, [description("every hour/mintues")] everyhourormintues, [description("previous day data")] previousdaydata, [description("once week")] onceaweek } on selection of value dropdown want enum value in return: doing like: frequency selectedfrequency; foreach (frequency f in enum.getvalues(typeof(frequency))) { if (f.tostring().equals(this.dropdownlistfrequency.selectedvalue)) { selectedfrequency = f; break; } } it working poor way guess, looping through each of items in enum (even though enum small) how can retrieve selected enum like: frequency selectedvalue = enum.getvalues(typeof(frequency)).cast<frequency>().select(f => f.tostring().equals(this.dropdownlistfrequency.selectedvalue)); i understand above given code has casting...

jsf - After filtering datatable, pagination is not rendered anymore in primefaces -

i have created datatable using primefaces. contains options filtering, sorting , pagination. before filtering table, pagination works correctly. when data filtered, pagination doesn't work. means page numbers not rendered. before have created datatable in application in same way. works correctly. tried lazydatamodel of primefaces in code also. didn't work. can't figure out error in code. <ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html" xmlns:p="http://primefaces.org/ui" xmlns:f="http://java.sun.com/jsf/core" template="home.xhtml"> <ui:define name="content"> <p:tabview style="font-size: 12px" id="numberanalyzertab"> <p:tab title="number analyzer"> <h:form id="form"...

php - List posts in WordPress with Key which is the post id -

i have function in wordpress lists ids of custom meta posts in wordpress , function current user meta function. query: <?php $args = array( 'post_type' => 'todo_listing', 'posts_per_page' => 4, 'order'=>'asc' 'meta_query' => array( array( 'key' => $id, 'meta_value_num' => '1', ) )); $loop = new wp_query( $args ); ?> <?php while ( $loop->have_posts() ) : $loop->the_post(); ?> <?php echo get_the_id();?> <?php endwhile; ?> i want list posts key id of post , has key value 1. the above code not work. how can make work? try this: $id = get_queried_object_id(); $args = array( 'post_type' => 'todo_listing', 'posts_per_page' => 4, 'order'=>'asc' 'meta_key' =...

Cookie not accepting dynamic data ASP.net -

when using cookie, have 2 buttons should add number it. using number make print shopping cart. when print it, gives 1 number back. if insert static data work, when press both buttons, seems add 1 of values. cookie being made: protected void page_load(object sender, eventargs e) { if (httpcontext.current.request.cookies["mytestcookie"] == null) { httpcookie mycookie = new httpcookie("mytestcookie"); response.cookies.add(mycookie); mycookie.values.add("", "1"); mycookie.expires = datetime.now.addseconds(30); } } buttonclick add data cookie, got 2 of these, button1 adds nr 3 , button2 adds nr 2: protected void button1_click(object sender, eventargs e) { response.cookies["mytestcookie"].values.add("item", "3"); response.write(request.cookies["mytestcookie"].values.tostring()); } butto...

javascript - how to write the regular expression to allow dashes in the date -

i write regular expression below var validformat = /\d\d?[\-\/]\d\d?[\-\/](19\d\d|200\d)$/ it wont take dates : 08-12-2008 08/12/2008 works. what's problem? you presumably had trailing whitespace @ end broke $ field. otherwise regex written fine. paste code proving actual string date "08-12-2008" did not match... remove $ , verify matched. proves it's $.

USB audio For Android Platform -

i using android 4.2.2 on qualcomm apq8064 chip set. want enable audio output usb headset. tried using aplay command no luck. driver usb-audio there in code. integrated don't output on usb-headset. flags need set?? lead of great help. @micheal:following logs same, noticed below logs audiousbalsa can seen when usb headset not connected. 3502:i/inputreader( 676): device added: id=8, name='logitech inc. logitech usb headset h340', sources=0x00000501 3504:d/statusbar.networkcontroller( 769): refreshviews: data not connected!! set no data type icon / roaming 3505:d/statusbar.networkcontroller( 769): refreshviews connected={ } level=?? combinedsignaliconid=0x7f02013d/com.android.systemui:drawable/stat_sys_signal_null combinedactivityiconid=0x0 mobilelabel=no internet connection wifilabel= emergencyonly=false combinedlabel=no internet connection mairplanemode=false mdataactivity=0 mphonesignaliconid=0x7f02013d mqsphonesignaliconid=0x7f020073 mdatadirectioniconid=0x0 mdat...

c++ - How to do memcpy in C# .Net CF with the following task -

hi trying convert c/c++ strcut c# , how fill structure member address of structure in c#? c/c++ struct looks like: typedef struct _ndisuio_query_oid { ndis_oid oid; ptchar ptcdevicename; uchar data[sizeof(ulong)]; } ndisuio_query_oid, *pndisuio_query_oid; typedef struct my_struct { //les have 2 variables... uint a; uint b; }my_stats, *pmy_stats; pndisuio_query_oid pqueryoid = null; pqueryoid = (pndisuio_query_oid)malloc(sizeof(ndisuio_query_oid)+ sizeof(my_stats)) ; pmy_stats statistics; pqueryoid->oid = uloidcode;//required oid pqueryoid->ptcdevicename = aub_name;//required string memcpy(pqueryoid->data, statistics, sizeof(my_stats)); my c# struct is: [structlayout(layoutkind.sequential, charset = charset.unicode)] public struct _ndisuio_...

.htaccess - Apache RewriteRule in virtual-host(Apache) -

i want rewrite following url: http://www.example.com/bengaluru/cantonment to http://www.example.com/bengaluru/cantonment-hrbr/6238393 i wrote : rewriteengine on rewriterule `^(.*)/cantonment $1/cantonment-hrbr/6238393 [r,l]` why isn't working? try following: rewriteengine on rewriterule ^bengaluru/cantonment/(.*)$ /bengaluru/cantonment-hrbr/6238393/$1 [r,l]

how to mention a json file for elasticsearch which can be used by kibana? -

i have show log file(a json file) dashboard of kibana. configured elasticsearch , kibana. i tried giving elasticsearch.yml path.data: c:\users\rajesh\desktop\temp (where logs are),but while using dashboard if searching string gives 0 results. could please guide me? in advance you can use logstash read logfile , output elasticsearch. use kibana view it. logstash has lot of plugin this. here example reference. logstash configuration . read json data file , output elasticsearch. input { file { path => "/path/to/your/json/file" codec => json_lines { } } } output { elasticsearch { cluster => "abc" } }

objective c - Trouble calling method from another class -

object1.h #import <foundation/foundation.h> @interface object1 : nsobject + (id) randomobject; @end object1.m #import "object1.h" @implementation object1 + (id) randomobject{ ... } @end viewcontroller.m #import "viewcontroller.h" #import "object1.h" @interface viewcontroller () @end @implementation viewcontroller ... -(ibaction)randbutton:(id)sender{ object1 *ro1=[[object1 alloc]init]; [ro1 randomobject]; //issue here } @end i getting issue "no visible @interface 'object1' declares selector 'randomobject'" , i'm not entirely sure i'm supposed make visible it's in imported object1.h file. how work? [edit: missed line] when use + create class method , access class method don't create object, call: //[class_name method_name]; [object1 randomobject];

Is OpenCV HoughLines using this paper: Real-Time Line Detection Through an Improved Hough Transform Voting Scheme" -

today found paper "real-time line detection through improved hough transform voting scheme" here http://www2.ic.uff.br/~laffernandes/projects/kht/ . 1 published on 2007 wonder if opencv using or not? if not, why? thank you. if find random computer vision paper on internet, assume it's not implemented in opencv. has limited time of contributors of opencv. i see provide source code (both in mathlab , c++), should not difficult implement in opencv.

wso2 - WSO2Carbon Error : java.lang.ClassNotFoundException: org.apache.cxf.transport.servlet.CXFServlet -

i trying install api manager 1.6.0 in wso2carbon 4.2.0, while installed , trying restart getting exception in logs.. is possible install api manager 1.6.0 in wso2carbon 4.2.0 ? i want know possible install api manager feature on wso2esb 4.8.1 `[2014-03-24 13:45:32,882] error {org.apache.catalina.core.standardcontext} - servlet /oauth2 threw load() exception java.lang.classnotfoundexception: org.apache.cxf.transport.servlet.cxfservlet @ org.wso2.carbon.webapp.mgt.loader.carbonwebappclassloader.loadclass(carbonwebappclassloader.java:138) @ org.apache.catalina.loader.webappclassloader.loadclass(webappclassloader.java:1559) @ org.apache.catalina.core.defaultinstancemanager.loadclass(defaultinstancemanager.java:532) @ org.apache.catalina.core.defaultinstancemanager.loadclassmaybeprivileged(defaultinstancemanager.java:514) @ org.apache.catalina.core.defaultinstancemanager.newinstance(defaultinstancemanager.java:133) @ org.apache.cata...

meteor - Clone MongoDB objects in Meteorjs by changing value of a single field -

Image
i working on meteorjs application using mongodb in end. in collection there objects having common field named parent_id eg {name:'a',parent_id:'acd'} {name:'b',parent_id:'acd'} {name:'c',parent_id:'acd'} {name:'d',parent_id:'acd'} i want copy these objects in database changing parent_id field eg {name:'a',parent_id:'acdef'} {name:'b',parent_id:'acdef'} {name:'c',parent_id:'acdef'} {name:'d',parent_id:'acdef'} and these objects in database {name:'a',parent_id:'acd'} {name:'b',parent_id:'acd'} {name:'c',parent_id:'acd'} {name:'d',parent_id:'acd'} {name:'a',parent_id:'acdef'} {name:'b',parent_id:'acdef'} {name:'c',parent_id:'acdef'} {name:'d',parent_id:'acdef'} for have find elements db have parent_id:'abc' ...

html - Conditional IE8 stylesheet not loaded -

i'm having problem getting conditional ie8 , below stylesheet work. i've placed conditional statement below regular stylesheet links no result. this current setup: <link rel="stylesheet" type="text/css" media="all , (max-width: 640px)" href="/css/mobile-new.css" /> <link rel="stylesheet" type="text/css" media="all , (min-width:641px) , (max-width: 768px)" href="/css/tablet.css" /> <link rel="stylesheet" type="text/css" media="all , (min-width:769px) , (max-width: 1024px)" href="/css/tablet-landscape.css" /> <link rel="stylesheet" type="text/css" media="all , (min-width:1025px)" href="style.css" /> <!--[if lte ie 8]> <link rel="stylesheet" type="text/css" href="style.css" /> <![endif]--> as can see should use regular 'desktop'...

python - Complicated Django annotation with self reference -

given 2 models: floor has reference called previousfloor can null first floor room of course can in 1 floor (but there multiple rooms in floor ) i need query returns rooms on top floor. in order achieve that, created function in floor model called get_next_floor return floor previousfloor set self , return none if filter empty (this last floor ). function in floor model called is_last_floor , return true if get_next_floor returned none , , otherwise returned false . in end loop through rooms , have call is_last_floor floor room in, in order decide if fits condition. this problem can optimized saving found last floor during loop. since abstraction of real problem , working on large database, solution no longer viable option because of bad performance of loop. is there way implement in 1 query annotation? a floor top floor surely 1 has no other floor referring previousfloor . so: top_floors = floor.objects.exclude(id__in=floor.objec...

.net - Why is my File result filename corrupted IE9? -

Image
i'm trying generate , return files users. file names contain unicode characters: aäa.pdf . when trying download them in ie 9 filename gets corrupted , download appears this:           in chrome works expected. return statement: return file(filestream: stream, contenttype: system.net.mime.mediatypenames.application.octet, filedownloadname: mymodel.name + "." + pub.outputfiletype); how can fix issue ie 9 has? it seems no doable ie9, state namesv in comments. solved abusing browser feature: when requests /foo/fileÄÖ.pdf , file returned, "filename" in url used. so, created new route, targeted dynamic download , did in action: if (request.browser.browser == "ie" && request.browser.majorversion == 9) { // filename comes route used, host/print/file.pdf response.clear(); response.addheader("content-disposition", "attachment"); response.contenttype = system.net.mime....

html - Backbone.js: Why does the event being fired multiple times -

i new in backbone. i trying have event on view object. when add event alert box message, event being called multiple times. this code written: var photo = backbone.model.extend({ initialize : function () { imageurl = 'no url', data = ""; width = 0, height = 0 }, close: function () { this.destroy(); this.view.remove(); } }); var photocollection = backbone.collection.extend({ model : photo, url : '/photos' }); var photoview = backbone.view.extend({ model: photo, el: 'body', initialize: function () { }, events : { 'click img':'imageclicked' }, imageclicked : function () { alert("asdf"); }, resize: function (d, width, height) { var image = new image(); image.src = d; $(image).prop('src', d); $(image).prop('width', width + 'px'); ...

javascript - use multiple triggers in jQuery autocomplete using mutiple datasets -

i trying implement twitter/facebook auto-complete on textarea. till have implemented single trigger "@". want work 2 triggers "@" , "#". both have different data sets. here single dataset. 1 works perfectly. html <!doctype html> <html> <head> <link rel="stylesheet" href="//code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css"> <script src="//code.jquery.com/jquery-1.9.1.js"></script> <script src="//code.jquery.com/ui/1.10.4/jquery-ui.js"></script> <meta charset="utf-8"> <title>js bin</title> </head> <body> <textarea class="searchbox" cols="20" rows="10"></textarea> </body> </html> js var triggered = false; // default trigger off var trigger = "@"; // defining trigger var data = [ { label: "abc", value: "ab...