Posts

Showing posts from September, 2012

iphone - find out users who deleted my app -

i've created iphone app , it's on app store, know number of downloads , wondering if there way find out how many users removed/deleted app phone i'm afraid can't this. apple doesn't provide information. provide update app , see how many people updated app. won't show has app on devices, give idea of how many people conscious app enough update it.

sql server - MSSQL error #120 -

i have following sql: insert [dbo].[table1] ([col1],[col2],[col3],...[col14]) select * [dbo].table2 go running throws mssql err #120 means number of columns line insert. table2 has 5 columns , table1 has 14. correct in assuming cause of error? reason ask a) not familiar mssql , b) unfamiliar database. yes, cause of error. you have to: insert [dbo].[table1] ([col1],[col2],[col3],...[col14]) select col1, col2, col3, col4, col5, --your table's columns 'const1', null, 1, etc... --other values want other columns, [dbo].table2 --defaults, constants, null, etc. go or insert [dbo].[table1] ([col1],[col2],[col3],[col4],[col5]) --the rest have default value. select col1, col2, col3, col4, col5 [dbo].table2 go

linux - sed usage in x loader Makefile -

what sed command do? when run uname -m on pc, returns x86_64 . hostarch := $(shell uname -m | \ sed -e s/i.86/i386/ \ -e s/sun4u/sparc64/ \ -e s/arm.*/arm/ \ -e s/sa110/arm/ \ -e s/powerpc/ppc/ \ -e s/macppc/ppc/) note: code snippet x loader makefile. the sed tries show system run more readable name. eks if have i.86 shows i386 but 1 made script did forget intel 64 bits x86_64 .

sql server - condition based select SQL query -

for example have table "info" below. +--------+------------+------+------------+ | entity | department | code | code_count | +--------+------------+------+------------+ | e1 | d1 | 123 | 5 | | e1 | d1 | 234 | 10 | | e1 | d1 | 345 | 20 | | e1 | d2 | 456 | 2 | | e1 | d2 | 567 | 5 | | e1 | d2 | 678 | 10 | +--------+------------+------+------------+ my query should function this: each entity , department pair, select code has maximum code count . any appreciated. thanks. select t1.* your_table t1 join ( select entity, department, max(code_count) code_count your_table group entity, department ) t2 on t1.entity = t2.entity , t1.department = t2.department , t1.code_count = t2.code_count

c++ - Converting printf-style logger with stack buffer to stringstream -

i have logging solution defines macro this: #define my_log(level, component, message, ...) { mylog::instance()->log(level, component, message, __file__, __line__, ##__va_args__); } the const char* message parameter using printf format, " my name %s , %u. " the actual logging method using declaring char buffer[2048] variable on stack , using vsnprintf convert va_list param, defined in message parameter, buffer. however, handling values can quite bigger 2k, buffer truncated thought reworking whole thing around stringstream more flexible. when implementing solution, encountered problem retrieving va_args parameters list use << operator... solution available parse whole message parameter % values , retrieve them using va_arg type retrieved? need push text between % values, vsnprintf handy, need split strings on % push previous text stringstream... hint or idea me out issue? i can't use external libs , support platforms , compilers may or may not suppor

algorithm - Constructing a polygon (hexagon) given length of one side, 2 points and the perimeter? -

i have general question on algorithm use construct irregular polygon. i have following scenario: have start , end position ship, know distance between 2 position (say 40km). using info, calculate remaining vertices of polygon includes 1 side, while other sides should equal in length , sum 200km (as matter of fact, user supplied length). therefore know perimeter of resulting polygon , 2 vertices make 1 of sides. in short, how other 4 vertices each side besides calculated same size (and perimeter of hexagon adds 200 + initial side)? thanks in advance!

c++ - How do you dynamically expand array and update? -

i trying wrap head around how logic works. idea dynamically allocate memory because won't know how many iterations program go through , can't use vectors. here abstraction of have far. have while loop contains variable count act size of array. update stored in array. thing can't figure out how update array ipoint without making infinite amount of if else statements. know there better way @ point brain fried. #include <iostream> #include <string> using namespace std; int main() { int itickets, count = 0, update = 0; int *tempipoint = null; int *ipoint = null; { count++; update++; if (count == 1) { tempipoint = new int[count]; (int = 0; < count; i++) { *(tempipoint + i) = update; } } else if (count > 1) { ipoint = new int[count]; (int = 0; < count; i++)

spring - Which is the default transaction manager the @Transactional uses? -

