Posts

Showing posts from March, 2011

image processing - Is there a way of programatically detecting whether a photograph is in focus? -

image processing - Is there a way of programatically detecting whether a photograph is in focus? - if building web service used number of photos illustrate service, useful observe whether photos in focus or not. is there way of doing programatically? (even better, there open source implementation of such routine?) how know in focus? recognize object, of course, more generally, because has detail. detail, typically, means drastic alter in color on short range of pixels. i'm sure can find lot of border detection algorithms out there via google. without giving much thought: edgepixelcount = 0; each pixel in image { mixed = pixel.red + pixel.blue + pixel.green; each adjacentpixel in image.adjacentpixels(pixel) { adjacentmixed = adjacentpixel.red + adjacentpixel.blue + adjacentpixel.green; if ( abs ( adjacentmixed - mixed ) > edge_detection_threshold ) { edgepixelcount++; ...

multithreading - Periodicall popup form -

multithreading - Periodicall popup form - i should implement periodically popup form @ other form. popup form isn't mutual design, couldn't utilize standard messages. need implement smoothly showing\hiding of popup form. now utilize timers hide\show form, have unusual problems. if run show\hide popup form process ok, when seek run other threads @ base of operations form,which marshling vcl thread (math painting) behaviour of popup form become strange. how should imlement thread-safe popup form @ multi-thread app? thanks edit strange thing: timers setup show show hide form period 5s. when process starts ok. popup form show , hide on 5s expecting. got cycles of popup(show popup from) withous pause. 1 time again period of popup ok(5s). timer intervals don't work correctly. agree ~4,6s period. there no periods between popup. because left out lot of of import info ("form behaving strange" can interpreted in zillion ways, many solutions), i...

Assignment via `:=` in a `for` loop (R data.table) -

Assignment via `:=` in a `for` loop (R data.table) - i'm trying assign new variables within for loop (i'm trying create variables mutual structure, subsample-dependent). i've tried life of me re-produce error on sample info , can't. here's code works & gets gist of want do: dt<-data.table(id=rep(1:100,each=20),period=rep(-9:10,100), grp=rep(sample(4,size=100,replace=t),each=20), y=runif(2000,min=0,max=5),key=c("id","period"))[,x:=cumsum(y),by=id] dt2<-dt[id %in% seq(1,100,by=2),] dt3<-dt[id %in% seq(1,100,by=3),] (dd in list(dt,dt2,dt3)){ setkey(setkey(dd,grp)[dd[period==0,sum(x),by=grp],x_at_0_by_grp:=v1],id,period) } this works fine--however, when own code, generates invalid .internal.selfref warning (and doesn't create variable want): in [.data.table (setkey(dt, treatment), dt[posting_rel == 0, sum(current_balance), : invalid .internal.selfref detected , fixed takin...

JSON syntax error -

JSON syntax error - { "manifest_version" : 2, "name": "kittenbook", "description" : "replace photos on facebook kittens", "version": "0.0.1" "content_scripts": [ { "matches": ["*://www.facebook.com/*"], "js": [kittenbook.js"] } } can explain me wrong this? failed load extension from: ~\kittenbook.html manifest not valid json. line: 6, column: 3, syntax error. you have 3 errors here. at end of "version":"0.0.1" << missing , at end of "js":[kittenbook.js"] << missing " , start of string also missing closing [] on "content_scripts" :[ this right json syntaxis. { "manifest_version": 2, "name": "kittenbook", "description...

java - ArrayList Retrieve First and Last Result without Sorting ArrayList -

java - ArrayList Retrieve First and Last Result without Sorting ArrayList - i have arraylist of string, , retrieve first , lastly result of names after calculating order of alphabets. below code snippet: arraylist<string> list = new arraylist<string>(20); list.add("charles darwin"); list.add("albert einstein"); list.add("issac newton"); list.add("tony hoare"); list.add("grace hopper"); list.add("edgar dijkstra"); list.add("ada lovelace"); list.add("charles babbage"); list.add("stephen hawking"); string biggest = ""; string smallest = ""; (int = 0; < list.size(); i++) { string first = list.get(i); (int j = 0; j < list.size(); j++) { string sec = list.get(j); if (!first.equalsignorecase(second)) { ...

send data from php to javascript using jquery -

send data from php to javascript using jquery - i'm trying implement vertical timeline, don't know how info in right form db using php. the code add together events following: $(function() { $("#element").timeline({ data: [ {time: new date(), color: '#555', css: 'success', content: 'jquery.timeline demo event 1'}, {time: new date(), color: '#00ff00', css: 'success', content: 'jquery.timeline demo event 2'}, {time: new date(), color: '#000', css: 'success', content: 'jquery.timeline demo event 3'}, {time: new date(), color: '#000', css: 'success', content: 'jquery.timeline demo event 4'} ] }); i set get.php , can info db in way: <?php $servername = "localhost"; $username = ""; $password = "...

c - learning to use intrinsics -- segm fault using _mm256_sub_ps -

c - learning to use intrinsics -- segm fault using _mm256_sub_ps - i trying larn how utilize intrinsics. , c code : void vor( const int nbpoints, const int height, const int width, float * x, float * y, int * v, int * const ouvor ) { float xd , yd; float distance ,initdistance = flt_max; int threshold; int x , y; // pixel coordinates int i; ( y = 0; y < height; y++ ) { ( x = 0; x < width; x++ ) { ( = 0; < nbpoints; i++ ) { xd = x[ ] - x; yd = y[ ] - y; distance = xd * xd + yd * yd; //if point closer , assign proper threshold if ( distance < initdistance ) { initdistance = distance; threshold = v[ ]; } *( ouvor + ( x + y * width ) ) = threshold; } /* */ } /* x */ } /* y ...

android - Reinitialize a layout based on a config file -

android - Reinitialize a layout based on a config file - i have menu activity , settings activity. settings activity started menu activity comes straight after menu activity in stack trace. my menu activity has severel buttons, 1 each function of app. of these functions can enabled , disabled using settings activity. configurations saved in preferences. if function disabled should not available button in menu screen. so... problem: need reload whole menu activity after user changed configuration file using settings activity otherwise have restart app until changes taking effect. so how can remove / add together buttons from/to layout of menu activity when button in settings activity clicked? /** * */ @override public void onviewcreated(view view, @nullable bundle savedinstancestate) { super.onviewcreated(view, savedinstancestate); this.layoutmenu = (relativelayout) view.findviewbyid(r.id.menu_layout); this.circularimageview = (circularimageview) view.f...

c# - How to make HTTP calls, using ASP.NET MVC? -

c# - How to make HTTP calls, using ASP.NET MVC? - i'm new programming, , learning asp.net mvc 5. i can't find how create http calls/requests websites in tutorials, nor on stackoverflow (or maybe exists, can't find it; not quite sure what search, though have tried). what i'm trying do: i'm trying practise making http calls (...if it's called) simple asp.net mvc web application. this, attempting weather details openweathermap. can by: add next parameter request: appid=apikey example: api.openweathermap.org/data/2.5/forecast/city?id=524901&appid=1111111111 my understanding, learning: the controller 1 create above http call. my question: how create http request, in asp.net mvc? use system.net.http.httpclient . you can basic reading website using following: using (var client = new httpclient()) { var uri = new uri("http://www.google.com/"); var response = await client.getasync(uri); ...

xpath - Capybara can not find checkbox type label -

xpath - Capybara can not find checkbox type label - i need check checkbox type label input text on label. actually want check checkbox these values mon, tue, wed there in html tag, possible? the labels mon tue wed ... shown not checkboxes, buttons, need click on label or something... my html looks this: <div id="ck-button"><label><input tabindex="-1" id="checkbox_aghdfklg" name="checkbox_fdhadfadf" type="checkbox"><span>mon</span></label></div> <div id="ck-button"><label><input tabindex="-1" id="checkbox_0_aghdfklg" name="checkbox_0_fdhadfadf" type="checkbox"><span>tue</span></label></div> <div id="ck-button"><label><input tabindex="-1" id="checkbox_1_aghdfklg" name="checkbox_1_fdhadfadf" type="checkbox"...

android - Testing Pending Intents using Robotium -

android - Testing Pending Intents using Robotium - i have method sends pending intents main activity activity using alarm manager. want write test case this. how can accomplish using robotium testing framework? solutions/leads helpful. thanks android android-intent

c# - How to control gui text using the space bar in Unity? -

c# - How to control gui text using the space bar in Unity? - (disclaimer: new unity please bear me) basically want have text element displays multiple sentences 1 letter @ time , stop @ end of sentence. also, if space bar pressed remaining text sentence should display immediately, if sentence finished next sentence should show. so far have managed text display 1 letter @ time using strings stored in array. however, having difficulty navigating index index using space bar , getting finish sentence show if space bar pressed. the code below: using unityengine; using unityengine.ui; using system.collections; public class textscript : monobehaviour { public animator bar; public float letterpause = 0.1f; string[] strarray = new string[3]; string str; int i; int count; void start () { bar.enabled = true; strarray[0] = "hello , welcome game"; strarray[1] = "the next line of code"; strarray[2] = "testing space bar"; gameobject...

multithreading - errorjava.lang.IllegalStateExceptionCan't overwrite cause with java.lang.IllegalStateException: -

multithreading - errorjava.lang.IllegalStateExceptionCan't overwrite cause with java.lang.IllegalStateException: - i have created restful service using hibernate, bailiwick of jersey framework. have deployed tomcat8 server problem is: service stops working after 2-3 days(some errors occurred) have restart server 1 time again work properly.then after 2-3 days same problem happens. here code have closed session properly: public category getcategory(int id) throws exception { session session = hibernatesessionmanager.getsession(); category category = new category(); transaction tx = null; seek { tx = session.begintransaction(); category = (category) session.load(category.class, id); tx.commit(); } grab (exception e) { if (tx != null) { tx.rollback(); } throw e; } { session.close(); } homecoming category; here hibernate config: class="lang-xml prettypri...

c# - ASP MVC 4 MEF Lock Plugin -

c# - ASP MVC 4 MEF Lock Plugin - i have next code class="lang-cs prettyprint-override"> public class mef { public compositioncontainer container { { homecoming _container; } set { _container = value; } } private compositioncontainer _container; public ienumerable<lazy<icontroller, dictionary<string, object>>> allcontrollers() { homecoming container.getexports<icontroller, dictionary<string, object>>(); } } ... private void updatecontrollers(userscontext context, moduledb moduledb) { mef mef = new mef(); var mefexports = mef.allexports(); //get exports foreach (lazy<icontroller, dictionary<string, object>> controllerlazy in mefexports) { string typename = controllerlazy.value.gettype()....

vba - Excel Addins - Not Modifying Toolbar -

vba - Excel Addins - Not Modifying Toolbar - i looking best way deploy excel macros users. goal create super easy end users install , promote utilize adding addin toolbar. know there number of help articles on topic couldn't find covered exact issue. can please help , excuse me if noobie question. please see below replication steps issue. i have added code below worksheet event on "this worksheet" of excel macro file i add together main code module references i save .xlam in addin roaming folder i enable addin in excel 2013 after install adds button add together in tab it works until close excel in case button disappears it still under active add together ins not on toolbar the code: option explicit dim ccontrol commandbarbutton private sub workbook_addininstall() on error resume next 'just in case 'delete existing menu item may have been left. application.commandbars("worksheet menu bar").controls("super code").delete ...

C# - Record Click Strokes into an array? -

C# - Record Click Strokes into an array? - how can record click strokes , set them array? window need in focus work? how can avoid this. the requirement works without having focused window more hard one. need utilize low-level mouse hook setwindowshookex() api function. requires p/invoke, illustration available in blog post. c# click

plot - knn classification in matlab - plotting graph for different values of K -

plot - knn classification in matlab - plotting graph for different values of K - i have training info containing 8 images , 4 classes , test info of 4 images. have classified them using knn classification. now, want plot graph these training , test info different values of k. please give me idea. info consists of 1*261 features each. i found this link. can't seem understand how utilize plot info in case. any help appreciated. give thanks you. matlab plot

Is there any way to pass Dart variables to another browser window? -

Is there any way to pass Dart variables to another browser window? - i know can utilize local storage, cookies , postmessage these methods take simple types. want pass objects , lists straight other window. i found similar question using javascript. i'd victor pointed in next link. can pass javascript variable browser window? trying similar in dart gives me warining before running. var popup = window.open('popup.html', ''); popup.variable = localvariable; //warning here passing objects not possible. you can serialize json create simple type , pass using postmessage , deserialize. lists , maps containing simple types should work postmessage. dart

java - Spring MVC. Default values for fields of method parameter -

java - Spring MVC. Default values for fields of method parameter - i have simple controller method test: @requestmapping(produces = "application/json") @responsebody public httpentity<void> test(test test) { homecoming new responseentity<>(httpstatus.ok); } test class looks this: public class test { private string name; private date date; public string getname() { homecoming name; } public void setname(string name) { this.name = name; } public date getdate() { homecoming date; } @datetimeformat(iso= datetimeformat.iso.date) public void setdate(date date) { this.date = date; } } and need default values fields of test object. if had primitive param, able utilize @requestparam(required = false, defaultvalue = "somevalue") . non-primitive param approach doesn't seem work. see couple of variants how deal it: assign values in con...

hook - Issue while inserting the user in liferay -

hook - Issue while inserting the user in liferay - i have created form has basic user details , on clinking of save button inserting user details in "user_" table calling userlocalserviceutil.adduser(....) . user creating out issue. not able see form field parameters in userlocalserviceutil.adduser(....) method (title, gender , date of birth). how can save values. please give me suggestions how can insert next fields (title, gender , date of birth) @ time of user creation. liferay uses com.liferay.portal.model.contact entity store contact information. use com.liferay.portal.service.contactlocalserviceutil.addcontact method create contact. important parametres: userid - id of user creating contact. can utilize portalutil.getuser method current user request. classname - "com.liferay.portal.model.user". classpk - id of new user contact created for. liferay hook liferay-6 liferay-theme liferay-aui

filepath - Powershell's Join-Path Errs when Passing Path via Pipeline -

filepath - Powershell's Join-Path Errs when Passing Path via Pipeline - join-path allegedly accepts path parameter pipeline. this suggests 2 functions below should both work alike: join-path 'c:\temp' 'x' #returns c:\temp\x 'c:\temp' | join-path 'x' #throws error however sec phone call (i.e. using passing path parameter value pipeline) gives below error: join-path : input object cannot bound parameters command either because command not take pipeline input or input , properties not match of parameters take pipeline input. @ line:1 char:13 + 'c:\temp' | join-path 'x' + ~~~~~~~~~~~~~ + categoryinfo : invalidargument: (c:\temp:string) [join-path], parameterbindingexception + fullyqualifiederrorid : inputobjectnotbound,microsoft.powershell.commands.joinpathcommand nb: since path may array tried [array]('c:\temp') | join-path 'x' ; made no difference....

firefox addon - Why destructor of an extended binding is not called when extending binding is removed? -

firefox addon - Why destructor of an extended binding is not called when extending binding is removed? - creating xulrunner application windows found if binding b extends binding a. , b beingness removed, destructor of b called, not followed phone call of a's destructor. is there wrong code, or xulrunner bug (i haven't find matching bug in bugzilla)? here illustration tested on xulrunner 23 , 35: main.xul: <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <window id="main" title="my app" width="500" height="300" sizemode="normal" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" xmlns:html="http://www.w3.org/1999/xhtml"> <script><![cdata[ function print(astring) { document.getelementbyid("log_msg").value += astring + "\n"; } ...

How to write validation functions for jQuery mobile input type range? -

How to write validation functions for jQuery mobile input type range? - following problem: have input fields of type range. jquery mobile automatically transforms them input field slider aside. want instant validation while typing. validation script shall remove non-digits. function utilize works on input field text not input type range. this html: <label for="my_range_input_field">label_text:</label> <input data-type="range" type="range" name="my_range_input_field" id="my_range_input_field" value="10000" min="0" max="85000" /> this jquery validation function: $(document).delegate('#my_range_input_field', 'input', function(e) { $(this).val($(this).val().replace(/[^\d]/g, "")); }); the problem is, function deletes whole input value , not non digits. tried debug , when using console.log display val saw empty string when not digits typed in ...

angularjs - MEAN stack user delete -

angularjs - MEAN stack user delete - i've got users list delete button on /users url. delete route looks this: app.route('/users/:userid') .get(users.read) .put(users.updatebyid) .delete(users.delete); app.param('userid', users.userbyid); but problem is, delete button calling delete on /users url, i'm getting delete http://localhost:3000/users 404 (not found) . how can solve problem? controller remove() function can see below. how can pass '/user/' + user._id it? user removed correctly scope :( $scope.remove = function(id) { var user = $scope.users[id]; var modaloptions = { closebuttontext: 'cancel', actionbuttontext: 'delete user', headertext: 'delete ' + user.displayname + '?', bodytext: 'are sure want delete user?' }; modalservice.showmodal({}, modaloptions).then(function() { if (user) { user.$remove(); ...

iphone - XCODE 6.2 inelligible device IOS 8.3 -

iphone - XCODE 6.2 inelligible device IOS 8.3 - this question has reply here: xcode 6: ios 8.1 developer disk image not mounted 7 answers i got error msg while seek run code in xcode 6.2.. suggest me solution. when type of issue occurs @ time, you have download latest version of xcode, in case have download xcode 6.3 beta version, can run in iphone 8.3 os. it's perfect solution. download latest xcode link : https://developer.apple.com/xcode/downloads/ ios iphone xcode xcode6 ios8.3

c# - How can fix System.StackOverflow Exception? -

c# - How can fix System.StackOverflow Exception? - i used 2 classes, , need send/receive methods , variables. when create instance of class gives me system.stackoverflowexception . how can prepare problem? this code: class setup1 { setup2 set2 = new setup(); int = 5; public int mymethod(); { set2.b = + 10; homecoming set2.b; } } class setup2 { setup1 set1 = new setup(); public int b = 0; void show() { messagebox.show(set1.mymethod()); } } you have infinite recursion. in constructor of setup2() phone call constructor of setup1() . there phone call constructor of setup2() and on, infinitely. memory runs out, , stack overflows. c# class exception

python - Django: Error loading psycopg2 -

python - Django: Error loading psycopg2 - i next geodjango tutorial (https://docs.djangoproject.com/en/1.8/ref/contrib/gis/tutorial/#geographic-models) , got migrate step, , getting error "cannot import name util". i'm not sure problem is. also, engine set 'django.contrib.gis.db.backends.postgis' in settings.py file. know how prepare this? thanks! $ python manage.py makemigrations ... __import__(name) file "//anaconda/lib/python2.7/site-packages/django/contrib/gis/db/backends/postgis/base.py", line 3, in <module> django.db.backends.postgresql_psycopg2.base import \ file "//anaconda/lib/python2.7/site-packages/django/db/backends/postgresql_psycopg2/base.py", line 20, in <module> raise improperlyconfigured("error loading psycopg2 module: %s" % e) django.core.exceptions.improperlyconfigured: error loading psycopg2 module: cannot import name util i figured out how solve it. provide details in case...

java - Cannot resolve TabListener -

java - Cannot resolve TabListener - i using android.support.v7.app.actionbaractivity getsupportactionbar but, after import this"android.support.v7.app.actionbaractivity" tablistener becomes cannot resolve. have remove tablistener in order getsupportactionbar resolve. when seek public class mainactivity extends actionbaractivity implements actionbar.tablistener fragment activity becomes undefined cannot live since whole application built on fragment. in simple words want tablistener activity getsupportactionbar without removing while using android.support.v7.app.actionbaractivity how can done? here main activity: import android.annotation.targetapi; import android.app.fragmenttransaction; import android.os.build; import android.os.bundle; import android.support.v4.app.fragmentactivity; import android.support.v4.view.viewpager; import android.support.v7.app.actionbar; import android.support.v7.app.actionbaractivity; import android.support.v7.app.actionbar.ta...

c++ - trying to use my custom class constructor without new -

c++ - trying to use my custom class constructor without new - coming java not have deal de-allocation when creating new custom or other library's objects. today trying create instance of entity object like: entity cube = new entity("entityname") because how entity's constructor formatted next error: cannot convert |entity *| |entity| i noticed there no errors if remove new keyword, , wondering 2 things. what error while using new mean ? (i'm pretty confident how pointers work not started java.) is ok me create objects without new keyword or object created? (because there no errors.) new entity("entityname") means "create instance of entity in free store , homecoming pointer instance". since pointer entity not same entity , cannot initialise entity value unless have yet constructor. the way want is entity cube("entityname"); and need book on c++. c++

asp.net - Microsoft Offline Transliteration API -

asp.net - Microsoft Offline Transliteration API - for 1 of web application(intranet based), want create transliteration english language other language. so there microsoft api available can utilize in web application. don't want utilize google api. should microsoft or other 3rd party. you can utilize translator api. may find more resources on bing developer resources page. asp.net ms-office transliteration

encoding - R Studio does not work with Chinese Characters properly -

encoding - R Studio does not work with Chinese Characters properly - it seems have problem working chinese characters in r studio. simple codes following: data <- c("物品","方案") info # [1] "\347\211\251\345\223\201" "\346\226\271\346\241\210" it remains same if run sys.setlocale(category="lc_all",locale="chinese")* this happened both windows laptop , mac. can tell me how configure r studio in order read info in chinese properly? run in shell r > print("中文") [1] "中文" > sys.getlocale() [1] "en_us.utf-8/en_us.utf-8/en_us.utf-8/c/en_us.utf-8/en_us.utf-8" run in rstudio > print("中文") [1] "\344\270\255\346\226\207" > sys.getlocale() [1] "c" by contrast, can find locale environment in rstudio not set back upwards utf-8. you should not alter locale environment while rstudio running, can phone call sys.setlocale in ....

libGDX project update with use of git -

libGDX project update with use of git - i working on libgdx projects month ago, there several new versions of framework. have read, useful update framework's files, have many classes, many assets. how can update framework latest version? on official wiki, this recommended way. however, have found new way same thing. may way if not wish open gradle file. open libgdx setup gdx-setup.jar file (mine latest @ time 1.5.5). setup parameters way setup other old project. make sure have set destination different location old project (don't overwrite old project because need it, , backup) open project in whatever editor use. this of import section. said wanted maintain old classes , assets copy assets , classes previous project new project.you can re-create old code old project*; note: libgdx update 1.5.5 updates next parameters. if have applies next need rewrite [1.5.5] -> added ios arm-64 bit back upwards bullet physics -> 3d animation, ...

php - WooCommerce create new attributes programmatically -

php - WooCommerce create new attributes programmatically - how can create attributes woocommerce plugin? find : wp_set_object_terms( $object_id, $terms, $taxonomy, $append); from this stack-question but approach required id of product. need generate attributes not attached products. to create term can utilize wp_insert_term() like so: wp_insert_term( 'red', 'pa_colors' ); where colors name of attribute. taxonomy name of attribute prepended pa_ . edit attributes simply custom taxonomies. or dynamic taxonomies manually created user in back-end. still same custom taxonomy rules apply. you can see source code here loops through attributes , runs register_taxonomy() on each. create new attribute (remember taxonomy) need run register_taxonomy() , simple prepend pa_ start of taxonomy name. mimicking of values of taxonomy args core, 'colors' attribute. add_action( 'woocommerce_after_register_taxonomy', 'so_29549525_...

sql - Calculate a running total in MySQL -

sql - Calculate a running total in MySQL - i have mysql query: select dayofyear(`date`) d, count(*) `orders` `haspaid` > 0 grouping d order d which returns this: d | count(*) | 20 | 5 | 21 | 7 | 22 | 12 | 23 | 4 | what i'd column on end show running total: d | count(*) | ??? | 20 | 5 | 5 | 21 | 7 | 12 | 22 | 12 | 24 | 23 | 4 | 28 | is possible? perhaps simpler solution , prevents database having ton of queries. executes 1 query little math on results in single pass. set @runtot:=0; select q1.d, q1.c, (@runtot := @runtot + q1.c) rt (select dayofyear(`date`) d, count(*) c `orders` `haspaid` > 0 grouping d order d) q1 this give additional rt (running total) column. don't miss set statement @ top initialize running total variable first or column of null values. mysql sql

caching - Azure cache Invalid identifier -

caching - Azure cache Invalid identifier - so got error locally when trying out caching in worker role: errorcode<errca0042>:substatus<es0001>:invalid identifier: 'fildela worker'. check cache rolename/endpoint in configuration. on line: <autodiscover isenabled="true" identifier="fildela worker" /> in mvc app, webconfig. so updated both azure sdk version 2.5.1, , visual studio 2013 version update 4 , voilà! worked! however, when publish project cloudapp azure error message appear 1 time again. cache works on localhost not when published azure. why that? thanks! edit 1 i'm using newest windows azure cache, 2.5.10. this particular error thrown when identifier beingness validated uri managed cache. azure cache client tries first utilize given identifier role, , if fails endpoint. think client may failing connect cache server role. 1 of reasons may versions of azure sdk , cache client not compatible, s...

ios - AFNetworking with NSURLCredential -

ios - AFNetworking with NSURLCredential - i have 3 methods, userlogin, login , logoutbuttonpressed: userlogin: using afnetworking connect windows authenticated url using nsurlcredential: -(void)userlogin:(nsstring *)user andpasswordexists:(nsstring *)password completionhandler:(void (^)(nsarray *resultsobject, nserror *error))completionhandler { nsurl *url = [nsurl urlwithstring:kip]; nsurlrequest *request = [nsurlrequest requestwithurl:url]; afhttprequestoperation *operation = [[afhttprequestoperation alloc] initwithrequest:request]; nsurlcredential *credential = [nsurlcredential credentialwithuser:user password:password persistence:nsurlcredentialpersistenceforsession]; [operation setcredential:credential]; [[nsoperationqueue mainqueue] addoperation:operation]; [operation setcompletionblockwithsucc...

objective c - How to pop up UIAlertView when the numberofrow (TableView) is 1 -

objective c - How to pop up UIAlertView when the numberofrow (TableView) is 1 - i have 'add' button create new row of tableview. , number of row limited one. - (nsinteger)tableview:(uitableview *)tableview numberofrowsinsection:(nsinteger)section { // homecoming number of rows in section. homecoming 1; } i'd button pop alert view when there 1 row, not allowing create new row. however don't know how implement 'if condition' in button action following: - (ibaction)add { if (condition) { uialertview *alert = [[uialertview alloc] initwithtitle:@"title" message:@"hi" delegate:self cancelbuttontitle:@"done" otherbuttontitles:nil]; } [alert show]; } please help! sorry not beingness professional, i'm trying larn objective c all have - - (ibaction)add { if ([self.tableview numberofrowsinsection:0] == 1) { uialertview *alert = [[uialertview alloc] initwithtitle:@...

spring - Oracle Data Replication and Transaction Isolation level -

spring - Oracle Data Replication and Transaction Isolation level - i have java spring / hibernate based application running in test , prod environments. application behavior different in test , prod environments respect transactions. i using @transactional @ class level db operations. in test env select operation able read uncommitted (dirty) transaction info in prod not. both test , prod db same except in prod have 2 databases info replication. my question there specific transaction related configuration done in prod because of info replication? or info replication mandates specific transaction level? i have no details , no command on db configurations. allow me know possible cause of transactional behavior. spring hibernate oracle11g transactional-replication transaction-isolation

android - How To Use HorizontalScrollView Only When Needed -

android - How To Use HorizontalScrollView Only When Needed - i displaying text , images in listview horizontalscrollview if text , images long screen size thought there if needed. but when there no need horizontalscrollview cause text , images fit in screen still appears every row , in tabs makes swiping tab tab irritating cause finger catches horizontalscrollview , not whole tab. and textviews ect... in 1 layout file can't take rows. <horizontalscrollview android:layout_width="wrap_content" android:layout_height="wrap_content" xmlns:android="http://schemas.android.com/apk/res/android"> <linearlayout android:layout_width="match_parent" android:layout_height="match_parent" android:gravity="center_vertical" android:orientation="horizontal" > <textview android:id="@+id/textview1" android:layout_marginstart="5dp" android:layout_marginleft="5dp...

objective c - How to deactivate or hide a view in XCode? -

objective c - How to deactivate or hide a view in XCode? - in nsview have container view , 2 nsbutton's (see picture). nsbutton's alter content in container view. show view , hide other one, this: @ibaction func changeview(sender: nsbutton) { switch sender.id { case "button 1" { view1.hidden = true; view2.hidden = false; } case "button 2" { view1.hidden = false; view2.hidden = true; } } } it works properly, since in views there's lot draw (fields, buttons , images), switching view little bit (very little) slow. , have uncertainty method not right one. how switch view in proper way? hiding should fine. might want switch order set view hidden before setting other view unhidden. you remove view view hierarchy ( removefromsuperview() ) way hide it. sure in code maintains strong reference view. view controller does, that's presumably plenty (assuming have strong reference view controller). and...