we have configured multiple transaction managers: <tx:annotation-driven transaction-manager="transactionmanager1" /> <tx:annotation-driven transaction-manager="transactionmanager2" /> <tx:annotation-driven transaction-manager="transactionmanager3" /> <bean id="transactionmanage1" class="org.springframework.orm.hibernate4.hibernatetransactionmanager"> <property name="sessionfactory" ref="sessionfactory1" /> </bean> <bean id="transactionmanager2" class="org.springframework.orm.hibernate4.hibernatetransactionmanager"> <property name="sessionfactory" ref="sessionfactory2" /> </bean> <bean id="transactionmanage3" class="org.springframework.orm.hibernate4.hibernatetransactionmanager"> <property name="sessionfactory" ref="sessionfactory3" /> </bea

sql - Select Query for Days of the Week -

when using following query return days of week i'd show specific day (monday, example) , count number of times 'monday' returned. select w.[id] , w.[name] , [status] , [initiatorpersonaliasid] , p.[firstname] , p.[lastname] , ( select top 1 [value] [attributevalue] av inner join [attribute] on a.[id] = av.[attributeid] , a.[entitytypeid] = 113 , a.[entitytypequalifiercolumn] = 'workflowtypeid' , a.[entitytypequalifiervalue] = w.[workflowtypeid] [entityid] = w.[id] , a.[key] = 'dayoftheweek' ) [day] , (select top 1 [value] [attributevalue] av inner join [attribute] on a.[id] = av.[attributeid] , a.[entitytypeid] = 113 , a.[entitytypequalifiercolumn] = 'workflowtypeid' , a.[entitytypequalifiervalue] = w.[workflowtypeid] [entityid] = w.[id] , a.[key] = 'time' ) [time] [wo

jquery - Accessing 2nd nested div's table element's height property -

i have posted complete body of web page. need access elements in second div of parent div id productgrid2. second div height 219.3999 in code below. need height of table of second div. table class k-selectable. problem elements dynamically generated , need access them via jquery. looked around nothing matched unique situation. can this? <div id="productgrid2" style="border: 1px solid rgb(54, 57, 64); box-shadow: rgb(136, 136, 136) 7px 7px 5px; margin-bottom: 15px; height: 250px;" data-role="grid" class="k-grid k-widget"> <div class="k-grid-header" style="padding-right: 14px;"> <div class="k-grid-header-wrap" data-role="resizable"> <table role="grid"> <colgroup> <col style="width:170px"> <col style="width:135px">

python - Exim filter pipe script only working on last email - not current -

this little combination processing second recent email coming in - not recent. here's filter: # exim filter save /srv/domain.com/bin/mail 660 pipe "/srv/domain.com/bin/sendtomailchimp.py" it works - i.e. can see saving mail file , call script.. great! far good.. here's script: #!/usr/bin/python mailbox_dir = '/srv/domain.com/mailboxes/enqace/mail' import mailbox import logging import time time.sleep(10) logging.basicconfig(filename='/srv/domain.com/mailboxes/enqace/logging.log',level=logging.debug) inbox = mailbox.mbox(mailbox_dir) logging.info('script called') key in inbox.iterkeys(): logging.info(key) message = inbox[key] subject = message['subject'] logging.info(subject) logging.info('===finish====') (prints 0-6 along subject lines of each) i can tail log. runs on getting email - seems parse mail mbox , completes before getting recent email (i.e. last one). hits last 1 (the recent) ne

r - GET {httr} returns a Bad Request response -

i trying scrape html elements of url stored in searchlink . method worked me is htmltreeparse {xml}.however it's not returning elements i'm looking for. example: img[@title='add compare'] searchlink <- "http://www.realtor.ca/map.aspx#cultureid=1&applicationid=1&recordsperpage=9&maximumresults=9&propertytypeid=300&transactiontypeid=2&sortorder=a&sortby=1&longitudemin=-114.52066040039104&longitudemax=-113.60536193847697&latitudemin=50.94776904194829&latitudemax=51.14246522072541&pricemin=0&pricemax=0&bedrange=0-0&bathrange=0-0&parkingspacerange=0-0&viewstate=m&longitude=-114.063011169434&latitude=51.0452194213867&zoomlevel=11&currentpage=1" doc <- htmltreeparse(searchlink,useinternalnodes = t) classes <- xpathsapply(doc,"//img[@title='add compare']",function(x){xmlgetattr(x,'class')}) the result of running classes above: list

css - Fade In doesn't work on IE -

i using code fade-in images when page loads. works fine in browsers have tested except ie on windows. @-webkit-keyframes fadein { { opacity:0; } { opacity:1; } } @-moz-keyframes fadein { { opacity:0; } { opacity:1; } } @keyframes fadein { { opacity:0; } { opacity:1; } } .fade-in {opacity:0;-webkit-animation:fadein ease-in 1;-moz-animation:fadein ease-in 1;animation:fadein ease-in 1;-webkit-animation-fill-mode:forwards;-moz-animation-fill-mode:forwards;animation-fill-mode:forwards;-webkit-animation-duration:1.5s;-moz-animation-duration:1.5s;animation-duration:1.5s;} .fade-in.one {-webkit-animation-delay: 0.3s;-moz-animation-delay: 0.3s;animation-delay: 0.3s;} .fade-in.two {-webkit-animation-delay: 0.6s;-moz-animation-delay:0.6s;animation-delay: 0.6s;} .fade-in.three {-webkit-animation-delay: 0.9s;-moz-animation-delay: 0.9s;animation-delay: 0.9s;} any ideas? you using this method , has warning ie: warning! css3 code work on firefox, chrome, safari , maybe newer

ios - How to make the view static until other view controller appear? -

Image
situation: first image there have view 1 have animation left right when run app. after that, user click "proceed" button , continue view controller 2 before show view controller 2, view 1 disappear can see in second image. how make view1 static on there until view controller 2 appear?

Rails Devise Mailer: No Received Messages in Inbox -

i'm using rails 4 , devise 3. need send confirmation e-mails production. these smtp configs config/environments/production.rb config.action_mailer.default_url_options = { :host => 'smtp.gmail.com' } config.action_mailer.raise_delivery_errors = false config.action_mailer.perform_deliveries = true config.action_mailer.delivery_method = :smtp config.action_mailer.smtp_settings = { :address => "smtp.gmail.com", :tls => true, :port => '587', :user_name => 'my_email@gmail.com', :password => 'my_password', :authentication => 'plain', :enable_starttls_auto => true } logs e-mail's been sent. however, don't see in inbox. (yes, mailcatcher off) another question, configs of development file affect production's environment's in ways? shouldn't, correct? another im

javascript - Directive scope using transclusion hiding parent scope of inner elements -

i'm trying implement directive delay apparition of container using ng-show , $timeout . here's directive looks like: angular.module('myapp') .directive('delay', function($timeout) { return { template: '<div ng-show="showit" ng-transclude></div>', replace: false, transclude: true, scope:true, restrict: 'a', link: function postlink(scope, element, attrs) { $timeout(function() { scope.showit = true; }, attrs.delay); } }; }); then, use in view this <div delay="1000"> <intput type="text" ng-model="mytext"/> </div> so far, delay works. yeah, i'm proud. then, mytext isn't accessible anymore controller because it's not visible parent scope. tried changing scope instead: scope: { mytext:

javascript - Is it possible to use a for loop for DRY protractor test? *var coming up undefined* -

goal: want make make loop on it block tests if element text matches. error: error: no element found using locator: by.csscontainingtext(".submenu li a", "undefined") question: how write loop test multiple list items'? moreover, how make var title visible inner it block for example: have 2 test want dry via loop this next test example psuedocode doesn't work working test below . var config = require('../../protractor.conf.js').config; describe('this homepage body tests', function(){ browser.driver.get(config.homepageurl); describe('sub navigation functionality', function () { //creates teh array of strings sample var title = ['find store', 'clinic']; for(var = 0; < title.length; i++){ it("should open find a" + title[i] + "page", function(){ browser.driver.sleep(2000); browser.ignoresynchronization = true; var link = element(

java - Iterating through hashmap keys and comparing -

i want iterate through each key of hashmap , compare each key below (so don't compare keys twice). want see slopes perpendicular each other. if product of slopes -1, , arraylists keys. so far have built map using: map<double, list<double>> map = new hashmap<double, list<double>>(); for(int = 0; < n; i++) { for(int j = + 1; j < n; j++) { if(line[4][i] == line[4][j]) { double distance = 7.0; //distance(); list<double> array = (map.containskey(line[4][i])) ? map.get(line[4][i]):new arraylist<double>(); array.add(distance); map.put(line[4][i], array); // system.out.println(arrays.aslist(array)); // system.out.println(distance); } } } and attempt iterate through map with: iterator<entry<double, list<double>>> = map.entryset().iterator(); while(i.hasnext()) { entry next = i.next(); i.remove(); for(entry e

image - Picture missing when export using matlab surf function -

i'm new of here![enter image description here][1] i want export picture in 3d space so using surf function img = imread('img_3630.jpg'); yimage = [0 0;100 100]; %# z data image corners surf([0 100],[0 100],zimage,... %# plot surface 'cdata',img,... 'facecolor','texturemap'); colormap(map) it works on matlab when export file picture missing i wish export file : http://ppt.cc/0-uo but file exported : http://ppt.cc/zjfb i'm sorry i'm new of matlab thx help to new question, did try typing in hold on before adding bar?

java - Proper way to restrict member value to subset of set -

say have person object field profession, list of strings. canonical way, using spring , hibernate, restrict list subset of professions defined either user or admin? ie, list of global, predefined professions @ runtime {accountant, developer}, , user adds 'plumber' list. if new person created, i'd restrict possible professions person can have 3 in list. originally, implemented enum, seems poor design, it's generated @ compile time, , can't added @ run time (i think?). proper way define 1 column table profession, , @ each request make person, populate singleton 1 member, list of professions? domain object person source profession singleton (presumably in service layer?). you can create new entity profession related person one-to-many relationship. way profession persisted hibernate. profession entity not need much. id , name now. later might add more attributes need.

ios - Different behavior for segue using UISearchController -

i must doing wrong here. have uitableview, , have implemented uisearchcontroller. have prototype cell linked details screen , pass selected value in prepareforsegue method. for normal view controller, works ok, row selected , details screen pushed (i.e. slide in right). however when there active search, using uisearchcontroller, details screen presented modally (i.e. slide bottom of screen) without uinavigationbar (so there no possibility go "back") i not using didselectrowatindexpath since have used storyboard push details screen why presenting animation different when same code in "prepareforsegue" being correctly called in each case: // mark: - navigation override func prepareforsegue(segue: uistoryboardsegue, sender: anyobject?) { if (segue.identifier! == "presentcontactdetail") { // pass person details selected row if let selectedrow = self.tableview.indexpathforselectedrow()?.row { let selectedperson = s

java - How to remove bookmarkview under general category from eclipse? -

hi in perspective don't want user see default bookmark view showing custom view similar functionality. how can remove it? i tried hide using activities adding activity in plugin.xml of plugin , disabling in activator did not help. <activity id="com.fd.vplus.core.defbookmarkviewactivity" name="default bookmark view"> </activity> <activitypatternbinding activityid="com.fd.vplus.core.defbookmarkviewactivity" isequalitypattern="false" pattern="org.eclipse.ui/org.eclipse.ui.views.bookmarkview"> </activitypatternbinding> i tried change id of view of default bookmark view override did not help.though approach time showed mine view instead of default not working. edit (activity code in plugin activator): iworkbenchactivitysuppo

python - Creating a simple Django driven online shop engine using Amazon Product Advertising API as backend database -

similarly sample : https://github.com/evrial/amazondjangoshop i want create online shop using amazon product advertising api backend db. however, sample uses django.db database. how switch use amazon api database. don't have type in related information of products such price, reviews, , api me i have set account , have linked via access id , secreat id. thanks lot i looked through example briefly , have say: example not use amazon product advertising api database backend. has sqlite database storing data. can see if check out settings py. in case - can't use api database backend. can use api loading products -sure, use other api. either via django app proxy, make api calls or using front-end calls (if cross domain js supported api) angular.js or ember.js.

tomcat - using UrlRewriteFilter not redirecting properly -

this <urlrewrite> <rule> <name>canonical hostnames</name> <condition name="host" operator="equal">^example\.com</condition> <condition name="host" operator="notequal">^$</condition> <from>^/(.*)</from> <to type="redirect" last="true">http://www.example.com/$1</to> </rule> </urlrewrite> it redirectiing www.example.com problem http://example.com/resetpassword/?user=2560256&token=1233 redirected http://example.com/resetpassword to preserve query string, can add use-query-string parameter urlrewrite element follows: <urlrewrite use-query-string="true"> alternatively, can include query string in redirect url follows: <to type="redirect" last="true">http://www.example.com/$1?%{query-string}</to> see documentation here .

c++ - Returning an object reference in a wrapped temporary -

i have iterator internal contiguous memory block , when invoking operator * wrap ever iterator pointing class marshals various operations can performed on underlying type. here's example better explain myself. class iterator { private: some_t* _ptr; public: // .. wrapper<some_t&> operator *() { return wrapper<some_t&>(*_ptr); } // .. }; int main(int argc, char** argv) { auto = some_class.begin() // returns iterator above; *it += 20; // operation invokes overload. return 0; } i want have wrapper behave underlying built in type as possible (all operators, binary, unary, boolean, etc...) above has proven difficult achieve , messy, when want have wrapper<some_t*> , wrapper<some_t&> behave built in types would. it's clear approach plain wrong, wondering if else has ideas on how achieve same goals in better way? thank you! are looking std::ref() ? http://en.cppreference.com/w/cpp/utility/functional/ref it'

c# - No overload for 'Button1_Click' matches delegate 'System.EventHandler'? -

i want display values db grid view image file. while using given below code shows error. me find proper solution. code: protected void button1_click(object sender, gridviewroweventargs e1) { shadinganalysisdatasettableadapters.tbl_sitelayoutuploadtableadapter sl; sl = new shadinganalysisdatasettableadapters.tbl_sitelayoutuploadtableadapter(); datatable dt = new datatable(); dt = sl.getgriddata(ddlsit.selectedvalue, int.parse(ddlversion.selectedvalue)); try { if (e1.row.rowtype == datacontrolrowtype.datarow && gvedit.editindex == e1.row.rowindex) { image image1 = (image)e1.row.findcontrol("image1"); foreach (datarow row in dt.rows) { byte[] img1 = (byte[])row["imgdata"]; string base1 = convert.tobase64string(img1); image1.imageurl = "data:image/jpg;base64," + base1;

android - php Json getting a blank textview -

i using mysql database in host, want recive data host when data textview, in blank. public class mainactivity extends activity { textview tv1; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); tv1=(textview)findviewbyid(r.id.name); loader loader = new loader(getapplicationcontext()); tv1.settext(loader.loadinbackground()); } public static class loader extends asynctaskloader<string>{ public loader (context contexto) { super(contexto); } @override public string loadinbackground() { string resultado = ""; string entrada = ""; defaulthttpclient cliente = new defaulthttpclient(); httpget httpget = new httpget("http://comupunt.esy.es/cities.php"); try { httpresponse execute = cliente.execute(httpget); inputstream contenido = execute.getentity().get

C++ making int array using new operation -

i want make dynamic array using new operator. #include <iostream> using namespace std; class set{ public: set() { count = 0; } set(int i) { elements = new int; elements[0] = i; count = 1; } void add(int new_element) { if(find(new_element) != -1) { cout << "the set has " << new_element << " already.\n"; return; } else { // elements[count] = new int; elements[count++] = new_element; cout << elements[count-1] << endl; } } void remove(int remove_element) { int index = find(remove_element); if(index == -1) { cout << "the set doesn't have " << remove_element << ".\n"; return; } else { for(int i=index ; i<count ; i++) elements[i] = elements[i+1]

Bind data to MS Dynamic CRM sub grid from external database -

i not able set lookup fields on ms crm sub grid external database. i tried retrieve multiple plugin as: get data external database in datatable entitycollection entitycollection= (entitycollection)context.outputparameters["businessentitycollection"]; entity anyentity= new entity("entity"); anyentity.attributes["new_customerid"] = new entityreference("contact", new guid("b26ef3e7-bd68-e411-9447-00155d010b06")); anyentity.attributes["new_address1"] ="value datatable"; entitycollection.entities.add(anyentity); except lookup type field able bind fields sub grid external database. this expected since cannot "look up" record in different database. crm enforces foreign key constraints on lookup fields can set lookup value point entity exists in crm system. set lookup value in crm based on value in other database.

android - How can I make Gradle install targets replace a device's app on Lollipop devices like it does on previous versions? -

android's gradle plugin has install targets built in can type following build , install app connected device. $ gradle installdebug i've found, however, lollipop device doesn't have same replacement behavior older releases of android have. instead of replacing installed version, complains app installed, dumps huge stack trace, , quits. this behavior annoying, makes hard test stuff database version upgrade code if have uninstall older version first. i can run adb below magic -r flag replace apk workaround, that's not satisfying. $ adb install -r build/outputs/apk/mycoolapp-debug.apk how can make gradle replace installed app fresh apk pre-lollipop devices? apparently bug in plugin , has been fixed in rc1 .

class - Multiple classes in Eclipse but can only run up to 3 -

just started eclipse sdk , trying create simple hello world examples. have created total of 4 classes in 1 project in eclipse, can run first three. how run/debug classes beyond first 3 or there limit number of classes can run program? keep in mind can run classes main method. the method signature needs exactly public static void main(string[] argv)

Powershell button image -

i'm trying use jpgs button images in powershell form. tried code: #add image button $image = new-object system.windows.controls.image $image.source = "c:\users\administrator\desktop\avengers.jpg" $image.stretch = 'fill' $button.content = $image from: http://learn-powershell.net/2012/10/01/powershell-and-wpf-buttons/ the script throwing error: cannot find type[system.controls.image]: make sure assembly containing type loaded. i tried use assembly script figure 1 out: [void][reflection.assembly]::load('system.windows.forms, version=2.0.0.0, culture=neutral, publickeytoken=b77a5c561934e089') i'm stuck on version, culture, , publickeytoken (i started script in powershell studio, i'm finishing in notepad++). how can best information? thank you. you picked cool language .net development in!! it's bit difficult though, since there little documentation out. instead of using system.controls.image, try system.drawing.image

c# - Can params be used to call methods with strongly typed parameters? -

i have method calls delegate based on state of network. method must decide call method( server, client ). in order work method, i've defined following delegate: public delegate void networkcall( params object[] args ); this take parameter, work methods exact same signature. results in stuff: protected virtual void donetowrkmove( params object[] args ) { destination = ( vector3 )args[0]; } which not ideal solution. possible "unpack" objects in 'args' more typesafe method call? example: protected virtual void donetowrkmove( vector3 newdestination ) { destination = newdestination; } i'm not sure grasp use-case here. seems more flexible solution involve true serialization/deserialization data being sent, allow type-safe communications end-to-end. that said, while delegates don't allow you're trying directly, can create generic method automate of work: delegate void callback(params object[] args); static void method1(para

c# - ASP.net MVC 5 Integration with OWIN same as Web API -

for web api integration use following thing in asp.net mvc 5 template onwards. app.userwebapi(configuration); here plug web api owin pipe line. is same thing possible mvc . app.usemvc(); also owin , mvc use same routetable url configuration. currently cannot host mvc app owin since mvc has dependency on system.web namespace restrict self hosting . but can use fubumvc, nancy , simple.web etc

c - Difference between assigning strings -

in c tried assign sting variable in 2 different ways char question[200]; strcpy( question, "this question" ); and char question[] = "this question"; and both works... what's difference between these 2 methods? the difference flexibility. this strcpy( question, "this question" ); you can anytime after declare variable. whereas this: char question[] = "this question"; you have use directly during declaration time. in second example length of question got fixed length of text +1 null terminator. can't change length of variable later, can't assign larger string example.

Adding background scripts to a firefox add-on -

i want add file(background.js) background script firefox extension. added content scripts main.js using following code. var panel = panels.panel({ contenturl: self.data.url("panel.html"), onhide: handlehide, contentscriptfile: [self.data.url("js/jquery.js"), self.data.url("tipsy/jquery.tipsy.js"),, self.data.url("js/settings.js")] }); how add background scripts main.js file. simply place file in lib folder. except scripts interact directly web content, javascript code you'll write or use when developing add-ons using sdk part of commonjs module. essentially, backend script don't share variables content scripts/normal js. export , require variables between modules. see adding local modules

wso2greg - How to change services storage location in wso2 governancy registry -

i have gone through wso2 doc: https://docs.wso2.com/display/governance460/changing+storage+location+of+services when change location of services in regisrty.xml file. <staticconfiguration> <versioningproperties>true</versioningproperties> <versioningcomments>true</versioningcomments> <versioningtags>true</versioningtags> <versioningratings>true</versioningratings> <!-- location want add service , default location /services/ --> <servicepath>/trunk/services/mylocation</servicepath> </staticconfiguration> when ever tried register service throwing following exception: error {org.wso2.carbon.governance.api.common.governanceartifactmanager} - failed add artifact: artifact id: 153b122e-5b4f-4e8e-bbe0-e7934da571d0, path: /trunk/services/mylocation/sample/com/myservice. resource not exist @ path /_system/governance/trunk/services/sample/com org.wso2.carbon.registry.core.exceptions

javascript - HTML5 canvas zoom my drawings -

hello create program paint on html5 canvas. have problem need create few tools drawing , zoom. don't have idea how create zoom without delay. drawing example: http://jsfiddle.net/x5rrvcr0/ how can zooming drawings? drawing code: <style> canvas { background-color: #cecece; } html, body { background-color: #ffffff; } </style> <script> $(document).ready(function () { var paintcanvas = document.getelementbyid("paintcanvas"); var paintctx = paintcanvas.getcontext("2d"); var size = 500; paintcanvas.width = size; paintcanvas.height = size; var draw = false; var prevmousex = 0; var prevmousey = 0; function getmousepos(canvas, evt) { evt = evt.originalevent || window.event || evt; var rect = canvas.getboundingclientrect(); if (evt.clientx !== undefined &&a

c# - Can't return HTTP status and data from a method after using httpClient.GetAsync() -

i having issues following code. retrieving json object string , wish return method can used elsewhere. when message: 'filmsglossary.searchqueries.returnjson(object); returns void, return keyword must not followed object expression' public async void returnjson(object term) { //set variables var searchformat = "&format=json"; var termvalue = term; var httpclient = new httpclient(); try { //set web service url format string baseuri = "http://localhost/filmgloss/webservice/web-service.php?termname="; string useruri = baseuri + termvalue + searchformat; //send url web service , retrieve response code. var response = await httpclient.getasync(useruri); response.ensuresuccessstatuscode(); var content = await response.content.readasstringasync(); return content.tostring();

windows - Execute system commands using wmi python on remote computer -

i trying create directory on remote computer using wmi , python. able run batch file providing complete path it. not execute system command. this following code not create directory on remote computer. conn = wmi.wmi('172.20.23.45', user='administrator', password='pass@123') conn.win32_process.create(commandline='mkdir temp') it done as. conn.win32_process.create(commandline='cmd.exe /c mkdir temp')

ios - Does afnetworking support web socket handling? -

do have facility working websockets in afnetworking ios? no unfortunately afnetworking doesn't support websocket handling, using socketrocket websocket handling.

javascript - Angularjs, IONIC; Hide DOM element on state changed instead of removing it -

the default behavior or angularjs/ionic remove dom element when route changed/left page , replace new dom elm/run controller again if navigate previous page. is there way hide dom elm associated route instead of removing completely? my use case is: ionic app landing page/index takes time compute/render , when user navigate detailed view , come index page build again scratch, because dom removed , needs build again, waist of time rather removing dom elm when route changed hide instead , if user come previous route, show it. improve app performance. looking forward response. thanks in advance abod use tabs in project: http://ionicframework.com/docs/api/directive/ionnavview/ there lot of stuff understand feature works great. basicly allows change view without removing dom (it stores in memory). when come previous dom it's loaded memory.

c# - NCrawler behaves erroneous when adding HTMLAgilityPack -

system specs: win7 64 bit, vs2013, .net 4.0 i trying make application crawl page , extract something. i using ncrawl .net 4.0 sln. ran ncrawler.demo project , it's working (extracting sub-urls specific url). problem appears: when try add htmlagilitypack demo can interpret html text. if add htmlagilitypack reference demo project makes app behaves erroneous: extract first url , exit without error. tried ncrawler .net 3.5 , same problem appeared. is known issue, there fix it? thx after days of investigating drawn conclusion there library conflict on methods refering htmlagilitypack. noticed 1 of dependencies projects of ncrawler(ncrawler.htmlprocessor) contains htmlagilitypack reference, , instead of adding htmlagilitypack refernce in project nuget did, replaced htmlagilitypack htmlprocessor project(ncrawler\repository\htmlagilitypack\). after doing this, both projects have save dll reference.

android layout - Divide the screen in to three different sizes -

in application screen, there 2 listviews l1(filled data d1) , l2(filled data d2)and 1 button @ bottom of screen. conditions display lists: if(show d1){ //display l1 list in middle of screen , button @ bottom of screen. //hide l2 } if(show d2){ //display l2 list in middle of screen , button @ bottom of screen. //hide l1 } if(show d1 && d2){ if(d1>=d2){ //display l1 , l2 lists in middle of screen , //button @ bottom of screen. }else if(d1<d2){ //display l1 , l2 lists in middle of screen , //button @ bottom of screen. } } by using below layout, shows correctly while displaying both list @ time. when showing l1, covers whole screen , overlaps button , when showing l2, when data few displays correctly button come upward below list instead of bottom of screen. layout.xml: <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent&

postgresql - Wait for the sequence to get last_value -

i have query gives sequences nextval: select c.oid::regclass, setval(c.oid, nextval(c.oid), false) pg_class c c.relkind = 's' but throws error on production database: error: cannot access temporary tables of other sessions i've created function last_value (to avoid setting sequence value) in post get max id of sequences in postgresql that doesn't help. is there way wait sequences finished without locking tables? thats function create type tp_sequencedetails (sequence_name text, last_value bigint); create or replace function getsequenceswithdetails() returns setof tp_sequencedetails $body$ declare returnrec tp_sequencedetails; sequence_name text; begin sequence_name in (select c.oid::regclass pg_class c c.relkind = 's') loop returnrec in execute 'select ''' || sequence_name || ''', last_value ' || sequence_name loop return next returnrec;

How to get Tomcat version number in Java -

this question has answer here: how find out running tomcat version 18 answers how tomcat/catalina version number in java? i've seen lots of how via command line etc. that's not code can use, cannot use catalina.path version number has been stripped path. please note want use version in code, various jsp solutions i've looked @ not work me. thanks from jsp in jsp file can print out version this: tomcat version : <%= application.getserverinfo() %> output: tomcat version : apache tomcat/8.0.14 outside of jsp (any java code) if want outside of jsp (e.g. in servlet or listener or w/e) take @ org.apache.catalina.util.serverinfo class, has nice static methods: system.out.println(serverinfo.getserverbuilt()); system.out.println(serverinfo.getserverinfo()); system.out.println(serverinfo.getservernumber()); output: sep 24 201

c++ - Qt GUI becomes unresponsive emitting signals too fast -

i've got small chat client stores history in sqlite database. when user clicks on history tab in application app fetches relevant history , displays in qwebview . im fetching background thread dbthread below , sending signals update qwebview accordingly. this works fine, until database grows. when database gets larger app starts crashes. gui unresponsive few seconds until loaded (4-6 secs) depending on database size. i've tried add qt::queuedconnection on signals , mentioned above i'm handling database queries background thread . i'm guessing i'm emitting signals fast. ideas how solve this? signals connect(dbtrad, signal(addallhistorymessage(qstring, qstring, qstring, qstring, qstring)), this, slot(addallhistorymessage(qstring, qstring, qstring, qstring, qstring)), qt::queuedconnection); connect(dbtrad, signal(addallhistorymessageinner(qstring, qstring, qstring, qstring, qstring)), this, slot(addallhistorymessageinner(qstring, qstring, qstring,

java - Client Server JRE usage -

i have developed server application running in wildfly , client connecting on server. happen if client use java 1.7 (32bit) , application server java 1.6 (64bit)? serialization in java independent of architecture (32-bit vs 64-bit). data types use same number of bits, regardless. difference reference data type, 32-bit or 64-bit respectively, "data" never serialized (it pointer memory address), instead, data references serialized.

oauth 2.0 - Office365 - Application authentication with no user consent -

we've been working ews managed services while now, transition on using restful api office 365. is possible application access of our users data without consent? have in-house application o365/sharepoint data our users. using sso isn't option, don't want keep asking our users give consent (we assume give it). specifically, want access calendars , mail. are these "service/application level" accounts available in o365 yet? think read while ago on roadmap have not seen since. would best continue using impersonation ews until ready? (for reason, ews painfully slow when getting data, meanwhile our tests o365 sso great deal faster, not want sso). apologies if not meet requirements sa questions. thanks. edit. daemon , service apps possible office365. check out link. building daemon or service apps office 365 mail, calendar, , contacts apis (oauth2 client credential flow) app-level authentication coming soon. organization administrator have consen

c# - auto disable edit and continue on 64X -

i'm working project runs on 64x, , have vs2008. enabling "edit , continue" i'm switching x86, , enabling button. thing want automatic code disable/enable "edit , continue" according solution configuration. i'm switching modes many times, , many times i'm finding self trying change code, , disabled debugger. thanks you have upgrade vs2013 feature, edit , continue not supported in earlier version on 64bit: debugging-support-for-64-bit-edit-and-continue-in-visual-studio-2013

c# - why object in collection of System.Linq.Enumerable.WhereSelectListIterator cannot be changed -

i use linq select data , returned type whereselectlistiterator. find object in whereselectlistiterator cannot modified, e.g., set null or update property of value. design? how make possible? using system; using system.collections.generic; using system.linq; namespace linqtest { class program { static void main(string[] args) { var project = new project() { sections = new list<section>() { new section() { outdated = new char[2]{'a','d'} }, new section() { outdated = new char[2]{'a','d'} }, new section() { outdated = new char[2]{'a','d'} } } }; var dates =

objective c - Unable to get intermediate output from NSTask's stdout? -

i have written nstask async exec method simple python script. when python script prints stdout, fine. when there raw_input in there (expecting input user), sure gets input fine, not print data before raw_input . what's going on? - (nsstring*)exec:(nsarray *)args environment:(nsdictionary*)env action:(void (^)(nsstring*))action completed:(void (^)(nsstring*))completed { _task = [nstask new]; _output = [nspipe new]; _error = [nspipe new]; _input = [nspipe new]; nsfilehandle* outputf = [_output filehandleforreading]; nsfilehandle* errorf = [_error filehandleforreading]; nsfilehandle* inputf = [_input filehandleforwriting]; __block nsstring* fulloutput = @""; nsmutabledictionary* envs = [nsmutabledictionary dictionary]; nsarray* newargs = @[@"bash",@"-c"]; [_task s